/* PMS — portfolio & project management.
   Layout: fixed sidebar (projects + account) on the right, working surface on the left;
   project header with progress ring, tab strip, then list / board / gantt surfaces. */
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-display: swap; src: url(fonts/vazirmatn-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-weight: 600; font-display: swap; src: url(fonts/vazirmatn-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-weight: 700; font-display: swap; src: url(fonts/vazirmatn-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-display: swap; src: url(fonts/vazirmatn-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2190-21FF; }
@font-face { font-family: "Vazirmatn"; font-weight: 600; font-display: swap; src: url(fonts/vazirmatn-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2190-21FF; }
@font-face { font-family: "Vazirmatn"; font-weight: 700; font-display: swap; src: url(fonts/vazirmatn-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2190-21FF; }

:root {
  --bg: #F4F5F2; --surface: #FFFFFF; --raised: #FBFCFA; --sunk: #ECEFE8; --line: #DEE3D8; --line-strong: #C8D0C0;
  --ink: #18211B; --ink-2: #3B463E; --muted: #6A766C;
  --accent: #3F7A3A; --accent-ink: #2F5F2B; --accent-soft: #E3EEDC; --on-accent: #FFFFFF;
  --side: #15241B; --side-2: #1E3326; --side-ink: #DCE7DD; --side-muted: #8FA693; --side-on: #2A4634;
  --hi: #C2410C; --hi-soft: #FCE9DD; --mid: #A16207; --mid-soft: #FBF1D9; --lo: #4B6F96; --lo-soft: #E2EBF5;
  --ok: #2F7D4F; --ok-soft: #DDF0E3; --info: #2F6597; --info-soft: #DFEAF5; --bad: #B4372A; --bad-soft: #F8E0DB; --warn: #A16207; --warn-soft: #FBF1D9;
  --shadow: 0 1px 2px rgb(20 36 27 / .06), 0 4px 14px rgb(20 36 27 / .05);
  --f: "Vazirmatn", Tahoma, "Segoe UI", sans-serif; --r: 12px; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0F1411; --surface: #161D18; --raised: #1A221C; --sunk: #1F2922; --line: #2A352D; --line-strong: #39463C;
  --ink: #E4EBE5; --ink-2: #C3CEC5; --muted: #8E9B90; --accent: #7DB86A; --accent-ink: #9BCB8A; --accent-soft: #223421; --on-accent: #0F1411;
  --side: #0B100D; --side-2: #142019; --side-ink: #D3DED5; --side-muted: #7E9483; --side-on: #1E3326;
  --hi: #F08A4B; --hi-soft: #3A2316; --mid: #E0B04D; --mid-soft: #362B13; --lo: #86AEDB; --lo-soft: #1B2938;
  --ok: #6CC793; --ok-soft: #173023; --info: #86B3DD; --info-soft: #1A2938; --bad: #EE8572; --bad-soft: #3A1D18; --warn: #E0B04D; --warn-soft: #362B13;
  --shadow: none; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0F1411; --surface: #161D18; --raised: #1A221C; --sunk: #1F2922; --line: #2A352D; --line-strong: #39463C;
  --ink: #E4EBE5; --ink-2: #C3CEC5; --muted: #8E9B90; --accent: #7DB86A; --accent-ink: #9BCB8A; --accent-soft: #223421; --on-accent: #0F1411;
  --side: #0B100D; --side-2: #142019; --side-ink: #D3DED5; --side-muted: #7E9483; --side-on: #1E3326;
  --hi: #F08A4B; --hi-soft: #3A2316; --mid: #E0B04D; --mid-soft: #362B13; --lo: #86AEDB; --lo-soft: #1B2938;
  --ok: #6CC793; --ok-soft: #173023; --info: #86B3DD; --info-soft: #1A2938; --bad: #EE8572; --bad-soft: #3A1D18; --warn: #E0B04D; --warn-soft: #362B13;
  --shadow: none; color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 14px; line-height: 1.6; direction: rtl; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); }
.num, td.n, input[type=number] { font-variant-numeric: tabular-nums; }
h1 { font-size: 22px; margin: 0; line-height: 1.35; text-wrap: balance; }
h2 { font-size: 15.5px; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- app frame */
.app { display: grid; grid-template-columns: 252px minmax(0, 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; gap: 6px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; text-decoration: none; color: inherit; }
.brand .mk { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--on-accent); font-weight: 700; font-size: 14px; letter-spacing: .5px; }
.brand b { display: block; font-size: 15px; }
.brand small { color: var(--side-muted); font-size: 11.5px; }
.side .lbl { color: var(--side-muted); font-size: 11.5px; padding: 10px 8px 4px; letter-spacing: .3px; }
.nav a, .nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border-radius: 8px; color: var(--side-ink); cursor: pointer; font-size: 13.5px; }
.nav a:hover, .nav button:hover { background: var(--side-2); }
.nav a.on { background: var(--side-on); color: #fff; }
.nav a:focus-visible, .nav button:focus-visible { outline: 2px solid var(--accent); }
.nav .pj { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; }
.nav .pj span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .pj small { color: var(--side-muted); font-size: 11.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--side-muted); }
.dot.on_track, .dot.done { background: #5DBB7E; } .dot.at_risk { background: #E0B04D; } .dot.critical { background: #EE6F5B; }
.side .foot { margin-top: auto; border-top: 1px solid var(--side-2); padding-top: 10px; display: grid; gap: 2px; }
.side .who { padding: 4px 9px 8px; font-size: 12.5px; color: var(--side-muted); }
.side .who b { display: block; color: var(--side-ink); font-weight: 600; }
.mtop { display: none; }
.main { min-width: 0; padding: 22px 28px 60px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 270px; z-index: 40; transform: translateX(110%); transition: transform .2s; }
  .app.open .side { transform: none; box-shadow: -10px 0 30px rgb(0 0 0 / .3); }
  .mtop { display: flex; align-items: center; gap: 10px; background: var(--side); color: var(--side-ink); padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .mtop button { all: unset; cursor: pointer; font-size: 20px; padding: 0 6px; }
  .main { padding: 16px 16px 50px; }
}

/* ---------- headers */
.crumb { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent-ink); }
.phead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
@media (max-width: 1100px) { .phead { grid-template-columns: 1fr; } }
.ptitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--sunk); color: var(--muted); direction: ltr; }
.pdesc { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 75ch; }
.pstats { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; display: grid; align-content: center; box-shadow: var(--shadow); min-width: 0; }
.stat .k { color: var(--muted); font-size: 11.5px; }
.stat .v { font-weight: 700; font-size: 15px; }
.stat.ring { grid-template-columns: auto auto; gap: 10px; align-items: center; }
.ring svg { display: block; }
.rt { font-weight: 700; fill: var(--ink); font-family: var(--f); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

nav.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 18px 0 0; scrollbar-width: none; }
nav.tabs a { text-decoration: none; padding: 9px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13.5px; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 5px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-size: 11px; text-align: center; line-height: 18px; }

/* ---------- common blocks */
.sec { margin-top: 18px; }
.sechead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.grow { flex: 1; }
.hint { color: var(--muted); font-size: 12.5px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 24px; font-weight: 700; line-height: 1.35; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.bad .v { color: var(--bad); } .kpi.warn .v { color: var(--warn); } .kpi.good .v { color: var(--ok); }

.btn { font: inherit; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); color: var(--on-accent); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 3px 6px; }
.btn.ghost:hover { color: var(--accent-ink); background: var(--sunk); }
.btn.ghost.del:hover { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg a { padding: 5px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--accent-soft); color: var(--accent-ink); }
.f { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 9px; }
textarea.f { width: 100%; min-height: 70px; }
label.fl { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
label.fl .f { width: 100%; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.note { background: var(--warn-soft); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }

/* ---------- chips */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 22px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-todo, .st-planning, .st-archived, .h-none { background: var(--sunk); color: var(--muted); }
.st-doing, .st-active { background: var(--info-soft); color: var(--info); }
.st-blocked, .st-on_hold, .h-critical { background: var(--bad-soft); color: var(--bad); }
.st-done, .h-on_track, .h-done { background: var(--ok-soft); color: var(--ok); }
.h-at_risk { background: var(--warn-soft); color: var(--warn); }
.pr { display: inline-block; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; line-height: 20px; white-space: nowrap; }
.pr-high { background: var(--hi-soft); color: var(--hi); } .pr-normal { background: var(--mid-soft); color: var(--mid); } .pr-low { background: var(--lo-soft); color: var(--lo); }
.late { color: var(--bad); font-weight: 600; }
.av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.owner { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.left { display: inline-block; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 20px; background: var(--sunk); color: var(--muted); }
.left.soon { background: var(--warn-soft); color: var(--warn); } .left.over { background: var(--bad-soft); color: var(--bad); } .left.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- bars */
.bar { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar i.d { background: var(--accent); } .bar i.p { background: var(--info); opacity: .75; } .bar i.b { background: var(--bad); }
.streams { display: grid; gap: 9px; }
.srow { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.srow .c { color: var(--muted); font-size: 12px; text-align: left; }
.legend { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 600; min-width: 0; }
.li .m { color: var(--muted); font-size: 12px; grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mile { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 6px 0; }
.mile .dm { width: 11px; height: 11px; transform: rotate(45deg); border: 2px solid var(--line-strong); background: var(--surface); margin-top: 6px; justify-self: center; }
.mile.done .dm { background: var(--accent); border-color: var(--accent); }
.mile.late .dm { border-color: var(--bad); }
.mile .d { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.wl { display: grid; grid-template-columns: minmax(0, 150px) 1fr 40px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.wl .bar { height: 10px; }
.wl .bar i.h { background: var(--hi); } .wl .bar i.o { background: var(--accent); opacity: .55; }

.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.hero h2 { font-size: 18px; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- tables */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
th { text-align: start; font-weight: 600; color: var(--muted); font-size: 11.5px; background: var(--raised); padding: 9px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--raised); }
td input, td select { font: inherit; font-size: 13px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; width: 100%; min-width: 0; }
td input:hover, td select:hover { border-color: var(--line-strong); }
td input:focus, td select:focus { border-color: var(--accent); background: var(--surface); outline: none; }
td input:disabled, td select:disabled { color: var(--ink); opacity: 1; cursor: default; }
td input[type=number] { text-align: left; direction: ltr; }
td input[type=checkbox] { width: auto; accent-color: var(--accent); }
td.n { text-align: left; direction: ltr; white-space: nowrap; }
td.idx { color: var(--muted); font-size: 12px; white-space: nowrap; width: 46px; font-variant-numeric: tabular-nums; }
tr.grp td { background: var(--accent-soft); font-weight: 700; padding: 7px 10px; color: var(--accent-ink); }
tr.grp .gp { font-weight: 500; color: var(--muted); font-size: 12px; margin-inline-start: 10px; }
tr.parent td { background: var(--raised); }
tr.parent input.title { font-weight: 700; }
tr.child .tcell { padding-inline-start: 22px; position: relative; }
tr.child .tcell::before { content: ""; position: absolute; inset-inline-start: 10px; top: 0; bottom: 50%; width: 9px; border-inline-start: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-end-start-radius: 4px; }
tr.isdone input.title { text-decoration: line-through; color: var(--muted); }
.tcell { display: flex; align-items: center; gap: 4px; min-width: 260px; }
.caret { all: unset; cursor: pointer; width: 18px; text-align: center; color: var(--muted); font-size: 11px; }
.jd { direction: ltr; text-align: right; }
.sub { display: block; font-size: 10.5px; color: var(--muted); padding-inline: 6px; line-height: 1.1; direction: ltr; text-align: right; }
.pg { position: relative; min-width: 84px; }
.pg .bar { position: absolute; inset-inline: 6px; bottom: 2px; height: 3px; }
.pg input { padding-bottom: 6px; }
.ro { padding: 4px 6px; display: block; }
.cal { display: inline-flex; gap: 2px; }
.cal a { text-decoration: none; font-size: 11.5px; padding: 1px 6px; border-radius: 6px; color: var(--muted); border: 1px solid var(--line); }
.cal a:hover { color: var(--accent-ink); border-color: var(--accent); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; direction: ltr; }

/* ---------- board */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.col { background: var(--sunk); border-radius: var(--r); padding: 10px; min-height: 200px; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.col h3 { margin: 2px 4px 10px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.col h3 small { color: var(--muted); font-weight: 500; }
.kc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); display: grid; gap: 6px; }
.kc:active { cursor: grabbing; }
.kc.drag { opacity: .4; }
.kc .pt { font-size: 11.5px; color: var(--muted); }
.kc .tt { font-weight: 600; font-size: 13.5px; }
.kc .mt { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.kc .bar { height: 5px; }

/* ---------- gantt */
.gwrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); max-height: 75vh; }
.gantt { display: grid; position: relative; min-width: max-content; }
.g-name, .g-head, .g-cell { border-bottom: 1px solid var(--line); }
.g-name { position: sticky; right: 0; z-index: 2; background: var(--surface); padding: 6px 10px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-inline-end: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.g-name.child { padding-inline-start: 26px; color: var(--ink-2); }
.g-name.par { font-weight: 700; }
.g-name.sec, .g-track.sec { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.g-hd { position: sticky; top: 0; z-index: 3; background: var(--raised); }
.g-hd.corner { right: 0; z-index: 4; display: flex; align-items: end; padding: 6px 10px; font-size: 12px; color: var(--muted); border-inline-end: 1px solid var(--line); }
.g-months, .g-days { display: flex; }
.g-months div { font-size: 11.5px; font-weight: 700; padding: 4px 6px; border-inline-start: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.g-days div { font-size: 10.5px; text-align: center; color: var(--muted); padding: 3px 0; border-inline-start: 1px solid var(--line); }
.g-days div.fri { background: var(--sunk); }
.g-days div.today { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.g-track { position: relative; border-bottom: 1px solid var(--line); }
.g-track .fri { position: absolute; top: 0; bottom: 0; background: var(--sunk); opacity: .7; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; pointer-events: none; }
.g-bar { position: absolute; top: 7px; height: 20px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; font-size: 11px; font-weight: 600; z-index: 1; min-width: 6px; }
.g-bar .fill { position: absolute; inset-block: 0; right: 0; opacity: .9; }
.g-bar span { position: relative; padding: 0 6px; white-space: nowrap; color: var(--ink); }
.g-bar.high { background: var(--hi-soft); border: 1.5px solid var(--hi); } .g-bar.high .fill { background: var(--hi); }
.g-bar.normal { background: var(--mid-soft); border: 1.5px solid var(--mid); } .g-bar.normal .fill { background: var(--mid); }
.g-bar.low { background: var(--lo-soft); border: 1.5px solid var(--lo); } .g-bar.low .fill { background: var(--lo); }
.g-bar.done { background: var(--ok-soft); border-color: var(--ok); } .g-bar.done .fill { background: var(--ok); }
.g-bar.lateb { box-shadow: 0 0 0 2px var(--bad); }
.g-bar.sum { height: 10px; top: 12px; border-radius: 2px; background: var(--ink-2); border: 0; }
.g-bar.sum .fill { background: var(--accent); }
.g-ms { position: absolute; top: 10px; width: 13px; height: 13px; transform: rotate(45deg); background: var(--ink); z-index: 2; }
.g-ms.done { background: var(--ok); }

/* ---------- cards / login / modal / misc */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-decoration: none; color: inherit; display: grid; gap: 10px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card .top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.card h3 { margin: 4px 0 0; font-size: 16px; }
.card .stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.login form { background: var(--surface); border-radius: 16px; padding: 30px; width: min(380px, 100%); display: grid; gap: 14px; box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
.login .brand { color: var(--ink); padding: 0 0 6px; }
.login .brand small { color: var(--muted); }
.err { color: var(--bad); font-size: 13px; min-height: 1em; }
.modal-back { position: fixed; inset: 0; background: rgb(10 16 12 / .45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); width: min(640px, 100%); max-height: 90vh; overflow: auto; padding: 22px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; background: var(--ink); color: var(--bg); padding: 9px 18px; border-radius: 10px; font-size: 13px; z-index: 70; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }
.segs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.sg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: flex; justify-content: space-between; gap: 8px; }
.sg b { font-size: 13px; font-weight: 600; }
.sg span { font-weight: 700; color: var(--accent-ink); }
.calc { display: grid; gap: 6px; font-size: 13.5px; }
.calc div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.calc div:last-child { border-bottom: 0; font-weight: 700; font-size: 15px; }
.act { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.act:last-child { border-bottom: 0; }
.act .who { font-weight: 600; }
.act .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.act .ch { color: var(--muted); font-size: 12px; grid-column: 2 / -1; }
.tag { display: inline-block; padding: 0 8px; border-radius: 6px; font-size: 11.5px; background: var(--sunk); color: var(--muted); line-height: 20px; }
.tag.c { background: var(--ok-soft); color: var(--ok); } .tag.u { background: var(--info-soft); color: var(--info); } .tag.d { background: var(--bad-soft); color: var(--bad); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
