/* BSB/CHSB baholash — sayt uslubi. Yorug' va qorong'i mavzu, telefon va kompyuter uchun. */

:root {
  /* Qorong'i shisha mavzu (standart) */
  --bg: #060913;
  --bg-glow-1: rgba(46, 104, 255, .30);
  --bg-glow-2: rgba(255, 112, 41, .26);
  --surface: rgba(19, 27, 48, .62);
  --surface-solid: #10172b;
  --surface-2: rgba(255, 255, 255, .055);
  --border: rgba(140, 165, 255, .14);
  --border-strong: rgba(140, 165, 255, .26);
  --text: #e9edf9;
  --muted: #8e98b8;
  --primary: #4d8dff;
  --primary-2: #8b5cf6;
  --primary-ink: #ffffff;
  --primary-soft: rgba(77, 141, 255, .16);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .14);
  --warn: #ffa24c;
  --warn-soft: rgba(255, 162, 76, .15);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .14);
  --g5: #3ddc97;
  --g4: #4cc3ff;
  --g3: #ffb84c;
  --g2: #ff6b6b;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .05);
  --glow: 0 0 24px rgba(77, 141, 255, .45);
  --blur: blur(18px) saturate(140%);
  --font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef2fb;
  --bg-glow-1: rgba(77, 141, 255, .22);
  --bg-glow-2: rgba(255, 140, 70, .16);
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #ffffff;
  --surface-2: rgba(30, 50, 110, .05);
  --border: rgba(40, 60, 130, .12);
  --border-strong: rgba(40, 60, 130, .22);
  --text: #141b2f;
  --muted: #5d6888;
  --primary: #2f6fed;
  --primary-2: #7c3aed;
  --primary-soft: rgba(47, 111, 237, .12);
  --danger: #dc3b3b;
  --danger-soft: rgba(220, 59, 59, .1);
  --warn: #d9700f;
  --warn-soft: rgba(217, 112, 15, .12);
  --ok: #12945d;
  --ok-soft: rgba(18, 148, 93, .1);
  --g5: #12945d;
  --g4: #0f86c4;
  --g3: #d48a06;
  --g2: #dc3b3b;
  --shadow: 0 12px 34px rgba(30, 45, 90, .10), inset 0 1px 0 rgba(255, 255, 255, .7);
  --glow: 0 0 18px rgba(47, 111, 237, .3);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 700px at 100% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 800px at 105% 75%, var(--bg-glow-2), transparent 60%),
    radial-gradient(600px 500px at -10% 110%, rgba(77, 141, 255, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
small, .muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* --- Karkas ------------------------------------------------------------------------------ */

.shell { display: grid; grid-template-columns: 104px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px 0 16px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.sidebar .brand { padding: 0 0 14px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--primary), var(--primary-2)); color: #fff;
  box-shadow: var(--glow);
}
.brand small { display: block; font-weight: 400; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav a {
  position: relative;
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px;
  color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active {
  background: linear-gradient(140deg, rgba(77, 141, 255, .32), rgba(77, 141, 255, .12));
  color: #9cc2ff; box-shadow: inset 0 0 0 1px rgba(120, 170, 255, .35), var(--glow);
}
:root[data-theme="light"] .nav a.active { color: var(--primary); }
.nav svg { width: 22px; height: 22px; flex: none; }
.nav a .tip {
  position: absolute; left: 60px; top: 50%; transform: translateY(-50%);
  padding: 5px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  background: var(--surface-solid); border: 1px solid var(--border); color: var(--text);
  font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .12s; z-index: 20;
}
.nav a:hover .tip, .nav a:focus-visible .tip { opacity: 1; }
.sidebar .spacer { flex: 1; }
.side-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.side-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.side-btn:hover { color: var(--text); text-decoration: none; }
.side-btn svg { width: 22px; height: 22px; }
.side-btn .avatar { width: 38px; height: 38px; }
.side-btn .nm { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(77, 141, 255, .45), rgba(139, 92, 246, .45)); color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.user-chip .who { min-width: 0; }
.user-chip .who b, .user-chip .who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; padding: 28px 32px 48px 24px; max-width: 1240px; width: 100%; }
.topbar { display: none; }
.bottom-nav { display: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Kartalar va to'r ---------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.stack > .seg, .stack > .row > .seg { align-self: flex-start; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section { margin-top: 24px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .hint { font-size: 12px; color: var(--muted); }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px; border-top: 1px solid var(--border);
  color: var(--text);
}
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; border-radius: 12px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }

.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.class-card { display: block; color: var(--text); transition: border-color .15s; }
.class-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow), var(--glow); text-decoration: none; }
.class-card .meta { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* --- Tugmalar va maydonlar ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px;
  font: inherit; font-weight: 600; font-size: 14px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s, filter .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), #6a6dff); border-color: transparent; color: var(--primary-ink); box-shadow: 0 6px 20px rgba(77, 141, 255, .35); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 6px 26px rgba(77, 141, 255, .5); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.big { height: 48px; padding: 0 22px; font-size: 16px; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { width: 38px; padding: 0; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="number"], input:not([type]), select, textarea {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 8px 11px; min-height: 38px; width: 100%;
}
textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
input.invalid, select.invalid { border-color: var(--danger); background: var(--danger-soft); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-weight: 600; font-size: 14px; border: 0; background: transparent; color: var(--muted); padding: 0 16px; height: 36px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--primary-soft); color: var(--primary); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); color: var(--text); }
.dropzone b { color: var(--text); }
.dropzone input { display: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* --- Yorliqlar, nishonlar ------------------------------------------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.bsb { background: var(--primary-soft); color: var(--primary); }
.badge.chsb { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.grade { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 700; color: #fff; }
.grade.g5 { background: var(--g5); } .grade.g4 { background: var(--g4); } .grade.g3 { background: var(--g3); } .grade.g2 { background: var(--g2); }
.grade { color: #07101f; }
:root[data-theme="light"] .grade { color: #fff; }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; }
.notice.err { background: var(--danger-soft); border-color: transparent; color: var(--text); }
.notice.ok { background: var(--ok-soft); border-color: transparent; }

/* --- Jadvallar ------------------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }
tr.dim td { color: var(--muted); }
tr.err td { background: var(--danger-soft); }
tr.dirty td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.row-msg { font-size: 12px; color: var(--danger); margin-top: 3px; }

.grid-input td { padding: 5px 6px; }
.grid-input input { min-height: 34px; padding: 5px 8px; }
.grid-input .letters { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; min-width: 150px; }
.grid-input .score { width: 64px; text-align: center; }
.grid-input .name { min-width: 170px; }
.grid-input select { min-height: 34px; padding: 4px 6px; width: auto; }

/* --- Diagrammalar --------------------------------------------------------------------------- */

.bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #7aa9ff); box-shadow: 0 0 10px rgba(77, 141, 255, .5); }
.bar.low > span { background: var(--danger); }
.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-cell .bar { flex: 1; }
.bar-cell .num { width: 52px; text-align: right; font-weight: 600; }

.dist { display: flex; height: 28px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.dist span { display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; min-width: 0; }
.dist span { color: #07101f; }
:root[data-theme="light"] .dist span { color: #fff; }
.dist .g5 { background: var(--g5); } .dist .g4 { background: var(--g4); } .dist .g3 { background: var(--g3); } .dist .g2 { background: var(--g2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.letters-dist { display: flex; gap: 4px; font-family: var(--mono); font-size: 12px; }
.letters-dist span { padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); }
.letters-dist span.key { background: var(--ok-soft); color: var(--ok); font-weight: 700; }

/* --- Kirish sahifasi ------------------------------------------------------------------------ */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 440px; text-align: center; padding: 36px 30px; }
.login-card .brand-mark { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 18px; }
.login-card .brand-mark svg { width: 28px; height: 28px; }
.login-card h1 { margin-bottom: 8px; }
.login-card .btn.big { width: 100%; margin-top: 22px; }
.login-steps { text-align: left; margin: 18px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.login-steps li + li { margin-top: 4px; }
.login-foot { margin-top: 18px; font-size: 13px; color: var(--muted); }
.features { display: grid; gap: 10px; margin-top: 22px; text-align: left; }
.features div { display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.features b { color: var(--text); font-weight: 600; }
.features svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--primary); }

/* --- Bildirishnoma, oyna, yuklanish -------------------------------------------------------- */

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 11px 14px; border-radius: 12px; background: var(--surface-solid); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 14px; animation: rise .18s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

dialog { border: 1px solid var(--border); border-radius: 18px; padding: 0; background: var(--surface-solid); color: var(--text); width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(3, 6, 15, .6); backdrop-filter: blur(4px); }
#modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
#modal-body .actions { justify-content: flex-end; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 60vh; display: grid; place-items: center; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* --- Telefon -------------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 10;
    padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  }
  .topbar .brand { padding: 0; flex: 1; }
  .main { padding: 18px 16px 110px; }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10;
    background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
    box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    padding: 6px 4px;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 8px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .grid-2, .grid-2-1 { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
  .tile .value { font-size: 22px; }
  #toasts { bottom: 96px; }
  .dash { grid-template-columns: 1fr; }
  .dash .span-2 { grid-column: auto; }
}

/* --- Bosh sahifa: dashboard kartochkalari --------------------------------------------------- */

.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash .span-2 { grid-column: span 2; }
.dash .card + .card { margin-top: 0; }
.card.glow { position: relative; overflow: hidden; }
.card-title { font-size: 15px; font-weight: 650; color: var(--text); }
.card-sub { font-size: 12px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hello { display: flex; flex-direction: column; min-height: 210px; }
.hello .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hello .greet { color: var(--muted); font-size: 15px; }
.hello h1 { font-size: 30px; margin-top: 4px; }
.hello p { color: var(--muted); margin-top: 10px; max-width: 320px; }
.spark { margin-top: auto; padding-top: 12px; width: 100%; height: auto; display: block; }
.spark path.line { fill: none; stroke: url(#sparkStroke); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(77, 141, 255, .8)); }
.spark path.area { fill: url(#sparkFill); }
.spark circle { fill: #9cc2ff; filter: drop-shadow(0 0 5px rgba(120, 170, 255, .9)); }

.today .date { font-size: 18px; font-weight: 650; }
.today .wd { color: var(--muted); margin-top: 2px; }
.today .big { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.today .big b { font-size: 42px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.today .big svg { width: 54px; height: 54px; color: var(--warn); filter: drop-shadow(0 0 10px rgba(255, 162, 76, .5)); }
.today .foot { display: flex; gap: 16px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.today .foot b { color: var(--text); }

.ring-card { display: flex; align-items: center; gap: 18px; }
.ring-card .info { flex: 1; min-width: 0; }
.ring-card .pct { font-size: 46px; font-weight: 700; line-height: 1.05; margin-top: 14px; font-variant-numeric: tabular-nums; }
.ring-card .pct small { font-size: 22px; color: var(--text); font-weight: 600; }
.ring-card .note { color: var(--muted); margin-top: 2px; }
.ring-card .pair { display: flex; gap: 28px; margin-top: 18px; }
.ring-card .pair div { font-size: 12px; color: var(--muted); }
.ring-card .pair b { display: block; font-size: 20px; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ring { flex: none; display: block; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-2); }
.ring .val { fill: none; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring .val.blue { stroke: url(#ringBlue); filter: drop-shadow(0 0 8px rgba(110, 120, 255, .55)); }
.ring .val.orange { stroke: url(#ringOrange); filter: drop-shadow(0 0 8px rgba(255, 140, 60, .55)); }
.ring .val.green { stroke: url(#ringGreen); filter: drop-shadow(0 0 8px rgba(61, 220, 151, .5)); }
.ring-center { position: relative; display: grid; place-items: center; }
.ring-center > .lbl { position: absolute; text-align: center; }
.ring-center > .lbl b { display: block; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-center > .lbl span { font-size: 12px; color: var(--muted); }

.tasks { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.task { display: flex; align-items: center; gap: 12px; padding: 9px 4px; color: var(--text); border-radius: 10px; }
a.task:hover { background: var(--surface-2); text-decoration: none; }
.task .box { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; display: grid; place-items: center; }
.task.done .box { background: var(--primary); border-color: var(--primary); box-shadow: var(--glow); color: #fff; }
.task.done .box svg { width: 13px; height: 13px; }
.task .t { flex: 1; min-width: 0; }
.task .st { font-size: 12px; color: var(--muted); white-space: nowrap; }
.task.now .st { color: var(--warn); font-weight: 600; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; margin-top: 14px; padding-top: 30px; }
.week .col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; position: relative; }
.week .railw { position: relative; flex: 1; width: 12px; display: flex; }
.week .rail { width: 12px; flex: 1; border-radius: 999px; background: var(--surface-2); position: relative; overflow: hidden; }
.week .rail i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 999px; background: linear-gradient(180deg, #7aa9ff, var(--primary)); box-shadow: 0 0 12px rgba(77, 141, 255, .7); }
.week .d { font-size: 12px; color: var(--muted); }
.week .col.today .d { color: var(--text); font-weight: 700; }
.week .tipv { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--surface-solid); border: 1px solid var(--border-strong); }

.shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; margin-top: 16px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.shortcut:hover { color: var(--text); text-decoration: none; }
.shortcut span.ic {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: box-shadow .15s, border-color .15s;
}
.shortcut:hover span.ic { border-color: var(--border-strong); box-shadow: var(--glow); }
.shortcut svg { width: 22px; height: 22px; }

.events { display: flex; flex-direction: column; margin-top: 8px; }
.event { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-top: 1px solid var(--border); color: var(--text); border-radius: 10px; }
.event:first-child { border-top: 0; }
a.event:hover { background: var(--surface-2); text-decoration: none; }
.event .day { width: 46px; text-align: center; flex: none; }
.event .day b { display: block; font-size: 20px; line-height: 1.1; }
.event .day small { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.event .t { flex: 1; min-width: 0; }
.event .t b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event .t small { font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--primary); box-shadow: 0 0 10px currentColor; color: var(--primary); }
.dot.orange { background: var(--warn); color: var(--warn); }
.dot.green { background: var(--ok); color: var(--ok); }
.dot.red { background: var(--danger); color: var(--danger); }
.dot.grey { background: var(--muted); color: transparent; box-shadow: none; }

.meters { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.meter { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.meter b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* --- Admin ------------------------------------------------------------------------------------ */

.marks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.mark-tile { display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.mark-tile.on { border-color: var(--border-strong); box-shadow: var(--shadow), var(--glow); }
.mark-tile b { font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.mark-tile span { display: block; font-size: 13px; color: var(--muted); }
.mark-tile .dot { width: 12px; height: 12px; }
.t-row { display: grid; grid-template-columns: 14px minmax(0, 1.6fr) minmax(0, 1.2fr) 110px 90px; gap: 14px; align-items: center; }
.t-row .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-row .nm small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-head { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 4px 8px; }
.trouble { padding: 12px 0; border-top: 1px solid var(--border); }
.trouble:first-child { border-top: 0; }
.trouble .when { font-size: 12px; color: var(--muted); }
.trouble .msg { margin-top: 3px; }
.trouble code { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); font-family: var(--mono); font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .marks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-row { grid-template-columns: 12px minmax(0, 1fr) 64px; }
  .t-row .ph, .t-row .seen { display: none; }
  .t-head { display: none; }
  .ring-card .pct { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.theme-btn span { display: block; }
.meter .bar-cell .num { display: none; }
.meter { grid-template-columns: 96px 1fr; }
.marks > .card + .card { margin-top: 0; }
a.mark-tile:hover { text-decoration: none; border-color: var(--border-strong); }
.mark-tile b { display: block; color: var(--text); }
/* Telefon: oxirida turishi shart — yuqoridagi 1100px qoidasini bosib o'tadi */
@media (max-width: 860px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash .span-2 { grid-column: auto; }
}
@media (max-width: 520px) {
  .ring-card { gap: 12px; }
  .ring-card .ring-center, .ring-card .ring { width: 108px !important; height: 108px !important; }
  .ring-card .pair { gap: 16px; }
  .marks { gap: 10px; }
}
