:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --sidebar: #101318;
  --surface: #14181e;
  --surface-2: #191e25;
  --border: #252c35;
  --muted: #8e98a5;
  --text: #edf1f5;
  --accent: #7da2ff;
  --accent-soft: rgba(125, 162, 255, .12);
  --green: #72d6a1;
  --orange: #efbd6a;
  --red: #ef7d7d;
  --shadow: 0 18px 45px rgba(0,0,0,.22);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; border-right: 1px solid var(--border); background: var(--sidebar); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 25px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--text); color: #0e1115; font-weight: 800; }
.brand-title { font-weight: 700; letter-spacing: -.02em; }
.brand-subtitle { margin-top: 2px; font-size: 12px; color: var(--muted); }
.nav { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #aab3be; cursor: pointer; text-align: left; transition: .15s ease; }
.nav-item span { width: 20px; text-align: center; color: #737e8b; }
.nav-item:hover { background: #151a20; color: var(--text); }
.nav-item.active { background: var(--accent-soft); border-color: rgba(125,162,255,.18); color: #dce6ff; }
.nav-item.active span { color: var(--accent); }
.sidebar-note { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #0d1014; }
.sidebar-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(114,214,161,.08); }
.sidebar-note strong, .sidebar-note span { display: block; font-size: 12px; }
.sidebar-note span { color: var(--muted); margin-top: 2px; }
.content { min-width: 0; padding: 28px 34px 50px; max-width: 1550px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
h1 { font-size: 28px; margin: 0; letter-spacing: -.035em; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 999px; color: #c7cfd8; font-size: 12px; background: #11151a; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.ghost, .secondary, .primary, .link-btn, .icon-btn { border: 0; cursor: pointer; }
.ghost { padding: 8px 11px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; color: #c7cfd8; }
.ghost:hover, .secondary:hover { border-color: #394453; }
.demo-banner { display: flex; gap: 14px; padding: 16px 18px; margin-bottom: 22px; border: 1px solid rgba(125,162,255,.22); background: rgba(125,162,255,.07); border-radius: 12px; }
.banner-icon { flex: 0 0 auto; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #0c1220; font-weight: 800; }
.demo-banner strong { font-size: 14px; }
.demo-banner p { margin: 5px 0 0; color: #aeb8c6; font-size: 13px; line-height: 1.55; max-width: 1000px; }
.view { display: none; }
.view.active { display: block; animation: fade .16s ease; }
@keyframes fade { from { opacity: .65; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 14px; }
.metrics-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.metric-card, .panel, .tool-card { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.metric-card { padding: 18px; }
.metric-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 13px; }
.metric-card strong { display: block; font-size: 29px; letter-spacing: -.04em; margin-bottom: 8px; }
.metric-foot { font-size: 11px; color: #9aa5b2; }
.metric-foot.positive { color: var(--green); }
.metric-foot.warning { color: var(--orange); }
.grid-two { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; margin-bottom: 14px; }
.panel { padding: 18px; margin-bottom: 14px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.panel h2, .tool-card h2 { font-size: 15px; margin: 0; letter-spacing: -.02em; }
.panel-head p, .tool-card p { color: var(--muted); font-size: 12px; margin: 4px 0 0; line-height: 1.55; }
.link-btn { padding: 0; background: transparent; color: var(--accent); font-size: 12px; }
.compact-list { display: grid; }
.compact-user { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.compact-user:first-child { border-top: 0; padding-top: 0; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #252e3a; color: #dce6ff; font-size: 12px; font-weight: 700; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.user-cell strong { font-size: 12px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-cell small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.tag { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 5px 8px; font-size: 10px; color: #b8c1cc; white-space: nowrap; }
.tag.green { color: var(--green); border-color: rgba(114,214,161,.2); background: rgba(114,214,161,.05); }
.tag.orange { color: var(--orange); border-color: rgba(239,189,106,.2); background: rgba(239,189,106,.05); }
.tag.blue { color: #99b5ff; border-color: rgba(125,162,255,.2); background: rgba(125,162,255,.05); }
.funnel { display: grid; gap: 14px; }
.funnel-row { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-bottom: 9px; color: #b7c0cb; font-size: 11px; }
.funnel-row b { color: var(--text); font-size: 11px; }
.funnel-row i { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 10px; background: var(--accent); opacity: .8; }
.table-wrap { overflow-x: auto; margin: 0 -18px -18px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 18px; text-align: left; border-top: 1px solid var(--border); font-size: 11px; vertical-align: middle; }
th { color: #788391; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; font-weight: 600; background: #12161b; }
td { color: #c3cbd5; }
.row-action { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: #9eabc0; cursor: pointer; }
.row-action:hover { border-color: #465367; color: var(--text); }
.filters { display: flex; gap: 8px; }
input, select { border: 1px solid var(--border); border-radius: 8px; background: #0f1318; color: var(--text); padding: 9px 10px; outline: none; font-size: 11px; }
input { width: 235px; }
select { min-width: 145px; }
input:focus, select:focus { border-color: #45536b; box-shadow: 0 0 0 3px rgba(125,162,255,.07); }
.empty { display: none; padding: 28px 0 10px; color: var(--muted); font-size: 12px; text-align: center; }
.tool-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.tool-card { padding: 20px; }
.tool-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: #10151b; margin-bottom: 18px; color: var(--accent); }
.tool-card p { min-height: 58px; margin: 8px 0 18px; }
.primary, .secondary { padding: 9px 12px; border-radius: 8px; font-size: 11px; }
.primary { background: #e8eefb; color: #10141b; font-weight: 650; }
.secondary { background: #11161c; color: #bbc5d0; border: 1px solid var(--border); }
.architecture { padding-bottom: 20px; }
.architecture-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 13px; }
.architecture-flow span { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: #101419; color: #c6cfd8; font-size: 11px; }
.architecture-flow b { color: #5f6a77; }
.architecture > p { color: var(--muted); font-size: 12px; line-height: 1.65; max-width: 900px; }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); z-index: 20; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(650px,100%); border: 1px solid #313945; background: #13171c; border-radius: 14px; box-shadow: 0 25px 90px rgba(0,0,0,.55); padding: 20px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 4px 0 0; font-size: 20px; }
.eyebrow { color: var(--accent); font-size: 9px; letter-spacing: .14em; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; background: #1a2027; color: #9da8b5; font-size: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.detail { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: #0f1317; }
.detail span { display: block; color: #788391; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.detail strong { font-size: 12px; font-weight: 500; word-break: break-word; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 380px; padding: 12px 14px; border-radius: 9px; border: 1px solid #35404d; background: #171d24; color: #d3dbe4; box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s ease; z-index: 50; }
.toast.show { opacity: 1; transform: none; }
@media (max-width: 1050px) { .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } .grid-two { grid-template-columns: 1fr; } .tool-grid { grid-template-columns: 1fr; } .tool-card p { min-height: 0; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding-bottom: 13px; }
  .nav { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-note { display: none; }
  .content { padding: 20px 14px 35px; }
  .topbar { align-items: flex-start; }
  .status-pill { display: none; }
  .metrics, .metrics-three { grid-template-columns: 1fr 1fr; }
  .stacked-mobile { align-items: stretch; flex-direction: column; }
  .filters { flex-direction: column; }
  input, select { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 470px) { .metrics, .metrics-three { grid-template-columns: 1fr; } .topbar-actions .ghost { display:none; } }
