/* =====================================================================
   TULGA — ҰБТ сынақ жүйесі
   Дизайн жүйесі: slate реңктер + индиго акцент,
   шекарасыз ақ карточкалар, жұмсақ көлеңке, кең дөңгелектеу.
   ===================================================================== */

:root {
  /* --- Акцент --- */
  --accent:        #4f46e5;   /* indigo-600 */
  --accent-hover:  #4338ca;   /* indigo-700 */
  --accent-soft:   #eef2ff;   /* indigo-50  */
  --accent-soft-2: #e0e7ff;   /* indigo-100 */
  --accent-ring:   #c7d2fe;   /* indigo-200 */
  --accent-text:   #4338ca;

  /* --- Бейтарап (slate) --- */
  --ink:      #0f172a;
  --ink-2:    #334155;
  --ink-3:    #64748b;
  --ink-4:    #94a3b8;
  --line:     #e2e8f0;
  --line-soft:#f1f5f9;
  --bg:       #f1f5f9;
  --card:     #ffffff;

  /* --- Күй --- */
  --ok:       #047857;  --ok-bg:   #ecfdf5;  --ok-line:  #a7f3d0;
  --warn:     #b45309;  --warn-bg: #fffbeb;  --warn-line:#fde68a;
  --bad:      #be123c;  --bad-bg:  #fff1f2;  --bad-line: #fecdd3;

  /* --- Пішін --- */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --shadow:    0 1px 2px 0 rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .05);

  --sans: 'Instrument Sans', ui-sans-serif, system-ui, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 22px; letter-spacing: -.015em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p  { margin: 0 0 1em; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- layout */
.wrap  { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 620px; }
.main  { flex: 1; padding: 24px 0 64px; }


/* ================================================================= 
   БҮЙІР МЕНЮ
   ================================================================= */
.app { display: flex; min-height: 100vh; }

.side-nav {
  width: 232px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px;
}

.side-nav .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 20px;
}
.side-nav .brand:hover { text-decoration: none; }

.brand-mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--accent); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
}
.brand-mark.sm { width: 26px; height: 26px; font-size: 13px; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: .01em; }
.brand-sub  { font-size: 9.5px; color: var(--ink-4); letter-spacing: .09em; }

.side-links { display: flex; flex-direction: column; gap: 2px; }
.side-links a,
.side-foot a,
.side-foot button {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  border: 0; background: none; width: 100%; text-align: left;
  font-family: inherit; cursor: pointer;
}
.side-links a:hover,
.side-foot a:hover,
.side-foot button:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.side-links a.on,
.side-foot a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.side-links .ico, .side-foot .ico {
  width: 20px; text-align: center; font-size: 14px; opacity: .75; flex-shrink: 0;
}
.side-links a.on .ico, .side-foot a.on .ico { opacity: 1; }

.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.side-foot form { margin: 0; }
.side-user { padding: 12px 12px 0; }
.who-name { font-size: 13px; font-weight: 650; color: var(--ink); }
.who-role { font-size: 11px; color: var(--ink-4); margin-top: 1px; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobile-bar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 900px) {
  .side-nav {
    position: fixed; left: 0; top: 0; z-index: 70;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .nav-toggle:checked ~ .side-nav { transform: none; }
  .nav-toggle:checked ~ .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(15, 23, 42, .35);
  }
  .mobile-bar {
    display: flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 14px;
    background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 40;
  }
  .burger {
    font-size: 20px; line-height: 1; cursor: pointer;
    padding: 4px 8px; border-radius: 6px; color: var(--ink-2);
  }
  .burger:hover { background: var(--line-soft); }
}

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-head {
  padding: 15px 20px 13px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 14px 20px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------------------------------------------------------------- stats */
.stat {
  background: var(--card); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em;
              margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-note  { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.stat.accent { box-shadow: var(--shadow), inset 3px 0 0 var(--accent); }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--line-soft); color: var(--ink-2);
}
.badge.ok    { background: var(--ok-bg);   color: var(--ok); }
.badge.warn  { background: var(--warn-bg); color: var(--warn); }
.badge.bad   { background: var(--bad-bg);  color: var(--bad); }
.badge.muted { background: var(--line-soft); color: var(--ink-3); }
.badge.brand,
.badge.sun   { background: var(--accent-soft); color: var(--accent-text); }

/* ---------------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 10px 16px;
  font-size: 11px; font-weight: 600; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--line-soft); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .shrink { width: 1%; white-space: nowrap; }

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: 14px; }
.field label, .lbl {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px;
}
.hint { font-size: 12px; color: var(--ink-4); margin-top: 5px; }

/* Барлық мәтіндік өріс — type жазылмағанын да қамтиды.
   :not() тізбегі checkbox/radio/түймелерді шығарып тастайды. */
input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=image]),
select, textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  font: inherit; font-size: 14px; color: var(--ink);
  background: #f8fafc; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); opacity: 1; }

input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):hover,
select:hover, textarea:hover { border-color: #cbd5e1; }

input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):focus,
select:focus, textarea:focus {
  background: #fff; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}

/* Қате толтырылған өріс — тек қолданушы әрекет еткеннен КЕЙІН боялады,
   бет ашылғанда бос міндетті өрістер қызыл болып тұрмауы үшін. */
input:user-invalid, select:user-invalid, textarea:user-invalid {
  border-color: var(--bad-line); background: var(--bad-bg);
}
input:user-invalid:focus, select:user-invalid:focus, textarea:user-invalid:focus {
  border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-line); background: #fff;
}
.field.has-error > input, .field.has-error > select, .field.has-error > textarea {
  border-color: var(--bad-line); background: var(--bad-bg);
}
.field-error {
  display: block; margin-top: 5px;
  font-size: 12px; font-weight: 500; color: var(--bad);
}

input[disabled], select[disabled], textarea[disabled] {
  background: var(--line-soft); color: var(--ink-4); cursor: not-allowed;
}

input[type=file] {
  padding: 9px 12px; cursor: pointer; font-size: 13px; color: var(--ink-3);
}
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 6px 13px; border: 0; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent-text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--accent-soft-2); }
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
/* Күн/уақыт өрісінің қалқымалы белгішесі көрінуі үшін */
input[type=date], input[type=time], input[type=datetime-local] { padding-right: 10px; }
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
input[type=date]::-webkit-calendar-picker-indicator:hover,
input[type=time]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

input[type=checkbox], input[type=radio] {
  accent-color: var(--accent); width: 17px; height: 17px;
  background: #fff; padding: 0; cursor: pointer;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--r);
  border: 1px solid transparent; background: var(--accent); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(.5px); }
.btn[disabled], .btn.off { opacity: .45; pointer-events: none; }

.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-soft); border-color: var(--ink-4); color: var(--ink); }
.btn.sun { background: var(--accent); color: #fff; }
.btn.sun:hover { background: var(--accent-hover); }
.btn.danger { background: #fff; border-color: var(--bad-line); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.block { display: flex; width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- alerts */
.alert {
  padding: 12px 16px; border-radius: var(--r);
  border: 1px solid; font-size: 14px; margin-bottom: 14px;
}
.alert.ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: var(--ok); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.alert.bad  { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad); }
.alert.info { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent-text); }

/* ---------------------------------------------------------------- misc */
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.xs    { font-size: 12px; }
.strong{ font-weight: 650; }
.mono  { font-family: var(--mono); font-size: 13px; }
.right { text-align: right; }
.center{ text-align: center; }
.nowrap{ white-space: nowrap; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .spacer { margin-left: auto; }
.page-sub { color: var(--ink-3); font-size: 14px; margin-top: 3px; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
.empty-icon { font-size: 28px; opacity: .45; display: block; margin-bottom: 10px; }

.bar { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.ok   > i { background: #10b981; }
.bar.warn > i { background: #f59e0b; }
.bar.bad  > i { background: #f43f5e; }

.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }

/* ------------------------------------------------------- сұрақ элементтері */
/* Нұсқаның әріптік белгісі: A B C D F G */
.opt-letter {
  flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--line-soft); color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.opt.sel .opt-letter { background: var(--accent); color: #fff; }

/* Сұрақтың суреті */
.qimg { margin: 12px 0 4px; }
.qimg img {
  max-width: 100%; max-height: 340px;
  border-radius: var(--r); border: 1px solid var(--line);
  display: block; background: #fff;
}

/* Сұрақ түрін таңдау карточкалары */
.pick-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pick-card {
  flex: 1; min-width: 220px;
  display: flex; gap: 11px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.pick-card:hover { border-color: var(--accent-ring); background: var(--accent-soft); }
.pick-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick-card input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.pick-title { display: block; font-weight: 650; font-size: 14px; }
.pick-note  { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Жауап нұсқаларының өңдеу жолы */
.opt-row {
  display: flex; gap: 10px; align-items: center; margin-bottom: 8px;
  padding: 6px 8px; border-radius: var(--r-sm);
  border: 1px solid transparent;
}
.opt-row.on { border-color: var(--ok-line); background: var(--ok-bg); }
.opt-row .opt-letter { width: 26px; height: 26px; font-size: 12px; }
.opt-row input[type=text] { flex: 1; }
.opt-correct {
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; cursor: pointer; font-size: 12px;
  font-weight: 600; color: var(--ink-3);
}
.opt-correct input { width: 17px; height: 17px; }

/* Сурет алдын ала көрсету */
.img-current, .img-preview {
  display: flex; gap: 12px; align-items: center;
  padding: 10px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--line-soft);
}
/* display:flex hidden-ды басып кетпеуі үшін */
.img-current[hidden], .img-preview[hidden] { display: none; }

.img-current img, .img-preview img {
  width: 96px; height: 72px; object-fit: cover;
  border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line);
}

/* ---------------------------------------------------------------- login */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .brand-mark {
  width: 48px; height: 48px; border-radius: var(--r);
  font-size: 20px; margin: 0 auto 14px;
}
.auth-logo .brand-name { font-size: 20px; }
.auth-logo .brand-sub { font-size: 12px; letter-spacing: .12em; margin-top: 4px; }
.auth-card .card { border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--ink-4); }

/* ---------------------------------------------------------------- footer */
.foot {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 16px 0; font-size: 13px; color: var(--ink-4);
}
.foot-in { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

@media (max-width: 720px) {
  .topbar-in { padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; }
  .who { margin-left: auto; }
  h1 { font-size: 20px; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px 12px; }
  .tbl th, .tbl td { padding: 10px 12px; }
}

/* ---------------------------------------------------------------- tiles */
.tile {
  display: block; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r);
  color: inherit; transition: border-color .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--accent-ring); box-shadow: var(--shadow); text-decoration: none; }
.tile-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }

/* --------------------------------------------------- ішкі бөлім қосымшасы */
.subnav {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--card); border-radius: var(--r-lg);
  padding: 6px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.subnav a {
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.subnav a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.subnav a.on { background: var(--accent); color: #fff; font-weight: 600; }

/* -------------------------------------------------- пән таңдау чиптері */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--accent-ring); background: var(--accent-soft); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) {
  border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600;
}
.chip .chip-mark { font-size: 12px; opacity: .5; }
.chip:has(input:checked) .chip-mark { opacity: 1; }

/* =====================================================================
   ҚАЛҚЫМАЛЫ ТЕРЕЗЕ (modal)
   ===================================================================== */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto;
}
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .45);
  animation: mFade .15s ease;
}
.modal-box {
  position: relative; width: 100%; max-width: 620px;
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .28);
  animation: mRise .18s cubic-bezier(.2, .8, .3, 1);
  margin: auto 0;
}
.modal-box.wide { max-width: 860px; }
@keyframes mFade { from { opacity: 0 } }
@keyframes mRise { from { opacity: 0; transform: translateY(10px) scale(.985) } }

.modal-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.modal-x {
  margin-left: auto; flex-shrink: 0;
  width: 32px; height: 32px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-4); font-size: 20px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: var(--line-soft); color: var(--ink); }

.modal-body { padding: 20px 22px; }
.modal-foot {
  display: flex; gap: 10px; align-items: center;
  padding: 16px 22px 20px; border-top: 1px solid var(--line-soft);
}
.modal-foot .spacer { margin-left: auto; }

body.modal-open { overflow: hidden; }

/* ---------------------------------------------------- қадамдық шебер */
.steps { display: flex; gap: 8px; padding: 0 22px 16px; }
.step-dot {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-4);
}
.step-dot i {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--line-soft); color: var(--ink-4);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-style: normal;
}
.step-dot.on { color: var(--accent-text); }
.step-dot.on i { background: var(--accent); color: #fff; }
.step-dot.done i { background: var(--ok-bg); color: var(--ok); }
.step-pane[hidden] { display: none; }

/* ------------------------------------------- профиль бетінің жинақы жолы */
.info-strip {
  display: flex; flex-wrap: wrap; gap: 26px;
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 14px 20px;
}
.info-strip .k { display: block; font-size: 11px; color: var(--ink-4); }
.info-strip .v { font-size: 14px; font-weight: 500; }

.mini-row {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.mini-row:last-child { border-bottom: 0; }

/* ------------------------------------------ өзгермейтін ереже туралы блок */
.rule-note {
  padding: 11px 14px; border-radius: var(--r);
  background: var(--accent-soft); border: 1px solid var(--accent-ring);
  color: var(--accent-text); font-size: 14px;
}
.rule-note .xs { color: var(--ink-3); margin-top: 4px; line-height: 1.5; }

/* ============================================================ пән блогы */
/* Тұрақты тор — бағандар барлық жолда бір деңгейде тұрады */
.blk {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.5fr)   /* пән атауы */
    150px                  /* толтырылуы */
    minmax(140px, 1fr)     /* жауаптылар */
    120px                  /* күйі */
    auto;                  /* әрекеттер */
  align-items: center;
  gap: 14px;
  padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: var(--r);
}
.blk-ok   { border-left-color: #10b981; }
.blk-warn { border-left-color: #f59e0b; }
.blk-bad  { border-left-color: #f43f5e; }
.blk-muted{ border-left-color: var(--ink-4); }

.blk-name { min-width: 0; }
.blk-name .xs {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.blk-prog { display: flex; align-items: center; gap: 8px; }
.blk-prog .bar { flex: 1; }
.blk-who { line-height: 1.5; min-width: 0; overflow: hidden; }
.blk-who .nowrap { overflow: hidden; text-overflow: ellipsis; }
.blk-state { justify-self: start; }
.blk-act { display: flex; gap: 8px; justify-content: flex-end; }
.blk-foot { grid-column: 1 / -1; padding-top: 4px; border-top: 1px solid var(--line-soft); }

@media (max-width: 1000px) {
  .blk { grid-template-columns: 1fr 1fr; }
  .blk-act { grid-column: 1 / -1; justify-content: flex-start; }
  .blk-name { grid-column: 1 / -1; }
}

/* ─────────────────────────── Беттеу ─────────────────────────── */
.pager {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  padding: 13px 18px; border-top: 1px solid var(--line-soft);
}
.pager-info { font-size: 13px; color: var(--ink-3); }

.pager .pg {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); text-decoration: none; background: var(--line-soft);
}
.pager .pg:hover { background: var(--accent-soft); color: var(--accent-text); }
.pager .pg.on {
  background: var(--accent); color: #fff; font-weight: 600;
}
.pager .pg.on:hover { background: var(--accent-hover); }
.pager .pg.off {
  opacity: .35; pointer-events: none;
}
.pager .pg-gap { color: var(--ink-4); padding: 0 2px; font-size: 13px; }

@media (max-width: 600px) {
  .pager-info { width: 100%; }
}

/* ── Мерзім ескертуі (оқытушының басты беті) ── */
.due-over { color: var(--bad);  font-weight: 600; }
.due-soon { color: var(--warn); font-weight: 600; }

/* ── Жиналмалы тізім ── */
.fold > summary {
  cursor: pointer; padding: 13px 18px; font-size: 13.5px;
  color: var(--accent-text); user-select: none;
  border-top: 1px solid var(--line-soft);
}
.fold > summary:hover { background: var(--accent-soft); }
.fold[open] > summary { border-bottom: 1px solid var(--line-soft); }

/* ── Сұрақ формасының бөлімдері (бетте де, қалқымалыда да) ── */
.qsec {
  background: var(--card); border-radius: var(--r); margin-bottom: 16px;
}
.qsec-head {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 20px 0; font-weight: 600; font-size: 15px; color: var(--ink);
}
.qsec-head .spacer { margin-left: auto; }
.qsec-body { padding: 17px 20px; }

/* Қалқымалы терезенің ішінде бөлімдер жалаңаш болады */
.modal-body .qsec { background: transparent; margin-bottom: 20px; }
.modal-body .qsec:last-child { margin-bottom: 0; }
.modal-body .qsec-head { padding: 0 0 12px; border-bottom: 1px solid var(--line-soft); }
.modal-body .qsec-body { padding: 14px 0 0; }

/* ── Мәтін бірлігі (бөлінбейтін блок) ── */
.psg-list { display: flex; flex-direction: column; gap: 8px; }
.psg {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-ring);
}
.psg.broken { background: var(--warn-bg); border-color: var(--warn-line); }
.psg-ico {
  width: 30px; height: 30px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: #fff; color: var(--accent);
  font-size: 15px; font-weight: 700;
}
.psg.broken .psg-ico { color: var(--warn); }
.psg-name { flex: 1; min-width: 0; }

/* ── Түймедегі иконка: оқымай-ақ түсінікті болсын ── */
.btn .bico {
  margin-right: 6px; font-size: 12px; line-height: 1;
  opacity: .75; display: inline-block;
}
.btn.sm .bico { margin-right: 5px; font-size: 11px; }
.btn:hover .bico { opacity: 1; }

/* ── Логотип (SVG: белгі + TULGA + оқу орталығы бір суретте) ── */
.brand-logo {
  display: block; width: 100%; max-width: 168px; height: auto;
}
.brand-logo.sm { max-width: 104px; }          /* мобиль жолағында */
.brand-logo.lg { max-width: 220px; margin: 0 auto 6px; }  /* кіру беті */

.side-nav .brand { padding: 2px 6px 18px; }

/* ── Сұрау терезесі (браузердің confirm-ының орнына) ── */
.modal-box.ask { max-width: 420px; }
.modal-box.ask .modal-head { border-bottom: 0; padding-bottom: 4px; }
.ask-text {
  margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2);
}
.modal-box.ask .modal-foot { border-top: 0; padding-top: 8px; }

/* ── Сурет өшірілгендегі ескерту жолағы ── */
.img-dropped {
  display: flex; gap: 12px; align-items: center;
  padding: 11px 14px; margin-bottom: 10px;
  border: 1px dashed var(--line); border-radius: var(--r);
  background: var(--warn-bg); color: var(--warn); font-size: 13.5px;
}
.img-dropped[hidden] { display: none; }
.img-dropped span { flex: 1; }

/* ── Эмодзи иконка менюдің бір түсті стиліне бағынсын ── */
.side-links .ico, .side-foot .ico { filter: grayscale(1); }
.side-links a.on .ico, .side-foot a.on .ico { filter: none; }

/* ── Сұрақты қарау терезесі (тек оқуға) ── */
.qv-passage {
  padding: 14px 16px; margin-bottom: 16px;
  border-radius: var(--r); background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
}
.qv-passage-text {
  white-space: pre-wrap; line-height: 1.7; font-size: 14px;
  max-height: 260px; overflow-y: auto;
}
.qv-body {
  white-space: pre-wrap; font-size: 15.5px; font-weight: 600;
  line-height: 1.6; color: var(--ink);
}
.qv-img {
  max-width: 100%; max-height: 300px; display: block; margin-top: 10px;
  border-radius: var(--r); border: 1px solid var(--line); background: #fff;
}
.qv-opts { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.qv-opt {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px;
}
.qv-opt.right {
  background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok);
}
.qv-opt.right .opt-letter { background: var(--ok); color: #fff; }
