/* 54-maktab test platformasi — yagona dizayn tizimi.
   Ranglar logotipdan: to'q ko'k (asosiy) va oltin-sariq (urg'u). */
:root {
  --brand: #1b2d55;
  --brand-600: #24407a;
  --brand-50: #eef2fa;
  --accent: #f2a20c;
  --accent-50: #fff6e3;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e3e7ef;
  --text: #1c2333;
  --muted: #667085;
  --success: #12945b;
  --danger: #d0384b;
  --radius: 14px;
  --sidebar-w: 264px;
  --bs-primary: var(--brand);
  --bs-primary-rgb: 27, 45, 85;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
}

body { font-size: 15px; }
a { color: var(--brand-600); }

/* Tugmalar katta va aniq */
.btn { border-radius: 10px; font-weight: 600; padding: .6rem 1.1rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-600); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); --bs-btn-disabled-color: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1b1b1b; }
.btn-accent:hover { background: #db9108; border-color: #db9108; color: #1b1b1b; }
.form-control, .form-select { border-radius: 10px; padding: .7rem .9rem; border-color: var(--border); }
.form-control:focus, .form-select:focus { border-color: var(--brand-600); box-shadow: 0 0 0 .2rem rgba(36, 64, 122, .15); }
.form-label { font-weight: 600; font-size: .9rem; }

/* Kartochkalar */
.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-x .card-x-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-x .card-x-body { padding: 1.25rem; }
.card-x.card-x-body { padding: 1.25rem; }

.stat { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.2rem; height: 100%; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex: none; background: var(--brand-50); color: var(--brand); }
.stat-icon.accent { background: var(--accent-50); color: #b97700; }
.stat-icon.success { background: #e6f6ee; color: var(--success); }
.stat-label { color: var(--muted); font-size: .85rem; line-height: 1.2; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.15; color: var(--text); }

.page-title { font-size: 1.45rem; font-weight: 800; margin: 0; }
.page-sub { color: var(--muted); margin: .2rem 0 0; }

/* Ilova karkasi: sidebar + kontent */
.app-shell { min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--brand); color: #dbe3f4; }
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; color: #fff; text-decoration: none; }
.sidebar .brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.sidebar .brand b { display: block; font-size: 1rem; line-height: 1.1; }
.sidebar .brand small { color: #aebbd6; font-size: .75rem; }
.side-nav { list-style: none; padding: .5rem .7rem 1.5rem; margin: 0; }
.side-nav .nav-group { color: #8fa0c4; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: .9rem .7rem .35rem; display: flex; gap: .5rem; align-items: center; }
.side-nav a { display: flex; align-items: center; gap: .7rem; color: #dbe3f4; text-decoration: none; padding: .6rem .75rem; border-radius: 10px; font-weight: 500; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active { background: #fff; color: var(--brand); font-weight: 700; }
.side-nav a.active i { color: var(--accent); }
.side-nav .stage { margin-left: auto; font-size: .68rem; background: rgba(255, 255, 255, .12); color: #c9d4ea; border-radius: 6px; padding: .05rem .4rem; }
.side-nav a.active .stage { background: var(--brand-50); color: var(--brand); }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: .65rem 1.25rem; position: sticky; top: 0; z-index: 1020; }
.content { padding: 1.5rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; }

@media (min-width: 992px) {
  /* Bootstrap offcanvas-lg katta ekranda fonni shaffof qiladi — qayta beramiz */
  .sidebar.offcanvas-lg { position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; background-color: var(--brand) !important; }
  .main { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) {
  .sidebar.offcanvas-lg { --bs-offcanvas-width: var(--sidebar-w); background: var(--brand); }
  .content { padding: 1rem; }
}

/* Abituriyent: telefonda pastki navigatsiya */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); display: flex; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; text-align: center; padding: .5rem 0 .45rem; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.bottom-nav a i { display: block; font-size: 1.3rem; }
.bottom-nav a.active { color: var(--brand); }
@media (max-width: 991.98px) { .has-bottom-nav { padding-bottom: 72px; } }

/* Kirish sahifasi */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 55%, var(--bg) 55.2%); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 18px; box-shadow: 0 20px 50px rgba(17, 30, 60, .18); padding: 2rem; }
.auth-card .logo { width: 96px; height: 96px; display: block; margin: -4rem auto .75rem; border-radius: 50%; background: #fff; box-shadow: 0 6px 18px rgba(17, 30, 60, .2); }

.placeholder-box { text-align: center; padding: 3rem 1rem; }
.placeholder-box .big { font-size: 3rem; color: var(--accent); }
.empty-note { color: var(--muted); font-size: .9rem; text-align: center; padding: 2rem 0; }
/* Savol matnidagi jadvallar (atributsiz <table>) */
table:not([class]){border-collapse:collapse;margin:.5rem 0;font-size:.95em}
table:not([class]) th,table:not([class]) td{border:1px solid #999;padding:.3rem .6rem;text-align:center}
table:not([class]) th{background:#f3f5f9;font-weight:600}

/* ---------- Batafsil natija oynasi ---------- */
.rd { max-width: 760px; }
.rd-head { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; background: linear-gradient(135deg, #eef6ff, #f5faff); border-radius: 16px; padding: 1.5rem 2rem; margin-bottom: 1rem; }
.rd-ring { position: relative; width: 170px; height: 170px; flex: none; }
.rd-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rd-ring circle { fill: none; stroke-width: 11; }
.rd-ring .bg { stroke: #dbeafe; }
.rd-ring .fg { stroke: url(#rdg); stroke-linecap: round; stroke-dasharray: calc(var(--p) * 1) 100; }
.rd-ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rd-ring-text b { font-size: 2.1rem; font-weight: 800; line-height: 1; color: #16213e; }
.rd-ring-text span { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.rd-meta { margin: 0; display: grid; gap: .55rem; font-size: 1.05rem; }
.rd-meta div { display: flex; gap: .4rem; align-items: baseline; }
.rd-meta dt { font-weight: 500; color: #48546b; }
.rd-meta dd { margin: 0; font-weight: 700; color: #1f2a44; }
.rd-score { font-size: 1.5rem; color: #1e6fd9 !important; font-weight: 800 !important; }
.rd-score small { font-size: .8rem; color: var(--muted); font-weight: 500; }
.rd-legend { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1.1rem; margin-bottom: 1rem; font-size: .9rem; color: #2b3650; background: #fff; }
.rd-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.rd-c { display: inline-block; width: 20px; height: 20px; border: 1.5px solid #9aa6bd; background: #fff; }
.rd-c.sq { border-radius: 5px; } .rd-c.ci { border-radius: 50%; }
.rd-c.correct { border-color: #2f9e44; background: #e6f7ea; }
.rd-c.wrong { border: 1.5px dashed #e03131; background: #ffe8e8; }
.rd-c.empty { border: 1.5px dashed #adb5bd; background: #f1f3f5; }
.rd-current { display: flex; align-items: center; gap: .9rem; border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; background: #fff; }
.rd-pill { border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.rd-pill.correct, .rd-pill.annulled { background: #e6f7ea; color: #2b8a3e; }
.rd-pill.wrong { background: #ffe3e3; color: #c92a2a; }
.rd-pill.empty { background: #f1f3f5; color: #6c757d; }
.rd-sec { margin-bottom: 1rem; }
.rd-sec-title { font-weight: 600; color: #48546b; margin-bottom: .5rem; }
.rd-sec-title span { font-weight: 400; font-size: .8rem; color: var(--muted); margin-left: .35rem; }
.rd-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.rd-cell { position: relative; width: 46px; height: 46px; display: inline-grid; place-items: center; font-weight: 700; font-size: .95rem; border: 1.5px solid #9aa6bd; background: #fff; color: #495057; padding: 0; flex: none; }
.rd-cell.sq { border-radius: 9px; } .rd-cell.ci { border-radius: 50%; }
.rd-cell.correct, .rd-cell.annulled { border-color: #2f9e44; background: #e6f7ea; color: #2b8a3e; }
.rd-cell.annulled { border-style: double; border-width: 3px; }
.rd-cell.wrong { border: 1.5px dashed #e03131; background: #ffe8e8; color: #c92a2a; }
.rd-cell.empty { border: 1.5px dashed #adb5bd; background: #f1f3f5; color: #868e96; }
.rd-cell.active { outline: 3px solid #1e6fd9; outline-offset: 2px; }
.rd-appeal { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); color: #f08c00; background: #fff; border-radius: 50%; font-size: 14px; line-height: 1; }
.rd-q { margin-top: 1rem; }
@media (max-width: 575.98px) { .rd-head { padding: 1rem; gap: 1rem; justify-content: center; } .rd-ring { width: 130px; height: 130px; } .rd-cell { width: 40px; height: 40px; } }
