:root {
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --bg: #f5f6fb;
  --bg-grad: radial-gradient(1100px 560px at 8% -8%, #eef2ff 0%, rgba(238, 242, 255, 0) 62%),
    radial-gradient(900px 520px at 100% 0%, #ecfeff 0%, rgba(236, 254, 255, 0) 58%),
    linear-gradient(180deg, #f8f9fd 0%, #f3f5fa 100%);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6e9f0;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-strong: #4338ca;
  --sidebar: linear-gradient(180deg, #0b1220 0%, #111a2e 55%, #0d1526 100%);
  --sidebar-text: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .07);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
  --radius: 16px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070b14;
    --bg-grad: radial-gradient(1000px 600px at 0% 0%, rgba(79, 70, 229, .18), transparent 60%),
      radial-gradient(900px 520px at 100% 0%, rgba(6, 182, 212, .12), transparent 55%),
      #070b14;
    --surface: #0f172a;
    --surface-2: #111c33;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1e293b;
    --sidebar: linear-gradient(180deg, #050816 0%, #0b1220 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-strong); }
::selection { background: rgba(99, 102, 241, .22); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-thumb { background: #334155; border: 3px solid transparent; background-clip: content-box; }
}

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px;
  flex: 0 0 252px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 14px 18px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  overflow-y: auto;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 14px; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 48%, #06b6d4 100%);
  box-shadow: 0 10px 24px rgba(79, 70, 229, .38);
  letter-spacing: -.02em;
}
.brand-name { color: #f8fafc; font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.brand-sub { color: #64748b; font-size: 10.5px; margin-top: 3px; letter-spacing: .12em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #56657d;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, .30), rgba(99, 102, 241, .08));
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .24);
}
.nav a .dot { width: 6px; height: 6px; border-radius: 50%; background: #475569; flex: 0 0 6px; }
.nav a.active .dot { background: #a5b4fc; box-shadow: 0 0 0 4px rgba(129, 140, 248, .16); }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, .14); }
.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #94a3b8;
}
.sidebar-user a { color: #cbd5e1; font-weight: 600; }
.sidebar-user a:hover { color: #fff; }

.content { flex: 1; min-width: 0; }
.main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 30px 60px;
  animation: rise .35s ease;
}
@keyframes rise {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- typography ---------- */
h1 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text);
}
h1::before {
  content: "";
  width: 6px;
  height: 24px;
  flex: 0 0 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary-2), #06b6d4);
  box-shadow: 0 4px 14px rgba(79, 70, 229, .3);
}
h2 {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}
p { line-height: 1.65; }
.muted { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cards a.card { display: block; color: inherit; text-decoration: none; }
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  opacity: .95;
}
.cards .card:nth-child(2)::before { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.cards .card:nth-child(3)::before { background: linear-gradient(90deg, #0ea5e9, #22d3ee); }
.cards .card:nth-child(4)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.cards .card:nth-child(5)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.cards .card:nth-child(6)::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(99, 102, 241, .22); }
.card .num {
  margin-top: 7px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.card .muted { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; font-weight: 700; }
.card.alert { border-color: #fbbf24; background: linear-gradient(180deg, #fffbeb 0%, var(--surface) 70%); }
.clickable-card { cursor: pointer; }
.clickable-card:focus-visible { outline: 3px solid rgba(79, 70, 229, .45); outline-offset: 2px; }
.global-search { display: flex; gap: 6px; margin: 0 8px 2px; }
.global-search input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, .3); background: rgba(255, 255, 255, .07);
  color: #e2e8f0; font-size: 12px; outline: none;
}
.global-search input::placeholder { color: #94a3b8; }
.global-search input:focus { border-color: rgba(129, 140, 248, .75); background: rgba(255, 255, 255, .1); }
.global-search button {
  border: 0; border-radius: 9px; padding: 8px 10px; cursor: pointer;
  background: rgba(99, 102, 241, .9); color: #fff; font-size: 12px; font-weight: 700;
}
.global-search button:hover { background: #6366f1; }
@media (prefers-color-scheme: dark) {
  .card.alert { background: linear-gradient(180deg, rgba(245, 158, 11, .16) 0%, var(--surface) 70%); border-color: rgba(245, 158, 11, .4); }
}

.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 8px 0 4px;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  background: var(--surface);
}
.table-wrap table { min-width: 680px; }
@media (max-width: 900px) { .table-wrap table { min-width: 620px; } }
th {
  padding: 12px 16px;
  text-align: left;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover td { background: var(--surface-2); }
td code, .code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 7px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, border-color .15s ease;
}
.btn:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(79, 70, 229, .30);
  filter: saturate(1.06);
}
.btn:active { transform: translateY(0); }
.btn.gray {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn.gray:hover { color: var(--primary); border-color: rgba(99, 102, 241, .35); box-shadow: var(--shadow-sm); }
.btn.red {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 6px 16px rgba(220, 38, 38, .22);
}
.btn.red:hover { box-shadow: 0 10px 22px rgba(220, 38, 38, .3); }
.btn.small { padding: 7px 11px; border-radius: 8px; font-size: 12px; box-shadow: none; }
.btn.small:hover { box-shadow: var(--shadow-sm); }
td form { display: inline; }
td .btn { margin: 2px 3px 2px 0; }
form.inline { display: inline; }

/* ---------- forms ---------- */
input, select, textarea {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
::placeholder { color: var(--muted); opacity: .8; }
select { cursor: pointer; }
label { font-size: 13px; font-weight: 600; color: var(--text); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}
.badge.green { background: rgba(16, 185, 129, .12); color: #047857; border-color: rgba(16, 185, 129, .24); }
.badge.red { background: rgba(239, 68, 68, .12); color: #b91c1c; border-color: rgba(239, 68, 68, .22); }
.badge.orange { background: rgba(245, 158, 11, .14); color: #b45309; border-color: rgba(245, 158, 11, .26); }
.badge.blue { background: rgba(37, 99, 235, .12); color: #1d4ed8; border-color: rgba(37, 99, 235, .22); }
@media (prefers-color-scheme: dark) {
  .badge.green { color: #6ee7b7; }
  .badge.red { color: #fca5a5; }
  .badge.orange { color: #fcd34d; }
  .badge.blue { color: #93c5fd; }
}

/* ---------- notices / kv ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, .30);
  background: linear-gradient(90deg, rgba(245, 158, 11, .12), rgba(245, 158, 11, .04));
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
}
.notice:hover { background: linear-gradient(90deg, rgba(245, 158, 11, .18), rgba(245, 158, 11, .06)); color: #92400e; }
@media (prefers-color-scheme: dark) { .notice { color: #fcd34d; } }

.kv {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border);
}
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); min-width: 110px; flex: 0 0 auto; }
.kv .v { color: var(--text); word-break: break-all; }

/* ---------- login ---------- */
.login-body { background: var(--bg-grad); }
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  pointer-events: none;
}
.login-page::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(99, 102, 241, .45), transparent 70%);
  top: -120px;
  left: -80px;
}
.login-page::after {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(6, 182, 212, .35), transparent 70%);
  bottom: -140px;
  right: -60px;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 404px;
  padding: 34px 32px 28px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .65);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow-lg);
}
@media (prefers-color-scheme: dark) {
  .login-card { background: rgba(15, 23, 42, .82); border-color: rgba(148, 163, 184, .18); }
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-card .brand-name { color: var(--text); }
.login-card .brand-sub { color: var(--muted); }
.login-card h1 { font-size: 24px; margin: 0 0 6px; }
.login-card h1::before { display: none; }
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.login-card input { width: 100%; padding: 12px 14px; font-size: 14px; }
.login-btn { width: 100%; margin-top: 22px; padding: 12px; font-size: 14px; border-radius: 11px; }
.login-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, .25);
  background: rgba(239, 68, 68, .09);
  color: #b91c1c;
  font-size: 13px;
}
@media (prefers-color-scheme: dark) { .login-error { color: #fca5a5; } }
.login-foot { margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal[hidden] { display: none; }
body:has(.modal:not([hidden])) { overflow: hidden; }
.modal-card {
  width: 100%;
  max-width: 720px;
  max-height: 82vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: 0; }

/* ---------- user role cards ---------- */
.role-tabs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.role-tabs h1 { margin: 0 8px 0 0; }
.role-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.role-card:hover {
  color: var(--text);
  border-color: rgba(99, 102, 241, .35);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.role-card .label { color: var(--muted); }
.role-card .count {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.role-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(6, 182, 212, .06));
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .10), var(--shadow-sm);
}

/* ---------- team stats role chooser ---------- */
.team-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin-top: 18px;
}
.team-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.team-choice:hover {
  color: var(--text);
  border-color: rgba(99, 102, 241, .38);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.team-choice.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(6, 182, 212, .06));
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .10), var(--shadow-sm);
}
.team-choice-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .2px;
}
.team-choice-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.team-choice-arrow {
  margin-top: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 640px) {
  .team-choice-grid { grid-template-columns: 1fr; }
}

/* ---------- relay chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 24px; }
.chat-row { display: flex; flex-direction: column; max-width: 76%; }
.chat-row.left { align-self: flex-start; }
.chat-row.right { align-self: flex-end; align-items: flex-end; }
.chat-meta { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.chat-bubble {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}
.chat-row.right .chat-bubble {
  border-color: rgba(99, 102, 241, .25);
  background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(6, 182, 212, .06));
}
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-bubble img {
  display: block;
  max-width: 240px;
  max-height: 240px;
  margin-top: 6px;
  border-radius: 10px;
  object-fit: cover;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    flex: none;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .brand { padding: 0 6px 0 0; flex: 0 0 auto; }
  .brand-sub, .brand-name { display: none; }
  .brand-mark { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; font-size: 15px; }
  .nav { flex-direction: row; gap: 6px; }
  .nav-group { flex-direction: row; gap: 6px; }
  .nav-label { display: none; }
  .nav a { white-space: nowrap; padding: 8px 10px; font-size: 12.5px; gap: 7px; }
  .nav a .dot { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex: 0 0 auto; }
  .sidebar-user { padding: 0 4px; gap: 8px; white-space: nowrap; }
  .main { padding: 20px 14px 44px; }
  h1 { font-size: 21px; margin-bottom: 16px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .card { padding: 15px; }
  .card .num { font-size: 25px; }
  .table-wrap { border-radius: 12px; }
  th, td { padding: 10px 12px; }
}


/* ---------- role view chrome ---------- */
.brand-role {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.view-switch {
  display: block;
  margin: 8px 4px 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}
.view-switch:hover {
  color: var(--text);
  border-color: rgba(99, 102, 241, .35);
}
.nav-global {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.page-topbar {
  margin-bottom: 14px;
}
