/* ==========================================================================
   SQL Maktab - yagona uslub fayli.
   Dizayn: to'q ko'k sidebar + oq sahifa + marjon-to'q sariq urg'u.
   UI ni almashtirish uchun faqat shu fayl (va kerak bo'lsa HTML) o'zgartiriladi.
   ========================================================================== */
:root {
  --navy: #15203b;
  --navy-2: #1d2b4d;
  --navy-3: #2a3a63;
  --side-text: #c9d2ea;
  --side-muted: #7d89a8;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f3f4f9;
  --text: #15203b;
  --muted: #7a8399;
  --border: #e6e9f2;
  --accent: #e5785a;
  --accent-600: #d4684a;
  --accent-soft: #fdeee8;
  --green: #22b35e;
  --green-soft: #e6f8ed;
  --red: #ea4b4b;
  --red-soft: #fdecec;
  --amber: #e29a12;
  --amber-soft: #fdf3dc;
  --blue: #4f8df5;
  --blue-soft: #e7f0fe;
  --purple: #8b6cf0;
  --purple-soft: #efeafd;
  --code-bg: #111b33;
  --code-text: #e6ebf5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 32, 59, .04), 0 6px 20px rgba(21, 32, 59, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; color: var(--text); }
h1 { font-size: 28px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .8em; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .12em .4em; border-radius: 6px; color: #c0452b; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }

/* ---------- ilova qobig'i ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--navy); color: var(--side-text); padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 22px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .02em; text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #f19a7d, #e5785a 55%, #c44f7c); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 17px; height: 17px; }
.brand small { font-weight: 500; color: var(--side-muted); font-size: 11px; display: block; letter-spacing: .08em; text-transform: uppercase; }
.nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); padding: 18px 12px 8px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-text); font-weight: 550; font-size: 13.5px; text-decoration: none !important; margin-bottom: 2px; transition: background .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: var(--navy-2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.nav-link.active svg { color: var(--accent); }
.nav-link .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; color: var(--side-muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: var(--surface); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.score-chip { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 600; text-decoration: none !important; color: var(--text); }
.score-chip .ring { width: 30px; height: 30px; font-size: 11px; }
.user-menu { position: relative; }
.avatar-btn { border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text); font: inherit; }
.user-meta { text-align: right; line-height: 1.2; }
.user-meta b { display: block; font-size: 13.5px; }
.user-meta span { font-size: 12px; color: var(--muted); }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: transparent; border-radius: 8px; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; text-decoration: none !important; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.page { padding: 28px 32px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; text-decoration: none !important; }
.back-link:hover { color: var(--text); }
.backdrop { display: none; }

/* ---------- kartalar, tugmalar ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(230, 233, 242, .7); padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3, .card-head h2 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 18px 22px 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid > .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; background: var(--surface-2); color: var(--text); text-decoration: none !important; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #e9ebf3; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-600); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbdada; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--text); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: #46506b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-amber { background: var(--amber-soft); color: #b97a05; }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-purple { background: var(--purple-soft); color: var(--purple); }
.chip-accent { background: var(--accent-soft); color: var(--accent-600); }

.progress { height: 7px; background: #eceef5; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.progress.green > span { background: var(--green); }
.progress.thick { height: 10px; }

.ring { --p: 0; --c: var(--accent); width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #eceef5 0); display: grid; place-items: center; font-weight: 750; font-size: 15px; position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 14%; background: var(--surface); border-radius: 50%; }
.ring > span { position: relative; }
.score-chip .ring::before { background: var(--surface-2); }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; background: var(--accent); }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

.kpi { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.kpi-body { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 14px; }
.kpi-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.kpi-value { font-size: 30px; font-weight: 750; line-height: 1; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.kpi-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .12), inset 0 -3px 6px rgba(0, 0, 0, .12); }
.kpi-icon.blue { background: linear-gradient(135deg, #7db3ff, #4f8df5); }
.kpi-icon.purple { background: linear-gradient(135deg, #b9a2ff, #8b6cf0); }
.kpi-icon.green { background: linear-gradient(135deg, #7fe0a5, #22b35e); }
.kpi-icon.accent { background: linear-gradient(135deg, #f4a98f, #e5785a); }
.kpi-icon.amber { background: linear-gradient(135deg, #f8cd6e, #e29a12); }
.kpi-foot { border-top: 1px solid var(--border); padding: 10px 22px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.kpi-foot a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- jadval ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: #f8f9fc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: 12px; }
.person b { display: block; font-weight: 650; white-space: nowrap; }
.person span { color: var(--muted); font-size: 12.5px; }

/* ---------- formalar ---------- */
label.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: 13px; }
label.field > span { display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea.input, .input {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: inherit; color: var(--text); outline: none; transition: box-shadow .15s, border-color .15s; }
input:focus, select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229, 120, 90, .18); }
select { appearance: none; 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 d='M1 1l5 5 5-5' fill='none' stroke='%237a8399' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.form-error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.form-ok { background: var(--green-soft); color: var(--green); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbox input { padding-left: 38px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* ---------- tablar ---------- */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 2px 12px; border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-600); border-bottom-color: var(--accent); }
.subtabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.subtab { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.subtab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(21, 32, 59, .1); }

/* ---------- ro'yxatlar, callout ---------- */
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row.click { cursor: pointer; }
.list-row.click:hover { background: #f8f9fc; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { display: block; font-weight: 650; }
.list-row .sub { color: var(--muted); font-size: 12.5px; }
.list-foot { padding: 12px 22px 16px; font-size: 13px; color: var(--muted); }
.callout { border-radius: 12px; padding: 12px 16px; margin: 14px 0; background: var(--blue-soft); color: #234a8c; font-size: 13.5px; }
.callout.warn { background: var(--amber-soft); color: #7a5206; }
.callout.tip { background: var(--green-soft); color: #176b3a; }
.callout code { background: rgba(255, 255, 255, .6); color: inherit; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 360px; animation: pop .2s ease; }
.toast.ok { background: #14653a; }
.toast.error { background: #a32727; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-back { position: fixed; inset: 0; background: rgba(21, 32, 59, .45); display: grid; place-items: center; z-index: 150; padding: 20px; }
.modal { background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal h3 { margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- kirish sahifasi ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-hero { background: var(--navy); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(229, 120, 90, .55), transparent 65%); }
.auth-hero h1 { color: #fff; font-size: 38px; max-width: 460px; line-height: 1.15; }
.auth-hero p { color: var(--side-text); max-width: 440px; font-size: 16px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: var(--side-text); }
.auth-points .dot { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; color: var(--accent); }
.auth-card { display: grid; place-items: center; padding: 40px 28px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 26px; margin-bottom: 6px; }

/* ---------- darslar kartalari ---------- */
.module-card { padding: 0; overflow: hidden; }
.module-top { display: flex; gap: 14px; padding: 18px 22px 12px; align-items: flex-start; }
.module-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; }
.lesson-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 22px 16px; }
.lesson-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none !important; border: 1px solid transparent; }
.lesson-chip:hover { border-color: var(--accent); }
.lesson-chip.done { background: var(--green-soft); color: #176b3a; }
.lesson-chip.partial { background: var(--amber-soft); color: #7a5206; }
.module-foot { border-top: 1px solid var(--border); padding: 12px 22px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 26px 28px; display: flex; gap: 26px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; width: 340px; height: 340px; right: -90px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(229, 120, 90, .5), transparent 65%); }
.hero-card h2 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.hero-card p { color: var(--side-text); margin: 0 0 16px; }
.hero-card .ring { --c: var(--accent); width: 92px; height: 92px; font-size: 20px; z-index: 1; }
.hero-card .ring::before { background: var(--navy); }
.hero-card .ring-wrap { display: flex; align-items: center; gap: 16px; z-index: 1; }
.tool-card { display: flex; gap: 14px; align-items: center; padding: 16px 18px; text-decoration: none !important; color: var(--text); transition: transform .15s, box-shadow .15s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(21, 32, 59, .1); }
.tool-card b { display: block; }
.tool-card span { font-size: 12.5px; color: var(--muted); }

/* ---------- dars sahifasi ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.lesson-col { min-width: 0; }
.sticky-col { position: sticky; top: 84px; }
.lesson-body h2 { margin-top: 1.3em; font-size: 19px; }
.lesson-body h3 { margin-top: 1.1em; }
.lesson-body ul, .lesson-body ol { padding-left: 1.3em; margin: 0 0 .9em; }
.lesson-body table { border-collapse: collapse; width: 100%; margin: 10px 0 16px; font-size: 13.5px; }
.lesson-body th { text-align: left; background: var(--surface-2); padding: 8px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lesson-body td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.goal-box { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; color: #8a3a22; font-size: 13.5px; margin-bottom: 16px; }
.codeblock { margin: 12px 0 16px; border-radius: 12px; overflow: hidden; background: var(--code-bg); }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--code-text); white-space: pre; }
.codeblock-actions { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.codeblock-actions button { background: rgba(255, 255, 255, .08); color: #dbe3f7; border: 0; padding: 5px 11px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.codeblock-actions button:hover { background: rgba(255, 255, 255, .16); }
.task { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface); }
.task.solved { border-color: #bfe8cf; background: #f7fdf9; }
.task-head { display: flex; gap: 12px; align-items: flex-start; }
.task-num { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.task.solved .task-num { background: var(--green); color: #fff; }
.task-text { flex: 1; min-width: 0; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.task-msg { margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.task-msg.ok { background: var(--green-soft); color: #176b3a; }
.task-msg.bad { background: var(--red-soft); color: #9d2b2b; }
.task-extra { margin-top: 10px; }

/* ---------- SQL muharrir va natija ---------- */
.sql-editor { position: relative; background: var(--code-bg); border-radius: 12px; overflow: hidden; }
.sql-editor pre, .sql-editor textarea { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; white-space: pre; tab-size: 2; letter-spacing: 0; border: 0; }
.sql-editor pre { position: absolute; inset: 0; overflow: hidden; color: var(--code-text); pointer-events: none; }
.sql-editor textarea { position: relative; display: block; width: 100%; background: transparent; color: transparent; caret-color: #fff; resize: none; outline: none; overflow: auto; }
.sql-editor textarea::selection { background: rgba(229, 120, 90, .35); color: transparent; }
.tk-k { color: #f4a58a; font-weight: 600; } .tk-t { color: #93c5fd; } .tk-f { color: #c7a6ff; }
.tk-s { color: #8fd6a7; } .tk-n { color: #8ab4ff; } .tk-c { color: #6f7c9c; font-style: italic; } .tk-i { color: #ffd479; }
.editor-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.editor-bar .hint { margin-left: auto; font-size: 12px; color: var(--muted); }
.result-box { margin-top: 10px; }
.result-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin: 8px 2px; flex-wrap: wrap; }
.result-table-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: auto; max-height: 420px; background: var(--surface); }
.result-table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--mono); }
.result-table th { position: sticky; top: 0; background: #f1f3f9; text-align: left; padding: 8px 12px; font-weight: 650; color: #46506b; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
.result-table td { padding: 7px 12px; border-bottom: 1px solid #f0f2f8; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.result-table tr:nth-child(even) td { background: #fafbfd; }
.result-table .null { color: #a3abc0; font-style: italic; }
.result-table td.n { text-align: right; color: #2f5fb3; }
.result-ok { padding: 11px 14px; background: var(--green-soft); color: #176b3a; border-radius: 10px; font-size: 13.5px; margin-top: 8px; }
.result-err { padding: 12px 14px; background: var(--red-soft); color: #9d2b2b; border-radius: 10px; font-size: 13.5px; margin-top: 8px; }
.result-err .raw { font-family: var(--mono); font-size: 12px; opacity: .8; margin-top: 6px; word-break: break-word; }
.result-note { padding: 9px 14px; background: var(--blue-soft); color: #234a8c; border-radius: 10px; font-size: 12.5px; margin-top: 8px; }
.schema-table { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.schema-table > header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface-2); font-weight: 650; font-size: 13px; cursor: pointer; }
.schema-table > header .badge-n { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 12px; }
.schema-table ul { list-style: none; margin: 0; padding: 4px 0; }
.schema-table li { display: flex; gap: 8px; align-items: center; padding: 4px 12px; font-size: 12.5px; font-family: var(--mono); }
.schema-table li .ty { margin-left: auto; color: var(--muted); }
.key-pk { color: var(--amber); } .key-fk { color: var(--blue); }

/* ---------- workbench ---------- */
.wb-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.wb-side { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.history-item { padding: 8px 10px; border-radius: 8px; font-family: var(--mono); font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid transparent; }
.history-item:hover { background: var(--surface-2); }
.history-item.bad { color: var(--red); }

/* ---------- terminal ---------- */
.term { background: #0c1429; color: #d7e0f5; border-radius: 14px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 420px; box-shadow: var(--shadow); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #0a1022; color: #7f8cab; font-size: 12.5px; }
.term-bar .dots i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; background: #ff6b5f; }
.term-bar .dots i:nth-child(2) { background: #ffbd2e; } .term-bar .dots i:nth-child(3) { background: #28c940; }
.term-out { flex: 1; overflow: auto; padding: 14px 18px 4px; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line.cmd { color: #fff; }
.term-line .prompt { color: #5fe0a0; font-weight: 600; }
.term-line.err { color: #ff8f8f; } .term-line.note { color: #7fb5ff; } .term-line.dim { color: #7f8cab; }
.term-line.ascii { white-space: pre; overflow-x: auto; }
.term-in { display: flex; gap: 8px; padding: 6px 18px 14px; align-items: flex-start; }
.term-in .prompt { color: #5fe0a0; font-weight: 600; white-space: pre; padding-top: 1px; }
.term-in textarea { flex: 1; background: transparent; border: 0; outline: none; color: #fff; font: inherit; resize: none; padding: 1px 0; overflow: hidden; caret-color: var(--accent); }

/* ---------- Draw SQL ---------- */
.draw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.draw-board-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: #fbfbfe; overflow: auto; height: calc(100vh - 230px); min-height: 480px; background-image: radial-gradient(#d9deec 1px, transparent 1px); background-size: 20px 20px; }
.draw-board { position: relative; width: 2400px; height: 1600px; }
.draw-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.draw-svg path { fill: none; stroke: #8a95b3; stroke-width: 2; }
.draw-svg path.sel { stroke: var(--accent); stroke-width: 2.6; }
.draw-svg circle { fill: var(--accent); }
.draw-svg text { font-size: 11px; fill: #5b6785; font-weight: 700; }
.dt { position: absolute; width: 300px; background: var(--surface); border-radius: 12px; box-shadow: 0 4px 18px rgba(21, 32, 59, .12); border: 1px solid var(--border); font-size: 12.5px; user-select: none; }
.dt.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(229, 120, 90, .3), 0 8px 24px rgba(21, 32, 59, .15); }
.dt-head { background: var(--navy); color: #fff; padding: 8px 10px; border-radius: 11px 11px 0 0; display: flex; gap: 6px; align-items: center; cursor: grab; }
.dt-head input { background: transparent; border: 0; color: #fff; font-weight: 700; font-size: 13px; padding: 2px 4px; width: 100%; box-shadow: none !important; border-radius: 5px; }
.dt-head input:focus { background: rgba(255, 255, 255, .12); }
.dt-head button { background: transparent; border: 0; color: #a9b4d0; cursor: pointer; padding: 2px; border-radius: 6px; display: grid; }
.dt-head button:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.dt-col { display: grid; grid-template-columns: 22px minmax(0, 1fr) 96px 22px; gap: 3px 4px; align-items: center; padding: 6px 8px 6px 4px; border-bottom: 1px solid #f0f2f8; position: relative; }
.dt-flags-row { grid-column: 2 / 5; padding-bottom: 1px; }
.dt-col input[type=text] { padding: 3px 5px; font-size: 12.5px; border-radius: 6px; border-color: transparent; font-family: var(--mono); }
.dt-col input[type=text]:hover { border-color: var(--border); }
.dt-col select { padding: 3px 18px 3px 5px; font-size: 11.5px; border-radius: 6px; border-color: transparent; background-position: right 5px center; }
.dt-col select:hover { border-color: var(--border); }
.dt-flags { display: flex; gap: 2px; }
.flag { border: 0; min-width: 22px; background: var(--surface-2); color: #96a0b8; font-size: 10px; font-weight: 800; border-radius: 5px; padding: 2px 4px; cursor: pointer; line-height: 1.2; }
.flag.on { background: var(--accent); color: #fff; }
.flag.pk.on { background: var(--amber); }
.dt-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #aeb7d0; background: #fff; cursor: crosshair; padding: 0; justify-self: center; }
.dt-dot:hover, .dt-dot.armed { border-color: var(--accent); background: var(--accent); }
.dt-foot { padding: 6px 8px; }
.draw-side .sql-editor textarea { min-height: 260px; color: var(--code-text); caret-color: #fff; }
.draw-hint { position: absolute; left: 14px; bottom: 14px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 12.5px; z-index: 5; }

/* ---------- statistika ---------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 54px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.bar-track { height: 10px; background: #eceef5; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.bar-fill.g5 { background: var(--green); } .bar-fill.g4 { background: var(--blue); } .bar-fill.g3 { background: var(--amber); } .bar-fill.g2 { background: var(--red); }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbar > div { width: 100%; max-width: 30px; background: var(--accent); border-radius: 7px 7px 3px 3px; min-height: 3px; position: relative; }
.vbar > div.alt { background: var(--navy-3); }
.vbar small { font-size: 10.5px; color: var(--muted); }
.vbar b { font-size: 11px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--accent); }
.legend i.alt { background: var(--navy-3); }
.attention-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.attention-item:first-child { border-top: 0; }
.attention-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.accordion > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 22px; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion[open] > summary svg.chev { transform: rotate(90deg); }
.accordion svg.chev { transition: transform .15s; color: var(--muted); }
.task-line { display: flex; gap: 10px; align-items: flex-start; padding: 8px 22px 8px 56px; border-top: 1px solid var(--border); font-size: 13px; }
.task-line .grow { flex: 1; min-width: 0; }
.task-line pre { margin: 6px 0 0; padding: 8px 12px; background: var(--code-bg); color: var(--code-text); border-radius: 8px; font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: pre-wrap; }
.status-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; font-size: 11px; background: #cfd5e6; margin-top: 1px; }
.status-dot.ok { background: var(--green); } .status-dot.part { background: var(--amber); }

/* ---------- test ---------- */
.q-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; background: var(--surface); }
.q-card h3 { font-size: 15.5px; margin-bottom: 12px; }
.q-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.q-opt:hover { border-color: #cfd5e6; background: #fafbfd; }
.q-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.q-opt.right { border-color: var(--green); background: var(--green-soft); }
.q-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.q-explain { margin-top: 10px; font-size: 13px; color: var(--muted); }
.big-score { font-size: 54px; font-weight: 800; line-height: 1; }

/* ---------- hisobot (chop etish) ---------- */
.report { background: #fff; max-width: 900px; margin: 0 auto; padding: 40px 48px; border-radius: 12px; box-shadow: var(--shadow); }
.report h1 { font-size: 24px; }
.report-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; margin: 16px 0 22px; font-size: 14px; }
.report-lesson { margin-top: 26px; page-break-inside: avoid; }
.report-task { margin: 12px 0; padding-left: 14px; border-left: 3px solid var(--border); }
.report-task.solved { border-left-color: var(--green); }
.report-task pre { background: #f4f5fa; padding: 8px 12px; border-radius: 8px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; margin: 6px 0; }
.report table { border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.report table th, .report table td { border: 1px solid #d8dcea; padding: 3px 8px; }

.cheat-item { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.cheat-item:first-child { border-top: 0; }
.cheat-item pre { margin: 0; flex: 1; font-family: var(--mono); font-size: 13px; background: var(--code-bg); color: var(--code-text); padding: 9px 13px; border-radius: 9px; overflow-x: auto; white-space: pre; }
.cheat-item .desc { width: 34%; font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid.cols-4, .grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-layout, .grid.main-side, .draw-layout { grid-template-columns: minmax(0, 1fr); }
  .sticky-col { position: static; }
  .wb-layout { grid-template-columns: minmax(0, 1fr); }
  .wb-side { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(21, 32, 59, .45); z-index: 35; }
  .menu-btn { display: grid; }
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { display: none; }
  .user-meta { display: none; }
  .cheat-item { flex-direction: column; align-items: stretch; }
  .cheat-item .desc { width: auto; }
}
@media (max-width: 560px) {
  .grid.cols-4, .grid.cols-6 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 23px; }
  .report { padding: 22px 18px; }
}
@media print {
  .sidebar, .topbar, .no-print, .backdrop, .toast-wrap { display: none !important; }
  body, .page { background: #fff; padding: 0; }
  .app { display: block; }
  .report { box-shadow: none; padding: 0; max-width: none; }
}
