/* ============================================================
   TraceR2C sample workspace: real-app theme
   Icon rail, roomy rounded cards, warm paper background, one teal accent.
   Loaded after the inline styles and dashboard-light.css so it wins.
   ============================================================ */
:root {
  color-scheme: light;
  --bg-app:#f8f8f5; --bg-card:#ffffff; --bg-card-raise:#f1f3ef; --bg-inset:#f4f5f1;
  --line:#e7e9e5; --line-strong:#d6dbd5;
  --text-1:#10231f; --text-2:#3d514b; --text-3:#6a7d76;
  --accent:#0e7667; --accent-hi:#0e7667; --accent-dim:#e3f3ee;
  --ok:#147657; --ok-dim:#e3f3ea; --warn:#8a5b0c; --warn-dim:#fbefd6; --bad:#b04a2c; --bad-dim:#fbe3dc;
  --r-card:22px; --r-control:12px;
  --teal2:#2aa58f; --red:#b9382a; --amber:#c98a1d; --slate:#5b6b73;
}
body { grid-template-columns:90px minmax(0,1fr); font-size:15px; background:var(--bg-app); }
::selection { background:#bfe5db; color:var(--text-1); }
.sb-scroll::-webkit-scrollbar-thumb, .page::-webkit-scrollbar-thumb { border-color:var(--bg-app); background:#cdd5d0; }

/* ---------------- icon rail ---------------- */
aside.rail { background:#f3f4f0; border-right:1px solid var(--line); align-items:center; padding:16px 0 14px; overflow:visible; position:relative; z-index:20; }
aside.rail .rail-logo { width:46px; height:46px; border-radius:50%; background:#fff; border:1px solid var(--line); display:grid; place-items:center; margin:0 0 22px; padding:0; flex:none; }
aside.rail .rail-logo img { width:28px; height:28px; }
aside.rail .rail-add { width:56px; height:56px; border-radius:14px; background:var(--accent); color:#fff; display:grid; place-items:center; margin:0 0 22px; padding:0; flex:none; box-shadow:0 8px 18px -8px rgba(14,118,103,.7); }
aside.rail .rail-add:hover { background:#0b6a5c; }
aside.rail .sb-item.rail-add { color:#fff; }
aside.rail .rail-add svg { width:24px; height:24px; opacity:1; stroke-width:2.2; }
aside.rail .sb-scroll { flex:0 0 auto; padding:0; overflow:visible; display:grid; gap:8px; }
aside.rail .rail-sp { flex:1; }
aside.rail .sb-item { width:54px; height:52px; padding:0; margin:0; justify-content:center; border-radius:14px; color:#2d413c; position:relative; font-size:0; gap:0; }
aside.rail .sb-item svg { width:26px; height:26px; opacity:1; stroke-width:1.8; }
aside.rail .sb-item:hover { background:#e8ece7; color:var(--text-1); }
aside.rail .sb-item.active { background:#dfeee8; color:var(--accent); box-shadow:none; }
aside.rail .sb-item.active::before { left:-18px; top:12px; bottom:12px; width:4px; border-radius:0 4px 4px 0; background:var(--accent); }
aside.rail .sb-item .sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
aside.rail .sb-item .cnt { position:absolute; top:3px; right:2px; min-width:18px; height:18px; padding:0 5px; display:grid; place-items:center; margin:0; border:0; border-radius:99px; background:#c4452f; color:#fff; font:600 10.5px var(--ui); }
aside.rail .sb-item::after { content:attr(data-tip); position:absolute; left:calc(100% + 12px); top:50%; translate:0 -50%; white-space:nowrap; background:#fff; color:var(--text-1); border:1px solid var(--line); border-radius:10px; padding:8px 14px; font:500 15px var(--ui); box-shadow:0 10px 24px -12px rgba(16,35,31,.35); opacity:0; pointer-events:none; transition:opacity .15s; z-index:30; }
aside.rail .sb-item:hover::after, aside.rail .sb-item:focus-visible::after { opacity:1; }
aside.rail .rail-help { width:52px; height:52px; border-radius:14px; background:#fff; border:1px solid var(--line); color:var(--accent); margin-bottom:10px; }
aside.rail .rail-ver { font:500 12px var(--mono); color:#7c8d87; }

/* ---------------- top bar ---------------- */
main { grid-template-rows:94px minmax(0,1fr); }
.topbar { height:94px; padding:0 30px 0 38px; gap:22px; background:#fcfcfa; border-bottom:1px solid var(--line); }
.topbar .tb-toggle { color:#2d413c; display:grid; place-items:center; width:30px; height:30px; flex:none; }
.topbar .tb-toggle svg { width:24px; height:24px; }
.tb-search { flex:none; width:318px; max-width:none; height:46px; padding:0 14px; gap:12px; border:1px solid var(--line); border-radius:12px; background:#fff; font-family:var(--ui); font-size:16px; color:#5f736d; box-shadow:0 1px 2px rgba(16,35,31,.05); }
.tb-search svg { width:20px; height:20px; }
.tb-search kbd { font:500 12px var(--mono); border:1px solid var(--line); border-radius:7px; padding:4px 8px; color:#5f736d; }
.tb-branch { height:46px; padding:0 20px; gap:30px; border:1px solid var(--line); border-radius:12px; background:#fff; font-size:17px; font-weight:500; color:var(--text-1); box-shadow:0 1px 2px rgba(16,35,31,.05); }
.tb-branch svg { width:16px; height:16px; opacity:.8; }
.tb-badge { font:500 11px var(--mono); letter-spacing:.1em; color:var(--accent); background:var(--accent-dim); border:0; padding:8px 13px; }
.tb-badge i { background:var(--accent); }
.tb-right { margin-left:auto; display:flex; align-items:center; gap:34px; color:#2d413c; }
.tb-right svg { width:24px; height:24px; }
.tb-right .bell { position:relative; display:grid; }
.tb-right .bell b { position:absolute; right:-9px; top:-11px; width:22px; height:22px; border-radius:50%; background:#c4452f; color:#fff; font:600 12px var(--ui); display:grid; place-items:center; }
.tb-right .avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#7fc4b6,#2b8f80); color:#fff; font:600 13px var(--ui); display:grid; place-items:center; box-shadow:0 0 0 2px #fff,0 0 0 3px var(--line); }

/* ---------------- pages ---------------- */
.page { padding:24px 28px 34px 30px; }
.page-head { margin-bottom:20px; }
.page-head h2 { font-size:28px; letter-spacing:-.02em; }
.page-head .ph-sub { font:400 13px var(--mono); margin-top:6px; color:var(--text-3); }
.card { border-radius:22px; box-shadow:none; }
.card-h { padding:18px 24px; border-bottom:1px solid var(--line); }
.card-h h3 { font:500 18px var(--disp); letter-spacing:-.01em; }
.card-h .h-mono { font-size:12px; letter-spacing:.06em; }
.card-b { padding:18px 24px; }
.card-f { padding:14px 24px; font-size:12px; }
.pill { font:600 11.5px var(--ui); letter-spacing:.04em; padding:6px 13px; }
.pill::before { display:none; }
.chip { font-size:11px; padding:3px 9px; border-radius:99px; background:#f4f5f1; }
.toolbar { gap:12px; margin-bottom:18px; }
.seg { border-radius:12px; background:#fff; }
.seg span { font-size:14px; padding:9px 16px; }
.seg span.on { background:var(--accent-dim); color:var(--accent); font-weight:600; }
.tb-input { font:400 14px var(--ui); min-width:230px; padding:9px 14px; border-radius:12px; background:#fff; }
.tb-tool { font-size:14px; padding:9px 16px; border-radius:12px; }
.tb-tool.accent { color:var(--accent); background:var(--accent-dim); border-color:#bfe0d6; }
th { font-size:11px; padding:14px 22px; }
td { padding:15px 22px; font-size:14.5px; }
td .t-sub { font-size:11.5px; }
td.num { font-size:13px; }
tbody tr:hover { background:#f7f8f5; }
.av { width:34px; height:34px; border-radius:11px; font-size:11px; }
.score-bar b { font-size:13px; }
.score-bar .sb-track { width:70px; height:6px; background:#e9ece8; }
.spec-row, .feed-item, .qa-row, .ai-item { font-size:14.5px; }
.pg-nav span { width:28px; height:28px; border-radius:9px; font-size:12px; }
.pg-nav span.on { background:var(--accent-dim); color:var(--accent); border-color:#bfe0d6; }
.btn-ghost-sm { color:var(--accent); border-color:#bfe0d6; }
.grade-chip { background:var(--ok-dim); border-color:#bfe0cf; }
.pk { border-radius:22px; }
.meter, .score-bar .sb-track { background:#e9ece8; }

/* ---------------- dashboard (real-app layout) ---------------- */
.dash { display:grid; grid-template-columns:1.27fr 1fr .74fr; gap:18px; align-items:stretch; }
.dc { background:#fff; border:1px solid var(--line); border-radius:22px; padding:20px 24px; position:relative; overflow:hidden; min-width:0; }
.d-stack { display:grid; gap:18px; grid-template-rows:auto 1fr; min-width:0; }
.d-stack .dc { padding:18px 24px; }
.dh { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; gap:12px; }
.dh h3 { font:500 18px var(--disp); letter-spacing:-.01em; }
.dh a { color:var(--accent); font-weight:600; font-size:14.5px; display:inline-flex; align-items:center; gap:3px; white-space:nowrap; }
.dh a svg { width:14px; height:14px; }
.d-sub { font-size:14.5px; color:var(--text-3); }
.d-sub b { color:var(--bad); font-weight:500; }
.d-row { display:flex; align-items:center; gap:14px; padding:14px 4px; border-bottom:1px solid #f0f2ee; }
.d-row:last-child { border-bottom:0; }
.d-dot { width:7px; height:7px; border-radius:50%; background:var(--bad); flex:none; }
.d-dot.a { background:var(--amber); }
.d-row .t { flex:1; min-width:0; }
.d-row .t strong { display:block; font-weight:600; font-size:16.5px; line-height:1.25; }
.d-row .t span { font:400 13.5px var(--mono); color:var(--text-3); }
.d-pill { font:600 11.5px var(--ui); letter-spacing:.04em; border-radius:99px; padding:6px 14px; background:#fbe3dc; color:#b04a2c; text-transform:uppercase; white-space:nowrap; }
.d-pill.a { background:#fbefd6; color:#8a5b0c; }
.d-row .chev { width:14px; height:14px; color:#b3beba; flex:none; }
.d-score { display:grid; grid-template-columns:1fr auto; align-items:center; gap:12px; }
.d-score h4 { font:500 15.5px var(--ui); }
.d-score .big { font:500 44px/1.1 var(--disp); letter-spacing:-.03em; margin:6px 0 2px; }
.d-score .m1 { font-size:14.5px; }
.d-score .m2 { font:400 13px var(--mono); color:var(--text-3); margin-top:6px; }
.d-score .ring { width:80px; height:80px; }
.d-risk .rr { display:flex; justify-content:space-between; align-items:center; padding:12px 2px; font-weight:500; font-size:16.5px; }
.d-risk .rr b { color:var(--accent); font-weight:500; font-size:15.5px; }
.d-ai { background:linear-gradient(160deg,#eef8f4,#e6f4ef); border:1.5px solid #8fd1c1; box-shadow:0 0 0 4px rgba(143,209,193,.18),0 18px 40px -22px rgba(14,118,103,.5); }
.d-ai .hd { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.d-ai .hd h3 { font:600 18px var(--disp); }
.d-ai .hd svg { width:22px; height:22px; }
.beta { font:600 11px var(--ui); letter-spacing:.06em; background:#cdeae1; color:#0b6a5c; border-radius:6px; padding:3px 8px; }
.d-ai .hd .r { margin-left:auto; display:flex; align-items:center; gap:12px; color:#6a7f78; }
.d-ai .hd .r svg { width:18px; height:18px; }
.d-ai .now { font:400 12px var(--mono); border-radius:99px; background:#dcebe6; padding:4px 10px; color:#5a706a; }
.d-ai ul { display:grid; gap:11px; list-style:none; font-size:15px; line-height:1.5; }
.d-ai li { position:relative; padding-left:16px; }
.d-ai li::before { content:""; position:absolute; left:0; top:9px; width:5px; height:5px; border-radius:50%; background:var(--teal2); }
.d-ai li b { font-weight:600; }
.d-ai .fu { margin-top:14px; padding-top:14px; border-top:1px solid #cfe5de; }
.d-ai .fu small { display:block; font:500 12px var(--mono); letter-spacing:.08em; color:#5a706a; text-transform:uppercase; margin-bottom:10px; }
.d-chip { display:inline-block; margin:0 8px 8px 0; padding:8px 14px; border:1px solid #a9d9cc; border-radius:99px; background:#f5fbf8; font-size:14px; font-weight:500; color:#12493f; }
.d-legend { display:flex; flex-wrap:wrap; gap:6px 18px; font-size:14px; color:#3d514b; margin-bottom:8px; }
.d-legend i { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:7px; vertical-align:-1px; }
.d-chart svg { width:100%; height:auto; display:block; }
.d-foot { font:400 13.5px var(--mono); color:var(--text-3); margin-top:8px; }
.d-foot em { font-style:normal; color:var(--accent); }
.d-bar { display:grid; grid-template-columns:56px 1fr 24px; align-items:center; gap:14px; font:400 14px var(--mono); color:#3d514b; padding:7px 0; }
.d-bar i { display:block; height:8px; border-radius:9px; background:#e8ebe7; position:relative; overflow:hidden; }
.d-bar i::after { content:""; position:absolute; inset:0; width:var(--w); background:var(--c); border-radius:9px; }
.d-bar b { text-align:right; font-weight:500; }
.d-exp-list { margin-top:8px; padding-top:12px; border-top:1px solid #f0f2ee; }
.d-exp-list .e { display:flex; justify-content:space-between; align-items:flex-start; padding:10px 0; }
.d-exp-list .e strong { display:block; font-weight:600; font-size:16px; line-height:1.25; }
.d-exp-list .e span { font:400 13.5px var(--mono); color:var(--text-3); }
.d-exp-list .e em { font:500 14px var(--mono); font-style:normal; color:#8a5b0c; }
.d-quick { display:flex; flex-direction:column; }
.d-qa { display:grid; gap:10px; margin-top:6px; }
.d-q { display:flex; align-items:center; gap:14px; border:1px solid var(--line); border-radius:14px; padding:13px 14px; font-weight:600; font-size:16.5px; background:#fff; }
.d-q svg { width:22px; height:22px; color:#2d413c; flex:none; }
.d-q .c { margin-left:auto; width:14px; height:14px; color:#b3beba; }
.d-stats { display:flex; gap:40px; align-items:flex-end; margin-top:auto; padding-top:26px; padding-right:74px; flex-wrap:wrap; }
.d-stats b { display:block; font:500 28px/1 var(--mono); }
.d-stats span { font-size:14px; color:var(--text-3); }
.d-fab { position:absolute; right:18px; bottom:16px; width:66px; height:66px; border-radius:50%; background:radial-gradient(circle at 30% 25%,#1c9b86,#0b6a5c); display:grid; place-items:center; color:#fff; box-shadow:0 0 0 6px #fff,0 0 0 7px var(--line),0 14px 30px -10px rgba(14,118,103,.8); }
.d-fab svg { width:28px; height:28px; }
.d-note { margin-top:16px; font:400 12px var(--mono); letter-spacing:.06em; color:var(--text-3); text-transform:uppercase; }
.dash .d-action { grid-column:1; } .dash .d-stack { grid-column:2; } .dash .d-ai { grid-column:3; }
.dash .d-chart { grid-column:1; } .dash .d-exp { grid-column:2; } .dash .d-quick { grid-column:3; }

@media (max-width:1280px) {
  .dash { grid-template-columns:1fr 1fr; }
  .dash .d-action, .dash .d-chart { grid-column:1; }
  .dash .d-stack, .dash .d-exp { grid-column:2; }
  .dash .d-ai { grid-column:1 / -1; }
  .dash .d-quick { grid-column:1 / -1; }
  .d-stats { padding-right:80px; }
}
@media (max-width:900px) {
  body { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); }
  aside.rail { height:auto; flex-direction:row; padding:8px 10px; border-right:0; border-bottom:1px solid var(--line); overflow-x:auto; gap:6px; justify-content:flex-start; }
  aside.rail .rail-logo { width:40px; height:40px; margin:0; }
  aside.rail .rail-add { width:44px; height:44px; margin:0 6px 0 2px; border-radius:12px; }
  aside.rail .sb-scroll { display:flex; gap:4px; overflow:visible; padding:0; }
  aside.rail .sb-item { width:46px; height:44px; flex:none; padding:0; }
  aside.rail .sb-item svg { display:block; width:22px; height:22px; }
  aside.rail .sb-item .cnt { display:grid; }
  aside.rail .sb-item.active::before { display:none; }
  aside.rail .sb-item::after { display:none; }
  aside.rail .rail-sp, aside.rail .rail-help, aside.rail .rail-ver { display:none; }
  main { height:auto; min-height:0; grid-template-rows:62px minmax(0,1fr); }
  .topbar { height:62px; padding:0 16px; gap:12px; }
  .tb-search, .tb-branch, .topbar .tb-toggle { display:none; }
  .tb-right { gap:20px; }
  .page { padding:18px 14px 28px; }
  .page-head h2 { font-size:22px; }
  .dash { grid-template-columns:minmax(0,1fr); }
  .dash .d-action, .dash .d-stack, .dash .d-ai, .dash .d-chart, .dash .d-exp, .dash .d-quick { grid-column:1; }
  .d-stats { padding-right:80px; }
  .kpis, .g-2, .g-3, .g-2b { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:640px) {
  .topbar { display:flex; }
  .tb-right { display:flex; }
  .tb-right .sw, .tb-right .moon { display:none; }
}
