/* ===== Dizayn tizimi ===== */
:root {
  --bg: #f5f3ec;
  --surface: #ffffff;
  --surface-2: #faf8f2;
  --text: #0f1f22;
  --text-2: #33443f;
  --muted: #66736f;
  --border: #e6e0d3;
  --border-2: #d3cbb9;
  --primary: #0d5c63;
  --primary-hover: #094a50;
  --primary-soft: #e5f0ee;
  --primary-ring: rgba(13, 92, 99, .25);
  --gold: #c9ae6a;
  --gold-strong: #a48a45;
  --gold-soft: #f6efdc;
  --success: #15803d;
  --success-bg: #16a34a;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --navy: #032e34;
  --navy-2: #0a3d44;
  --telegram: #229ed9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(3, 46, 52, .05);
  --shadow: 0 1px 2px rgba(3, 46, 52, .04), 0 8px 24px rgba(3, 46, 52, .07);
  --shadow-lg: 0 24px 60px rgba(3, 46, 52, .2);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 650; }
h4 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .8em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
small, .small { font-size: .84rem; }
.tiny { font-size: .78rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.stack > * + * { margin-top: 1rem; }
.grow { flex: 1; min-width: 0; }

.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2.4em; height: 2.4em; stroke-width: 1.6; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ===== Tugmalar ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .62em 1.1em; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--text); text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s, color .15s;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(13, 92, 99, .3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-success { background: var(--success-bg); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--success); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-outline { border-color: var(--border-2); background: var(--surface); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(15, 23, 42, .06); }
.btn-soft-danger { background: var(--danger-soft); color: var(--danger); }
.btn-soft-danger:hover:not(:disabled) { background: #fecaca; }
.btn-gold { background: linear-gradient(180deg, #dcc68f, #c3a65f); color: #1d2a22; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.btn-gold:hover:not(:disabled) { background: linear-gradient(180deg, #e3cf9a, #cbae69); }
.btn-ghost-light { background: transparent; color: #e6efea; border-color: rgba(230, 239, 234, .35); }
.btn-ghost-light:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #fff; }
.btn-telegram { background: var(--telegram); color: #fff; }
.btn-telegram:hover { background: #1b8bc0; }
.btn-sm { padding: .42em .75em; font-size: .86rem; border-radius: 8px; }
.btn-lg { padding: .85em 1.4em; font-size: 1.02rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: .5em; }

/* ===== Kartochka, nishon, ogohlantirish ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; }
.card-tight { padding: 16px 18px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; }
.card-body { padding: 20px; }
.eyebrow { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: .4rem; }

.badge {
  display: inline-flex; align-items: center; gap: .35em; padding: .2em .65em; border-radius: 999px;
  font-size: .76rem; font-weight: 650; line-height: 1.5; background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: #cfe3e0; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #bbf7d0; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: #fde68a; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.badge-dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge-gold { background: var(--gold-soft); color: var(--gold-strong); border-color: #eadbb0; }
.dot { width: .55em; height: .55em; border-radius: 50%; background: currentColor; display: inline-block; }
.dot-pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.alert { display: flex; gap: .7rem; align-items: flex-start; padding: 12px 16px; border-radius: 12px; border: 1px solid; font-size: .93rem; }
.alert .icon { margin-top: .15em; }
.alert > div { flex: 1; }
.alert .btn { margin-left: auto; flex: none; }
.alert-info { background: var(--primary-soft); border-color: #cfe3e0; color: #0b4a50; }
.alert-success { background: var(--success-soft); border-color: #bbf7d0; color: #14532d; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #78350f; }
.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }
.messages { display: grid; gap: .6rem; margin-bottom: 1.25rem; }

.chip { display: inline-flex; align-items: center; gap: .35em; font-size: .8rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: .2em .55em; border-radius: 8px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; border-radius: 20px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; stroke-width: 1.5; color: var(--border-2); margin-bottom: .6rem; }
.empty h3 { color: var(--text); }

/* ===== Forma ===== */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; align-content: start; }
.field > label, .label { font-weight: 600; font-size: .9rem; color: var(--text-2); }
.field .help, .helptext { font-size: .8rem; color: var(--muted); }
.field .errorlist, ul.errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: .84rem; }
input[type=text], input[type=number], input[type=password], input[type=search], input[type=datetime-local],
input[type=email], input[type=url], input[type=tel], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: .6em .8em; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 1.05em; height: 1.05em; }
input[type=file] { font: inherit; font-size: .9rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-list ul, ul.checkbox-list, .checkbox-list > div { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.checkbox-list label { display: inline-flex; align-items: center; gap: .45rem; padding: .4em .75em; border: 1px solid var(--border-2); border-radius: 999px; font-weight: 500; cursor: pointer; font-size: .9rem; }
.toggles { display: grid; gap: .75rem; }
.toggle-row { display: flex; gap: .75rem; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.toggle-row input { margin-top: .2em; }
.toggle-row b { display: block; font-weight: 600; }
.toggle-row small { color: var(--muted); }
.field.is-disabled { opacity: .45; }

/* ===== Jadval ===== */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f6faf9; }
.table .actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: .7rem; min-width: 180px; }
.person b { display: block; font-weight: 600; }
.person small { color: var(--muted); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .65em 1em; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.tabs .count { font-size: .75rem; background: var(--surface-2); border: 1px solid var(--border); padding: 0 .45em; border-radius: 999px; margin-left: .3em; }
.tabs a.active .count { background: var(--primary-soft); border-color: #cfe3e0; }

.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1rem; align-items: center; }

/* ===== Logotip ===== */
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.08rem; color: var(--text); text-decoration: none !important; letter-spacing: -.01em; }
.logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; display: block;
        box-shadow: 0 0 0 2px rgba(213, 195, 137, .65), 0 4px 12px rgba(3, 46, 52, .25); }

/* ===== O'quvchi qismi ===== */
.nav { background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.nav-user { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.nav-user-text { line-height: 1.25; min-width: 0; }
.nav-user-text b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.nav-user-text small { color: var(--muted); }
.page { padding-top: 28px; padding-bottom: 40px; min-height: calc(100vh - 64px - 64px); }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.hero h1 { margin-bottom: .2rem; }
.hero p { margin: 0; }

.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 1.25rem; }
.exam-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: .65rem; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s, border-color .2s; position: relative; overflow: hidden; }
.exam-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--border); }
.exam-card.state-available::before { background: linear-gradient(90deg, var(--primary), var(--gold)); }
.exam-card.state-done::before { background: var(--success-bg); }
.exam-card.state-in_progress::before { background: var(--warning); }
.exam-card.terminated::before { background: var(--danger); }
.exam-card.state-available.locked::before { background: linear-gradient(90deg, var(--gold-strong), var(--gold)); }
.exam-card.state-available:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #bcd8d4; }
.exam-card h3 { font-size: 1.12rem; margin: .1rem 0 0; }
.exam-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.exam-card-chips { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.exam-card .desc { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { list-style: none; padding: 0; margin: .2rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .75rem; font-size: .87rem; color: var(--text-2); }
.meta li { display: flex; align-items: center; gap: .45rem; }
.meta .icon { color: var(--muted); }
.exam-card-foot { margin-top: auto; padding-top: .6rem; display: grid; gap: .45rem; }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .9rem; }
.result-line b { font-size: 1.05rem; }
.card-note { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .84rem; color: var(--warning); }

/* ===== Kirish sahifasi ===== */
body.auth { background: radial-gradient(1200px 600px at 10% -10%, #e2eee9 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #efe8d6 0%, transparent 60%), var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 940px; display: grid; grid-template-columns: 1fr 1.05fr; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); }
.auth-side { background: linear-gradient(160deg, #0a3d44 0%, #032e34 55%, #0d5c63 140%); color: #e6efea; padding: 40px 36px; display: flex; flex-direction: column; gap: 1.5rem; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 340px; height: 340px; right: -120px; bottom: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 174, 106, .35), transparent 70%); }
.auth-side h1 { color: #fff; font-family: var(--serif); font-size: 2.3rem; line-height: 1.05; margin: .35rem 0 0; }
.auth-home { color: #cfe1dd; font-size: .88rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; position: relative; z-index: 1; }
.auth-home:hover { color: #fff; }
.auth-logo { width: 132px; height: 132px; border-radius: 50%; position: relative; z-index: 1;
             box-shadow: 0 0 0 1px rgba(213, 195, 137, .55), 0 0 0 10px rgba(213, 195, 137, .07), 0 20px 50px rgba(0, 0, 0, .4); }
.auth-eyebrow { color: var(--gold); font-size: .74rem; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; }
.auth-points { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: .9rem; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: .75rem; align-items: flex-start; font-size: .95rem; }
.auth-points .icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #d5c389; flex: none; margin-top: -.2rem; }
.auth-main { padding: 40px 40px 32px; }
.steps { padding: 0; margin: 1.25rem 0; list-style: none; counter-reset: s; display: grid; gap: .8rem; }
.steps li { counter-increment: s; display: flex; gap: .8rem; align-items: flex-start; font-size: .95rem; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .85rem; display: grid; place-items: center; flex: none; }
.otp-form { display: grid; gap: .8rem; margin-top: 1.25rem; }
.otp-input { font-family: var(--mono) !important; font-size: 2rem !important; letter-spacing: .5em; text-align: center; padding: .45em .2em .45em .7em !important; font-weight: 700; border-radius: 14px !important; }
.otp-input::placeholder { color: #cbd5e1; letter-spacing: .5em; }

/* ===== Yuzni ro'yxatdan o'tkazish va kamera ===== */
.camera-box { position: relative; aspect-ratio: 4 / 3; background: #0b1220; border-radius: 16px; overflow: hidden; display: grid; place-items: center; }
.camera-box video, .camera-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-placeholder { color: #94a3b8; display: grid; justify-items: center; gap: .5rem; text-align: center; padding: 1rem; font-size: .92rem; z-index: 1; }
.face-frame { position: absolute; left: 50%; top: 47%; width: 46%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border: 3px dashed rgba(255, 255, 255, .55); border-radius: 50%; z-index: 2; transition: border-color .2s; pointer-events: none; }
.face-frame.ok { border-style: solid; border-color: #4ade80; box-shadow: 0 0 0 9999px rgba(11, 18, 32, .35); }
.face-frame.bad { border-color: #f87171; }
.camera-status { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; background: rgba(11, 18, 32, .72); color: #fff; padding: .55em .9em; border-radius: 10px; font-size: .9rem; display: flex; gap: .5rem; align-items: center; backdrop-filter: blur(4px); }
.enroll-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.progress-dots { display: flex; gap: .4rem; }
.progress-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.progress-dots i.on { background: var(--success-bg); }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; font-size: .92rem; color: var(--text-2); }
.tips li { display: flex; gap: .6rem; align-items: flex-start; }
.tips .icon { color: var(--primary); margin-top: .15em; }

/* ===== Test oldidan tekshiruv ===== */
.precheck-top { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.precheck-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; padding-bottom: 40px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1.25rem 0; }
.facts div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.facts b { display: block; font-size: 1.35rem; }
.facts span { font-size: .8rem; color: var(--muted); }
.rules { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .75rem; }
.rules li { display: flex; gap: .75rem; align-items: flex-start; font-size: .93rem; color: var(--text-2); }
.rules .icon { color: var(--primary); margin-top: .1em; width: 20px; height: 20px; }
.checklist { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.checklist li { display: flex; gap: .75rem; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.checklist b { display: block; font-size: .92rem; }
.checklist small { color: var(--muted); display: block; line-height: 1.35; }
.check-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-2); flex: none; display: grid; place-items: center; position: relative; }
.checklist li.pending .check-dot { border-color: var(--primary); border-top-color: transparent; animation: spin .9s linear infinite; }
.checklist li.ok .check-dot { background: var(--success-bg); border-color: var(--success-bg); }
.checklist li.ok .check-dot::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checklist li.fail { border-color: #fecaca; background: #fff7f7; }
.checklist li.fail .check-dot { background: var(--danger); border-color: var(--danger); }
.checklist li.fail .check-dot::after { content: "!"; color: #fff; font-weight: 800; font-size: .8rem; }
.agree { display: flex; gap: .6rem; align-items: center; margin: 1rem 0; font-weight: 500; cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Test ekrani ===== */
body.exam-body { background: #efede6; }
.exam { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none;
        -webkit-touch-callout: none; position: relative; }
.exam-top { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 10px 20px; min-height: 68px; position: sticky; top: 0; z-index: 10; }
.exam-top-left { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.exam-top-left b { display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.exam-top-left small { color: #9fc0ba; }
.exam-progress { color: #cfe1dd; font-size: .9rem; white-space: nowrap; }
.exam-progress b { color: #fff; }
.exam-top-right { display: flex; align-items: center; gap: .9rem; }
.timer { display: inline-flex; align-items: center; gap: .5rem; background: #fff; color: var(--navy); font-family: var(--mono); font-weight: 800; font-size: 1.35rem; padding: .3em .75em; border-radius: 12px; min-width: 128px; justify-content: center; }
.timer.low { background: var(--danger); color: #fff; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { opacity: .82; } }
.cam-pip { position: relative; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: #000; border: 2px solid rgba(255, 255, 255, .25); flex: none; }
.cam-pip video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-status { position: absolute; top: 5px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: #94a3b8; border: 2px solid #fff; }
.cam-status.ok { background: #22c55e; }
.cam-status.warn { background: #f59e0b; }
.cam-status.bad { background: #ef4444; }
.face-warning { background: var(--danger); color: #fff; text-align: center; padding: .6em 1em; font-weight: 600; display: flex; justify-content: center; gap: .5rem; align-items: center; }
.exam-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 24px; max-width: 1240px; width: 100%; margin: 0 auto; align-items: start; position: relative; z-index: 1; }
.question-card { background: var(--surface); border-radius: 18px; padding: 28px 30px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.question-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.question-num { font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: .25em .8em; border-radius: 999px; font-size: .88rem; }
.save-state { font-size: .82rem; color: var(--muted); display: inline-flex; gap: .35rem; align-items: center; }
.question-text { font-size: 1.28rem; font-weight: 650; line-height: 1.5; margin: 0 0 1.4rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.options { display: grid; gap: .7rem; }
.option { display: flex; align-items: center; gap: 1rem; text-align: left; width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); font: inherit; font-size: 1.02rem; color: var(--text); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.option:hover { border-color: #a9cfca; background: #f6faf9; }
.option:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }
.option .letter { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2); flex: none; }
.option .text { flex: 1; overflow-wrap: anywhere; white-space: pre-wrap; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.question-nav { display: flex; justify-content: space-between; margin-top: 1.6rem; gap: .75rem; }
.palette-card { background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); position: sticky; top: 92px; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: .75rem 0; max-height: 48vh; overflow-y: auto; padding: 2px; }
.palette button { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); font: inherit; font-size: .82rem; font-weight: 650; cursor: pointer; color: var(--text-2); padding: 0; }
.palette button.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.palette button.current { box-shadow: 0 0 0 3px var(--primary-ring); border-color: var(--primary); }
.legend { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted); margin-bottom: 1rem; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend .lg { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-2); display: inline-block; }
.legend .lg.answered { background: var(--primary); border-color: var(--primary); }
.watermark { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 70px 90px; padding: 40px; transform: rotate(-22deg) scale(1.4); opacity: .07; font-weight: 700; font-size: 15px; color: var(--navy); white-space: nowrap; user-select: none; }
.hint-keys { font-size: .78rem; color: var(--muted); text-align: center; margin-top: .9rem; }
kbd { font-family: var(--mono); font-size: .76rem; background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35em; }

/* ===== Oynalar (modal) ===== */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(3, 46, 52, .62); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.overlay-solid { background: #032e34; }
.modal { background: var(--surface); border-radius: 20px; padding: 32px; max-width: 460px; width: 100%; text-align: center; box-shadow: var(--shadow-lg); }
.modal h2 { margin-top: .6rem; }
.modal .btn + .btn { margin-left: .5rem; }
.modal-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.modal-icon .icon { width: 32px; height: 32px; }
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-icon.warning { background: var(--warning-soft); color: var(--warning); }
.modal-icon.primary { background: var(--primary-soft); color: var(--primary); }
.modal-icon.success { background: var(--success-soft); color: var(--success); }
.modal-actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .8s linear infinite; margin: 0 auto 1rem; }
.busy-mark { position: relative; width: 104px; height: 104px; margin: 0 auto 1.1rem; }
.busy-mark img { position: absolute; inset: 12px; width: 80px; height: 80px; border-radius: 50%; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.busy-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(213, 195, 137, .18); border-top-color: var(--gold); animation: spin .9s linear infinite; }
.busy-text { color: #e6efea; text-align: center; max-width: 30em; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: .65em 1.1em; border-radius: 12px; font-size: .92rem; font-weight: 550; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Natija ===== */
.result-card { max-width: 560px; margin: 0 auto; text-align: center; padding: 36px 32px; }
.ring { --p: 0; --c: var(--primary); width: 170px; height: 170px; border-radius: 50%; margin: 1rem auto 1.25rem; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #ebe6da 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; }
/* Natija sahifasi: qayta topshirish bloki */
.retake { display: flex; gap: 14px; margin-top: 1.5rem; padding: 18px; border: 1px solid var(--border); border-radius: 14px;
          background: var(--surface-2); text-align: left; }
.retake h3 { margin: 0 0 .2rem; font-size: 1.02rem; }
.retake p { margin: 0 0 .75rem; font-size: .9rem; color: var(--text-2); }
.retake > div > :last-child { margin-bottom: 0; }
.retake-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
               background: var(--gold-soft); color: var(--gold-strong); }
.retake-pending .retake-icon { background: var(--warning-soft); color: var(--warning); }
.retake-rejected .retake-icon { background: var(--danger-soft); color: var(--danger); }
.retake-approved .retake-icon, .retake-left .retake-icon { background: var(--primary-soft); color: var(--primary); }
.retake-form summary { list-style: none; display: inline-flex; }
.retake-form summary::-webkit-details-marker { display: none; }
.retake-form[open] summary { display: none; }
.retake-form form { display: grid; gap: .5rem; }
.retake-form label { font-size: .85rem; font-weight: 600; }
.retake-form .btn { justify-self: start; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1.25rem 0; }
.result-stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px; }
.result-stats b { display: block; font-size: 1.15rem; }
.result-stats span { font-size: .78rem; color: var(--muted); }

/* ===== Admin paneli ===== */
.panel { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy); color: #cfe1dd; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: 4px 8px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: .75rem; padding: .62em .8em; border-radius: 10px; color: #cfe1dd; font-weight: 550; font-size: .93rem; text-decoration: none; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: rgba(201, 174, 106, .18); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar nav a .icon { width: 19px; height: 19px; opacity: .85; }
.sidebar nav .nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700; padding: .05em .55em; border-radius: 999px; }
.sidebar nav .nav-badge.live { background: #22c55e; }
.sidebar .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #7fa39d; padding: .8rem .8rem .3rem; font-weight: 700; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.sidebar-foot .btn { color: #cfe1dd; margin-left: auto; }
.sidebar-foot .btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.panel-main { padding: 28px 32px 48px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.panel-head h1 { font-size: 1.55rem; margin: 0; }
.panel-head p { margin: .25rem 0 0; color: var(--muted); }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; display: flex; gap: .4rem; align-items: center; }
.breadcrumb a { color: var(--muted); }
.mobile-bar { display: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 1.5rem; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: .9rem; align-items: center; text-decoration: none !important; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: #bcd8d4; box-shadow: var(--shadow); }
.stat .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat .stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat .stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat .stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.stat span { font-size: .84rem; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.setup-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.setup-list li { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; }
.setup-list .icon { margin-top: .15em; }
.setup-list .ok { color: var(--success); }
.setup-list .no { color: var(--warning); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.25rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }

.q-list { list-style: none; padding: 0; margin: 0; }
.q-item { padding: 16px 20px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.q-item:last-child { border-bottom: 0; }
.q-index { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: .82rem; font-weight: 700; color: var(--muted); }
.q-text { font-weight: 600; margin-bottom: .45rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-options { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; font-size: .9rem; color: var(--text-2); }
.q-options li { display: flex; gap: .5rem; align-items: baseline; }
.q-options .l { font-weight: 700; color: var(--muted); width: 1.2em; flex: none; }
.q-options li.correct { color: var(--success); font-weight: 600; }
.q-options li.correct .l { color: var(--success); }
.q-options li.wrong { color: var(--danger); font-weight: 600; text-decoration: line-through; }
.q-options li.wrong .l { color: var(--danger); }
.option-rows { display: grid; gap: .55rem; }
.option-row { display: grid; grid-template-columns: auto 28px minmax(0, 1fr); gap: .6rem; align-items: center; }
.option-row .letter { font-weight: 700; color: var(--muted); text-align: center; }
.option-row label.correct-pick { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muted); cursor: pointer; }

.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.live-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.live-card.bad { border-color: #fca5a5; box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }
.live-card.warn { border-color: #fcd34d; }
.live-photo { aspect-ratio: 4 / 3; background: #0b1220; position: relative; color: #64748b; display: grid; place-items: center; }
.live-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.live-photo .badge { position: absolute; top: 10px; left: 10px; }
.live-photo .time-left { position: absolute; bottom: 10px; right: 10px; background: rgba(11, 18, 32, .75); color: #fff; font-family: var(--mono); font-weight: 700; padding: .15em .55em; border-radius: 8px; font-size: .9rem; }
.live-body { padding: 12px 14px; display: grid; gap: .35rem; font-size: .88rem; }
.live-body b { font-size: .98rem; }
.bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.live-actions { display: flex; gap: .4rem; padding: 0 14px 14px; }
.live-actions .btn { flex: 1; }

.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.snap { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.snap.problem { border-color: #fca5a5; }
.snap img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transform: scaleX(-1); cursor: zoom-in; }
.snap figcaption { padding: 6px 8px; font-size: .76rem; display: flex; justify-content: space-between; gap: .3rem; align-items: center; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 70px 16px minmax(0, 1fr); gap: 10px; padding: 7px 0; font-size: .88rem; align-items: start; }
.timeline time { color: var(--muted); font-family: var(--mono); font-size: .8rem; padding-top: .1em; }
.timeline .tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); margin-top: .45em; }
.timeline .problem .tl-dot { background: var(--danger); }
.timeline .ok .tl-dot { background: var(--success-bg); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare figure { margin: 0; }
.compare img { border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transform: scaleX(-1); background: #0b1220; }
.compare figcaption { font-size: .78rem; color: var(--muted); margin-top: .3rem; text-align: center; }
.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 23, .88); z-index: 200; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 90vh; max-width: 92vw; border-radius: 12px; transform: scaleX(-1); }
.import-sample { background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: 12px; padding: 12px 14px; font-family: var(--mono); font-size: .82rem; white-space: pre; overflow-x: auto; margin: .5rem 0 0; }
details.import-help summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.error-list { margin: 0; padding-left: 1.2rem; font-size: .88rem; color: #7f1d1d; max-height: 220px; overflow-y: auto; }
.inline-form { display: inline; }
.retake-reason { max-width: 320px; font-size: .88rem; color: var(--text-2); }
details.revoke { position: relative; }
details.revoke > summary { list-style: none; }
details.revoke > summary::-webkit-details-marker { display: none; }
.revoke-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: flex; gap: .4rem; width: 360px;
               padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.input-sm { padding: .4em .6em !important; font-size: .9rem !important; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 180px; }
.group-name { margin-right: .4rem; }

/* Guruh a'zolari: qidirish, saralash, belgilash */
.member-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.member-tools input[type=search] { flex: 1 1 240px; width: auto; }
.segmented { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented label { padding: .35em .75em; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--primary-ring); }
.member-list { list-style: none; margin: 0; padding: 6px 0; max-height: 600px; overflow-y: auto; }
.member-list label { display: flex; align-items: center; gap: 12px; padding: 9px 20px; cursor: pointer; transition: background-color .12s; }
.member-list label:hover { background: var(--surface-2); }
.member-list .avatar { width: 34px; height: 34px; font-size: .9rem; transition: background-color .12s, color .12s; }
.member-list input:checked ~ .avatar { background: var(--primary); color: #fff; }
.member-list li.changed label { background: var(--gold-soft); }
.member-name { flex: 1; min-width: 0; }
.member-name b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name small { color: var(--muted); }
.member-from { flex: none; }
.member-empty { margin: 0; padding: 16px 20px; }
.group-side { position: sticky; top: 16px; }
.group-side .chip { margin: 0 .25rem .35rem 0; }
@media (max-width: 900px) { .group-side { position: static; } }

/* Rasch: savollar darajasi */
.level-badge { display: inline-flex; align-items: center; gap: .3em; margin-top: .35rem; padding: .15em .55em; border-radius: 6px;
               font-size: .74rem; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.level-badge.easy { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }
.level-badge.medium { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.level-badge.hard { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.rasch-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: .75rem 0; }
.rasch-levels div { display: grid; padding: 10px 8px; border-radius: 10px; text-align: center; border: 1px solid; }
.rasch-levels b { font-size: 1.35rem; line-height: 1.1; }
.rasch-levels span { font-size: .72rem; }
.rasch-levels .hard { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.rasch-levels .medium { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.rasch-levels .easy { background: var(--success-soft); border-color: #bbf7d0; color: #166534; }
.rasch-help summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--primary); }
.rasch-help ul { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .82rem; color: var(--text-2); display: grid; gap: .35rem; }
.grade { display: inline-block; min-width: 1.9em; padding: .05em .35em; border-radius: 6px; text-align: center;
         font-family: var(--serif); font-size: 1.02rem; background: var(--gold-soft); color: var(--navy); }
.grade-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

/* Test sozlamalari: kimlarga bepul */
.free-groups { margin-top: 1rem; }
.free-groups > label { display: flex; align-items: center; gap: .35rem; margin-bottom: .2rem; font-weight: 600; font-size: .9rem; }
.free-groups .help { display: block; font-size: .8rem; color: var(--muted); }
.free-groups .checkbox-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.free-groups .checkbox-list label:has(input:checked) { background: var(--success-soft); border-color: #bbf7d0; color: var(--success); }
.free-groups .is-locked { opacity: .75; cursor: default; }

/* ===== Xato sahifalari (404, 500) ===== */
.error-page { max-width: 560px; margin: 0 auto; padding-top: 48px; padding-bottom: 64px; text-align: center; }
.error-page h1 { font-family: var(--serif); font-size: 2.4rem; color: var(--navy); }
.error-mark { width: 160px; height: auto; margin: 0 auto 1rem; opacity: .9; }

/* ===== Narx va hisob ===== */
.price-chip { display: inline-flex; align-items: center; gap: .3em; padding: .2em .6em; border-radius: 8px; font-size: .8rem;
              font-weight: 700; white-space: nowrap; background: var(--gold-soft); color: var(--gold-strong); border: 1px solid #eadbb0; }
.price-chip.free { background: var(--success-soft); color: var(--success); border-color: #bbf7d0; }
.price-chip.owned { background: var(--primary-soft); color: var(--primary); border-color: #cfe3e0; }
.amount-in { color: var(--success); }
.amount-out { color: var(--text); }
.balance-figure { font-size: 1.15rem; }

.hero-balance { display: flex; align-items: center; gap: .8rem; padding: .65rem .9rem; border-radius: 16px; color: var(--text);
                background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
                text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.hero-balance:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.hero-balance small { display: block; color: var(--muted); font-size: .76rem; }
.hero-balance b { display: block; font-size: 1.12rem; line-height: 1.2; }
.hero-balance > .icon { color: var(--muted); }
.hero-balance-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); }

/* Sotib olish oynasi (test sahifasi) */
.buy-box { display: grid; gap: 1rem; }
.buy-head { display: flex; align-items: center; gap: .9rem; }
.buy-head .eyebrow { margin-bottom: .1rem; color: var(--gold-strong); }
.buy-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none;
            background: linear-gradient(160deg, var(--gold-soft), #efe2bd); color: var(--gold-strong); }
.buy-icon .icon { width: 26px; height: 26px; }
.buy-price { display: block; font-size: 1.85rem; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; color: var(--navy); }
.buy-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: .93rem; color: var(--text-2); }
.buy-facts li { display: flex; gap: .6rem; align-items: flex-start; }
.buy-facts .icon { color: var(--success); margin-top: .15em; }
.buy-balance { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem;
               border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.buy-balance span { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); }
.buy-balance b { font-size: 1.1rem; }

/* Hisob sahifasi: logotipli karta (fonda o'zbek girih naqshi — sakkiz qirrali yulduzlar) */
.wallet-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.balance-card { position: relative; overflow: hidden; display: flex; flex-direction: column; aspect-ratio: 1.586; padding: 22px 24px;
  border-radius: 22px; color: #e6efea; isolation: isolate;
  background:
    radial-gradient(circle at 88% 10%, rgba(213, 195, 137, .38), transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23d5c389' stroke-opacity='.13' stroke-width='1'%3E%3Cpath d='M11 11h22v22H11z'/%3E%3Cpath d='M22 6.4 37.6 22 22 37.6 6.4 22z'/%3E%3Ccircle cx='22' cy='22' r='4'/%3E%3Cpath d='M0 0l6.4 6.4M44 0l-6.4 6.4M0 44l6.4-6.4M44 44l-6.4-6.4'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 44px 44px,
    linear-gradient(140deg, #0d5c63 0%, #063d43 45%, #021f23 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 22px 50px rgba(3, 46, 52, .35); }
.balance-card::after { content: ""; position: absolute; inset: 8px; z-index: -1; border-radius: 16px; border: 1px solid rgba(213, 195, 137, .28); }
.balance-card-top { display: flex; align-items: center; gap: .7rem; }
.balance-card-top b { display: block; font-family: var(--serif); font-size: 1.2rem; line-height: 1.05; color: #fff; }
.balance-card-top small { display: block; font-size: .6rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.balance-logo { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(213, 195, 137, .7), 0 6px 16px rgba(0, 0, 0, .35); }
.balance-label { margin-top: auto; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: #9fc0ba; }
.balance-amount { font-size: clamp(1.8rem, 6vw, 2.25rem); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: #fff; }
.balance-card-foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: .9rem; padding-top: .7rem;
                     border-top: 1px solid rgba(213, 195, 137, .22); font-size: .82rem; color: #cfe1dd; }
.balance-card-foot span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.amount-chip { padding: .35em .75em; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface);
               font: inherit; font-size: .82rem; font-weight: 600; color: var(--text-2); cursor: pointer; }
.amount-chip:hover { border-color: var(--gold); color: var(--gold-strong); background: var(--gold-soft); }
.ledger { list-style: none; padding: 0; margin: 0; }
.ledger li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 20px;
             border-bottom: 1px solid var(--border); }
.ledger li:last-child { border-bottom: 0; }
.ledger-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.ledger-icon.in { background: var(--success-soft); color: var(--success); }
.ledger-icon.out { background: var(--gold-soft); color: var(--gold-strong); }
.ledger-body b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-body small, .ledger-amount small { display: block; color: var(--muted); font-size: .78rem; }
.ledger-amount { text-align: right; white-space: nowrap; }
.mini-ledger { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; font-size: .88rem; }
.mini-ledger li { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.mini-ledger small { display: block; color: var(--muted); font-size: .76rem; }

/* ===== Moslashuvchanlik ===== */
@media (max-width: 1000px) {
  .precheck-grid, .enroll-grid, .grid-side, .grid-2, .wallet-grid { grid-template-columns: minmax(0, 1fr); }
  .exam-main { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .palette-card { position: static; }
  .palette { grid-template-columns: repeat(10, 1fr); max-height: none; }
  .exam-progress { display: none; }
}
@media (max-width: 900px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .panel.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; }
  .mobile-bar .brand { color: #fff; }
  .mobile-bar .btn { color: #fff; }
  .panel-main { padding: 20px 16px 40px; }
  .auth-card { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 28px; }
  .auth-side h1 { font-size: 1.45rem; }
  .auth-main { padding: 28px 24px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding: 0 16px; }
  h1 { font-size: 1.45rem; }
  .card { padding: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .exam-top { padding: 8px 12px; gap: .5rem; }
  .exam-top-left small { display: none; }
  .timer { font-size: 1.05rem; min-width: 0; padding: .3em .55em; }
  .cam-pip { width: 64px; height: 48px; }
  .question-card { padding: 20px 18px; }
  .question-text { font-size: 1.1rem; }
  .palette { grid-template-columns: repeat(7, 1fr); }
  .facts, .result-stats { grid-template-columns: repeat(3, 1fr); }
  .meta { grid-template-columns: 1fr; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .table td, .table th { padding: 10px; }
}
@media print { .exam-body * { visibility: hidden !important; } }
