/* NUVIZAN Status — dizayn tizimi. Barcha ranglar tokenlardan olinadi. */
:root {
  --brand: #0B1B4A;
  --brand-2: #13286A;
  --accent: #2F5BEA;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --surface-3: #EEF0F6;
  --text: #0E1430;
  --text-2: #3A4361;
  --muted: #6B7390;
  --border: #E2E5EE;
  --border-strong: #CDD2E0;
  --ok: #12965A; --ok-soft: color-mix(in srgb, var(--ok) 12%, transparent);
  --warn: #C67D05; --warn-soft: color-mix(in srgb, var(--warn) 14%, transparent);
  --danger: #D23B3B; --danger-soft: color-mix(in srgb, var(--danger) 11%, transparent);
  --info: #2F5BEA; --info-soft: color-mix(in srgb, var(--info) 11%, transparent);
  --violet: #7C4DDB; --violet-soft: color-mix(in srgb, var(--violet) 12%, transparent);
  --side-bg: #0B1B4A;
  --side-text: #C9D1EA;
  --side-muted: #8390B8;
  --side-active: rgb(255 255 255 / .1);
  --shadow-sm: 0 1px 2px rgb(14 20 48 / .06);
  --shadow: 0 1px 2px rgb(14 20 48 / .05), 0 6px 20px rgb(14 20 48 / .07);
  --shadow-lg: 0 20px 60px rgb(14 20 48 / .22);
  --r: 10px; --r-sm: 7px; --r-lg: 14px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --fs-xs: .74rem; --fs-sm: .84rem; --fs-md: .92rem;
  --font: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --side-w: 236px;
  --top-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090E1C; --surface: #10172B; --surface-2: #131B32; --surface-3: #1A2340;
    --text: #E7EAF4; --text-2: #C2C8DB; --muted: #8C94B0; --border: #222B47; --border-strong: #2F3A5C;
    --accent: #5B82FF; --side-bg: #070C1A; --side-active: rgb(255 255 255 / .07);
    --ok: #34C784; --warn: #EAA93A; --danger: #F2676B; --info: #5B82FF; --violet: #A07CF0;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090E1C; --surface: #10172B; --surface-2: #131B32; --surface-3: #1A2340;
  --text: #E7EAF4; --text-2: #C2C8DB; --muted: #8C94B0; --border: #222B47; --border-strong: #2F3A5C;
  --accent: #5B82FF; --side-bg: #070C1A; --side-active: rgb(255 255 255 / .07);
  --ok: #34C784; --warn: #EAA93A; --danger: #F2676B; --info: #5B82FF; --violet: #A07CF0;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.012em; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0 0 .8em; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-3); padding: .1em .38em; border-radius: 5px; }
pre { font-family: var(--mono); font-size: .82rem; background: var(--surface-3); padding: 12px 14px; border-radius: var(--r-sm); overflow-x: auto; margin: 0 0 .8em; white-space: pre; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-4) 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-text); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto; z-index: 30; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; letter-spacing: -.01em; }
.side .brand img { width: 22px; height: 28px; }
.side .brand small { display: block; font-weight: 500; color: var(--side-muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .nav-h { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 16px 10px 6px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--side-text); font-size: .9rem; text-decoration: none; }
.side a.nav:hover { background: rgb(255 255 255 / .05); color: #fff; }
.side a.nav.active { background: var(--side-active); color: #fff; font-weight: 600; }
.side a.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side a.nav .count { margin-left: auto; font-size: .72rem; background: rgb(255 255 255 / .1); padding: 1px 7px; border-radius: 99px; }
.side a.nav .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; margin: 0 4px; }
.side .side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / .08); }
.side .proj-list a.nav { font-size: .86rem; padding: 5px 10px; }
.side .proj-list a.nav span.k { color: var(--side-muted); font-size: .72rem; margin-left: auto; font-family: var(--mono); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-6); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.top .menu-btn { display: none; }
.content { padding: var(--s-6); max-width: 1440px; width: 100%; }
.content.wide { max-width: none; }

/* ---------- Search ---------- */
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; padding-left: 34px; background: var(--surface-2); }
.search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto; padding: 6px; }
.search-results .grp { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 7px; color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--surface-3); }
kbd { font: 500 .7rem var(--mono); color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface); }

/* ---------- Page header ---------- */
.page-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.page-h h1 { margin: 0; }
.page-h .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.page-h .actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.crumbs { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 550 .875rem var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
:root[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: var(--accent); border-color: var(--accent); } }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 28px; padding: 0 10px; font-size: .8rem; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 7px 10px; min-height: 34px; width: 100%; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type="color"] { padding: 2px; width: 46px; height: 34px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7390'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; padding-right: 30px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); }
label.f .hint, .hint { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.form { display: grid; gap: var(--s-4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: var(--fs-sm); cursor: pointer; }
.check input { margin-top: 3px; }
.seg { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 9px; gap: 2px; }
.seg button, .seg a { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font: 550 .82rem var(--font); color: var(--muted); cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on, .seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.radio-cards label { border: 1px solid var(--border-strong); border-radius: var(--r); padding: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }
.radio-cards b { display: block; margin-bottom: 2px; }
.filters { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-4); }
.filters input, .filters select { width: auto; min-width: 140px; height: 32px; min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: var(--fs-sm); }
.filters input[type="search"] { min-width: 220px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-b { padding: var(--s-5); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { margin: 0; font-size: .95rem; }
.card-h .more { font-size: var(--fs-sm); }
.stack { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
.cols > *, .cols-2 > *, .stack > * { min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-5); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
a.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.kpi .l { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .v { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: var(--fs-xs); color: var(--muted); }
.kpi.bad .v { color: var(--danger); }
.kpi.warn .v { color: var(--warn); }
.kpi.good .v { color: var(--ok); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--surface-3); color: var(--text-2); line-height: 1.5; }
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); margin: 0 4px 4px 0; }
.key { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.pri { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); }
.pri svg { width: 14px; height: 14px; }
.pri.critical { color: var(--danger); } .pri.high { color: var(--warn); } .pri.medium { color: var(--info); }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .68rem; font-weight: 700; color: #fff; flex: none; letter-spacing: 0; }
.avatar.lg { width: 36px; height: 36px; font-size: .85rem; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: var(--s-2); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-4 { margin-top: var(--s-4); } .mb-4 { margin-bottom: var(--s-4); }
.danger-text { color: var(--danger); } .ok-text { color: var(--ok); } .warn-text { color: var(--warn); }

/* ---------- Progress ---------- */
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.progress.ok > i { background: var(--ok); } .progress.warn > i { background: var(--warn); } .progress.danger > i { background: var(--danger); }
.ring { --p: 0; --c: var(--accent); width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-v); width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: .7rem; font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
table.t th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
table.t th.sort { cursor: pointer; user-select: none; }
table.t th.sort:hover { color: var(--text); }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tr.click { cursor: pointer; }
table.t select.inline { width: auto; min-height: 28px; height: 28px; padding: 2px 26px 2px 8px; font-size: .8rem; border-color: transparent; background-color: transparent; }
table.t select.inline:hover { border-color: var(--border-strong); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list > .li { display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-5); border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; min-width: 0; }
.list > .li:last-child { border-bottom: 0; }
a.li:hover, .li.click:hover { background: var(--surface-2); text-decoration: none; cursor: pointer; }
.li .grow { flex: 1; min-width: 0; }
.li .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: var(--s-8) var(--s-5); font-size: var(--fs-sm); }
.empty svg { width: 34px; height: 34px; opacity: .45; margin-bottom: 6px; }
.empty b { display: block; color: var(--text-2); font-size: .95rem; margin-bottom: 4px; }

/* ---------- Project cards ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }
.proj-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; position: relative; overflow: hidden; transition: border-color .12s, box-shadow .15s, transform .15s; }
.proj-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc, var(--accent)); }
.proj-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.proj-card .ph { display: flex; gap: 10px; align-items: flex-start; }
.proj-card .ph .nm { font-weight: 650; font-size: 1rem; line-height: 1.3; }
.proj-card .desc { color: var(--muted); font-size: var(--fs-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; min-height: 2.6em; }
.proj-card .meta { display: flex; gap: 14px; font-size: var(--fs-xs); color: var(--muted); flex-wrap: wrap; }
.proj-card .meta > span:not(.avatar) { display: inline-flex; gap: 4px; align-items: center; }
.proj-card .meta svg { width: 13px; height: 13px; }
.picon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font: 700 .72rem var(--mono); flex: none; letter-spacing: -.02em; }
.picon.lg { width: 46px; height: 46px; border-radius: 12px; font-size: .85rem; }

/* ---------- Project header ---------- */
.proj-head { display: flex; gap: var(--s-4); align-items: flex-start; margin-bottom: var(--s-4); flex-wrap: wrap; }
.proj-head .info { flex: 1; min-width: 260px; }
.proj-head h1 { margin: 0 0 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.proj-head .facts { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.proj-head .facts > span, .proj-head .facts > a > span { display: inline-flex; align-items: center; gap: 5px; }
.proj-head .facts svg { width: 14px; height: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--s-5); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 13px; font-size: .88rem; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs a .n { font-size: .7rem; background: var(--surface-3); padding: 0 6px; border-radius: 99px; color: var(--muted); }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(250px, 1fr)); gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-3); align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100vh - 250px); min-height: 200px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 11px 12px 8px; font-size: .84rem; font-weight: 650; }
.col-h .n { color: var(--muted); font-weight: 500; }
.col-h .btn { margin-left: auto; }
.col-b { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; flex: 1; min-height: 60px; border-radius: 0 0 var(--r-lg) var(--r-lg); transition: background .12s; }
.col-b.over { background: var(--accent-soft); }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; cursor: pointer; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 7px; transition: border-color .12s, box-shadow .12s; }
.tcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.tcard.dragging { opacity: .45; }
.tcard .tt { font-size: .875rem; font-weight: 520; line-height: 1.38; word-break: break-word; }
.tcard .tm { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); flex-wrap: wrap; }
.tcard .tm svg { width: 13px; height: 13px; }
.tcard .tm .sp { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tcard .due.over { color: var(--danger); font-weight: 600; }
.drop-ph { height: 3px; background: var(--accent); border-radius: 2px; margin: -2px 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; border: 2px solid currentColor; }
.st-backlog { color: #8C94B0; } .st-todo { color: #6B7390; } .st-in_progress { color: var(--info); } .st-review { color: var(--violet); } .st-done { color: var(--ok); }
.st-done.status-dot, .st-in_progress.status-dot { background: currentColor; }
.st-review.status-dot { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.quick-add { padding: 0 8px 8px; }
.quick-add input { font-size: .85rem; min-height: 32px; }

/* ---------- Drawer / Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgb(8 12 28 / .45); z-index: 100; display: flex; animation: fade .15s; }
.overlay.center { align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .18s var(--ease, ease); border: 1px solid var(--border); }
.modal.lg { max-width: 760px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-h h2 { margin: 0; font-size: 1.02rem; }
.modal-b { padding: 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: var(--s-2); padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.drawer { margin-left: auto; width: min(760px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s var(--ease, ease); }
.drawer-h { display: flex; align-items: center; gap: var(--s-2); padding: 12px 18px; border-bottom: 1px solid var(--border); }
.drawer-b { flex: 1; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 230px; }
.drawer-main { padding: 20px 22px; min-width: 0; }
.drawer-side { border-left: 1px solid var(--border); padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 14px; }
.drawer-side label.f select, .drawer-side label.f input { min-height: 32px; font-size: .85rem; }
.title-input { font-size: 1.25rem; font-weight: 650; border: 1px solid transparent; padding: 4px 8px; margin: -4px -8px 10px; width: calc(100% + 16px); background: transparent; letter-spacing: -.01em; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { background: var(--surface); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }

/* ---------- Markdown ---------- */
.md { font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; }
.md p:last-child, .md ul:last-child { margin-bottom: 0; }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 .8em; }
.md h1, .md h2, .md h3 { font-size: 1rem; margin-top: .8em; }
.md blockquote { margin: 0 0 .8em; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.md-edit { position: relative; }
.md-empty { color: var(--muted); font-style: italic; cursor: text; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }
.editable { cursor: text; border-radius: var(--r-sm); padding: 6px 8px; margin: -6px -8px; }
.editable:hover { background: var(--surface-2); }

/* ---------- Checklist / comments ---------- */
.checklist { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.checklist .ci { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 6px; }
.checklist .ci:hover { background: var(--surface-2); }
.checklist .ci.done span { text-decoration: line-through; color: var(--muted); }
.checklist .ci span { flex: 1; font-size: .88rem; }
.checklist .ci .btn { opacity: 0; }
.checklist .ci:hover .btn { opacity: 1; }
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment .cb { flex: 1; min-width: 0; }
.comment .ch { font-size: var(--fs-sm); display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.section-t { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }

/* ---------- Feed / activity ---------- */
.feed { display: flex; flex-direction: column; }
.feed .fi { display: flex; gap: 11px; padding: 10px var(--s-5); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.feed .fi:last-child { border-bottom: 0; }
.feed .fi .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.feed .fi .ic svg { width: 14px; height: 14px; }
.feed .fi .ic.mcp { background: var(--violet-soft); color: var(--violet); }
.feed .fi .ic.sys { background: var(--warn-soft); color: var(--warn); }
.feed .fi .fb { flex: 1; min-width: 0; }
.feed .fi .when { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }

/* ---------- Updates ---------- */
.update { padding: 16px var(--s-5); border-bottom: 1px solid var(--border); }
.update:last-child { border-bottom: 0; }
.update .uh { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.update .uh b { font-size: .98rem; }

/* ---------- Timeline (Gantt) ---------- */
.gantt { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.gantt-inner { min-width: 900px; position: relative; }
.g-head { display: grid; grid-template-columns: 260px 1fr; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface-2); z-index: 2; }
.g-head .g-months { position: relative; height: 34px; }
.g-head .g-months span { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); padding: 8px 8px; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; }
.g-row { display: grid; grid-template-columns: 260px 1fr; border-bottom: 1px solid var(--border); min-height: 40px; }
.g-row:last-child { border-bottom: 0; }
.g-row.sub .g-label { padding-left: 34px; font-size: var(--fs-sm); color: var(--text-2); }
.g-label { padding: 9px 14px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--border); min-width: 0; font-size: .88rem; }
.g-label > span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { position: relative; }
.g-grid { position: absolute; inset: 0; pointer-events: none; }
.g-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .7; z-index: 1; pointer-events: none; }
.g-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 20px; border-radius: 6px; background: var(--bc, var(--accent)); color: #fff; font-size: .7rem; font-weight: 600; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; min-width: 6px; cursor: pointer; }
.g-bar .gp { position: absolute; left: 0; top: 0; bottom: 0; background: rgb(255 255 255 / .22); pointer-events: none; }
.g-bar span { position: relative; }
.g-bar.thin { height: 10px; border-radius: 4px; opacity: .8; }
.g-ms { position: absolute; top: 50%; width: 12px; height: 12px; background: var(--bc, var(--brand)); transform: translate(-50%, -50%) rotate(45deg); border-radius: 2px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--bc, var(--brand)); z-index: 1; cursor: default; }
.g-ms.done { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--border); gap: 1px; }
.cal .dh { background: var(--surface-2); padding: 8px; font-size: var(--fs-xs); font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal .day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.other { background: var(--surface-2); }
.cal .day.other .dn { opacity: .45; }
.cal .day .dn { font-size: .78rem; font-weight: 600; color: var(--text-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .dn { background: var(--accent); color: #fff; }
.cal .ev { font-size: .72rem; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--ec) 13%, var(--surface)); border-left: 3px solid var(--ec); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; text-decoration: none; display: block; }
.cal .ev:hover { text-decoration: none; background: color-mix(in srgb, var(--ec) 22%, var(--surface)); }
.cal .ev.done { opacity: .55; text-decoration: line-through; }
.cal .ev.ms { font-weight: 650; }

/* ---------- Monitors ---------- */
.mon { display: flex; align-items: center; gap: 12px; padding: 12px var(--s-5); border-bottom: 1px solid var(--border); }
.mon:last-child { border-bottom: 0; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; position: relative; }
.pulse.up { background: var(--ok); }
.pulse.down { background: var(--danger); }
.pulse.down::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--danger); animation: ping 1.4s infinite; }
@keyframes ping { to { transform: scale(1.8); opacity: 0; } }
.bars { display: flex; gap: 2px; align-items: flex-end; height: 26px; }
.bars i { flex: 1; min-width: 3px; max-width: 8px; border-radius: 2px; background: var(--ok); height: 100%; }
.bars i.down { background: var(--danger); }
.bars i.part { background: var(--warn); }
.bars i.none { background: var(--surface-3); }
.spark { width: 100%; height: 40px; display: block; }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 170px; display: block; }
.chart text { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.legend { display: flex; gap: 14px; font-size: var(--fs-xs); color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 9px; font-size: var(--fs-sm); box-shadow: var(--shadow-lg); max-width: 380px; animation: pop .2s; display: flex; gap: 8px; align-items: center; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok::before { content: '✓'; font-weight: 700; color: var(--ok); }

/* ---------- Secret box ---------- */
.secret { display: flex; gap: 8px; align-items: stretch; }
.secret code { flex: 1; display: block; padding: 9px 12px; font-size: .84rem; word-break: break-all; background: var(--surface-3); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }
.callout { padding: 12px 14px; border-radius: var(--r); background: var(--info-soft); color: var(--text); font-size: var(--fs-sm); display: flex; gap: 10px; }
.callout.warn { background: var(--warn-soft); }
.callout.danger { background: var(--danger-soft); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: radial-gradient(1200px 600px at 10% 110%, #23408F 0%, transparent 60%), radial-gradient(900px 500px at 100% 0%, #172F78 0%, transparent 55%), var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .logo { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 1.1rem; }
.auth-art .logo img { width: 26px; height: 33px; }
.auth-art h2 { font-size: 2rem; line-height: 1.15; max-width: 440px; letter-spacing: -.025em; font-weight: 700; }
.auth-art p { color: #B8C3E6; max-width: 420px; }
.auth-art .feat { display: grid; gap: 12px; margin-top: 24px; font-size: .9rem; color: #D5DCF2; }
.auth-art .feat div { display: flex; gap: 10px; align-items: center; }
.auth-art .feat svg { width: 18px; height: 18px; color: #8FA8FF; }
.auth-art .sail { position: absolute; right: -60px; bottom: -40px; width: 380px; opacity: .06; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); margin-bottom: 24px; font-size: var(--fs-sm); }
.auth-form .btn.primary { width: 100%; height: 40px; }
.err-box { color: var(--danger); background: var(--danger-soft); padding: 9px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.pw-meter i { display: block; height: 100%; transition: width .2s, background .2s; }

/* ---------- Public status ---------- */
.pub { max-width: 920px; margin: 0 auto; padding: 32px 20px 60px; }
.pub-h { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.pub-h img { width: 24px; height: 30px; }
.pub-banner { padding: 18px 20px; border-radius: var(--r-lg); font-weight: 650; display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.pub-banner.ok { background: var(--ok-soft); color: var(--ok); }
.pub-banner.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- Misc ---------- */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; z-index: 50; }
.menu a, .menu button { display: flex; width: 100%; gap: 9px; align-items: center; padding: 7px 10px; border-radius: 6px; border: 0; background: none; font: inherit; font-size: var(--fs-sm); color: var(--text); cursor: pointer; text-align: left; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--surface-3); text-decoration: none; }
.menu svg { width: 15px; height: 15px; color: var(--muted); }
.menu hr { margin: 5px 0; }
.menu .mh { padding: 8px 10px; font-size: var(--fs-xs); color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.code-tabs .seg { margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.side-backdrop { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .drawer-b { grid-template-columns: 1fr; }
  .drawer-side { border-left: 0; border-top: 1px solid var(--border); order: -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .side { transform: none; }
  .app.nav-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 25; }
  .top { padding: 0 16px; }
  .top .menu-btn { display: inline-flex; }
  .top .spacer { display: none; }
  .top #new-project { display: none; }
  .search { min-width: 0; }
  .search kbd { display: none; }
  .content { padding: 16px; }
  .cols-2, .grid-2, .grid-3, .radio-cards { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .board { grid-template-columns: repeat(5, 82vw); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .drawer-side { grid-template-columns: 1fr; }
  .g-head, .g-row { grid-template-columns: 160px 1fr; }
  .cal .day { min-height: 76px; }
  .cal .ev { font-size: .64rem; padding: 1px 4px; }
}
