/* XAWS dashboard & console — compact enterprise UI. Radius ≤ 6px, 1px borders, no decorative shadows. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#fafafa, #0b0b0c);
  --surface: light-dark(#ffffff, #121214);
  --subtle: light-dark(#f4f4f5, #18181b);
  --hover: light-dark(#f4f4f5, #1c1c1f);
  --border: light-dark(#e4e4e7, #27272a);
  --border-strong: light-dark(#d4d4d8, #3f3f46);
  --ink: light-dark(#18181b, #f4f4f5);
  --ink-2: light-dark(#3f3f46, #d4d4d8);
  --muted: light-dark(#71717a, #a1a1aa);
  --primary: light-dark(#18181b, #fafafa);
  --primary-ink: light-dark(#ffffff, #18181b);
  --link: light-dark(#2563eb, #60a5fa);
  --focus: light-dark(#2563eb, #60a5fa);
  --ok: light-dark(#15803d, #4ade80);
  --ok-bg: light-dark(#f0fdf4, #052e16);
  --ok-bd: light-dark(#bbf7d0, #14532d);
  --bad: light-dark(#b91c1c, #f87171);
  --bad-bg: light-dark(#fef2f2, #2a0a0a);
  --bad-bd: light-dark(#fecaca, #7f1d1d);
  --warn: light-dark(#a16207, #facc15);
  --warn-bg: light-dark(#fefce8, #2a2205);
  --warn-bd: light-dark(#fde68a, #713f12);
  --info: light-dark(#1d4ed8, #93c5fd);
  --info-bg: light-dark(#eff6ff, #0b1a33);
  --info-bd: light-dark(#bfdbfe, #1e3a8a);
  --brand: light-dark(#0f5132, #34d399);
  --logo-ink: light-dark(#ffffff, #0b0b0c);
  --r: 6px;
  --r-sm: 4px;
  --side: 232px;
  font: 14px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.console { --brand: light-dark(#1e40af, #93c5fd); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
h1, h2, h3, p { margin: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { flex: none; vertical-align: -3px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; letter-spacing: .01em; }
.brand b { font-weight: 650; }
.logo { color: var(--brand); fill: var(--logo-ink); }
.env { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); border: 1px solid currentColor; border-radius: var(--r-sm); padding: 0 5px; line-height: 16px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); }
.side-brand { display: flex; align-items: center; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.side-brand:hover { text-decoration: none; }
.side-nav { display: grid; gap: 1px; padding: 8px; flex: 1; align-content: start; }
.side-nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r); color: var(--ink-2); font-weight: 500; }
.side-nav a .i { color: var(--muted); }
.side-nav a:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--subtle); color: var(--ink); }
.side-nav a[aria-current="page"] .i { color: var(--ink); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.avatar { width: 28px; height: 28px; flex: none; border-radius: var(--r); background: var(--subtle); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.who { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.who b { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid transparent; border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.bar { height: 48px; display: flex; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 1; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs .sep { color: var(--border-strong); }
.crumbs [aria-current] { color: var(--ink); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 20px 24px 48px; max-width: 1160px; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ph h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.ph p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.panel-h h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.panel-h h2 .i { color: var(--muted); }
.panel-b { padding: 14px; }
.panel-flush { overflow-x: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }

/* KPI strip: one bordered row of cells */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.kpi { padding: 12px 14px; border-right: 1px solid var(--border); margin-right: -1px; }
.kpi span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.kpi b { display: block; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -.01em; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 550; font-size: 12px; color: var(--muted); background: var(--subtle); padding: 0 14px; height: 32px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 0 14px; height: 40px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
td .sub.mono { font-size: 11.5px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td a.strong { color: var(--ink); font-weight: 550; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- Key / value ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 550; border: 1px solid var(--border); color: var(--ink-2); background: var(--subtle); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bd); }
.pill.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-bd); }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.pill.info { color: var(--info); background: var(--info-bg); border-color: var(--info-bd); }
.pill.plain::before { display: none; }

/* ---------- Notes ---------- */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid; border-radius: var(--r); font-size: 13px; }
.note .i { margin-top: 1px; }
.note > div { flex: 1; }
.note.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bd); }
.note.err { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-bd); }
.note.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.note.info { color: var(--info); background: var(--info-bg); border-color: var(--info-bd); }
.note .btn { margin-left: auto; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad-bd); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn .i { color: currentColor; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }
.actions { display: grid; gap: 8px; }
.actions form { display: flex; }
.actions .btn { width: 100%; justify-content: flex-start; }

/* ---------- Forms ---------- */
form.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); height: 34px; padding: 0 10px; width: 100%; }
select { padding-right: 6px; }
input:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.form-narrow { max-width: 420px; }
.search { position: relative; display: flex; align-items: center; width: 280px; max-width: 100%; }
.search .i { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 32px; height: 32px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.toolbar .count { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Empty ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .i { color: var(--muted); }
.empty b { color: var(--ink); font-weight: 600; font-size: 14px; }
.empty .btn { margin-top: 6px; }

/* ---------- Checklist ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.steps li:last-child { border-bottom: 0; }
.steps li .i { color: var(--muted); }
.steps li .pill { margin-left: auto; }
.steps li > span:not(.pill):not(.step-end) { display: grid; min-width: 0; }
.steps .sub { font-size: 12px; line-height: 1.3; }
.steps li:has(.sub) { height: auto; padding-top: 8px; padding-bottom: 8px; }

/* ---------- Auth ---------- */
.auth { max-width: 380px; margin: 0 auto; padding: 56px 16px 32px; display: grid; gap: 14px; }
.auth-brand { justify-self: center; margin-bottom: 6px; }
.auth-brand:hover { text-decoration: none; }
.auth h1 { font-size: 18px; font-weight: 650; text-align: center; }
.auth .panel-b { padding: 18px; }
.auth .foot { text-align: center; font-size: 13px; color: var(--muted); }
.auth .split { display: flex; justify-content: space-between; font-size: 13px; }
.btn.google { gap: 8px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-brand { border-bottom: 0; height: 44px; flex: 1; }
  .side-user { border-top: 0; padding: 6px 12px; order: 2; }
  .side-user .who { display: none; }
  .side-nav { order: 3; flex: 1 1 100%; display: flex; overflow-x: auto; padding: 0 8px 8px; gap: 2px; align-content: normal; }
  .side-nav a { flex: none; height: 30px; }
  .bar { height: 40px; padding: 0 16px; position: static; }
  .content { padding: 16px 16px 40px; }
  .search { width: 100%; }
  th, td { padding: 0 10px; }
  .hide-sm { display: none; }
}
.hint { font-size: 12.5px; color: var(--muted); }
.step-end { margin-left: auto; gap: 8px; flex-wrap: nowrap; }
