body {
    margin: 0;
    font-family: sans-serif;
    display: flex;
  }
  
  .sidebar {
    width: 200px;
    background:#005B96;
    color: white;
    padding: 1rem;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
  }
  
  .sidebar h3 {
    margin-top: 0;
    color: white;
  }
  
  .sidebar ul {
    list-style: none;
    padding: 0;
  }
  
  .sidebar ul li {
    margin: 1rem 0;
  }
  
  .sidebar ul li a {
    color: white;
    text-decoration: none;
  }
  
  .content {
    margin-left: 220px;
    padding: 2rem;
    flex: 1;
  }
  
  
  .login-box {
    max-width: 400px;
    margin: 100px auto;
    padding: 2rem;
    background: #f2f2f2;
    border-radius: 10px;
    text-align: center;
  }
  
  table {
    width: 600px;
    border-collapse: collapse;
    margin-top: 1rem;
  }
  
  table th, table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
  }
  
  table th {
    background: #eee;
    font-weight: bold;
  }
  
  button, input[type="text"], input[type="number"], textarea {
    font-size: 1rem;
    padding: 8px;
    margin: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  button {
    background: #005B96;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
  }
  
  button:hover {
    background: #4682B4;
  }
  
  button.selected {
    background: #b2c5ff;
    color: #1a1a1a;
    font-weight: bold;
    pointer-events: none;
  }
  
  form {
    margin-bottom: 2rem;
  }
  
  .storyline-box {
    background: #f3f0ff;
    border-left: 4px solid #ADD8E6;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 6px;
  }
  

  /* --- Design tokens --- */
:root{
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;

  --brand: #005B96;
  --brand-2: #4682B4;

  --radius: 10px;
  --radius-sm: 8px;

  --shadow: 0 6px 22px rgba(16,24,40,.08);
  --shadow-sm: 0 2px 10px rgba(16,24,40,.06);
}

/* --- Base layout --- */
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
}

/* Sidebar */
.sidebar{
  width: 240px;
  background: var(--brand);
  color: #fff;
  padding: 18px 16px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  box-shadow: 2px 0 14px rgba(0,0,0,.08);
}

.sidebar h3{
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: .2px;
}

.sidebar ul{
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.sidebar ul li{
  margin: 10px 0;
}

.sidebar ul li a{
  color: #fff;
  text-decoration: none;
  display: block;
  padding: 10px 10px;
  border-radius: 8px;
  opacity: .95;
}

.sidebar ul li a:hover{
  background: rgba(255,255,255,.12);
  opacity: 1;
}

/* Content area */
.content{
  margin-left: 260px;
  padding: 26px 28px;
  flex: 1;
  max-width: 1200px;
}

/* Headings */
h1{
  margin: 0 0 12px;
  font-size: 24px;
}
h2{
  margin: 18px 0 10px;
  font-size: 18px;
}
h3{
  margin: 14px 0 8px;
  font-size: 15px;
  color: #0f172a;
}

/* “Card” look for blocks – applies to forms by default */
form{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
  box-shadow: var(--shadow-sm);
  margin: 0 0 18px;
}

/* Inputs */
button,
input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea{
  font-size: 14px;
  padding: 10px 10px;
  margin: 6px 6px 6px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

textarea{
  width: 100%;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus{
  outline: none;
  border-color: rgba(0,91,150,.55);
  box-shadow: 0 0 0 4px rgba(0,91,150,.12);
}

/* Buttons */
button{
  background: var(--brand);
  color: #fff;
  border: 1px solid rgba(0,0,0,0);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
button:hover{ background: var(--brand-2); }
button:active{ transform: translateY(1px); }

/* Selected chips (class/module selectors) */
button.selected{
  background: rgba(0,91,150,.14);
  color: #0b1b2a;
  border: 1px solid rgba(0,91,150,.35);
  font-weight: 700;
  pointer-events: none;
}

/* Tables */
table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table th, table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table th{
  background: #f3f4f6;
  font-weight: 700;
  color: #111827;
  font-size: 13px;
  letter-spacing: .2px;
}

table tr:last-child td{ border-bottom: none; }
table tr:hover td{ background: #fbfdff; }

/* Links used as icon actions */
a{
  color: var(--brand);
  text-decoration: none;
}
a:hover{ text-decoration: underline; }

table a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
}
table a:hover{
  background: rgba(0,91,150,.08);
  border-color: rgba(0,91,150,.18);
  text-decoration: none;
}

/* Storyline / intro boxes */
.storyline-box{
  background: #f3f0ff;
  border: 1px solid rgba(0,91,150,.18);
  border-left: 4px solid rgba(0,91,150,.45);
  padding: 14px;
  margin-top: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Modal (move from abilities.php inline to CSS) */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-content{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(420px, 92vw);
  padding: 16px;
  box-shadow: var(--shadow);
}

/* Login box */
.login-box{
  max-width: 420px;
  margin: 100px auto;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}



/*login*/
/* =========================
   AUTH (Login) layout
   ========================= */
body.auth-page{
  display: block; /* felülírja a body flexet a login oldalon */
  background: radial-gradient(1200px 600px at 10% 0%, rgba(0,91,150,.16), transparent 60%),
              radial-gradient(900px 500px at 100% 10%, rgba(70,130,180,.18), transparent 55%),
              var(--bg);
  min-height: 100vh;
}

.auth-shell{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card{
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.auth-header{
  text-align: center;
  margin-bottom: 14px;
}

.auth-badge{
  width: 54px;
  height: 54px;
  border-radius: 16px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  background: rgba(0,91,150,.10);
  border: 1px solid rgba(0,91,150,.18);
}

.auth-badge i{
  font-size: 20px;
  color: var(--brand);
}

.auth-title{
  margin: 0;
  font-size: 20px;
}

.auth-subtitle{
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Alerts */
.alert{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
  border: 1px solid var(--border);
  background: #fff;
}

.alert i{ margin-top: 2px; }
.alert-error{
  border-color: rgba(220,38,38,.25);
  background: rgba(220,38,38,.06);
  color: #7f1d1d;
}

/* Form fields */
.auth-form{
  background: transparent; /* felülírjuk a form kártyát erre az oldalra */
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.field{
  display: block;
  margin: 10px 0 12px;
}

.field-label{
  display: block;
  font-size: 13px;
  color: #0f172a;
  margin: 0 0 6px;
  font-weight: 600;
}

.field-control{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.field-control i{
  color: var(--muted);
  width: 18px;
  text-align: center;
}

.field-control input{
  width: 100%;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.field-control:focus-within{
  border-color: rgba(0,91,150,.55);
  box-shadow: 0 0 0 4px rgba(0,91,150,.12);
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  padding: 11px 12px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-block{ width: 100%; }

.btn-primary{
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover{ background: var(--brand-2); }

.auth-footnote{
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.auth-footnote i{ margin-top: 2px; }


/*dashboard*/
/* Dashboard */
.page-head{
  margin-bottom: 18px;
}

.page-title{
  margin: 0;
  font-size: 24px;
}

.page-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stat-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-card i{
  font-size: 22px;
  color: var(--brand);
}

.stat-value{
  font-size: 20px;
  font-weight: 700;
}

.stat-label{
  font-size: 12px;
  color: var(--muted);
}

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.feature-list{
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.feature-list li{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.feature-list i{
  color: #16a34a;
  margin-top: 2px;
}

.hint-card{
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}


@media (max-width: 900px){
  .sidebar{ position: static; width: 100%; height: auto; }
  .content{ margin-left: 0; padding: 16px; }
}


/* Sidebar structure */
.sidebar{
  width: 240px;
  background: var(--brand);
  color: #fff;
  padding: 16px 14px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  box-shadow: 2px 0 14px rgba(0,0,0,.08);
}

.sidebar-head{
  margin-bottom: 14px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
}
.brand i{
  font-size: 18px;
}

.menu{
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.menu-section{
  margin: 14px 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  opacity: .65;
}

.menu li a{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  opacity: .95;
  transition: background .15s ease, opacity .15s ease;
}

.menu li a i{
  width: 18px;
  text-align: center;
}

.menu li a:hover{
  background: rgba(255,255,255,.14);
  opacity: 1;
}

.menu li a.active{
  background: rgba(255,255,255,.22);
  font-weight: 700;
}

.menu li a.logout{
  margin-top: 8px;
  background: rgba(0,0,0,.18);
}
.menu li a.logout:hover{
  background: rgba(0,0,0,.28);
}



/*menu*/
/* Backdrop for off-canvas */
.backdrop{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 80;
}

/* Topbar (mobile) */
.topbar{
  display: none;
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  align-items: center;
  gap: 10px;
}
.topbar-title{
  font-weight: 800;
  font-size: 14px;
}
.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:hover{
  background: rgba(0,91,150,.08);
}

/* Mobile behavior */
@media (max-width: 980px){
  body{ display: block; } /* a body flexet mobilon oldjuk */

  .topbar{ display: flex; }

  .content{
    margin-left: 0;
    max-width: none;
    padding: 16px;
  }

  .sidebar{
    z-index: 90;
    transform: translateX(-105%);
    transition: transform .18s ease;
    width: min(280px, 86vw);
  }

  body.sidebar-open .sidebar{
    transform: translateX(0);
  }

  body.sidebar-open .backdrop{
    display: block;
  }
}


/* Form grid */
.form-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.form-actions{
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.field-label{ display:block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.field input, .field textarea, textarea{     width: 90%;
    margin: auto; }

/* Table actions */
.col-actions{ width: 180px; }
.actions{ white-space: nowrap; }

.icon-action{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,91,150,.18);
  background: rgba(0,91,150,.06);
  color: #0b1b2a;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  margin-right: 6px;
}
.icon-action:hover{
  background: rgba(0,91,150,.12);
}
.icon-action.danger{
  border-color: rgba(220,38,38,.25);
  background: rgba(220,38,38,.06);
  color: #7f1d1d;
}
.icon-action.danger:hover{
  background: rgba(220,38,38,.10);
}

/* Modal head */
.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.modal-title{
  margin: 0;
  font-size: 16px;
  display:flex;
  align-items:center;
  gap:10px;
}

/* Responsive form grid */
@media (max-width: 980px){
  .form-grid{ grid-template-columns: 1fr; }
  .col-actions{ width: auto; }
}


.modal{ display:flex; } /* csak akkor, ha defaultból flexre váltasz */
.modal[style*="display:none"]{ display:none !important; }


/* Kerettörténet szerkesztés – szebb tipó */
textarea,
input,
select,
button {
  font-family: inherit;
}


.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  font-size: 13px;
  background: #fff;
}
.pill--ok{
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.25);
}
.pill--muted{
  background: rgba(148,163,184,.18);
  border-color: rgba(148,163,184,.28);
}


/* === MODAL UX FIX (global) === */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

/* Ablak */
.modal-content{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(980px, 96vw);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden; /* fontos: a body görgőzzön, ne a teljes doboz szétfolyjon */
}

/* Fejléc fixen fent */
.modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.modal-title{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Tartalom görgethető */
.modal-body{
  padding: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modal-on belüli kártyák szűkebb spacinggel */
.modal-body .card{
  margin-bottom: 14px;
}

/* Mobil */
@media (max-width: 980px){
  .modal{
    padding: 12px;
    align-items: flex-end; /* mobilon alulról "sheet" érzés */
  }
  .modal-content{
    width: 100%;
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}


/* === Segmented control (mode switch) === */
.segmented{
  display: inline-flex;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.segmented-btn{
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  color: #111827;
}
.segmented-btn.active{
  background: #fff;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,91,150,.15);
}

/* === Questions builder layout === */
.qbuilder .card-head{ margin-bottom: 10px; }

.qbuilder-grid{
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
}

.qleft{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.qleft-head{
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.qleft-title{ font-weight: 800; }
.qleft-actions{ display:flex; gap: 8px; }

.qlist{
  padding: 10px;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qitem{
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px;
  cursor: pointer;
}
.qitem:hover{ background: #fbfdff; }
.qitem.active{
  border-color: rgba(0,91,150,.35);
  box-shadow: 0 0 0 3px rgba(0,91,150,.10);
}
.qitem-title{
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
  color: #111827;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
}
.qitem-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 8px;
}
.qitem-num{ color: var(--muted); font-size: 12px; }

.qleft-foot{
  padding: 12px;
  border-top: 1px solid var(--border);
  display:flex;
  gap: 8px;
  justify-content: space-between;
}

.qright{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 520px;
  display:flex;
  flex-direction: column;
}

.qeditor-head{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.qeditor-title{ font-weight: 800; }
.qeditor-meta{ color: var(--muted); font-size: 13px; }

.qeditor-body{
  padding: 14px;
  overflow:auto;
  flex: 1;
}

.qeditor-body textarea,
.qeditor-body input[type="text"],
.qeditor-body select{
  width: 100%;
  box-sizing: border-box;
}

.qsubhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.qsubhead-title{ font-weight: 800; }

.option-row{
  display:flex;
  gap: 8px;
  align-items:center;
  margin-bottom: 8px;
}
.option-row .option-input{ flex: 1; }

.btn-sm{
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.qeditor-foot{
  border-top: 1px solid var(--border);
  padding: 12px 14px;
}
.hint{
  color: var(--muted);
  font-size: 13px;
}

/* Mobile: stack */
@media (max-width: 980px){
  .qbuilder-grid{
    grid-template-columns: 1fr;
  }
  .qleft, .qright{
    min-height: auto;
  }
}


.qprev-top{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:12px}
.qprev-top-title{font-weight:800}
.qprev-top-sub{color:var(--muted);font-size:12px}
.qprev-item{border:1px solid var(--border);border-radius:12px;padding:12px;margin-bottom:10px;background:var(--surface)}
.qprev-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:10px}
.qprev-title{display:flex;align-items:center;gap:10px;font-weight:700}
.qprev-num{color:var(--muted);font-size:12px}
.qprev-opts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.qprev-opt{display:flex;align-items:center;gap:10px;border:1px solid var(--border);border-radius:10px;padding:8px 10px}
.qprev-opt.is-correct{border-color:rgba(16,185,129,.45);background:rgba(16,185,129,.08)}
.qprev-dot{width:8px;height:8px;border-radius:999px;background:var(--border)}
.qprev-opt.is-correct .qprev-dot{background:rgba(16,185,129,1)}
.qprev-opt-text{flex:1}
.qprev-answer{margin-top:6px}

.pill--danger {
  border-color: rgba(220, 53, 69, .35);
  background: rgba(220, 53, 69, .12);
  color: #dc3545;
}

.pill--warn {
  border-color: rgba(255, 193, 7, .45);
  background: rgba(255, 193, 7, .14);
  color: #b78600;
}
