/* System: spacing 4/8/12/16/24/32, radii 6/10, text 12/14/18 (+24 for titles). */
:root {
  --bg: #f6f5f1; --panel: #ffffff; --sunken: #efede7; --stripe: #faf9f6;
  --ink: #1d1d1b; --muted: #66655f; --faint: #85837c; --line: #e3e1da;
  --accent: #1f5f4a; --accent-hover: #174a39; --accent-soft: #e3eee8; --on-accent: #ffffff;
  --warn: #8a5a00; --warn-soft: #fbf1dc; --bad: #a12c2c; --bad-soft: #fbe6e4; --ok: #2f7a4f;
  --r-sm: 6px; --r-lg: 10px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .06);
  --shadow-3: 0 12px 32px rgb(0 0 0 / .14), 0 2px 6px rgb(0 0 0 / .08);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --topbar: 52px; --sidebar: 300px; --detail: 480px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151614; --panel: #1d1e1b; --sunken: #262723; --stripe: #20211e;
    --ink: #ecebe6; --muted: #a3a19a; --faint: #7f7d76; --line: #34352f;
    --accent: #7cc4a6; --accent-hover: #95d3b9; --accent-soft: #22352d; --on-accent: #0f1a15;
    --warn: #e3b25a; --warn-soft: #3a2f1b; --bad: #f08a8a; --bad-soft: #3d2222; --ok: #7cc4a6;
    --shadow-3: 0 12px 32px rgb(0 0 0 / .5);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.gated .sidebar, body.gated .fab-filters, body.gated #statusMenu, body.gated .topnav, body.gated .reports-page, body.gated .crm-page { display: none !important; }
body.reports-view:not(.gated) .layout, body.reports-view .fab-filters { display: none !important; }
body.gated .layout { grid-template-columns: 1fr; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.only-mobile { display: none !important; }
@media (max-width: 900px) { .only-desktop { display: none !important; } }

/* --- buttons --------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s4);
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--panel); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-1); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--sunken); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm);
  border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }

.skip-link { position: absolute; left: var(--s4); top: -100px; z-index: 100; padding: var(--s2) var(--s4); border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent); font-weight: 600; }
.skip-link:focus { top: var(--s2); }
/* the CRM's dialogs are in every page but their components load only on /crm: until then they must not show as text */
wa-dialog:not(:defined), wa-drawer:not(:defined) { display: none; }
