:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #17202f;
  --ink-2: #4a5568;
  --muted: #8a94a6;
  --line: #e3e8f0;
  --line-2: #eef1f6;
  --primary: #1d4f91;
  --primary-2: #2d6cc0;
  --primary-soft: #e8effa;
  --side: #0f2a4d;
  --ok: #1f8a4c;   --ok-soft: #e4f4ea;
  --warn: #c98a06; --warn-soft: #fdf3dc;
  --bad: #c2372b;  --bad-soft: #fbe7e5;
  --info: #2d6cc0; --info-soft: #e7effb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .06), 0 1px 8px rgba(16, 32, 64, .04);
  font-family: 'Noto Sans Lao', 'Noto Sans', 'Phetsarath OT', 'Saysettha OT', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; margin: 16px 0 8px; color: var(--ink-2); }
small { color: var(--muted); font-size: 12px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.fine { font-size: 12px; color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }
.side { width: 236px; flex: none; background: var(--side); color: #c9d6ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { color: #fff; display: block; font-size: 13.5px; line-height: 1.35; }
.brand small { color: #8fa6c8; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #f0b429, #d9541e); display: grid; place-items: center; color: #fff; flex: none; }
.brand-mark .ic { width: 20px; height: 20px; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 14px; }
.brand-mark.big .ic { width: 30px; height: 30px; }
.side nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #c9d6ea; font-size: 13.5px; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 #f0b429; }
.side nav a em { margin-left: auto; font-style: normal; background: #f0b429; color: #10233f; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.side-foot { padding: 12px 16px; font-size: 11px; color: #7f95b8; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-title { min-width: 0; }
.top-title b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.mock-badge { background: var(--warn-soft); color: #8a5d00; border: 1px dashed #e0b44a; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; }
.bell { position: relative; color: var(--ink-2); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.bell:hover, .icon-btn:hover { background: var(--line-2); }
.bell em { position: absolute; top: 2px; right: 0; background: var(--bad); color: #fff; font-style: normal; font-size: 10px; border-radius: 9px; padding: 0 5px; font-weight: 700; }
.icon-btn { color: var(--ink-2); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.role-sel { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 4px 0 9px; color: var(--primary); }
.role-sel select { border: 0; background: transparent; padding: 6px 2px; color: var(--ink); cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; }
.content { padding: 22px 24px 48px; max-width: 1440px; width: 100%; }

/* ---------- common ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head p { color: var(--ink-2); max-width: 860px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.accent { border-left: 4px solid var(--warn); }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card-h.pad { padding: 14px 18px 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid > .card { margin-bottom: 0; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 16px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #163f75; }
.btn.ghost { background: #fff; color: var(--primary); border-color: var(--line); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.bad.ghost { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.full { width: 100%; }
.link { font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--primary); color: #fff; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: #946400; }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.muted { background: #eef0f4; color: var(--ink-2); } .pill.none { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; white-space: nowrap; }
.chip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.stage-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--ph, var(--primary)) 14%, white); color: color-mix(in srgb, var(--ph, var(--primary)) 80%, black); }
.code-tag { font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .5px; font-size: 11px; color: var(--muted); font-weight: 600; }
.note { display: flex; gap: 8px; align-items: flex-start; background: var(--info-soft); color: #1d4373; padding: 10px 12px; border-radius: 8px; margin: 12px 0 0; font-size: 13px; }
.note.warn { background: var(--warn-soft); color: #7a5200; } .note.bad { background: var(--bad-soft); color: #8e231a; } .note.ok { background: var(--ok-soft); color: #145f34; }
.link-note:hover { filter: brightness(.97); }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 10px; color: var(--ink-2); }
.crumb .ic { width: 15px; height: 15px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl td small { display: block; }
.tbl td small.plain { display: inline; color: var(--ink-2); font-size: 12.5px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr[data-href], .tbl td[data-href] { cursor: pointer; }
.tbl tr[data-href]:hover td, .tbl td[data-href]:hover { background: #f7f9fc; }
.tbl.compact td, .tbl.compact th { padding: 7px 4px; }
.tbl.compact th { background: transparent; }
.card:not(.flush) .tbl:not(.compact) th:first-child, .card:not(.flush) .tbl:not(.compact) td:first-child { padding-left: 0; }
.r { text-align: right; } .nowrap { white-space: nowrap; }
.tbad { color: var(--bad) !important; font-weight: 600; }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.blank { color: var(--muted); font-family: ui-monospace, monospace; font-size: 12px; }

/* ---------- KPIs & charts ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 12px; color: var(--ink-2); }
.kpi b { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.kpi.bad { border-top: 3px solid var(--bad); } .kpi.bad b { color: var(--bad); }
.kpi.warn { border-top: 3px solid var(--warn); } .kpi.ok { border-top: 3px solid var(--ok); }
.kpis.small .kpi b { font-size: 18px; }
.hbar { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 8px; align-items: center; font-size: 12.5px; }
.hbar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 6px; }
.hbar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.vbar, .linechart { width: 100%; height: auto; display: block; }
.vbar .grid, .linechart .grid { stroke: var(--line); stroke-width: 1; }
.vbar-val { font-size: 10px; fill: var(--ink-2); font-weight: 600; }
.vbar-lab { font-size: 10px; fill: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut-num { font-size: 22px; font-weight: 700; fill: var(--ink); }
.donut-sub { font-size: 11px; fill: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend li b { margin-left: auto; }
.legend.inline { flex-direction: row; flex-wrap: wrap; gap: 16px; margin: 6px 0 12px; }
.meter { display: inline-block; width: 70px; height: 7px; background: var(--line-2); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.meter > span { display: block; height: 100%; border-radius: 4px; }
.stage-dist { display: flex; flex-direction: column; gap: 10px; }
.sd-ph { font-size: 11.5px; font-weight: 700; display: block; margin-bottom: 3px; }
.sd-row { display: grid; grid-template-columns: 44px 1fr 20px; align-items: center; font-size: 11.5px; gap: 6px; height: 17px; }
.sd-row.zero { color: var(--muted); }
.sd-row span:first-child { font-weight: 600; }
.sd-bar i { display: block; height: 9px; border-radius: 3px; }

/* ---------- stepper ---------- */
.stepper { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 2px; }
.st-phase { flex: 1; min-width: max-content; }
.st-ph-label { font-size: 11.5px; font-weight: 700; color: var(--ph); border-bottom: 3px solid var(--ph); padding-bottom: 4px; margin-bottom: 10px; }
.st-steps { display: flex; gap: 6px; }
.st { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-2); min-width: 40px; }
.st .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; border: 2px solid var(--line); background: #fff; color: var(--muted); }
.st.approved .dot { background: var(--ph); border-color: var(--ph); color: #fff; }
.st.submitted .dot, .st.review .dot, .st.active .dot, .st.draft .dot { border-color: var(--ph); color: var(--ph); }
.st.returned .dot { border-color: var(--bad); color: var(--bad); }
.st.cur .dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ph) 22%, transparent); }
.st-l { font-size: 10.5px; font-weight: 600; }
.stepper.compact { gap: 8px; margin: 10px 0; }
.stepper.compact .st { min-width: 0; }
.stepper.compact .st .dot { width: 20px; height: 20px; font-size: 9.5px; }
.stepper.compact .st-steps { gap: 3px; }
.stepper.compact .st-phase { min-width: 0; border-top: 3px solid var(--ph); padding-top: 6px; flex: none; }
.minibar { display: flex; gap: 2px; margin-top: 5px; }
.minibar i { width: 7px; height: 4px; border-radius: 1px; background: var(--line); }
.minibar i.approved { background: var(--ph); }
.minibar i.submitted, .minibar i.review, .minibar i.draft, .minibar i.active { background: color-mix(in srgb, var(--ph) 45%, white); }
.minibar i.returned { background: var(--bad); }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; width: 100%; }
.login-hero { background: radial-gradient(circle at 20% 10%, #24569b 0, #0f2a4d 55%, #0b1f3a 100%); color: #fff; padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.login-hero h1 { font-size: 30px; line-height: 1.45; font-weight: 700; }
.login-hero .eyebrow { color: #f0b429; font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.login-hero .lead { color: #b9c9e3; font-size: 16px; }
.seg.light { background: transparent; border-color: rgba(255,255,255,.3); align-self: flex-start; }
.seg.light button { color: #dbe6f5; }
.seg.light button.on { background: #fff; color: var(--primary); }
.login-panel { padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.role-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.role-card:hover { border-color: var(--primary-2); transform: translateY(-1px); }
.role-card b { font-size: 15px; }
.role-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 6px; }
.role-user { margin-top: 6px; font-size: 12px; color: var(--primary); }

/* ---------- toolbar & filters ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar select, .toolbar input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; flex: 1; min-width: 240px; color: var(--muted); }
.search input { border: 0 !important; padding: 7px 0 !important; outline: none; flex: 1; background: transparent; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13.5px; }
.tabs a.on { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.tabs a em { font-style: normal; background: var(--line-2); border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.board-col { background: #eaeef5; border-radius: var(--radius); padding: 10px; border-top: 4px solid var(--ph); }
.board-h { display: flex; justify-content: space-between; padding: 2px 4px 10px; }
.board-card { display: flex; flex-direction: column; gap: 5px; background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); box-shadow: var(--shadow); border: 1px solid transparent; }
.board-card:hover { border-color: var(--primary-2); }
.board-card .stage-tag { align-self: flex-start; --ph: var(--primary); }
.row-b { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- project ---------- */
.proj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.la-name { color: var(--ink-2); margin: 2px 0 8px; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-2); }
.meta > span:not(.pill):not(.chip) { padding-left: 12px; border-left: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.facts.three { grid-template-columns: repeat(3, 1fr); margin: 12px 0; background: #fafbfd; border-radius: 8px; padding: 6px 14px; }
.facts.one { grid-template-columns: 1fr; margin-top: 12px; }
.facts > div { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.facts.three > div { border: 0; }
.facts span { font-size: 11.5px; color: var(--muted); }
.facts b { font-weight: 600; font-size: 13.5px; }
.facts.small b { font-size: 12.5px; }
.cur-stage { font-size: 17px; margin-bottom: 6px; }
.prog { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 10px 0; flex-wrap: wrap; }
.prog .meter { width: 120px; }
.proj-card h3 a { color: var(--ink); }
.proj-next { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.big-num { font-size: 24px; font-weight: 700; margin: 4px 0; }
.lc-phase { border-left: 4px solid var(--ph); }
.lc-ph { padding: 10px 16px; font-weight: 700; color: var(--ph); background: #fafbfd; border-bottom: 1px solid var(--line-2); }
.lc-ph small { font-weight: 400; margin-left: 6px; }
.lc-row { display: grid; grid-template-columns: 34px 1fr 100px 150px 20px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.lc-row:hover { background: #f7f9fc; }
.lc-row .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; border: 2px solid var(--line); color: var(--muted); }
.lc-row.approved .dot { background: var(--ph); border-color: var(--ph); color: #fff; }
.lc-row.submitted .dot, .lc-row.review .dot, .lc-row.draft .dot, .lc-row.active .dot { border-color: var(--ph); color: var(--ph); }
.lc-row.none { color: var(--muted); }
.lc-name small { display: block; }
.lc-date { font-size: 12.5px; color: var(--ink-2); }
.lc-go { color: var(--muted); }
.feat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.feat-sec h4 { color: var(--primary); border-bottom: 2px solid var(--primary-soft); padding-bottom: 4px; }
.feat-sec .val { font-weight: 600; }
.tag { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; letter-spacing: .3px; }
.tag.gol { background: var(--primary-soft); color: var(--primary); } .tag.add { background: #f0f1f4; color: var(--muted); }

/* ---------- stage ---------- */
.stage-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--ph); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.stage-head p { color: var(--ink-2); max-width: 760px; }
.stage-nav { display: flex; gap: 8px; align-items: center; flex: none; }
.stage-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .form-tbl input, textarea { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; width: 100%; }
.field input:disabled, .field select:disabled, .form-tbl input:disabled { background: #f7f8fb; color: var(--ink); border-color: var(--line-2); }
.field.dep input { background: #fffaf0; }
.field input:focus, .field select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary-2); }
.money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.money span { padding: 0 8px; color: var(--muted); font-size: 12px; background: #f7f8fb; align-self: stretch; display: grid; place-items: center; border-right: 1px solid var(--line); }
.money input { border: 0 !important; border-radius: 0 !important; }
.form-tbl td { padding: 4px; }
.groups fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 14px; margin: 0 0 12px; }
.groups legend { font-weight: 600; font-size: 13px; padding: 0 6px; color: var(--primary); }
.annex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.annex { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12.5px; color: var(--muted); }
.annex.on { color: var(--ink); background: var(--ok-soft); border-color: #bfe3cc; }
.cp-list { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; column-gap: 20px; }
.cp-list li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 13px; color: var(--muted); break-inside: avoid; }
.cp-list li.on { color: var(--ink); }
.cp-list input { margin-top: 3px; }
.docs { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.doc-row.has { border-style: solid; color: var(--primary); background: #fafcff; }
.doc-row > div { flex: 1; min-width: 0; }
.doc-row b { color: var(--ink); font-weight: 500; display: block; }
.doc-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 0; }
.wf li { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--muted); position: relative; font-size: 13px; }
.wf li span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #fff; z-index: 1; }
.wf li:not(:last-child)::after { content: ''; position: absolute; left: 11px; top: 28px; height: 14px; width: 2px; background: var(--line); }
.wf li.done { color: var(--ink); } .wf li.done span { background: var(--ok); border-color: var(--ok); color: #fff; }
.wf li.cur { color: var(--primary); font-weight: 600; } .wf li.cur span { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.wf li.ret { color: var(--bad); } .wf li.ret span { border-color: var(--bad); color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack textarea { min-height: 70px; resize: vertical; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li:last-child { padding-bottom: 0; }
.timeline b { display: block; font-size: 13px; }
.timeline p { font-size: 12.5px; background: #f7f9fc; border-radius: 6px; padding: 6px 8px; margin-top: 5px; color: var(--ink-2); }

/* ---------- flow ---------- */
.flow { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.flow-pre { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px dashed #9db4d6; border-radius: var(--radius); padding: 10px 14px; cursor: pointer; align-self: flex-start; }
.flow-pre:hover { background: var(--primary-soft); }
.flow-pre .num { background: var(--primary); }
.flow-pre b { display: block; font-size: 13.5px; }
.flow-phase { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); border-top: 4px solid var(--ph); padding: 12px 14px 14px; box-shadow: var(--shadow); }
.flow-ph-h { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.flow-ph-h b { color: var(--ph); font-size: 14px; }
.flow-stages { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.flow-arrow { color: var(--muted); align-self: center; font-size: 18px; flex: none; }
.flow-st { flex: 1 0 128px; max-width: 200px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; position: relative; }
.flow-st:hover { border-color: var(--ph); }
.flow-st.on { border-color: var(--ph); background: color-mix(in srgb, var(--ph) 8%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ph) 20%, transparent); }
.num { width: 22px; height: 22px; border-radius: 50%; background: var(--ph); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.flow-st .code { position: absolute; top: 9px; right: 10px; font-size: 10.5px; font-weight: 700; color: var(--ph); }
.flow-st .nm { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.flow-st .who { font-size: 11px; color: var(--muted); margin-top: auto; }
.flow-st .who b { color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { position: relative; padding-left: 18px; font-size: 13px; }
.checklist li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 2px; background: var(--primary-2); }
.checklist.doc li { padding-left: 0; display: flex; gap: 6px; align-items: center; }
.checklist.doc li::before { display: none; }
.checklist.doc .ic { width: 15px; height: 15px; color: var(--muted); }
.cycle { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; }
.cy-step { flex: 1 0 140px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fafbfd; display: flex; flex-direction: column; gap: 4px; }
.cy-step b { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12px; }
.cy-step.approved b { background: var(--ok); } .cy-step.review b { background: var(--warn); }
.cy-step p { font-size: 12.5px; margin: 0; }
.cy-who { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.cy-arr { align-self: center; color: var(--muted); flex: none; }
.cy-return { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--bad); font-size: 13px; background: var(--bad-soft); border-radius: 8px; padding: 8px 12px; }
.role-info { display: flex; flex-direction: column; gap: 4px; }
.role-info .ic { color: var(--primary); width: 22px; height: 22px; }
.role-info p { font-size: 12.5px; color: var(--ink-2); }
.grid > .role-info:nth-child(4) { grid-column: auto; }
.flow + .grid + .card + .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- compliance ---------- */
.rule-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rule-row > div { background: #fafbfd; border-radius: 8px; padding: 10px 12px; border: 1px solid var(--line-2); }
.rule-row b { font-size: 16px; color: var(--primary); }
.rule-row p { font-size: 12.5px; color: var(--ink-2); }

/* ---------- cooperation ---------- */
.coop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.coop-grid .card { margin: 0; }
.coop-num b { font-size: 26px; }
.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); margin: 10px 0 12px; }
.coop .legend { flex: none; }
.coop-wg { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); color: var(--primary); }
.coop-wg small { display: block; }
.coop-wg b { font-size: 12.5px; color: var(--ink); }

/* ---------- documents ---------- */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-layout > * { min-width: 0; }
.cats { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.cats a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--ink-2); font-size: 13px; }
.cats a .ic { width: 16px; height: 16px; color: var(--muted); }
.cats a em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--muted); }
.cats a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.doc-name { display: flex; gap: 8px; align-items: flex-start; }
.doc-name .ic { color: var(--bad); margin-top: 2px; }
.doc-name b { font-weight: 500; }

/* ---------- reports ---------- */
.report-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.report-card { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.report-card .ic { color: var(--primary); }
.report-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- admin ---------- */
.perm td span { font-size: 12px; padding: 2px 8px; border-radius: 5px; }
.perm-E, .perm-A { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.perm-A { background: var(--ok-soft); color: var(--ok); }
.perm-V { background: #f0f1f4; color: var(--ink-2); }
.perm-O, .perm-C { background: var(--warn-soft); color: #7a5200; }
.perm-x { color: var(--muted); }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: #17202f; color: #fff; padding: 10px 18px; border-radius: 9px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; font-size: 13.5px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: 1 / -1; }
  .coop-grid, .report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-layout { grid-template-columns: 1fr; }
  .top-title small { display: none; }
  .flow + .grid + .card + .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  #app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .side nav { flex-direction: row; overflow-x: auto; }
  .side nav a span { white-space: nowrap; }
  .side-foot { display: none; }
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .top-tools { flex: 1 1 100%; flex-wrap: wrap; }
  .role-sel select { max-width: 150px; }
  .search { min-width: 0; flex-basis: 100%; }
  .stage-nav { flex-wrap: wrap; }
  .flow-pre { align-self: stretch; }
  .top-title b { white-space: normal; }
  .content { padding: 16px; }
  .grid, .coop-grid, .report-cards, .board, .two-col, .feat-grid, .form-grid, .rule-row, .doc-layout, .login, .role-grid, .facts.three { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .flow + .grid + .card + .grid { grid-template-columns: 1fr; }
  .page-head, .proj-head, .stage-head { flex-direction: column; align-items: flex-start; }
  .login-hero, .login-panel { padding: 32px 20px; }
  .lc-row { grid-template-columns: 30px 1fr auto; } .lc-date, .lc-go { display: none; }
  .cp-list { columns: 1; }
  .tbl { display: block; overflow-x: auto; }
}
