/* Calendars hub - design system (CAL-3).
   The light "Accountant hub" look: sidebar, topbar, KPI cards, full width.
   Dark mode via colour tokens (system preference, with a manual override on
   <html data-theme>). Responsive down to a phone. */

:root {
  --bg:#f5f6f8; --surface:#ffffff; --surface-2:#fafbfc; --raised:#ffffff;
  --ink:#111827; --ink-2:#374151; --muted:#6b7280; --faint:#9ca3af;
  --line:#e5e7eb; --line-2:#eef0f3; --field:#ffffff;
  --brand:#4f46e5; --brand-ink:#ffffff; --brand-soft:rgba(79,70,229,.10);
  --ok:#047857; --ok-soft:#ecfdf5; --ok-line:#a7f3d0;
  --warn:#b45309; --warn-soft:#fffbeb; --warn-line:#fde68a;
  --bad:#b91c1c; --bad-soft:#fef2f2; --bad-line:#fecaca;
  --info:#1d4ed8; --info-soft:#eff6ff; --info-line:#bfdbfe;
  --shadow-sm:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-md:0 4px 12px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);
  --shadow-lg:0 18px 48px rgba(16,24,40,.22);
  --radius:14px; --radius-sm:10px; --radius-xs:8px;
  --sidebar:252px; --topbar:62px;
  --t:160ms cubic-bezier(.2,.6,.2,1);
}
html[data-theme="dark"], :root.dark {
  color-scheme: dark;
}
html[data-theme="dark"] {
  --bg:#0a0e16; --surface:#0f1420; --surface-2:#0c1119; --raised:#131a28;
  --ink:#e5e7eb; --ink-2:#cbd2dc; --muted:#94a0b0; --faint:#6b7685;
  --line:#1e2635; --line-2:#1a2130; --field:#0c1119;
  --brand:#6366f1; --brand-ink:#ffffff; --brand-soft:rgba(99,102,241,.16);
  --ok:#34d399; --ok-soft:#0c1f1a; --ok-line:#14402f;
  --warn:#fbbf24; --warn-soft:#241c07; --warn-line:#45360f;
  --bad:#f87171; --bad-soft:#241212; --bad-line:#4a1d1d;
  --info:#93c5fd; --info-soft:#0e1a2e; --info-line:#1e3356;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 6px 18px rgba(0,0,0,.5);
  --shadow-lg:0 20px 52px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:#0a0e16; --surface:#0f1420; --surface-2:#0c1119; --raised:#131a28;
    --ink:#e5e7eb; --ink-2:#cbd2dc; --muted:#94a0b0; --faint:#6b7685;
    --line:#1e2635; --line-2:#1a2130; --field:#0c1119;
    --brand:#6366f1; --brand-ink:#ffffff; --brand-soft:rgba(99,102,241,.16);
    --ok:#34d399; --ok-soft:#0c1f1a; --ok-line:#14402f;
    --warn:#fbbf24; --warn-soft:#241c07; --warn-line:#45360f;
    --bad:#f87171; --bad-soft:#241212; --bad-line:#4a1d1d;
    --info:#93c5fd; --info-soft:#0e1a2e; --info-line:#1e3356;
    --shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --shadow-md:0 6px 18px rgba(0,0,0,.5);
    --shadow-lg:0 20px 52px rgba(0,0,0,.6);
  }
}

* { box-sizing:border-box; }
html, body { height:100%; }
body {
  margin:0; background:var(--bg); color:var(--ink);
  font:15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
}
a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }
h1,h2,h3,h4 { margin:0; font-weight:650; letter-spacing:-.01em; }
button { font:inherit; }
::selection { background:var(--brand-soft); }

.boot { min-height:100vh; display:flex; align-items:center; justify-content:center; gap:12px; color:var(--muted); }
.boot-dot { width:14px; height:14px; border-radius:50%; background:var(--brand); animation:pulse 1s infinite ease-in-out; }
@keyframes pulse { 0%,100%{ opacity:.35; transform:scale(.8);} 50%{ opacity:1; transform:scale(1);} }

/* ---------- Sign-in screen (signed out) ---------- */
.auth { min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:40px; max-width:440px; width:100%; box-shadow:var(--shadow-md); text-align:center; }
.auth-logo { width:46px; height:46px; border-radius:12px; background:var(--brand); color:#fff;
  display:grid; place-items:center; font-weight:700; margin:0 auto 16px; font-size:20px; }
.auth-card h1 { font-size:22px; margin-bottom:4px; }
.auth-sub { color:var(--muted); margin:0 0 22px; font-size:14px; }
.auth-notice { margin:0 0 18px; padding:12px 14px; border-radius:var(--radius-sm); text-align:left; font-size:14px;
  background:var(--bad-soft); border:1px solid var(--bad-line); color:var(--bad); }
.auth-notice b { font-weight:700; }
.btn-google { display:inline-flex; align-items:center; gap:10px; margin-top:8px; padding:11px 18px;
  background:var(--brand); color:#fff; border:0; border-radius:var(--radius-sm); font-weight:600; font-size:15px;
  cursor:pointer; transition:filter var(--t), box-shadow var(--t); }
.btn-google:hover { filter:brightness(1.06); box-shadow:0 2px 12px rgba(79,70,229,.32); text-decoration:none; }
.btn-google svg { width:18px; height:18px; background:#fff; border-radius:3px; padding:1px; }

/* ---------- App shell ---------- */
.shell { display:grid; grid-template-columns:var(--sidebar) 1fr; min-height:100vh; }
.sidebar { background:var(--surface); border-right:1px solid var(--line); display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; }
.brand { display:flex; align-items:center; gap:11px; padding:0 18px; height:var(--topbar);
  border-bottom:1px solid var(--line-2); }
.brand .mark { width:30px; height:30px; border-radius:9px; background:var(--brand); color:#fff;
  display:grid; place-items:center; font-weight:700; font-size:16px; flex:none; }
.brand .name { font-weight:700; letter-spacing:-.01em; }
.brand .tag { font-size:11px; color:var(--faint); }
.nav { padding:12px 10px; display:flex; flex-direction:column; gap:2px; overflow:auto; flex:1; }
.nav-h { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--faint); padding:14px 12px 6px; }
.nav a { display:flex; align-items:center; gap:11px; padding:9px 12px; border-radius:var(--radius-sm);
  color:var(--ink-2); font-weight:550; font-size:14.5px; transition:background var(--t), color var(--t); }
.nav a:hover { background:var(--surface-2); text-decoration:none; color:var(--ink); }
.nav a.active { background:var(--brand-soft); color:var(--brand); }
.nav a svg { width:18px; height:18px; flex:none; }
.nav .count { margin-left:auto; font-size:12px; color:var(--faint); background:var(--surface-2);
  border:1px solid var(--line-2); border-radius:999px; padding:1px 8px; }
.side-foot { border-top:1px solid var(--line-2); padding:12px 16px; font-size:12px; color:var(--faint); }

.main { min-width:0; display:flex; flex-direction:column; }
.topbar { height:var(--topbar); position:sticky; top:0; z-index:30; background:color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter:saturate(1.3) blur(8px); border-bottom:1px solid var(--line); display:flex; align-items:center;
  gap:14px; padding:0 22px; }
.hamburger { display:none; background:transparent; border:1px solid var(--line); color:var(--ink);
  border-radius:9px; width:38px; height:38px; cursor:pointer; align-items:center; justify-content:center; }
.topbar .title { font-size:18px; font-weight:650; }
.topbar .sub { color:var(--faint); font-size:13px; }
.topbar .spacer { flex:1; }
.icon-btn { background:transparent; border:1px solid var(--line); color:var(--ink-2); border-radius:10px;
  width:38px; height:38px; display:grid; place-items:center; cursor:pointer; transition:background var(--t), color var(--t); }
.icon-btn:hover { background:var(--surface-2); color:var(--ink); }
.icon-btn svg { width:18px; height:18px; }
.usermenu { position:relative; }
.user-btn { display:flex; align-items:center; gap:9px; padding:5px 10px 5px 5px; border:1px solid var(--line);
  background:var(--surface); border-radius:999px; cursor:pointer; color:var(--ink); transition:background var(--t); }
.user-btn:hover { background:var(--surface-2); }
.avatar { width:28px; height:28px; border-radius:50%; background:var(--brand); color:#fff; display:grid;
  place-items:center; font-weight:650; font-size:13px; flex:none; }
.user-btn .em { font-size:13.5px; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.menu { position:absolute; right:0; top:46px; min-width:220px; background:var(--raised); border:1px solid var(--line);
  border-radius:12px; box-shadow:var(--shadow-lg); padding:6px; z-index:50; }
.menu .who { padding:10px 12px; border-bottom:1px solid var(--line-2); margin-bottom:6px; }
.menu .who .n { font-weight:600; }
.menu .who .e { font-size:12.5px; color:var(--muted); }
.menu button, .menu a { display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:transparent;
  border:0; padding:9px 12px; border-radius:8px; color:var(--ink-2); cursor:pointer; font-size:14px; }
.menu button:hover, .menu a:hover { background:var(--surface-2); color:var(--ink); text-decoration:none; }
.menu svg { width:16px; height:16px; }

.content { padding:24px 26px 56px; width:100%; }
.page-head { display:flex; align-items:flex-end; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.page-head h2 { font-size:22px; }
.page-head p { margin:3px 0 0; color:var(--muted); font-size:14px; }
.page-head .actions { margin-left:auto; display:flex; gap:10px; flex-wrap:wrap; }

/* ---------- Cards & KPI ---------- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); }
.card-pad { padding:18px 20px; }
.card-h { display:flex; align-items:center; gap:10px; padding:15px 20px; border-bottom:1px solid var(--line-2); }
.card-h h3 { font-size:15px; }
.card-h .spacer { flex:1; }
.kpis { display:grid; grid-template-columns:repeat(4, 1fr); gap:16px; margin-bottom:22px; }
.kpi { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:17px 18px;
  box-shadow:var(--shadow-sm); position:relative; overflow:hidden; transition:transform var(--t), box-shadow var(--t); }
.kpi:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.kpi .ico { width:38px; height:38px; border-radius:11px; display:grid; place-items:center; margin-bottom:12px; }
.kpi .ico svg { width:20px; height:20px; }
.kpi .ico.i-brand { background:var(--brand-soft); color:var(--brand); }
.kpi .ico.i-ok { background:var(--ok-soft); color:var(--ok); }
.kpi .ico.i-info { background:var(--info-soft); color:var(--info); }
.kpi .ico.i-bad { background:var(--bad-soft); color:var(--bad); }
.kpi .label { color:var(--muted); font-size:13px; }
.kpi .value { font-size:28px; font-weight:700; letter-spacing:-.02em; margin-top:2px; }
.kpi .delta { font-size:12px; color:var(--faint); margin-top:2px; }

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }

/* ---------- Buttons ---------- */
.btn { display:inline-flex; align-items:center; gap:8px; padding:9px 15px; border-radius:var(--radius-sm);
  border:1px solid var(--line); background:var(--surface); color:var(--ink); font-weight:600; font-size:14px;
  cursor:pointer; transition:background var(--t), border-color var(--t), box-shadow var(--t), filter var(--t); }
.btn:hover { background:var(--surface-2); text-decoration:none; }
.btn svg { width:16px; height:16px; }
.btn.primary { background:var(--brand); color:var(--brand-ink); border-color:transparent; }
.btn.primary:hover { filter:brightness(1.07); box-shadow:0 2px 12px rgba(79,70,229,.28); }
.btn.sm { padding:6px 11px; font-size:13px; border-radius:9px; }
.btn.danger { color:var(--bad); border-color:var(--bad-line); background:var(--bad-soft); }
.btn.danger:hover { filter:brightness(.98); }
.btn:disabled { opacity:.55; cursor:not-allowed; }
.btn.block { width:100%; justify-content:center; }

/* ---------- Status pills & legend ---------- */
.pill { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px;
  font-size:12.5px; font-weight:600; border:1px solid transparent; white-space:nowrap; }
.pill .dot { width:7px; height:7px; border-radius:50%; background:currentColor; }
.pill.ok { color:var(--ok); background:var(--ok-soft); border-color:var(--ok-line); }
.pill.pending { color:var(--warn); background:var(--warn-soft); border-color:var(--warn-line); }
.pill.bad { color:var(--bad); background:var(--bad-soft); border-color:var(--bad-line); }
.pill.info { color:var(--info); background:var(--info-soft); border-color:var(--info-line); }
.pill.muted { color:var(--muted); background:var(--surface-2); border-color:var(--line); }
.legend { display:flex; gap:16px; flex-wrap:wrap; align-items:center; color:var(--muted); font-size:12.5px; }
.legend .item { display:inline-flex; align-items:center; gap:6px; }
.legend .sw { width:9px; height:9px; border-radius:50%; }

/* ---------- Tables ---------- */
.table-wrap { overflow:auto; }
table.tbl { width:100%; border-collapse:collapse; font-size:14px; }
table.tbl th { text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--faint);
  font-weight:600; padding:11px 16px; border-bottom:1px solid var(--line); position:sticky; top:0; background:var(--surface); }
table.tbl td { padding:12px 16px; border-bottom:1px solid var(--line-2); color:var(--ink-2); vertical-align:middle; }
table.tbl tr:last-child td { border-bottom:0; }
table.tbl tbody tr { transition:background var(--t); }
table.tbl tbody tr.clickable { cursor:pointer; }
table.tbl tbody tr.clickable:hover { background:var(--surface-2); }
.mono { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:13px; }
.muted-id { color:var(--faint); font-size:12.5px; }

/* ---------- Provider logo ---------- */
.logo { width:30px; height:30px; border-radius:8px; flex:none; display:grid; place-items:center; overflow:hidden;
  background:var(--surface-2); border:1px solid var(--line-2); }
.logo svg { width:20px; height:20px; display:block; }
.logo.lg { width:40px; height:40px; border-radius:10px; }
.logo.lg svg { width:26px; height:26px; }
.logo.sm { width:24px; height:24px; border-radius:7px; }
.logo.sm svg { width:16px; height:16px; }
.prov { display:flex; align-items:center; gap:11px; min-width:0; }
.prov .nm { font-weight:600; }
.prov .sub { font-size:12.5px; color:var(--faint); }

/* ---------- Connections grid ---------- */
.conn-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(290px, 1fr)); gap:16px; }
.conn-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px;
  box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:14px; position:relative;
  transition:transform var(--t), box-shadow var(--t), border-color var(--t); }
.conn-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--line); }
.conn-card .top { display:flex; align-items:center; gap:12px; }
.conn-card .top .meta { min-width:0; }
.conn-card .foot { display:flex; align-items:center; gap:10px; margin-top:auto; }
.conn-card .foot .spacer { flex:1; }
.chip { font-size:11.5px; color:var(--muted); background:var(--surface-2); border:1px solid var(--line-2);
  border-radius:999px; padding:2px 9px; font-weight:600; }

/* ---------- Rich dropdown (never a bare select) ---------- */
.rs { position:relative; }
.rs-btn { display:flex; align-items:center; gap:9px; width:100%; min-width:190px; padding:8px 11px; cursor:pointer;
  background:var(--field); border:1px solid var(--line); border-radius:var(--radius-sm); color:var(--ink); text-align:left;
  transition:border-color var(--t), box-shadow var(--t); }
.rs-btn:hover { border-color:var(--brand); }
.rs-btn[aria-expanded="true"] { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.rs-btn .nm { font-weight:550; font-size:14px; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rs-btn .caret { color:var(--faint); transition:transform var(--t); }
.rs-btn[aria-expanded="true"] .caret { transform:rotate(180deg); }
.rs-pop { position:absolute; z-index:60; top:calc(100% + 6px); left:0; right:0; min-width:240px; background:var(--raised);
  border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-lg); padding:7px; max-height:320px;
  overflow:auto; animation:pop var(--t); }
@keyframes pop { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.rs-search { width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:9px; background:var(--field);
  color:var(--ink); margin-bottom:6px; font-size:14px; }
.rs-search:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.rs-opt { display:flex; align-items:center; gap:10px; padding:8px 9px; border-radius:9px; cursor:pointer; }
.rs-opt:hover, .rs-opt.cur { background:var(--surface-2); }
.rs-opt .nm { font-weight:550; font-size:14px; }
.rs-opt .id { font-size:12px; color:var(--faint); }
.rs-opt .check { margin-left:auto; color:var(--brand); opacity:0; }
.rs-opt.sel .check { opacity:1; }
.rs-opt .txt { min-width:0; }
.rs-empty { padding:14px; text-align:center; color:var(--muted); font-size:13px; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.search { display:flex; align-items:center; gap:8px; background:var(--field); border:1px solid var(--line);
  border-radius:var(--radius-sm); padding:8px 11px; min-width:230px; }
.search svg { width:16px; height:16px; color:var(--faint); flex:none; }
.search input { border:0; background:transparent; color:var(--ink); font:inherit; width:100%; outline:none; }

/* ---------- Floating hover detail ---------- */
.floater { position:fixed; z-index:80; max-width:320px; background:var(--raised); border:1px solid var(--line);
  border-radius:12px; box-shadow:var(--shadow-lg); padding:13px 15px; font-size:13px; pointer-events:none;
  opacity:0; transform:translateY(4px); transition:opacity var(--t), transform var(--t); }
.floater.show { opacity:1; transform:none; }
.floater .ft-h { display:flex; align-items:center; gap:9px; margin-bottom:9px; }
.floater .ft-row { display:flex; justify-content:space-between; gap:16px; padding:3px 0; }
.floater .ft-row .k { color:var(--muted); }
.floater .ft-row .v { font-weight:600; color:var(--ink); }

/* ---------- Detail drawer ---------- */
.scrim { position:fixed; inset:0; background:rgba(6,10,18,.46); z-index:90; opacity:0; transition:opacity var(--t); }
.scrim.show { opacity:1; }
.drawer { position:fixed; top:0; right:0; height:100vh; width:min(520px, 94vw); background:var(--surface);
  border-left:1px solid var(--line); box-shadow:var(--shadow-lg); z-index:95; transform:translateX(100%);
  transition:transform 220ms cubic-bezier(.2,.7,.2,1); display:flex; flex-direction:column; }
.drawer.show { transform:none; }
.drawer .dh { display:flex; align-items:center; gap:12px; padding:18px 20px; border-bottom:1px solid var(--line-2); }
.drawer .dh .spacer { flex:1; }
.drawer .db { padding:20px; overflow:auto; display:flex; flex-direction:column; gap:18px; }
.field-row { display:flex; justify-content:space-between; gap:16px; padding:9px 0; border-bottom:1px solid var(--line-2); }
.field-row .k { color:var(--muted); font-size:13px; }
.field-row .v { font-weight:550; text-align:right; word-break:break-word; }

/* ---------- Code block + copy ---------- */
.code { position:relative; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--radius-sm);
  padding:14px 15px; overflow:auto; }
.code pre { margin:0; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:13px;
  line-height:1.6; color:var(--ink-2); white-space:pre; }
.copy { position:absolute; top:9px; right:9px; display:inline-flex; align-items:center; gap:6px; padding:5px 9px;
  font-size:12px; font-weight:600; border:1px solid var(--line); background:var(--surface); color:var(--ink-2);
  border-radius:8px; cursor:pointer; opacity:.9; transition:background var(--t), color var(--t); }
.copy:hover { background:var(--brand-soft); color:var(--brand); }
.copy svg { width:14px; height:14px; }

/* ---------- API page ---------- */
.ep { border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow-sm);
  margin-bottom:14px; overflow:hidden; }
.ep-h { display:flex; align-items:center; gap:12px; padding:14px 18px; cursor:pointer; }
.ep-h .path { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:14px; font-weight:600; }
.ep-h .desc { color:var(--muted); font-size:13px; margin-left:auto; text-align:right; }
.method { font-family:ui-monospace, monospace; font-weight:700; font-size:12px; padding:3px 9px; border-radius:7px; flex:none; }
.method.get { color:var(--info); background:var(--info-soft); }
.method.post { color:var(--ok); background:var(--ok-soft); }
.method.delete { color:var(--bad); background:var(--bad-soft); }
.ep-b { padding:0 18px 18px; border-top:1px solid var(--line-2); display:none; }
.ep.open .ep-b { display:block; }
.ep-b h4 { font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--faint); margin:16px 0 8px; }

/* ---------- Settings ---------- */
.set-row { display:flex; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid var(--line-2); }
.set-row:last-child { border-bottom:0; }
.set-row .meta { min-width:0; }
.set-row .spacer { flex:1; }
.input { width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:9px; background:var(--field);
  color:var(--ink); font:inherit; }
.input:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.copyfield { display:flex; align-items:center; gap:0; border:1px solid var(--line); border-radius:9px; overflow:hidden;
  background:var(--field); }
.copyfield code { flex:1; padding:8px 11px; font-size:13px; color:var(--ink-2); overflow:auto; white-space:nowrap; }
.copyfield button { border:0; border-left:1px solid var(--line); background:var(--surface-2); color:var(--ink-2);
  padding:0 12px; align-self:stretch; cursor:pointer; display:flex; align-items:center; gap:6px; font-size:12.5px; }
.copyfield button:hover { background:var(--brand-soft); color:var(--brand); }
.copyfield svg { width:14px; height:14px; }

/* ---------- Empty state & skeleton ---------- */
.empty { text-align:center; padding:52px 24px; color:var(--muted); }
.empty .em-ico { width:56px; height:56px; border-radius:16px; background:var(--surface-2); border:1px solid var(--line-2);
  display:grid; place-items:center; margin:0 auto 14px; color:var(--faint); }
.empty .em-ico svg { width:26px; height:26px; }
.empty h3 { font-size:16px; color:var(--ink); margin-bottom:5px; }
.empty p { margin:0 auto 16px; max-width:380px; font-size:14px; }
.sk { background:linear-gradient(90deg, var(--surface-2) 25%, var(--line-2) 37%, var(--surface-2) 63%);
  background-size:400% 100%; animation:shimmer 1.3s infinite linear; border-radius:7px; }
@keyframes shimmer { 0%{ background-position:100% 0; } 100%{ background-position:-100% 0; } }
.sk-line { height:12px; margin:8px 0; }
.sk-kpi { height:112px; border-radius:var(--radius); }
.sk-row { height:52px; margin:8px 0; border-radius:9px; }

/* ---------- Toasts ---------- */
.toasts { position:fixed; right:18px; bottom:18px; z-index:200; display:flex; flex-direction:column; gap:10px; }
.toast { display:flex; align-items:flex-start; gap:10px; min-width:260px; max-width:360px; padding:12px 14px;
  background:var(--raised); border:1px solid var(--line); border-left-width:4px; border-radius:11px;
  box-shadow:var(--shadow-lg); animation:toastin 220ms cubic-bezier(.2,.7,.2,1); }
.toast.out { animation:toastout 200ms forwards ease-in; }
.toast.ok { border-left-color:var(--ok); } .toast.err { border-left-color:var(--bad); }
.toast.info { border-left-color:var(--info); }
.toast .ti { flex:none; margin-top:1px; } .toast .ti svg { width:18px; height:18px; }
.toast.ok .ti { color:var(--ok); } .toast.err .ti { color:var(--bad); } .toast.info .ti { color:var(--info); }
.toast .tt { font-weight:600; font-size:14px; } .toast .tm { font-size:13px; color:var(--muted); margin-top:1px; }
.toast .tx { margin-left:auto; background:transparent; border:0; color:var(--faint); cursor:pointer; font-size:16px; line-height:1; }
@keyframes toastin { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes toastout { to { opacity:0; transform:translateX(20px); } }

/* ---------- Misc ---------- */
.row-gap { display:flex; flex-direction:column; gap:16px; }
.inline { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.spacer { flex:1; }
.note { font-size:12.5px; color:var(--faint); }
.hr { height:1px; background:var(--line-2); border:0; margin:0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:0; top:0; width:var(--sidebar); z-index:120; transform:translateX(-100%);
    transition:transform 220ms cubic-bezier(.2,.7,.2,1); box-shadow:var(--shadow-lg); }
  .shell.nav-open .sidebar { transform:none; }
  .nav-scrim { position:fixed; inset:0; background:rgba(6,10,18,.4); z-index:110; opacity:0; pointer-events:none;
    transition:opacity var(--t); }
  .shell.nav-open .nav-scrim { opacity:1; pointer-events:auto; }
  .hamburger { display:flex; }
  .kpis { grid-template-columns:repeat(2, 1fr); }
  .grid-2 { grid-template-columns:1fr; }
  .user-btn .em { display:none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns:1fr; }
  .content { padding:18px 16px 48px; }
  .topbar { padding:0 14px; }
}
