:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --navy: #0b1f33;
  --navy-2: #122c46;
  --brand: #0e9384;
  --brand-2: #12b3a1;
  --blue: #175cd3;
  --red: #d92d20;
  --amber: #dc6803;
  --green: #079455;
  --purple: #7a5af8;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 8px 24px -12px rgba(16, 24, 40, .16);
  --shadow-lg: 0 24px 48px -24px rgba(16, 24, 40, .28);
  --radius: 16px;
  --radius-sm: 10px;
  --mono: "SF Mono", "Roboto Mono", ui-monospace, "Cascadia Code", monospace;
  --sans: "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  overflow-x: hidden;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
svg.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
pre, code { font-family: var(--mono); }
::selection { background: #b7e6df; }

/* ---------------- shell ---------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 238px; z-index: 40;
  background: linear-gradient(180deg, #0a1c2e 0%, #0d2740 55%, #0a2033 100%);
  color: #c7d2de; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 20px; position: relative; }
.brand-mark { width: 34px; height: 34px; position: relative; flex: none; }
.brand-mark span { position: absolute; left: 0; width: 34px; height: 9px; border-radius: 3px; transform: skewX(-18deg); }
.brand-mark span:nth-child(1) { top: 2px; background: #12b3a1; }
.brand-mark span:nth-child(2) { top: 13px; background: #2e90fa; opacity: .9; }
.brand-mark span:nth-child(3) { top: 24px; background: #fdb022; opacity: .9; }
.brand-text b { display: block; color: #fff; font-size: 17px; letter-spacing: .08em; }
.brand-text small { display: block; color: #7c93aa; font-size: 10px; letter-spacing: .06em; margin-top: 3px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; position: relative; scrollbar-width: thin; }
.nav-group { color: #5f7891; font-size: 10px; letter-spacing: .16em; padding: 18px 12px 8px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: #a9bbcd; font-size: 13px; margin-bottom: 2px; position: relative; transition: .18s;
}
.nav a .icon { opacity: .8; }
.nav a:hover { color: #eaf2fa; background: rgba(255, 255, 255, .055); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(18, 179, 161, .18), rgba(18, 179, 161, .04)); }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand-2); }
.nav a.active .icon { color: var(--brand-2); opacity: 1; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); position: relative; }
.nav-settings { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #a9bbcd; font-size: 13px; }
.nav-settings:hover, .nav-settings.active { color: #fff; background: rgba(255,255,255,.06); }
.local-badge { margin: 12px 10px 4px; color: #6d879e; font-size: 10px; display: flex; align-items: center; gap: 6px; }
.local-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #12b3a1; box-shadow: 0 0 0 3px rgba(18,179,161,.14); }
.main { margin-left: 238px; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 16px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.project-switch { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px 4px 12px; }
.ps-label { font-size: 10px; color: var(--faint); letter-spacing: .06em; }
.project-switch select { border: none; background: transparent; color: var(--ink); font-size: 12.5px; max-width: 240px; padding: 6px 2px; outline: none; }
.ai-badge { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--green); background: #ecfdf3; border: 1px solid #abefc6; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.ai-badge .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(7,148,85,.13); }
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 6px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #0e9384, #175cd3); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.user-name { font-size: 12px; color: var(--ink-2); }
.content { padding: 26px 30px 60px; max-width: 1560px; margin: 0 auto; }
.menu-btn { display: none !important; }
.scrim { display: none; }

/* ---------------- generic ---------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.02em; font-weight: 750; }
.page-head p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; max-width: 720px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { font-size: 10px; letter-spacing: .2em; color: var(--brand); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; }
.hidden { display: none !important; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.split-main > *, .split-even > *, .stack > *, .grid > * { min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.card-head .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 16px; align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.die-layout { grid-template-columns: 340px minmax(0, 1fr); }
.die-preview-grid { display: grid; grid-template-columns: minmax(180px, .62fr) minmax(0, 1.38fr); gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: .16s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: #b9c2ce; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(180deg, #0d3f63, #0b3352); border-color: #0b3352; color: #fff; }
.btn-primary:hover { background: linear-gradient(180deg, #10507c, #0c3b5e); border-color: #10507c; }
.btn-accent { background: linear-gradient(180deg, #10a596, #0b8779); border-color: #0b8779; color: #fff; }
.btn-accent:hover { background: linear-gradient(180deg, #12b3a1, #0e9384); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: #eef1f5; border-color: transparent; }
.btn-danger { color: var(--red); border-color: #fecdca; background: #fffbfa; }
.btn-danger:hover { background: #fef3f2; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-btn:hover { background: #eef1f5; color: var(--ink); }
.link { color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* badges / chips */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { background: #ecfdf3; color: var(--green); border: 1px solid #abefc6; }
.badge-blue { background: #eff8ff; color: var(--blue); border: 1px solid #b2ddff; }
.badge-red { background: #fef3f2; color: var(--red); border: 1px solid #fecdca; }
.badge-amber { background: #fffaeb; color: #b54708; border: 1px solid #fedf89; }
.badge-gray { background: #f2f4f7; color: var(--muted); border: 1px solid var(--line); }
.badge-purple { background: #f4f3ff; color: var(--purple); border: 1px solid #d9d6fe; }
.badge-teal { background: #f0fdf9; color: #0e9384; border: 1px solid #99f6e0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--line-2); color: var(--ink-2); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-count { font-family: var(--mono); font-size: 10px; opacity: .65; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 10px; margin: 2px 4px 2px 0; }
.tag-teal { background: #f0fdf9; color: #0e9384; border-color: #ccfbef; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.field .hint { font-size: 10.5px; color: var(--faint); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff;
  padding: 0 11px; color: var(--ink); outline: none; transition: .16s; font-size: 12.5px;
}
.textarea { height: auto; min-height: 82px; padding: 10px 11px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: #6bbfb6; box-shadow: 0 0 0 3px rgba(14,147,132,.1); }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.input-icon .input { padding-left: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.segmented { display: inline-flex; background: #f2f4f7; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: none; background: transparent; height: 30px; padding: 0 14px; border-radius: 7px; font-size: 12px; color: var(--muted); font-weight: 600; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.check input { margin-top: 2px; accent-color: var(--brand); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 17px 18px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(14,147,132,.08), transparent 70%); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #f0fdf9; color: var(--brand); }
.kpi-icon .icon { width: 16px; height: 16px; }
.kpi-value { font-family: var(--mono); font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; margin-top: 12px; }
.kpi-value small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; font-family: var(--sans); }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--faint); margin-top: 8px; }
.trend-up { color: var(--green); } .trend-down { color: var(--red); }

/* gauge */
.gauge { --score: 0; --size: 116px; width: var(--size); height: var(--size); border-radius: 50%; position: relative; flex: none;
  background: conic-gradient(var(--gauge-color, var(--brand)) calc(var(--score) * 1%), #edf0f4 0); display: grid; place-items: center; }
.gauge::before { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; box-shadow: inset 0 0 0 1px #eef1f5; }
.gauge-inner { position: relative; text-align: center; }
.gauge-score { font-family: var(--mono); font-size: calc(var(--size) * .27); font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.gauge-label { font-size: calc(var(--size) * .09); color: var(--muted); margin-top: 4px; }
.score-pill { font-family: var(--mono); font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 6px; background: #f2f4f7; }
.score-good { color: var(--green); background: #ecfdf3; }
.score-mid { color: #b54708; background: #fffaeb; }
.score-bad { color: var(--red); background: #fef3f2; }

/* pipeline */
.pipeline { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 0 2px; }
.pipe-step { flex: 1; min-width: 86px; position: relative; text-align: center; padding-top: 26px; }
.pipe-step::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.pipe-step:first-child::before { display: none; }
.pipe-step .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; z-index: 1; display: grid; place-items: center; }
.pipe-step .dot .icon { width: 9px; height: 9px; stroke-width: 3; color: #fff; display: none; }
.pipe-step.done .dot { background: var(--brand); border-color: var(--brand); }
.pipe-step.done .dot .icon { display: block; }
.pipe-step.done::before { background: var(--brand); }
.pipe-step.active .dot { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(14,147,132,.12); }
.pipe-step.failed .dot { border-color: var(--red); background: var(--red); }
.pipe-step .name { font-size: 10.5px; color: var(--muted); }
.pipe-step.done .name, .pipe-step.active .name { color: var(--ink-2); font-weight: 600; }
.pipe-step .meta { font-size: 9px; color: var(--faint); margin-top: 2px; }
.pipe-mini { display: flex; gap: 4px; align-items: center; }
.pipe-mini i { width: 18px; height: 3px; border-radius: 2px; background: #e4e7ec; display: block; }
.pipe-mini i.done { background: var(--brand); }
.pipe-mini i.fail { background: var(--red); }

/* project cards */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { overflow: hidden; display: flex; flex-direction: column; transition: .18s; }
.project-card:hover { border-color: #c8d1dc; box-shadow: var(--shadow); transform: translateY(-1px); }
.mini-thumb { position: relative; }
.mini-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb { position: relative; height: 138px; background: #f8fafc; border-bottom: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.thumb::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#eef2f7 1px, transparent 1px), linear-gradient(90deg, #eef2f7 1px, transparent 1px); background-size: 18px 18px; opacity: .55; }
.thumb img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; padding: 0; }
.thumb .thumb-empty { position: relative; color: var(--faint); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.thumb .thumb-empty .icon { width: 28px; height: 28px; opacity: .5; }
.project-body { padding: 15px 16px 14px; flex: 1; }
.project-title { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.project-title h3 { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; }
.project-title .code { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 3px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 10.5px; margin-top: 8px; }
.project-meta span { display: inline-flex; align-items: center; gap: 4px; }
.project-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: #fcfdff; }

/* table */
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; min-width: 680px; }
table.data th { text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid #eef1f5; font-size: 12px; color: var(--ink-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fbfcfe; }
.bom-table { min-width: 940px; }
.bom-table td:nth-child(2) .strong { white-space: nowrap; }
table.data .strong { font-weight: 650; color: var(--ink); }
table.data .num { font-family: var(--mono); font-size: 11.5px; }
.table-compact th { padding: 8px 10px; }
.table-compact td { padding: 8px 10px; }

/* preview */
.preview-frame { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; position: relative; }
.preview-frame::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#f1f4f8 1px, transparent 1px), linear-gradient(90deg, #f1f4f8 1px, transparent 1px); background-size: 22px 22px; opacity: .6; pointer-events: none; }
.preview-frame img { display: block; width: 100%; height: auto; position: relative; }
.preview-frame.tall img { max-height: 720px; object-fit: contain; }
.preview-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fcfdff; }
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); background: #fcfdff; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: middle; }
.legend .l-red { background: #d92d20; } .legend .l-blue { background: #2f6feb; } .legend .l-green { background: #0f9d76; } .legend .l-gray { background: #98a2b3; }

/* stats / kv */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kv > div { background: #fff; padding: 10px 12px; }
.kv label { display: block; color: var(--faint); font-size: 9.5px; letter-spacing: .03em; margin-bottom: 3px; }
.kv b { font-size: 13px; font-weight: 650; color: var(--ink); }
.kv b.mono { font-family: var(--mono); font-size: 12px; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-strip .stat { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfdff; }
.stat-strip label { display: block; color: var(--faint); font-size: 9.5px; margin-bottom: 4px; }
.stat-strip b { font-family: var(--mono); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.split-main .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-strip small { color: var(--muted); font-size: 9.5px; margin-left: 2px; }

/* issues */
.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 10px; padding: 12px 14px; background: #fff; }
.issue.error { border-left-color: var(--red); background: #fffcfc; }
.issue.warn { border-left-color: var(--amber); background: #fffdf7; }
.issue.info { border-left-color: var(--blue); }
.issue-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.issue-head h4 { margin: 0; font-size: 12.5px; font-weight: 700; flex: 1; min-width: 180px; }
.issue-code { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.issue-detail { color: var(--ink-2); font-size: 11.5px; line-height: 1.65; margin-top: 6px; }
.issue-sug { margin-top: 7px; padding: 8px 10px; border-radius: 7px; background: #f8fafc; font-size: 11px; color: var(--muted); line-height: 1.6; }
.issue-sug b { color: var(--ink-2); }
.issue-loc { font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: 5px; }

/* checks */
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 11.5px; }
.check-item .status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line-2); }
.check-item.pass .status-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(7,148,85,.1); }
.check-item.warn .status-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(220,104,3,.1); }
.check-item.fail .status-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(217,45,32,.1); }
.check-item b { font-weight: 600; flex: 1; }
.check-item span { color: var(--muted); font-size: 10px; }

/* layer stack */
.stack-viz { display: flex; flex-direction: column; gap: 3px; padding: 8px; background: #f8fafc; border-radius: 12px; border: 1px solid var(--line); }
.layer-bar { min-height: 30px; border-radius: 6px; display: flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid rgba(16,24,40,.09); font-size: 10.5px; }
.layer-bar .idx { width: 17px; height: 17px; border-radius: 50%; background: rgba(255,255,255,.7); display: grid; place-items: center; font-family: var(--mono); font-size: 9px; font-weight: 700; }
.layer-bar .nm { flex: 1; font-weight: 600; color: #344054; }
.layer-bar .th { font-family: var(--mono); font-size: 10px; color: #475467; }
.layer-bar .cat { font-size: 9px; color: #667085; }

/* timeline */
.timeline { position: relative; margin: 0; padding: 0 0 0 18px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 15px 0; font-size: 11.5px; }
.timeline li::before { content: ""; position: absolute; left: -18px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.timeline li:last-child { padding-bottom: 0; }
.timeline b { display: block; font-weight: 650; color: var(--ink-2); }
.timeline span { color: var(--faint); font-size: 9.5px; font-family: var(--mono); }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }

/* tasks */
.task { padding: 11px 0; border-bottom: 1px solid #eef1f5; }
.task:last-child { border-bottom: none; }
.task-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.task-head b { flex: 1; font-weight: 600; }
.progress { height: 5px; border-radius: 3px; background: #eef1f5; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #0e9384, #2e90fa); transition: width .4s; }
.task small { display: block; margin-top: 5px; color: var(--faint); font-size: 9.5px; }

/* alert list */
.alert-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef1f5; }
.alert-item:last-child { border-bottom: none; }
.alert-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--amber); }
.alert-item.error .alert-dot { background: var(--red); }
.alert-item b { display: block; font-size: 11.5px; font-weight: 650; }
.alert-item p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: none; background: transparent; padding: 10px 14px; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }

/* empty / loading */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .empty-ico { width: 54px; height: 54px; border-radius: 16px; background: #f2f4f7; display: grid; place-items: center; margin: 0 auto 14px; color: var(--faint); }
.empty .empty-ico .icon { width: 24px; height: 24px; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.empty p { margin: 0 auto 16px; font-size: 11.5px; line-height: 1.7; max-width: 420px; }
.loading-screen { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 90px 0; color: var(--muted); font-size: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid #d0d5dd; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spinner.light { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, #f2f4f7 25%, #f9fafb 37%, #f2f4f7 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(10, 25, 41, .48); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .16s ease; }
.modal { width: min(760px, 100%); max-height: min(88vh, 900px); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: rise .2s ease; }
.modal.wide { width: min(980px, 100%); }
.modal.slim { width: min(520px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head p { margin: 4px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }

/* toast */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; background: var(--navy); color: #fff; border-radius: 10px; padding: 11px 14px; font-size: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: flex-start; animation: rise .2s ease; pointer-events: auto; }
.toast .icon { width: 16px; height: 16px; margin-top: 1px; color: #6ce9d3; flex: none; }
.toast.error .icon { color: #fda29b; }
.toast.success .icon { color: #6ce9d3; }
.toast small { display: block; color: #b9c9d8; font-size: 10px; margin-top: 3px; line-height: 1.4; }

/* dropzone */
.dropzone { border: 1.5px dashed #b9c2ce; border-radius: 12px; padding: 26px 18px; text-align: center; background: #fbfcfe; transition: .16s; cursor: pointer; }
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: #f0fdf9; }
.dropzone .icon { width: 30px; height: 30px; color: var(--brand); margin-bottom: 8px; }
.dropzone b { display: block; font-size: 12.5px; }
.dropzone p { margin: 5px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.dropzone.has-file { border-style: solid; border-color: #99f6e0; background: #f0fdf9; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 9px; border-radius: 7px; background: #fff; border: 1px solid var(--line); font-size: 10.5px; font-family: var(--mono); }

/* code / json */
.code-block { background: #0d1b2a; color: #cbd5e1; border-radius: 10px; padding: 14px; overflow: auto; max-height: 360px; font-size: 10.5px; line-height: 1.65; border: 1px solid #1e3a56; }
.code-block .k { color: #7dd3fc; } .code-block .s { color: #86efac; } .code-block .n { color: #fcd34d; }
details.reveal { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
details.reveal summary { cursor: pointer; padding: 11px 13px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 7px; }
details.reveal summary::-webkit-details-marker { display: none; }
details.reveal summary::before { content: "›"; color: var(--faint); font-size: 16px; transition: .15s; }
details.reveal[open] summary::before { transform: rotate(90deg); }
details.reveal .reveal-body { padding: 0 13px 13px; }

/* doc / iframe */
.doc-frame { width: 100%; height: 820px; border: 1px solid var(--line); border-radius: 12px; background: #e9edf2; }
.doc-meta { display: flex; flex-direction: column; gap: 10px; }

/* KB */
.kb-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.kb-cats { display: flex; flex-direction: column; gap: 3px; }
.kb-cat { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; color: var(--muted); cursor: pointer; border: 1px solid transparent; }
.kb-cat:hover { background: #f8fafc; }
.kb-cat.active { background: #f0fdf9; color: #0e9384; border-color: #ccfbef; font-weight: 650; }
.kb-cat .count { margin-left: auto; font-family: var(--mono); font-size: 10px; opacity: .65; }
.kb-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kb-card { padding: 14px 15px; cursor: pointer; transition: .16s; }
.kb-card:hover { border-color: #c8d1dc; box-shadow: var(--shadow); transform: translateY(-1px); }
.kb-card .kb-top { display: flex; align-items: center; gap: 6px; }
.kb-card h4 { margin: 8px 0 5px; font-size: 13px; line-height: 1.45; }
.kb-card p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.kb-card .kb-code { font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: 8px; }
.kb-detail { font-size: 12.5px; line-height: 1.9; color: var(--ink-2); white-space: pre-wrap; }

/* settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 16px; align-items: start; }
.setting-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.setting-section:last-child { border-bottom: none; }
.setting-section h3 { margin: 0 0 4px; font-size: 13px; }
.setting-section p { margin: 0 0 14px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.info-note { padding: 10px 12px; border-radius: 9px; background: #f8fafc; border: 1px solid var(--line); color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.info-note b { color: var(--ink-2); }

/* approval banner */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 11px; border: 1px solid #abefc6; background: #ecfdf3; }
.banner.warn { border-color: #fedf89; background: #fffaeb; }
.banner.error { border-color: #fecdca; background: #fef3f2; }
.banner .icon { width: 18px; height: 18px; margin-top: 1px; }
.banner b { display: block; font-size: 12px; margin-bottom: 3px; }
.banner p { margin: 0; font-size: 10.5px; color: var(--muted); line-height: 1.6; }

/* responsive */
@media (max-width: 1180px) {
  .die-preview-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-list { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 262px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex !important; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(10, 25, 41, .4); z-index: 35; }
  .split-main, .split-even, .settings-grid, .die-layout { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; height: 58px; gap: 8px; }
  .page-title { font-size: 14px; }
  .project-switch { padding-left: 9px; }
  .project-switch select { max-width: 150px; font-size: 11.5px; }
  .ps-label { display: none; }
  .ai-label { display: none; }
  .ai-badge { padding: 6px 8px; }
  .user-name { display: none; }
  .content { padding: 18px 14px 52px; }
  .page-head h1 { font-size: 22px; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 25px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-layout { grid-template-columns: 1fr; }
  .kb-cats { flex-direction: row; flex-wrap: wrap; }
  .kb-cat { border: 1px solid var(--line); }
  .modal-foot { position: sticky; bottom: 0; }
  .doc-frame { height: 620px; }
}
@media (max-width: 700px) {
  .pipeline { overflow: visible; }
  .pipe-step { min-width: 0; flex: 1; }
  .pipe-step .meta { display: none; }
  .pipe-step .name { font-size: 9px; }
  .bom-toolbar { flex-direction: column; align-items: stretch !important; }
  .bom-toolbar .field { width: 100% !important; min-width: 0 !important; }
  .bom-toolbar .btn { width: 100%; }
  .dashboard-table { min-width: 0; }
  .dashboard-table th:nth-child(2), .dashboard-table td:nth-child(2),
  .dashboard-table th:nth-child(3), .dashboard-table td:nth-child(3),
  .dashboard-table th:nth-child(4), .dashboard-table td:nth-child(4) { display: none; }
  .page-head { flex-direction: column; gap: 12px; }
  .page-head .actions { justify-content: flex-start; width: 100%; }
  .project-grid, .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal.wide, .modal.slim { width: 100%; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; width: 100%; }
  .thumb { height: 120px; }
  .tabs button { padding: 9px 11px; font-size: 11.5px; }
  .toolbar { flex-direction: column; align-items: stretch !important; }
  .toolbar .input-icon { flex: 1; }
  .card-pad { padding: 15px; }
  .card-head { padding: 14px 15px; }
  .card-body { padding: 15px; }
}
@media (max-width: 380px) {
  .project-switch select { max-width: 112px; }
}
@media (max-width: 340px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; }
}

/* ---------------- login ---------------- */
.login-root { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); background: #f3f5f8; overflow: auto; }
.login-root.hidden { display: none; }
.login-side { position: relative; background: linear-gradient(150deg, #07192a 0%, #0d2c47 55%, #0a3d4f 100%); color: #dbe7f0; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-side::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 30px 30px; mask-image: radial-gradient(circle at 30% 30%, #000, transparent 75%); }
.login-side::after { content: ""; position: absolute; width: 420px; height: 420px; right: -160px; bottom: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(18,179,161,.28), transparent 65%); }
.login-brand { position: relative; display: flex; align-items: center; gap: 13px; }
.login-brand .brand-mark { width: 40px; height: 40px; }
.login-brand b { display: block; font-size: 20px; letter-spacing: .1em; color: #fff; }
.login-brand small { display: block; color: #7e9ab1; font-size: 10px; letter-spacing: .08em; margin-top: 3px; }
.login-hero { position: relative; margin: 8vh 0 6vh; }
.login-hero .kicker { color: #5eead4; font-size: 10px; letter-spacing: .22em; font-weight: 700; }
.login-hero h1 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.28; color: #fff; margin: 14px 0 14px; letter-spacing: -.02em; }
.login-hero h1 em { font-style: normal; color: #6ce9d3; }
.login-hero p { color: #9db2c4; font-size: 13px; line-height: 1.9; max-width: 480px; margin: 0; }
.login-features { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.login-feature { display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035); border-radius: 9px; font-size: 11px; color: #b8cad8; line-height: 1.6; }
.login-feature .icon { width: 15px; height: 15px; color: #5eead4; margin-top: 1px; }
.login-side-foot { position: relative; display: flex; gap: 16px; flex-wrap: wrap; color: #6d879e; font-size: 10px; }
.login-side-foot span { display: inline-flex; align-items: center; gap: 6px; }
.login-side-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: #12b3a1; }
.login-panel { display: grid; place-items: center; padding: 36px 24px; background: radial-gradient(circle at 80% 10%, #e8f5f2, transparent 45%), #f3f5f8; }
.login-mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 26px; }
.login-mobile-brand .brand-mark { width: 34px; height: 34px; }
.login-mobile-brand b { font-size: 16px; letter-spacing: .1em; }
.login-mobile-brand small { display: block; color: var(--faint); font-size: 9px; margin-top: 2px; }
.login-card { width: min(408px, 100%); }
.login-card .eyebrow { margin-bottom: 8px; }
.login-card h2 { font-size: 25px; margin: 0 0 8px; letter-spacing: -.02em; }
.login-card > p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-form .input { height: 44px; border-radius: 10px; }
.login-form .field > label { font-size: 11px; }
.login-error { display: none; padding: 9px 11px; border-radius: 8px; background: #fef3f2; border: 1px solid #fecdca; color: #b42318; font-size: 11px; line-height: 1.5; }
.login-error.show { display: block; }
.login-submit { height: 44px; border-radius: 10px; font-size: 13px; margin-top: 2px; }
.login-hint { text-align: center; color: var(--faint); font-size: 9.5px; margin-top: 12px; }
.demo-box { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 15px; }
.demo-box .demo-title { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.demo-accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.demo-account { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 9px; text-align: left; transition: .15s; }
.demo-account:hover { border-color: #99f6e0; background: #f0fdf9; }
.demo-account b { display: block; font-size: 10.5px; color: var(--ink-2); }
.demo-account span { display: block; font-size: 9px; color: var(--faint); font-family: var(--mono); margin-top: 2px; }
.login-version { position: absolute; right: 22px; bottom: 16px; color: #98a2b3; font-size: 9px; }

/* ---------------- account / users / roles ---------------- */
.user-chip { border: none; background: transparent; cursor: pointer; padding: 5px 7px; border-radius: 9px; }
.user-chip:hover { background: #f2f4f7; }
.avatar-lg { width: 66px; height: 66px; border-radius: 20px; font-size: 25px; background: linear-gradient(140deg, #0e9384, #175cd3); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 8px 20px -10px rgba(14,147,132,.7); }
.profile-hero { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.profile-hero .who { flex: 1; min-width: 220px; }
.profile-hero h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.01em; }
.profile-hero .handle { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.profile-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 10.5px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 5px; }
.perm-groups { display: flex; flex-direction: column; gap: 10px; }
.perm-group { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.perm-group b { display: block; font-size: 10px; color: var(--muted); margin-bottom: 6px; letter-spacing: .04em; }
.perm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-tag { display: inline-block; padding: 2px 7px; border-radius: 4px; background: #f0fdf9; border: 1px solid #ccfbef; color: #0e9384; font-size: 9.5px; }
.login-list { display: flex; flex-direction: column; gap: 0; }
.login-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef1f5; font-size: 10.5px; }
.login-item:last-child { border-bottom: none; }
.login-item .licon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: #f2f4f7; color: var(--muted); flex: none; }
.login-item.ok .licon { background: #ecfdf3; color: var(--green); }
.login-item .lbody { flex: 1; }
.login-item .lbody b { display: block; font-size: 10.5px; font-weight: 600; }
.login-item .lbody span { color: var(--faint); font-size: 9px; }
.login-item time { color: var(--faint); font-size: 9px; font-family: var(--mono); white-space: nowrap; }
.logout-card { border-color: #fecdca; background: #fffcfc; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.role-card { padding: 15px 16px; }
.role-card .role-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.role-card h3 { margin: 0; font-size: 14px; }
.role-card .role-code { font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: 3px; }
.role-card p { color: var(--muted); font-size: 10.5px; line-height: 1.6; min-height: 34px; margin: 9px 0; }
.role-stats { display: flex; gap: 14px; color: var(--faint); font-size: 9.5px; border-top: 1px solid #eef1f5; padding-top: 9px; margin-top: 4px; }
.role-stats b { color: var(--ink-2); font-family: var(--mono); font-size: 11px; }
.role-card .role-actions { display: flex; gap: 6px; margin-top: 10px; }
.perm-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.perm-block { border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; }
.perm-block h4 { margin: 0 0 7px; font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.perm-check { display: flex; align-items: flex-start; gap: 6px; font-size: 10.5px; color: var(--ink-2); padding: 3px 0; cursor: pointer; line-height: 1.4; }
.perm-check input { accent-color: var(--brand); margin-top: 1px; }
.user-status { display: inline-flex; align-items: center; gap: 5px; }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty-cell { padding: 30px !important; text-align: center; color: var(--faint); }

@media (max-width: 980px) {
  .login-root { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-mobile-brand { display: flex; }
  .login-panel { padding: 28px 18px; align-items: start; }
  .login-card { margin-top: 8vh; }
  .login-version { display: none; }
  .role-grid { grid-template-columns: 1fr; }
  .perm-matrix { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .login-card { margin-top: 4vh; }
  .demo-accounts { grid-template-columns: 1fr; }
  .profile-hero { gap: 13px; }
  .avatar-lg { width: 54px; height: 54px; border-radius: 16px; font-size: 20px; }
  .topbar .icon-btn[data-action="logout"] { display: none; }
}

/* user management mobile cards */
.user-mobile-list { display: none; }
@media (max-width: 700px) {
  .users-table-wrap { display: none; }
  .user-mobile-list { display: block; padding: 2px 15px 8px; }
  .user-mobile-item { padding: 13px 0; border-bottom: 1px solid #eef1f5; }
  .user-mobile-item:last-child { border-bottom: none; }
}

/* drawing files */
.drawing-file-ico { width: 34px; height: 38px; border-radius: 7px; background: #f0fdf9; color: #0e9384; display: grid; place-items: center; flex: none; border: 1px solid #ccfbef; }
.drawings-mobile-list { display: none; }
@media (max-width: 700px) {
  .drawings-table-wrap { display: none; }
  .drawings-mobile-list { display: block; padding: 2px 15px 8px; }
  .drawing-mobile-item { padding: 13px 0; border-bottom: 1px solid #eef1f5; }
  .drawing-mobile-item:last-child { border-bottom: none; }
}

/* database settings */
.db-backup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #eef1f5; }
.db-backup-row:first-of-type { border-top: none; }
.setting-section .form-grid { margin-bottom: 2px; }
