/* ============ Olimpiada tahlil platformasi — dizayn tizimi ============ */
:root {
  --bg: #f2f5fb;
  --card: #ffffff;
  --ink: #0e1a3d;
  --ink-2: #34425f;
  --muted: #6b7794;
  --line: #e5e9f4;
  --line-2: #eef1f8;
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --brand-soft: #eceafe;
  --good: #10b981;
  --good-soft: #dcfaee;
  --bad: #ef4444;
  --bad-soft: #fde8e8;
  --warn: #f59e0b;
  --gold: #f4b400;
  --silver: #94a3b8;
  --bronze: #cd7f32;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 27, 61, .04), 0 8px 24px -12px rgba(15, 27, 61, .14);
  --shadow-lg: 0 24px 60px -24px rgba(15, 27, 61, .35);
  --side-w: 264px;
  --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ============ Layout ============ */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(79, 70, 229, .55), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(6, 182, 212, .35), transparent 60%),
    #0b1233;
  color: #c9d2f0;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 22px; color: #fff; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, #6d63ff, #06b6d4);
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -6px rgba(6, 182, 212, .7);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand b { display: block; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.15; }
.brand span { font-size: 11.5px; color: #8e9bd0; letter-spacing: .02em; }

.nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6f7cb4; padding: 12px 12px 6px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: 12px; color: #c9d2f0; background: none; border: 0;
  font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.nav a svg, .nav button svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover, .nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active, .nav button.active {
  background: linear-gradient(90deg, rgba(109, 99, 255, .95), rgba(6, 182, 212, .8));
  color: #fff; box-shadow: 0 10px 24px -10px rgba(79, 70, 229, .9);
}
.nav a.active svg, .nav button.active svg { opacity: 1; }
.side-foot { margin-top: auto; padding: 14px 12px 4px; font-size: 12px; color: #7f8cc4; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot a { color: #b8c3f3; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.side-foot a svg { width: 17px; height: 17px; flex: none; }

.main { min-width: 0; padding: 0 28px 48px; }
.topbar {
  position: sticky; top: 0; z-index: 20; margin: 0 -28px 22px; padding: 16px 28px;
  background: rgba(242, 245, 251, .86); backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid transparent;
}
.topbar h1 { font-size: 24px; font-weight: 800; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar .grow { flex: 1; min-width: 160px; }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.select {
  appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236b7794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 34px 9px 14px; font-weight: 600; font-size: 13.5px;
  cursor: pointer; box-shadow: 0 1px 2px rgba(15, 27, 61, .04); max-width: 100%;
}
.select:focus, .input:focus, textarea:focus { outline: 2px solid rgba(79, 70, 229, .35); outline-offset: 1px; border-color: var(--brand); }
.pill-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-right: -4px; }

.demo-banner {
  background: linear-gradient(90deg, #fff7e0, #fff1d0); border: 1px solid #fde4a0; color: #7a5200;
  padding: 10px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 13px; display: flex; gap: 10px; align-items: center;
}

/* ============ Cards ============ */
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-side { grid-template-columns: 330px minmax(0, 1fr); align-items: start; }
.mt { margin-top: 20px; }
.mt-sm { margin-top: 12px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; border: 1px solid rgba(229, 233, 244, .7); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font-size: 16px; font-weight: 800; }
.card-h .hint { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-h { padding: 20px 22px 0; }

.kpi {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 20px 22px; color: #fff; min-height: 128px;
  box-shadow: 0 16px 34px -18px var(--kpi-shadow, rgba(79, 70, 229, .8));
  display: flex; flex-direction: column; justify-content: space-between;
}
.kpi::after { content: ''; position: absolute; right: -34px; top: -34px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.kpi::before { content: ''; position: absolute; right: 36px; bottom: -48px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.kpi .lbl { font-size: 12.5px; font-weight: 700; opacity: .88; letter-spacing: .02em; position: relative; z-index: 1; }
.kpi .val { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; position: relative; z-index: 1; }
.kpi .val small { font-size: 15px; font-weight: 600; opacity: .8; margin-left: 4px; }
.kpi .ft { font-size: 12.5px; opacity: .9; position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; }
.kpi.k1 { background: linear-gradient(135deg, #4f46e5, #8b5cf6); --kpi-shadow: rgba(79, 70, 229, .75); }
.kpi.k2 { background: linear-gradient(135deg, #0891b2, #22d3ee); --kpi-shadow: rgba(8, 145, 178, .75); }
.kpi.k3 { background: linear-gradient(135deg, #ea580c, #fbbf24); --kpi-shadow: rgba(234, 88, 12, .7); }
.kpi.k4 { background: linear-gradient(135deg, #059669, #5eead4); --kpi-shadow: rgba(5, 150, 105, .7); }
.kpi.k5 { background: linear-gradient(135deg, #be185d, #f472b6); --kpi-shadow: rgba(190, 24, 93, .65); }
.kpi.dark { background: linear-gradient(135deg, #0b1233, #26307a); --kpi-shadow: rgba(11, 18, 51, .7); }

/* ============ Chips / tabs / buttons ============ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2); transition: all .15s;
}
.chip:hover { border-color: #c9d0ea; background: #f8f9fe; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, var(--brand)); }
.chip.on .dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.chip.static { cursor: default; }
.chip .x { cursor: pointer; opacity: .6; font-weight: 800; margin-left: 2px; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15, 27, 61, .12); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #c9d0ea; background: #f8f9fe; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: linear-gradient(135deg, #4f46e5, #6d63ff); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .9); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: #f6cfcf; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }

/* ============ Tables ============ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .06em; text-transform: uppercase;
  padding: 11px 14px; background: #f8f9fd; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th .arr { opacity: .5; margin-left: 4px; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafbff; }
.tbl tbody tr.sel td { background: var(--brand-soft); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl-scroll { max-height: 520px; overflow: auto; }
.tbl-scroll.tall { max-height: 640px; }

.rk { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 10px; background: var(--line-2); font-weight: 800; font-size: 13px; padding: 0 6px; }
.rk.r1 { background: linear-gradient(135deg, #ffd95a, #f4a000); color: #5c3b00; }
.rk.r2 { background: linear-gradient(135deg, #e5eaf1, #aab4c5); color: #354054; }
.rk.r3 { background: linear-gradient(135deg, #f1c49a, #cd7f32); color: #4b2a07; }

.delta { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; font-weight: 800; font-size: 12.5px; }
.delta.up { background: var(--good-soft); color: #067a55; }
.delta.down { background: var(--bad-soft); color: #c01f1f; }
.delta.same { background: var(--line-2); color: var(--muted); }
.delta.new { background: #e0f2fe; color: #0369a1; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-2); }
.tag.gold { background: #fff3c4; color: #7a5200; }

.cell-heat { text-align: center; font-weight: 700; border-radius: 8px; padding: 5px 8px; min-width: 52px; display: inline-block; font-variant-numeric: tabular-nums; }
.dotc { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--c); flex: none; }

.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-width: 200px;
}
.search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; padding: 10px 0; background: transparent; width: 100%; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }

/* ============ Podium ============ */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pod { position: relative; border-radius: var(--radius); padding: 20px; background: #fff; box-shadow: var(--shadow); border: 1px solid rgba(229, 233, 244, .7); overflow: hidden; }
.pod::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--pc); }
.pod .medal { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--pc); font-size: 17px; }
.pod h4 { font-size: 16px; margin: 12px 0 2px; }
.pod .score { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.pod .score small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.pod .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; margin-top: 4px; }
.mix { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin-top: 14px; background: var(--line-2); gap: 2px; }
.mix i { display: block; height: 100%; }
.pod.p1 { --pc: linear-gradient(135deg, #ffd24d, #f59e0b); }
.pod.p2 { --pc: linear-gradient(135deg, #cbd5e1, #94a3b8); }
.pod.p3 { --pc: linear-gradient(135deg, #e8a977, #cd7f32); }

/* ============ School hero & ring ============ */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; }
.hero h2 { font-size: 22px; font-weight: 800; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat { background: var(--line-2); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.ring { --p: 50; --c: var(--brand); width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.ring div { position: relative; text-align: center; line-height: 1.1; }
.ring b { font-size: 25px; font-weight: 800; }
.ring small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }

.list-box { max-height: 640px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; border: 1px solid transparent;
}
.li:hover { background: #f6f7fd; }
.li.sel { background: var(--brand-soft); border-color: #cfcaff; }
.li.off { opacity: .55; }
.li .t { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .v { font-weight: 800; font-size: 13.5px; }

/* ============ Charts ============ */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { max-width: 100%; }

/* ============ Olympiad cards ============ */
.olc { position: relative; background: #fff; border-radius: var(--radius); padding: 20px 20px 18px 24px; box-shadow: var(--shadow); border: 1px solid rgba(229, 233, 244, .7); cursor: pointer; transition: transform .18s, box-shadow .18s; overflow: hidden; display: block; color: inherit; }
.olc::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.olc:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(15, 27, 61, .35); }
.olc .top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.olc .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.olc h4 { font-size: 15px; font-weight: 800; }
.olc .dt { font-size: 12.5px; color: var(--muted); }
.olc .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.olc .nums b { display: block; font-size: 18px; font-weight: 800; }
.olc .nums span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.year-h { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; font-size: 18px; font-weight: 800; }
.year-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #c7d2fe, #a5f3fc); display: grid; place-items: center; font-weight: 800; color: #3730a3; flex: none; font-size: 14px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; border: 3px solid #fff; box-shadow: 0 6px 18px -6px rgba(15, 27, 61, .4); }
.winner { display: flex; gap: 14px; align-items: center; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user .avatar { width: 32px; height: 32px; font-size: 12px; }

/* ============ Forms ============ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; transition: border-color .15s;
}
textarea.input { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint-text { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.drop {
  border: 2px dashed #c6cdea; border-radius: 16px; padding: 28px; text-align: center; background: #fafbff; cursor: pointer; transition: all .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop svg { width: 34px; height: 34px; color: var(--brand); }
.drop b { display: block; margin-top: 8px; }

.alert { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }
.alert.err { background: var(--bad-soft); color: #9b1c1c; }
.alert.ok { background: var(--good-soft); color: #065f46; }
.alert.warn { background: #fff4d6; color: #7a5200; }
.alert.info { background: #e0f2fe; color: #075985; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }

.modal-bg { position: fixed; inset: 0; background: rgba(8, 13, 40, .55); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 20px; overflow: auto; }
.modal { background: #fff; border-radius: 22px; padding: 26px; width: min(640px, 100%); box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); overflow: auto; }
.modal h3 { font-size: 19px; margin-bottom: 16px; }

.toast { position: fixed; right: 22px; bottom: 22px; background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 200; font-weight: 600; animation: pop .25s ease; max-width: 380px; }
.toast.err { background: #b91c1c; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; opacity: .5; }
.empty b { display: block; color: var(--ink-2); margin: 8px 0 2px; font-size: 15px; }

.skeleton { border-radius: var(--radius); height: 120px; background: linear-gradient(90deg, #e9edf7 25%, #f5f7fc 37%, #e9edf7 63%); background-size: 400% 100%; animation: sh 1.4s infinite; }
@keyframes sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

.chk-list { max-height: 330px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.chk { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.chk:hover { background: #f6f7fd; }
.chk input { accent-color: var(--brand); width: 16px; height: 16px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }

/* ============ Admin ============ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(90% 60% at 10% 0%, rgba(79, 70, 229, .25), transparent 60%), radial-gradient(70% 50% at 100% 100%, rgba(6, 182, 212, .25), transparent 60%), var(--bg); }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 26px; padding: 34px; box-shadow: var(--shadow-lg); }
.login-card .brand-mark { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 18px; }
.login-card h1 { font-size: 24px; font-weight: 800; }
.login-card p { color: var(--muted); margin: 6px 0 22px; }

.steps { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.step i { width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-style: normal; font-size: 12.5px; }
.step.on { color: var(--ink); }
.step.on i { background: var(--brand); color: #fff; }
.step.done i { background: var(--good); color: #fff; }

.formula { display: flex; gap: 10px; flex-wrap: wrap; }
.formula .f { flex: 1; min-width: 150px; border-radius: 14px; padding: 12px 14px; background: var(--line-2); }
.formula .f b { font-size: 18px; display: block; }
.formula .f span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ============ Responsive ============ */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(8, 13, 40, .5); z-index: 25; }
  .menu-btn { display: grid; }
  .main { padding: 0 16px 40px; }
  .topbar { margin: 0 -16px 18px; padding: 12px 16px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .podium { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 20px; }
  .card { padding: 16px; }
  .kpi .val { font-size: 28px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .side, .topbar .filters, .menu-btn { display: none !important; }
  .app { display: block; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}

/* ---------- Reja-grafik ---------- */
.w100 { width: 100%; }
.row.wrap { flex-wrap: wrap; }
.next-card {
  --c: var(--brand); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; color: #fff;
  border-radius: var(--radius); padding: 26px 30px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #1e1b4b 0%, #3730a3 55%, color-mix(in srgb, var(--c) 70%, #3730a3) 100%);
  box-shadow: 0 22px 50px -24px rgba(30, 27, 75, .7);
}
.next-card::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%); pointer-events: none; }
.next-card .nx-k { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.next-card h2 { font-size: 32px; font-weight: 800; margin: 6px 0 10px; letter-spacing: -.02em; }
.next-card .nx-d { display: flex; align-items: center; gap: 8px; font-weight: 600; opacity: .95; margin-top: 4px; flex-wrap: wrap; }
.next-card svg { width: 17px; height: 17px; flex: none; }
.nx-r { display: grid; gap: 14px; justify-items: end; position: relative; z-index: 1; }
.tps { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.tp { background: var(--line-2); border-radius: 12px; padding: 7px 12px; min-width: 82px; display: grid; gap: 1px; }
.tp span { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tp b { font-size: 17px; font-weight: 800; }
.tp.off { opacity: .45; }
.tps.big { margin: 0; justify-content: flex-end; }
.tps.big .tp { background: rgba(255, 255, 255, .14); backdrop-filter: blur(4px); min-width: 92px; }
.tps.big .tp span { color: rgba(255, 255, 255, .75); }
.when { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.when.now { background: #dcfce7; color: #166534; }
.when.soon { background: #e0e7ff; color: #3730a3; }
.when.past { background: var(--line-2); color: var(--muted); }
.next-card .when { background: rgba(255, 255, 255, .2); color: #fff; }
.sch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sch { --c: var(--brand); display: grid; grid-template-columns: 78px minmax(0, 1fr); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(229, 233, 244, .7); overflow: hidden; }
.sch.today { outline: 2px solid var(--c); }
.sch.past { opacity: .78; }
.sch-date { background: color-mix(in srgb, var(--c) 12%, #fff); border-right: 4px solid var(--c); display: grid; align-content: center; justify-items: center; padding: 14px 6px; text-align: center; }
.sch-date b { font-size: 30px; font-weight: 800; line-height: 1; }
.sch-date span { font-size: 12.5px; font-weight: 800; text-transform: uppercase; color: var(--c); margin-top: 3px; }
.sch-date em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.sch-body { padding: 16px 18px; min-width: 0; }
.sch-body h4 { font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sch-body h4 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.sch-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sch-meta svg { width: 14px; height: 14px; }
.sch-actions { margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.tgbtn { background: #229ed9; border-color: #229ed9; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.tgbtn:hover { background: #1b8bbf; color: #fff; }
.tgbtn svg { width: 16px; height: 16px; }
.tgbtn.light { background: #fff; color: #0f6a96; border-color: #fff; }
.tgbtn.light:hover { background: #e8f6fd; color: #0f6a96; }

/* ---------- Apelyatsiya ---------- */
.g-appeal { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.g-appeal .stack { display: grid; gap: 18px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; }
.ap-done { text-align: center; padding: 18px 8px; display: grid; gap: 8px; justify-items: center; }
.ap-ok { width: 56px; height: 56px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: grid; place-items: center; font-size: 28px; font-weight: 800; }
.ap-no { font-size: 38px; font-weight: 800; letter-spacing: .04em; color: var(--brand); }
.ap-status { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; }
.ap-answer { background: var(--line-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13.5px; }
.st-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.st-badge.st-new { background: #e0e7ff; color: #3730a3; }
.st-badge.st-review { background: #fff4d6; color: #7a5200; }
.st-badge.st-accepted { background: #dcfce7; color: #166534; }
.st-badge.st-rejected { background: #fee2e2; color: #991b1b; }
@media (max-width: 1100px) { .g-appeal { grid-template-columns: minmax(0, 1fr); } .sch-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .next-card { grid-template-columns: minmax(0, 1fr); padding: 20px; } .nx-r { justify-items: start; } .tps.big { justify-content: flex-start; } .next-card h2 { font-size: 26px; } .sch { grid-template-columns: 66px minmax(0, 1fr); } }

/* ---------- admin: reja / apelyatsiya ---------- */
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-style: normal; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.dot-s { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.muted-row td { opacity: .6; }
.ap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 4px 0; }
.ap-text { background: var(--line-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.5; max-height: 200px; overflow: auto; word-break: break-word; }
.tbl td svg { width: 18px; height: 18px; vertical-align: middle; }
.ap-closed { text-align: center; padding: 26px 12px; display: grid; gap: 10px; justify-items: center; }
.ap-lock { width: 56px; height: 56px; border-radius: 50%; background: var(--line-2); color: var(--muted); display: grid; place-items: center; }
.ap-lock svg { width: 26px; height: 26px; }
.ap-next { background: var(--brand-soft); color: var(--brand); border-radius: 12px; padding: 8px 14px; font-size: 14px; }
.alif-toggle { display: block; width: 100%; margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .85); font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; }
.alif-toggle:hover { background: rgba(255, 255, 255, .12); }
.alif-toggle b { color: #fff; }

/* ---- Admin: zaxira ---- */
.bk-card { min-height: 100%; }
.bk-big { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #ecfdf5, #fff); border: 1px solid #a7f3d0; }
.bk-big > div { display: grid; gap: 3px; }
.bk-big b { font-size: 20px; font-weight: 800; }
.bk-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #059669; color: #fff; flex: none; }
.bk-ic svg { width: 26px; height: 26px; }
.bk-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bk-counts > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--line-2, #f1f5f9); font-size: 13.5px; }
.bk-counts b { font-weight: 800; }
.bk-rules { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.55; }
@media (max-width: 1000px) { .grid[style*="repeat(2,minmax(0,1fr))"] { grid-template-columns: minmax(0, 1fr) !important; } }

/* ---- Admin: import ogohlantirishlari va yangilash paneli ---- */
.imp-groups { display: grid; gap: 8px; margin-top: 10px; }
.imp-g { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 12px; }
.tbl tr.row-bad td { background: #fffbeb; }
.refresh-card { border: 1px dashed #c7d2fe; background: linear-gradient(135deg, #f5f7ff, #fff); }
.alert.warn { background: #fff7e0; border: 1px solid #fde68a; color: #7a5200; padding: 10px 14px; border-radius: 12px; }
