:root {
  --ink: #0b0c0a;
  --panel: #11130f;
  --panel-strong: #171a14;
  --line: #343a2d;
  --muted: #90998a;
  --signal: #c6ff4a;
  --warning: #ffb800;
  --danger: #ff3b30;
  --type: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ink); color: #f4f7ee; font-family: var(--type); }
button, a { font: inherit; }
button { cursor: pointer; }
a { color: var(--signal); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 76px 1fr; }
.rail { border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 28px; background: #080908; }
.mark { color: var(--signal); font-size: 22px; letter-spacing: -2px; font-weight: 800; }
.rail button { background: transparent; border: 0; color: var(--muted); padding: 12px 4px; writing-mode: vertical-rl; text-transform: uppercase; font-size: 10px; letter-spacing: .12em; }
.rail button.active, .rail button:hover { color: var(--signal); }
.rail-foot { margin-top: auto; color: var(--muted); font-size: 10px; writing-mode: vertical-rl; }

.workspace { min-width: 0; }
.topbar { min-height: 76px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 36px; }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.topbar h1 { margin: 4px 0 0; font-size: 20px; font-weight: 500; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.role { color: var(--signal); border: 1px solid var(--signal); padding: 7px 10px; font-size: 11px; }
.button { border: 1px solid var(--signal); color: var(--ink); background: var(--signal); padding: 11px 14px; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.button:hover { background: #e0ff9a; }
.button.secondary { color: var(--signal); background: transparent; border-color: var(--line); }
.button.secondary:hover { border-color: var(--signal); }

.content { padding: 34px 36px 60px; max-width: 1440px; }
.section { display: none; }
.section.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
.section-head h2 { font-size: 28px; font-weight: 500; margin: 0; letter-spacing: -0.05em; }
.section-head p { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--panel); padding: 22px; min-height: 140px; }
.card h3 { font-size: 12px; color: var(--muted); font-weight: 400; text-transform: uppercase; margin: 0 0 24px; }
.metric { font-size: 40px; color: var(--signal); font-variant-numeric: tabular-nums; letter-spacing: -0.08em; }
.metric-label { color: var(--muted); font-size: 11px; margin-top: 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 22px; margin-top: 24px; }
.panel h3 { margin: 0 0 16px; font-size: 13px; font-weight: 500; }
.kv { display: grid; grid-template-columns: 180px 1fr; border-top: 1px solid var(--line); }
.kv span { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kv span:first-child { color: var(--muted); }
.empty { border: 1px dashed var(--line); color: var(--muted); padding: 30px; text-align: center; font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 12px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 13px 14px; white-space: nowrap; }
th { color: var(--muted); font-weight: 400; text-transform: uppercase; font-size: 10px; letter-spacing: .08em; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ''; width: 7px; height: 7px; background: var(--muted); display: inline-block; }
.status.available::before, .status.active::before { background: var(--signal); }
.status.permission_limited::before, .status.unavailable::before { background: var(--warning); }
.status.error::before, .status.invalid::before { background: var(--danger); }
.source-label { color: var(--signal); }
.tenant-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tenant-row { background: var(--panel); padding: 18px 20px; display: flex; justify-content: space-between; }
.tenant-row small { color: var(--muted); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 80% 20%, #202a16 0, var(--ink) 38%); }
.login-box { width: min(520px, 100%); border: 1px solid var(--line); padding: 42px; background: var(--panel); }
.login-box .mark { font-size: 42px; margin-bottom: 54px; display: block; }
.login-box h1 { font-size: 34px; font-weight: 500; margin: 0 0 14px; letter-spacing: -0.08em; }
.login-box p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0 0 30px; }
.login-box .button { width: 100%; }
.notice { border-left: 3px solid var(--warning); color: var(--warning); padding: 12px 14px; background: #1b170b; font-size: 12px; margin-bottom: 20px; }
.error { border-left-color: var(--danger); color: var(--danger); background: #1d0d0c; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; padding: 10px 16px; align-items: center; }
  .rail button { writing-mode: horizontal-tb; }
  .rail-foot { display: none; }
  .topbar { padding: 0 20px; }
  .content { padding: 24px 20px 40px; }
  .grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 130px 1fr; }
}
