/* =============================================
   AGENTLOG — Design System
   Warm off-white surfaces. IBM Plex Sans.
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg:        #f9f9f6;
  --surface:   #ffffff;
  --surface-2: #f3f1ea;
  --ink:       #0c0e12;
  --ink-2:     #2b2f38;
  --muted:     #6b7180;
  --muted-2:   #9aa0ad;
  --border:    #e7e3d8;
  --border-2:  #d5d0c2;
  --hairline:  #efebe1;

  --brand:        #5b4fcf;
  --brand-ink:    #3d32b0;
  --brand-soft:   #eeecfb;
  --success:      #1f8a5b;
  --success-soft: #e3f3ec;
  --warn:         #d97757;
  --warn-soft:    #fbece4;
  --danger:       #b8341f;
  --danger-soft:  #f6e1dc;
  --gold:         #b48933;
  --gold-soft:    #fdf3e0;

  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 0 rgba(12,14,18,.04), 0 1px 2px rgba(12,14,18,.04);
  --shadow:    0 1px 0 rgba(12,14,18,.04), 0 4px 14px -4px rgba(12,14,18,.08);
  --shadow-lg: 0 1px 0 rgba(12,14,18,.04), 0 24px 60px -20px rgba(12,14,18,.18);

  --maxw: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: "ss01","cv11","tnum","zero";
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
}
h1, h2, h3, h4 { letter-spacing: -0.02em; margin: 0; font-weight: 600; }
h1 { font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(26px, 3vw, 42px); line-height: 1.08; letter-spacing: -0.028em; }
h3 { font-size: clamp(18px, 2vw, 24px); line-height: 1.2; }
h4 { font-size: 15px; line-height: 1.3; }
p  { margin: 0; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-10 { gap: 40px; }
.between { justify-content: space-between; } .center { align-items: center; }
.middle { justify-content: center; align-items: center; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.brand svg { flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 7px 11px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
  transition: all .15s ease; background: transparent; color: var(--ink);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary {
  background: var(--ink); color: white; border-color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, var(--shadow-sm);
}
.btn.primary:hover { background: #181b22; }
.btn.brand { background: var(--brand); color: white; border-color: var(--brand); }
.btn.brand:hover { background: var(--brand-ink); }
.btn.outline { border-color: var(--border-2); background: var(--surface); }
.btn.outline:hover { background: var(--surface-2); }
.btn.danger-outline { border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); background: var(--surface); }
.btn.danger-outline:hover { background: var(--danger-soft); }
.btn.lg { padding: 13px 20px; font-size: 15px; border-radius: var(--r); }
.btn.sm { padding: 5px 9px; font-size: 12.5px; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Chips / Badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11.5px; color: var(--ink-2); font-weight: 500;
}
.chip.success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.chip.warn    { background: var(--warn-soft);    color: var(--warn);    border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.chip.danger  { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.chip.brand   { background: var(--brand-soft);   color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.chip.gold    { background: var(--gold-soft);    color: var(--gold);    border-color: color-mix(in srgb, var(--gold) 25%, transparent); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.pulse { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- Risk badges ---------- */
.risk {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 10.5px;
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.risk.critical { background: var(--danger-soft);  color: var(--danger); }
.risk.high     { background: var(--warn-soft);    color: var(--warn); }
.risk.medium   { background: var(--gold-soft);    color: var(--gold); }
.risk.low      { background: var(--success-soft); color: var(--success); }
.risk .dot { width: 5px; height: 5px; }

/* ---------- Platform tags ---------- */
.platform {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-xs);
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); font-weight: 500;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card.flat { box-shadow: none; }
.card.padded { padding: 24px; }
.divider { height: 1px; background: var(--hairline); border: 0; }

/* ---------- Marketing hero ---------- */
.hero { padding: 72px 0 48px; position: relative; }
.hero-sub { color: var(--muted); font-size: 18px; max-width: 580px; margin-top: 16px; line-height: 1.55; }
.hero-cta { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 20px; margin-top: 24px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.hero-meta .item { display: flex; align-items: center; gap: 7px; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section.tight { padding: 48px 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head h2 { margin-top: 10px; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 17px; line-height: 1.55; }
.section.dark { background: #0c0e12; color: #e7e8ec; }
.section.dark .eyebrow { color: #8b919c; }
.section.dark h2, .section.dark h3 { color: white; }

/* ---------- Footer ---------- */
footer.foot {
  padding: 60px 0 36px; border-top: 1px solid var(--hairline);
  background: var(--surface-2);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 36px; }
.foot-col h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.foot-col a { display: block; padding: 5px 0; color: var(--ink-2); font-size: 13.5px; }
.foot-col a:hover { color: var(--brand); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; background: var(--bg); }
.sidebar {
  background: var(--surface-2); border-right: 1px solid var(--border);
  padding: 16px 12px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.sb-brand { display: flex; align-items: center; gap: 9px; padding: 6px 10px; font-weight: 600; font-size: 15px; }
.sb-section { margin-top: 22px; }
.sb-section h6 { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 10px 7px; font-weight: 600; }
.sb-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; font-size: 13px; color: var(--ink-2);
  border-radius: var(--r-sm); margin-bottom: 1px;
  transition: background .1s, color .1s;
}
.sb-link:hover { background: white; color: var(--ink); }
.sb-link.active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }
.sb-link svg { width: 15px; height: 15px; opacity: .75; flex-shrink: 0; }
.sb-link.active svg { opacity: 1; }
.sb-link .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.sb-link.active .count { color: var(--brand); }
.sb-footer { margin-top: auto; padding-top: 16px; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--hairline);
  background: var(--bg); position: sticky; top: 0; z-index: 30;
}
.app-topbar .crumbs { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.app-topbar .crumbs strong { color: var(--ink); font-weight: 500; }
.app-content { padding: 24px; flex: 1; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; font-weight: 500; font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 11px 13px; border-bottom: 1px solid var(--border);
}
.table tbody td { padding: 13px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.table.dense tbody td { padding: 9px 13px; }
.table .num { font-family: var(--font-mono); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.input, .select, .textarea {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 9px 11px; font-size: 13.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.textarea { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
.toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border-2);
  border-radius: 999px; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; background: white; border-radius: 50%;
  transition: .2s; box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---------- Bars ---------- */
.bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar.success > span { background: var(--success); }
.bar.warn > span    { background: var(--warn); }
.bar.danger > span  { background: var(--danger); }

/* ---------- KPI cards ---------- */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
}
.kpi .l { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.kpi .n { font-family: var(--font-mono); font-size: 26px; margin-top: 6px; letter-spacing: -.01em; }
.kpi .d { font-size: 11.5px; font-family: var(--font-mono); margin-top: 3px; }
.kpi .d.up { color: var(--success); }
.kpi .d.down { color: var(--danger); }
.kpi .d.warn { color: var(--warn); }

/* ---------- Tabs ---------- */
.tab-bar {
  display: flex; align-items: center; gap: 2px;
  border-bottom: 1px solid var(--border); padding-bottom: 0; margin-bottom: 20px;
}
.tab-bar button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 9px 14px; font-size: 13.5px; color: var(--muted); font-weight: 500;
  margin-bottom: -1px; cursor: pointer; transition: color .12s;
  font-family: inherit;
}
.tab-bar button:hover { color: var(--ink); }
.tab-bar button.on { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Seg control ---------- */
.seg {
  display: inline-flex; padding: 3px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm); gap: 2px;
}
.seg button {
  background: transparent; border: 0; padding: 5px 11px;
  font-size: 12.5px; color: var(--muted); font-weight: 500;
  border-radius: var(--r-xs); font-family: inherit;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Code block ---------- */
.code-block {
  background: #0c0e12; color: #cdd3de;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.code-block .cb-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--font-mono); font-size: 11px; color: #6b7280;
  letter-spacing: .04em;
}
.code-block pre {
  margin: 0; padding: 20px;
  font-family: var(--font-mono); font-size: 12.5px;
  line-height: 1.7; overflow-x: auto;
}
.code-block .kw { color: #b78bfa; }
.code-block .str { color: #86efac; }
.code-block .cm { color: #4b5563; }
.code-block .fn { color: #7dd3fc; }
.code-block .num { color: #fdba74; }
.code-block .key { color: #f9a8d4; }

/* ---------- Event log row ---------- */
.event-row {
  display: grid;
  grid-template-columns: 130px 90px 1fr 100px 80px 40px;
  gap: 12px; align-items: center;
  padding: 11px 16px; border-bottom: 1px solid var(--hairline);
  font-size: 13px; transition: background .1s;
}
.event-row:hover { background: var(--surface-2); cursor: pointer; }
.event-row .time { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.event-row .action { font-weight: 500; }
.event-row .meta { color: var(--muted); font-size: 12.5px; }

/* ---------- Docs layout ---------- */
.docs-layout {
  display: grid; grid-template-columns: 220px 1fr 200px;
  gap: 0; min-height: 100vh;
}
.docs-sidebar {
  background: var(--surface-2); border-right: 1px solid var(--border);
  padding: 24px 14px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.docs-sidebar .ds-section { margin-bottom: 20px; }
.docs-sidebar .ds-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 10px; margin-bottom: 6px;
}
.docs-sidebar a {
  display: block; padding: 6px 10px;
  font-size: 13px; color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: background .1s, color .1s;
}
.docs-sidebar a:hover { background: var(--surface); color: var(--ink); }
.docs-sidebar a.active { background: var(--surface); color: var(--ink); font-weight: 500; }
.docs-main { padding: 40px 48px; max-width: 780px; }
.docs-toc {
  padding: 24px 16px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  border-left: 1px solid var(--hairline);
}
.docs-toc .dt-title { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.docs-toc a { display: block; padding: 4px 0; font-size: 12.5px; color: var(--muted); }
.docs-toc a:hover { color: var(--ink); }

/* Docs content typography */
.doc-content h1 { font-size: 30px; margin-bottom: 10px; }
.doc-content h2 { font-size: 21px; margin: 36px 0 12px; padding-top: 36px; border-top: 1px solid var(--hairline); }
.doc-content h3 { font-size: 16px; margin: 24px 0 8px; }
.doc-content p { color: var(--ink-2); line-height: 1.65; margin-bottom: 16px; font-size: 15px; }
.doc-content ul, .doc-content ol { padding-left: 22px; color: var(--ink-2); font-size: 15px; line-height: 1.65; margin-bottom: 16px; }
.doc-content li { margin-bottom: 6px; }
.doc-content code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; color: var(--ink);
}
.doc-content table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 16px; }
.doc-content table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.doc-content table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
.doc-content .callout { padding: 14px 16px; border-radius: var(--r); margin-bottom: 16px; font-size: 14px; }
.doc-content .callout.info { background: var(--brand-soft); border-left: 3px solid var(--brand); color: var(--brand-ink); }
.doc-content .callout.warn { background: var(--warn-soft); border-left: 3px solid var(--warn); color: #7a4520; }
.doc-content .callout.tip  { background: var(--success-soft); border-left: 3px solid var(--success); color: #0f5035; }

/* ---------- Misc ---------- */
.kbd {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--muted);
}
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }

.placeholder {
  background: repeating-linear-gradient(45deg,var(--surface-2),var(--surface-2) 10px,var(--bg) 10px,var(--bg) 20px);
  border: 1px solid var(--border); border-radius: var(--r);
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; min-height: 160px;
}

/* ---------- Tweaks panel container ---------- */
.tweaks-anchor { position: fixed; right: 18px; bottom: 18px; z-index: 100; }

/* ---------- Onboarding ---------- */
.onb-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 32px;
}
.onb-card {
  width: 100%; max-width: 520px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 40px;
}
.onb-steps {
  display: flex; gap: 6px; margin-bottom: 32px;
}
.onb-step {
  flex: 1; height: 3px; border-radius: 99px;
  background: var(--border);
}
.onb-step.done { background: var(--brand); }
.onb-step.active { background: var(--ink); }

/* ---------- Auth pages ---------- */
.auth-shell {
  min-height: 100vh; display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: var(--ink); color: white;
  display: flex; flex-direction: column;
  justify-content: center; padding: 64px;
}
.auth-right {
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}
.auth-form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 24px; margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Admin ---------- */
.admin-app { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: #0c0e12; color: #c9cdd6;
  padding: 16px 12px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.admin-sb-brand { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-weight: 600; font-size: 14px; color: white; margin-bottom: 20px; }
.admin-sb-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; font-size: 12.5px; color: #8b919c;
  border-radius: var(--r-sm); margin-bottom: 1px; transition: all .1s;
}
.admin-sb-link:hover { background: rgba(255,255,255,.06); color: #c9cdd6; }
.admin-sb-link.active { background: rgba(255,255,255,.1); color: white; }
.admin-sb-link svg { width: 14px; height: 14px; opacity: .7; }
.admin-sb-section { font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #4b5563; padding: 12px 10px 5px; }

/* ---------- Settings layout ---------- */
.set-layout { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; max-width: 820px; }
.set-nav { position: sticky; top: 76px; }
.set-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: background .1s, color .1s;
}
.set-nav a:hover { background: var(--surface-2); color: var(--ink); }
.set-nav a.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.set-nav a svg { opacity: .55; flex-shrink: 0; }
.set-nav a.active svg { opacity: 1; }
.set-nav .nav-section { font-size: 10px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; font-weight: 700; padding: 13px 11px 5px; }
.set-panel { display: none; flex-direction: column; gap: 20px; }
.set-panel.active { display: flex; }
.set-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.set-card-head {
  padding: 16px 22px 14px; border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center;
}
.set-card-head h3 { font-size: 13.5px; font-weight: 600; }
.set-card-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.set-card-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.set-card .field label { font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.set-card .field input, .set-card .field select, .set-card .field textarea {
  padding: 9px 11px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink); background: var(--surface); width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.set-card .field input:focus, .set-card .field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.danger-zone { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.danger-zone .set-card-head { border-bottom-color: color-mix(in srgb, var(--danger) 15%, transparent); }
.danger-zone .set-card-head h3 { color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .foot-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .docs-toc { display: none; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
}
