:root { color-scheme:light; --bg:#fff; --soft:#f4f6fa; --card:#fff; --ink:#1d2330; --muted:#5f6878; --line:#e2e6ee; --brand:#2f5bea; --ok:#1c8a4b; --warn:#c77d00; --bad:#c62f3b; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif; }
header { position:fixed; top:0; left:0; bottom:0; width:220px; display:flex; flex-direction:column; align-items:stretch; gap:12px; padding:18px 14px; background:var(--card); border-right:1px solid var(--line); box-shadow:1px 0 6px rgba(20,30,50,.04); overflow-y:auto; z-index:10; }
header[hidden] { display:none; }
header .brand { font-size:16px; line-height:1.3; padding:0 8px 8px; color:var(--brand); }
header nav { display:flex; flex-direction:column; gap:2px; } header nav a[hidden] { display:none; }
header a { color:var(--ink); text-decoration:none; padding:8px 10px; border-radius:7px; }
header a:hover { background:var(--soft); } header a.active { background:var(--brand); color:#fff; } .spacer { flex:1; }
#whoami { font-size:13px; color:var(--muted); padding:0 8px; }
main { max-width:1100px; margin:0 auto; padding:20px 16px 60px; }
header:not([hidden]) ~ main { margin-left:220px; max-width:none; padding:24px 28px 60px; }
@media (max-width:760px) {
  header { position:static; width:auto; flex-direction:row; flex-wrap:wrap; align-items:center; border-right:0; border-bottom:1px solid var(--line); }
  header nav { flex-direction:row; flex-wrap:wrap; } header:not([hidden]) ~ main { margin-left:0; padding:16px; }
}
h1 { font-size:22px; margin:0 0 16px; } h2 { font-size:17px; margin:0 0 10px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:16px; box-shadow:0 1px 3px rgba(20,30,50,.05); }
.grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
.stat { text-align:center; } .stat b { display:block; font-size:26px; } .muted { color:var(--muted); font-size:13px; }
table { width:100%; border-collapse:collapse; } th,td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
th { background:var(--soft); color:var(--muted); font-weight:600; font-size:13px; }
.table-wrap { overflow-x:auto; }
button, .btn { font:inherit; cursor:pointer; border:1px solid var(--brand); background:var(--brand); color:#fff; padding:6px 12px; border-radius:7px; text-decoration:none; display:inline-block; }
button.ghost { background:#fff; color:var(--brand); } button.ghost:hover { background:var(--soft); } button.danger { background:var(--bad); border-color:var(--bad); }
button:disabled { opacity:.5; cursor:not-allowed; }
input, select, textarea { font:inherit; color:#1d2330; background:#fff; border:1px solid var(--line); border-radius:7px; padding:6px 9px; width:100%; }
label { display:block; margin-bottom:10px; font-size:13px; color:var(--muted); } label > * { margin-top:3px; color:var(--ink); }
.row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.badge { display:inline-block; padding:1px 9px; border-radius:20px; font-size:12px; border:1px solid var(--line); background:var(--soft); }
.badge.Done,.badge.sent,.badge.resolved { color:var(--ok); } .badge.Cancelled,.badge.high,.badge.failed { color:var(--bad); }
.badge.Testing,.badge.Ready\ for\ QC,.badge.medium,.badge.queued { color:var(--warn); }
.bar { height:6px; background:var(--line); border-radius:4px; overflow:hidden; min-width:70px; } .bar i { display:block; height:100%; background:var(--brand); }
.over { color:var(--bad); font-weight:600; }
#toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; padding:9px 16px; border-radius:8px; opacity:0; transition:opacity .2s; pointer-events:none; max-width:90vw; }
#toast.show { opacity:1; } #toast.err { background:var(--bad); color:#fff; }
dialog { border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--ink); width:min(480px,92vw); padding:20px; }
dialog::backdrop { background:rgba(0,0,0,.4); }
.login { max-width:340px; margin:80px auto; }
.timeline { list-style:none; margin:0; padding:0; } .timeline li { padding:5px 0; border-bottom:1px dashed var(--line); font-size:13px; }
.cols { display:grid; gap:16px; grid-template-columns:1fr 1fr; } @media (max-width:760px) { .cols { grid-template-columns:1fr; } }

.kanban { display:grid; grid-template-columns:repeat(5,minmax(170px,1fr)); gap:12px; overflow-x:auto; }
.kcol { background:var(--soft); border:1px solid var(--line); border-radius:10px; padding:10px; min-height:140px; }
.kcol.over-col { outline:2px dashed var(--brand); }
.kcol h3 { font-size:13px; margin:0 0 8px; color:var(--muted); display:flex; justify-content:space-between; align-items:center; }
.kcard { background:#fff; border:1px solid var(--line); border-radius:8px; padding:9px; margin-bottom:8px; font-size:13px; box-shadow:0 1px 2px rgba(20,30,50,.06); }
.kcard.editable { cursor:grab; } .kcard.dragging { opacity:.4; } .kcard select { margin-top:6px; padding:3px 6px; font-size:12px; }
.kempty { text-align:center; padding:10px 0; }
.pboard { grid-template-columns:repeat(7,minmax(210px,1fr)); padding-bottom:8px; } .kcard a { color:var(--ink); text-decoration:none; } .kcard .bar { margin:6px 0 2px; }

/* ---- workflow v2 ---- */
.stepper { list-style:none; display:flex; gap:4px; padding:0; margin:12px 0; overflow-x:auto; }
.stepper li { flex:1; min-width:96px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--soft); color:var(--muted); font-size:13px; display:flex; align-items:center; gap:8px; white-space:nowrap; }
.stepper li span { display:inline-grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--line); color:var(--ink); font-size:11px; }
.stepper li.done { color:var(--ok); border-color:var(--ok); } .stepper li.done span { background:var(--ok); color:#fff; }
.stepper li.current { background:var(--brand); border-color:var(--brand); color:#fff; font-weight:600; } .stepper li.current span { background:#fff; color:var(--brand); }
.tabs { display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:16px; overflow-x:auto; }
.tabs a { padding:8px 14px; color:var(--muted); text-decoration:none; border-bottom:2px solid transparent; white-space:nowrap; }
.tabs a.active { color:var(--brand); border-color:var(--brand); font-weight:600; } .tabs a:hover { color:var(--ink); }
.nav-group { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); padding:12px 10px 2px; }
.kpis { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); margin-bottom:16px; } .kpis .card { margin:0; color:inherit; text-decoration:none; } .kpis .card:hover { border-color:var(--brand); }
.grid.mini { grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); margin:8px 0; }
.num { text-align:right; white-space:nowrap; }
.filters { margin:10px 0; } label.inline { display:inline-flex; align-items:center; gap:6px; margin:0; font-size:13px; }
.pager { margin-top:12px; } .empty { text-align:center; padding:14px 0; } .loading { padding:30px 0; text-align:center; }
.check { list-style:none; margin:0; padding:0; } .check li { padding:3px 0; } .check .ok { color:var(--ok); } .check .no { color:var(--bad); }
.comment { border-bottom:1px dashed var(--line); padding:6px 0; font-size:13px; }
.files { margin:6px 0; padding-left:18px; }
.badge.sev-critical { color:#fff; background:var(--bad); border-color:var(--bad); } .badge.sev-high { color:var(--bad); } .badge.sev-medium { color:var(--warn); }
.badge.feas-feasible,.badge.APPROVED,.badge.PASS,.badge.verified,.badge.closed,.badge.ts-done,.badge.approve { color:var(--ok); }
.badge.feas-rejected,.badge.REJECTED,.badge.FAIL,.badge.ts-blocked,.badge.reject { color:var(--bad); } .badge.feas-needs_revision,.badge.BLOCKED,.badge.fixed,.badge.acknowledged,.badge.in_progress { color:var(--warn); }
.kcard.blocked { border-color:var(--bad); }
.kcard a { color:var(--ink); text-decoration:none; }
th a { color:inherit; text-decoration:none; }
dialog#drawer { margin:0 0 0 auto; height:100vh; max-height:100vh; width:min(560px,100vw); border-radius:0; border-width:0 0 0 1px; padding:0; }
dialog#drawer::backdrop { background:rgba(0,0,0,.35); } .drawer-body { padding:20px; } .drawer-body h3 { margin:16px 0 6px; font-size:15px; }
dialog#modal form { max-height:80vh; overflow-y:auto; }
@media print { header, .tabs, button { display:none !important; } header:not([hidden]) ~ main { margin-left:0; } }

.stat small { display:block; font-size:11px; color:var(--muted); font-weight:400; }

.kcard[data-pid] { cursor:pointer; } .kcard[data-pid]:hover { border-color:var(--brand); }
.ms-login { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; box-sizing:border-box; padding:9px 12px; background:#fff; color:#2f2f2f; border:1px solid #8c8c8c; border-radius:6px; text-decoration:none; font-weight:600; }
.ms-login:hover { background:#f3f3f3; }
.ms-sep { text-align:center; margin:12px 0 4px; }
.typetabs { margin:10px 0; gap:8px; }
.typetabs button[aria-selected="true"] { font-weight:700; }

/* ---------- timeline (gantt) ---------- */
.g-card { padding:0; overflow:hidden; }
.gantt { --lw:260px; --c:var(--brand); overflow:auto; max-height:calc(100vh - 260px); position:relative; }
.g-head { display:flex; position:sticky; top:0; z-index:4; min-width:calc(var(--lw) + var(--w)); background:var(--soft); border-bottom:1px solid var(--line); }
.g-axis { position:relative; width:var(--w); flex:none; height:30px; }
.g-tick { position:absolute; top:0; height:30px; line-height:30px; padding-left:6px; font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; }
.g-today-lab { position:absolute; top:2px; transform:translateX(-50%); font-size:11px; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:10px; padding:0 6px; line-height:16px; }
.g-lab { position:sticky; left:0; z-index:3; flex:none; width:var(--lw); display:flex; align-items:center; gap:4px; padding:0 10px; background:var(--card); border-right:1px solid var(--line); overflow:hidden; white-space:nowrap; }
.g-corner { background:var(--soft); height:30px; font-size:13px; font-weight:600; color:var(--muted); }
.g-rows { position:relative; min-width:calc(var(--lw) + var(--w)); }
.g-row { display:flex; border-bottom:1px solid var(--line); height:38px; }
.g-row.g-sub { height:32px; background:var(--soft); } .g-row.g-sub .g-lab { background:var(--soft); }
.g-lab a { color:var(--ink); font-weight:600; text-overflow:ellipsis; overflow:hidden; text-decoration:none; } .g-lab a:hover { text-decoration:underline; }
.g-task { overflow:hidden; text-overflow:ellipsis; font-size:13px; padding:0; }
.g-meta { margin-left:auto; font-size:11px; padding-left:6px; overflow:hidden; text-overflow:ellipsis; }
.g-exp { all:unset; cursor:pointer; width:20px; text-align:center; color:var(--muted); border-radius:4px; flex:none; } .g-exp:hover { background:var(--soft); } .g-exp:focus-visible { outline:2px solid var(--brand); }
.g-track { position:relative; width:var(--w); flex:none; }
.gb { position:absolute; top:10px; height:16px; border-radius:4px; border:1px solid var(--c); background:color-mix(in srgb, var(--c) 18%, #fff); overflow:hidden; cursor:default; }
.g-sub .gb { top:9px; height:14px; }
.gb > i { display:block; height:100%; background:var(--c); }
.gb:hover, .gb:focus-visible { outline:2px solid var(--ink); outline-offset:1px; }
.gb.s-done { --c:var(--ok); } .gb.s-late { --c:var(--bad); } .gb.s-blocked { --c:var(--warn); } .gb.s-cancel { --c:#8a93a3; }
.g-note { position:absolute; top:0; line-height:38px; font-size:12px; color:var(--muted); white-space:nowrap; } .g-sub .g-note { line-height:32px; }
.g-lines { position:absolute; top:0; bottom:0; left:var(--lw); width:var(--w); pointer-events:none; z-index:1; }
.g-vline { position:absolute; top:0; bottom:0; width:1px; background:var(--line); }
.g-today { position:absolute; top:0; bottom:0; width:0; border-left:2px dashed var(--ink); opacity:.55; }
.g-legend { gap:14px; margin:8px 0; font-size:13px; } .g-key { display:inline-flex; align-items:center; gap:6px; }
.g-key .gb { position:static; width:34px; height:12px; flex:none; }
.g-tip { position:fixed; z-index:50; display:none; max-width:300px; padding:8px 10px; background:var(--ink); color:#fff; border-radius:8px; font-size:12px; line-height:1.5; pointer-events:none; box-shadow:0 4px 14px rgba(0,0,0,.25); }
.g-tip-v { font-size:14px; font-weight:700; } .g-tip-s { opacity:.75; }
