/* NUMIA boshqaruv tizimi — uslublar */
:root {
  --bg: #F6F5F1; --surface: #FFFFFF; --surface-2: #F0EFEA; --surface-3: #E8E6E0;
  --ink: #0B0B0C; --ink-2: #45454B; --muted: #85858B; --line: #E4E2DB;
  --side: #0B0B0C; --side-ink: #F2F1EC; --side-muted: #8E8D88; --side-hover: #1C1C1F;
  --accent: #2F54EB; --accent-soft: #E8EDFF; --accent-ink: #fff;
  --ok: #15803D; --ok-soft: #E3F4E8; --warn: #B45309; --warn-soft: #FDF0DC;
  --bad: #C62828; --bad-soft: #FCE6E4; --doing: #2F54EB; --doing-soft: #E8EDFF;
  --s-income: #2F54EB; --s-expense: #E8833A;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(10,10,12,.05), 0 6px 24px rgba(10,10,12,.06);
  --shadow-lg: 0 24px 64px rgba(10,10,12,.22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E10; --surface: #17171A; --surface-2: #1F1F23; --surface-3: #2A2A2F;
    --ink: #F2F1EC; --ink-2: #C3C2BC; --muted: #85847F; --line: #2A2A2F;
    --side: #08080A; --side-hover: #19191C;
    --accent: #5B7BFF; --accent-soft: #1D2547; --doing: #5B7BFF; --doing-soft: #1D2547;
    --ok: #4ADE80; --ok-soft: #12301D; --warn: #F5B14C; --warn-soft: #33260F;
    --bad: #F87171; --bad-soft: #3A1717;
    --s-income: #5B7BFF; --s-expense: #D9732A;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E10; --surface: #17171A; --surface-2: #1F1F23; --surface-3: #2A2A2F;
  --ink: #F2F1EC; --ink-2: #C3C2BC; --muted: #85847F; --line: #2A2A2F;
  --side: #08080A; --side-hover: #19191C;
  --accent: #5B7BFF; --accent-soft: #1D2547; --doing: #5B7BFF; --doing-soft: #1D2547;
  --ok: #4ADE80; --ok-soft: #12301D; --warn: #F5B14C; --warn-soft: #33260F;
  --bad: #F87171; --bad-soft: #3A1717;
  --s-income: #5B7BFF; --s-expense: #D9732A;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.ic { width: 15px; height: 15px; flex: none; vertical-align: -2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kirish ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--side); color: var(--side-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .big-logo { position: absolute; right: -80px; bottom: -60px; width: 520px; opacity: .08; }
.auth-art h1 { font-size: 44px; line-height: 1.05; max-width: 460px; }
.auth-art p { color: var(--side-muted); max-width: 420px; font-size: 15px; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-card form { margin-top: 24px; display: grid; gap: 14px; }

/* ---------- Asosiy tuzilma ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 18px; letter-spacing: .08em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand small { display: block; font-size: 10px; letter-spacing: .12em; color: var(--side-muted); font-weight: 600; }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); padding: 0 12px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #CFCEC9; font-weight: 600; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.active { background: #fff; color: #0B0B0C; }
.nav a .ic { width: 18px; height: 18px; flex: none; }
.nav a .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 7px; font-weight: 700; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #222226; }
.me-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px; border-radius: 10px; cursor: pointer; text-align: left; color: var(--side-ink); }
.me-btn:hover { background: var(--side-hover); }
.me-btn .who { min-width: 0; }
.me-btn .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btn .who span { font-size: 11.5px; color: var(--side-muted); }

.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 28px 32px 48px; max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Tugmalar va maydonlar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 11.5px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14px;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2385858B' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }
.pw-eye .ic { width: 18px; height: 18px; }
.input.sm { height: 32px; font-size: 13px; border-radius: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span-2 { grid-column: span 2; }
.form { display: grid; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle input { display: none; }
.chip-toggle span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: 13px; background: var(--surface); }
.chip-toggle input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 13px; border-radius: 8px; font-weight: 650; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Kartochkalar ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head .muted { font-size: 12.5px; }
.stack { display: grid; gap: 18px; }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.stack > *, .cols > *, .cols-even > *, .page > * { min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stats-5 .stat .value { font-size: 24px; overflow-wrap: anywhere; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stat.dark .label, .stat.dark .sub { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.brief { background: var(--side); color: var(--side-ink); border-radius: var(--radius); padding: 20px 22px; display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 18px; align-items: center; }
.brief h2 { font-size: 20px; }
.brief p { margin: 4px 0 0; color: var(--side-muted); font-size: 13px; }
.brief .b-item { border-left: 1px solid #2A2A2E; padding-left: 16px; }
.brief .b-item b { font-size: 26px; font-weight: 800; display: block; }
.brief .b-item span { font-size: 12.5px; color: var(--side-muted); }

/* ---------- Ro'yxatlar ---------- */
.list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.click { cursor: pointer; border-radius: 10px; }
.row.click:hover { background: var(--surface-2); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.av { --c: #666; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; letter-spacing: 0; border: 2px solid var(--surface); }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.xs { width: 22px; height: 22px; font-size: 9px; border-width: 1.5px; }
.av.none { background: var(--surface-3); color: var(--muted); }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -8px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.doing { background: var(--doing-soft); color: var(--doing); }
.badge.dark { background: var(--ink); color: var(--bg); }
.badge .ic { width: 12px; height: 12px; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.progress.ok > i { background: var(--ok); }
.progress.accent > i { background: var(--accent); }

/* ---------- Jadval ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t .r { text-align: right; }
table.t tfoot td { font-weight: 800; border-top: 1px solid var(--ink); border-bottom: 0; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.board.wide { grid-auto-columns: 250px; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 160px; scroll-snap-align: start; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.col.drop { outline-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 750; }
.col-head .n { margin-left: auto; color: var(--muted); font-weight: 700; font-size: 12px; }
.col-body { display: grid; gap: 8px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.03); transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: var(--shadow); }
.kcard.dragging { opacity: .4; }
.kcard .proj { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.kcard .kt { font-weight: 700; line-height: 1.3; }
.kcard .kf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.kcard .kf .sp { flex: 1; }
.kcard .kact { display: flex; gap: 6px; margin-top: 10px; }
.kcard.late { border-left: 3px solid var(--bad); }
.kcard.today { border-left: 3px solid var(--warn); }

/* ---------- Pipeline jadvali ---------- */
.pipe { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.pipe th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 6px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
.pipe th:first-child, .pipe td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 200px; max-width: 260px; }
.pipe td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.pipe tr { cursor: pointer; }
.pipe tr:hover td { background: var(--surface-2); }
.cell { display: inline-grid; justify-items: center; gap: 3px; min-width: 64px; padding: 6px 4px; border-radius: 9px; }
.cell .d { font-size: 11px; font-weight: 700; }
.cell.done { background: var(--ok-soft); color: var(--ok); }
.cell.doing { background: var(--doing-soft); color: var(--doing); }
.cell.late { background: var(--bad-soft); color: var(--bad); }
.cell.today { background: var(--warn-soft); color: var(--warn); }
.cell.todo { background: var(--surface-2); color: var(--muted); }
.cell.off { opacity: .35; }

.steps { display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--surface-2); color: var(--muted); }
.step.done .n { background: var(--ok); color: #fff; }
.step.doing .n { background: var(--doing); color: #fff; }
.step.late .n { background: var(--bad); color: #fff; }
.step .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }

.stage-edit { display: grid; gap: 6px; }
.dt { display: flex; gap: 6px; }
.dt input[type=date] { flex: 1.4; min-width: 0; }
.dt input[type=time] { flex: 1; min-width: 0; }
.stage-edit .se { display: grid; grid-template-columns: 22px 120px 1fr 250px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.stage-edit .se.off { opacity: .45; }
.stage-edit .se b { font-size: 13px; }

/* ---------- Diagrammalar ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s; z-index: 5; }
.tip.on { opacity: 1; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.spark { width: 90px; height: 28px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Loyiha kartalari ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; display: grid; gap: 14px; transition: box-shadow .15s, transform .15s; position: relative; overflow: hidden; }
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.pcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pc, var(--ink)); }
.pcard .ph { display: flex; gap: 12px; align-items: center; }
.plogo { width: 42px; height: 42px; border-radius: 12px; background: var(--pc, var(--ink)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.next-box { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.next-box b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 2px; }
.add-card { border: 1.5px dashed var(--line); background: transparent; display: grid; place-items: center; min-height: 200px; color: var(--muted); font-weight: 700; }
.add-card::before { display: none; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

.idea-pot { display: inline-flex; gap: 2px; }
.idea-pot i { width: 7px; height: 14px; border-radius: 2px; background: var(--surface-3); }
.idea-pot i.on { background: var(--accent); }
.hook { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.hook p { margin: 0; flex: 1; font-weight: 600; }

.feed .row { align-items: flex-start; }
.feed .row .grow { font-size: 13px; }

.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment .bubble { background: var(--surface-2); border-radius: 4px 12px 12px 12px; padding: 8px 12px; flex: 1; }
.comment .bubble b { font-size: 12.5px; }
.comment .bubble p { margin: 2px 0 0; white-space: pre-wrap; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 150px; }

.callout { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; font-size: 13px; }
.callout ol { margin: 6px 0 0; padding-left: 18px; }
.callout code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- Modal va xabarlar ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8,8,10,.48); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s ease; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 650; box-shadow: var(--shadow-lg); animation: pop .2s ease; max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); color: #fff; }

.menu { position: fixed; z-index: 55; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 600; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }

.bottom-nav { display: none; }

/* ---------- Moslashuvchanlik ---------- */
@media (max-width: 1180px) {
  .stats, .stats-5 { grid-template-columns: repeat(2, 1fr); }
  .stats-5 > :last-child { grid-column: span 2; }
  .cols, .cols-even { grid-template-columns: 1fr; }
  .brief { grid-template-columns: repeat(3, 1fr); }
  .brief > div:first-child { grid-column: 1 / -1; }
  .brief .b-item:nth-child(2) { border-left: 0; padding-left: 0; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .22s ease; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .side-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; color: var(--ink); font-size: 16px; }
  .topbar .sp { flex: 1; }
  .page { padding: 18px 16px 96px; }
  h1 { font-size: 22px; }
  .page-head { margin-bottom: 16px; }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
  .bottom-nav a.active { color: var(--ink); }
  .bottom-nav .ic { width: 22px; height: 22px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px; min-height: 220px; }
  .auth-art h1 { font-size: 30px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .stage-edit .se { grid-template-columns: 22px 1fr; }
  .stage-edit .se > select, .stage-edit .se > .dt { grid-column: 2; }
  .modal-back { padding: 0; align-items: end; }
  .modal, .modal.wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .filters .input { flex: 1; min-width: 130px; }
  .board { grid-auto-columns: 82%; margin: 0 -16px; padding: 0 16px 12px; }
  .board.wide { grid-auto-columns: 78%; }
  .stat .value { font-size: 23px; }
  .stat { padding: 14px; }
  .brief { grid-template-columns: 1fr 1fr 1fr; padding: 16px; gap: 12px; }
  .brief .b-item { padding-left: 10px; }
  .brief .b-item b { font-size: 21px; }
  .hbar { grid-template-columns: 90px 1fr auto; }
  .hide-m { display: none !important; }
  .row { flex-wrap: wrap; }
  .row .grow { flex: 1 1 150px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .table-wrap { margin: 0 -18px; }
}
@media (max-width: 420px) {
  .stats { gap: 10px; }
  .page-head .head-actions { width: 100%; }
}

/* ---------- Chop etish / PDF (mijoz hisoboti) ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .side, .topbar, .bottom-nav, .no-print, .head-actions, .filters, .btn, #toast-root { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .card, .stat { break-inside: avoid; box-shadow: none; }
  .stat.dark { background: #0B0B0C !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .progress, .badge, .cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .cols, .cols-even { grid-template-columns: 1fr 1fr; }
  a { color: inherit; }
}
