/* ==========================================================================
   Remote Sync — Command Center
   Enterprise UI theme. Dark by default, light via [data-theme="light"].
   App shell: fixed sidebar + sticky header + content + footer.
   ========================================================================== */

:root {
  /* Brand */
  --brand: #6366f1;
  --brand-2: #4f46e5;
  --brand-3: #22d3ee;
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #0ea5e9 100%);
  --brand-glow: rgba(99, 102, 241, .45);

  /* Dark palette (default) */
  --bg: #0b0f1a;
  --bg-2: #0e1422;
  --surface: #121a2b;
  --surface-2: #182238;
  --surface-3: #1e2a44;
  --border: #23304a;
  --border-soft: #1b2740;
  --text: #e8edf7;
  --text-strong: #f7fafc;
  --muted: #93a1ba;
  --muted-2: #6b7a96;

  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, .14);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, .14);
  --err: #fb7185;
  --err-bg: rgba(251, 113, 133, .14);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, .14);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-3: 0 20px 48px -16px rgba(0, 0, 0, .6);
  --shadow-glow: 0 12px 40px -12px var(--brand-glow);

  --sidebar-w: 264px;
  --header-h: 64px;
  --ring: 0 0 0 3px rgba(99, 102, 241, .35);
  --tx: 180ms cubic-bezier(.4, 0, .2, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #e7ebf3;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #eaeef6;
  --border: #d9e0ec;
  --border-soft: #e6ebf3;
  --text: #1a2438;
  --text-strong: #0b1220;
  --muted: #5a6b85;
  --muted-2: #8695ad;
  --shadow-2: 0 8px 24px -12px rgba(30, 41, 82, .18);
  --shadow-3: 0 24px 48px -20px rgba(30, 41, 82, .25);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 100% -10%, rgba(99, 102, 241, .10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(14, 165, 233, .08), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-3); text-decoration: none; }
a:hover { color: #67e8f9; }
h1, h2, h3 { color: var(--text-strong); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 24px 0 12px; }
::selection { background: var(--brand-glow); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border); background-clip: content-box; }

/* ==========================================================================
   App shell
   ========================================================================== */
body.app { min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--border-soft);
  z-index: 40;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h); padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar__brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-glow); }
.sidebar__brand .name { font-weight: 800; font-size: 16px; color: var(--text-strong); line-height: 1.1; letter-spacing: -.02em; }
.sidebar__brand .name small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.sidebar .sidebar__close { display: none; margin-left: auto; width: 34px; height: 34px; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group { margin-bottom: 18px; }
.nav-group__title { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); padding: 0 12px 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550; font-size: 14.5px;
  position: relative; transition: background var(--tx), color var(--tx);
}
.nav-link svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { color: #fff; background: var(--brand-grad); box-shadow: var(--shadow-glow); }
.nav-link.active svg { opacity: 1; }
.nav-link .count { margin-left: auto; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.14); padding: 1px 8px; border-radius: 20px; }

.sidebar__foot { padding: 12px; border-top: 1px solid var(--border-soft); }
.sidebar__foot .btn { width: 100%; justify-content: center; }

/* Header */
.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; margin-left: var(--sidebar-w); }
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: var(--header-h); min-height: var(--header-h); flex: none; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.app-header__title { display: flex; flex-direction: column; min-width: 0; }
.app-header__title .crumb { font-size: 11px; color: var(--muted-2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.app-header__title .pt { font-size: 16px; font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header__spacer { flex: 1; }
.hdr-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-soft);
  color: var(--muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.hdr-chip .dot { margin: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-soft); color: var(--muted);
  transition: var(--tx);
}
.icon-btn:hover { color: var(--text); border-color: var(--border); background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }
.nav-burger { display: none; }

/* User menu */
.usermenu { position: relative; }
.usermenu__btn {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 4px 10px 4px 4px; color: var(--text); transition: var(--tx);
}
.usermenu__btn:hover { border-color: var(--border); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--brand-grad); box-shadow: var(--shadow-glow);
}
.usermenu__meta { line-height: 1.15; text-align: left; }
.usermenu__meta .nm { font-size: 13px; font-weight: 700; }
.usermenu__meta .rl { font-size: 10.5px; color: var(--muted-2); text-transform: capitalize; }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 232px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-3); padding: 8px;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: var(--tx);
}
.usermenu.open .usermenu__panel { opacity: 1; transform: none; pointer-events: auto; }
.usermenu__panel .who { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.usermenu__panel .who .e { font-size: 12px; color: var(--muted); word-break: break-all; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--text); font: inherit; font-size: 14px; background: none; border: none; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 17px; height: 17px; color: var(--muted); }

/* Alert bell dropdown (header feed) */
.alertmenu { position: relative; }
.alertmenu__btn { position: relative; }
.alertmenu__badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--err); color: #fff; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  border: 2px solid var(--surface);
}
.alertmenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: 88vw;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-3); padding: 8px;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: var(--tx); z-index: 50;
}
.alertmenu.open .alertmenu__panel { opacity: 1; transform: none; pointer-events: auto; }
.alertmenu__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.alertmenu__empty { padding: 16px 12px; font-size: 13px; }
.alertmenu__list { list-style: none; margin: 0; padding: 0; max-height: 400px; overflow-y: auto; }
.alertmenu__list li { display: flex; gap: 9px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; }
.alertmenu__list li:hover { background: var(--surface-2); }
.alertmenu__list .dot { margin-top: 5px; flex: none; }
.alertmenu__body { min-width: 0; flex: 1; }
.alertmenu__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.alertmenu__label { font-weight: 700; font-size: 13px; color: var(--text-strong); }
.alertmenu__top .muted { font-size: 11px; white-space: nowrap; }
.alertmenu__msg { font-size: 12px; margin-top: 2px; line-height: 1.35; }

/* Content + footer */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 26px 40px; flex: 1; }
.app-footer {
  flex: none;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-2);
  padding: 20px 26px;
}
.app-footer__inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; column-gap: 16px; row-gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.app-footer .fbrand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); }
.app-footer .fbrand img { width: 22px; height: 22px; border-radius: 6px; }
.app-footer .sep { color: var(--border); }
.app-footer a { color: var(--muted); }
.app-footer a:hover { color: var(--text); }
.app-footer__inner > span { min-width: 0; }
.app-footer__inner .right { margin-left: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* Mobile scrim */
.scrim { display: none; position: fixed; inset: 0; background: rgba(3, 6, 14, .55); backdrop-filter: blur(2px); z-index: 39; }

/* ==========================================================================
   Page primitives
   ========================================================================== */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; gap: 14px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.subtitle { color: var(--muted); margin: 2px 0 0; }

.grid { display: grid; gap: 18px; }
/* Grid items default to min-width:auto, so a wide table inside a panel stretches
   its column past the viewport instead of letting .table-wrap scroll. */
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Stat cards */
.stat {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--surface));
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px 18px 20px; box-shadow: var(--shadow-1);
  transition: transform var(--tx), border-color var(--tx), box-shadow var(--tx);
}
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand-grad); opacity: .9; }
.stat:hover { transform: translateY(-3px); border-color: var(--border); box-shadow: var(--shadow-2); }
.stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-soft); }
.stat__icon svg { width: 20px; height: 20px; color: var(--brand-3); }
.stat .num { font-size: 32px; font-weight: 800; letter-spacing: -.02em; color: var(--text-strong); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat.is-ok::before { background: linear-gradient(180deg, var(--ok), #10b981); }
.stat.is-warn::before { background: linear-gradient(180deg, var(--warn), #f59e0b); }
.stat.is-err::before { background: linear-gradient(180deg, var(--err), #ef4444); }
.stat.is-ok .stat__icon svg { color: var(--ok); }
.stat.is-warn .stat__icon svg { color: var(--warn); }
.stat.is-err .stat__icon svg { color: var(--err); }
a.stat-link { display: block; color: var(--text); }
a.stat-link:hover { color: var(--text); }
.stat .num .unit { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.stat .sub { color: var(--muted-2); font-size: 12px; margin-top: 7px; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--err); }
.delta-flat { color: var(--muted-2); }
.stat .spark { display: block; width: 100%; height: 26px; margin-top: 8px; overflow: visible; }
.stat .spark polyline { stroke: var(--muted-2); }
.stat .spark .spark__dot { fill: var(--brand-3); stroke: var(--surface); stroke-width: 2; }

/* Dashboard activity chart (inline SVG, server-rendered) */
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--border-soft); stroke-width: 1; }
.chart .tick { fill: var(--muted-2); font-size: 10px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .seg-ok { fill: var(--ok); }
.chart .seg-err { fill: var(--err); }
.chart .seg-other { fill: var(--muted-2); opacity: .55; }
.chart .col__hit { fill: transparent; }
.chart .col:hover .seg-ok, .chart .col:hover .seg-err { filter: brightness(1.18); }
.chart .col:hover .seg-other { opacity: .8; }
.chart-foot { font-size: 12.5px; margin: 10px 0 0; }
.chart-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend .sw-ok { background: var(--ok); }
.chart-legend .sw-err { background: var(--err); }
.chart-legend .sw-other { background: var(--muted-2); opacity: .55; }

/* Dashboard panel extras */
.view-all { font-size: 13px; font-weight: 600; }
.view-all:hover { color: var(--text); }
.all-clear { display: flex; align-items: center; gap: 14px; padding: 22px 6px; }
.all-clear svg { width: 38px; height: 38px; color: var(--ok); flex: none; }
.all-clear strong { color: var(--text-strong); }
.all-clear p { margin: 2px 0 0; font-size: 13px; }

/* Panels */
.panel {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-1);
}
.panel > h2:first-child { margin-top: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel__head h2 { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
thead th { position: sticky; top: 0; }
th { color: var(--muted-2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: var(--surface); }
tbody tr { transition: background var(--tx); }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
.right { text-align: right; }

/* Clients table: keep action buttons on one line, truncate long URLs, and stop
   the small status columns from wrapping so rows stay tidy. */
#clients-table td.client-actions { white-space: nowrap; }
#clients-table td.client-actions .btn { margin-left: 6px; vertical-align: middle; }
#clients-table td.client-actions .btn:first-child { margin-left: 0; }
#clients-table td.url-cell { max-width: 280px; }
#clients-table td.url-cell a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: inherit; text-decoration: none; }
#clients-table td.url-cell a:hover { text-decoration: underline; }
#clients-table th:nth-child(n+4), #clients-table td:nth-child(n+4) { white-space: nowrap; }
#clients-table td:first-child, #clients-table td.url-cell { white-space: normal; }

/* Per-client access picker in the Users → Manage panel */
.ac-clients { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; padding: 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); }
.ac-clients__item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.ac-clients__item input { width: auto; margin: 0; }
.access-mode-select { width: 100%; margin: 8px 0 20px; }
.access-groups { margin-bottom: 10px; }
.access-groups > span, .access-list > span { display: block; margin-bottom: 4px; }

/* Client Groups list rows */
.group-row { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2); }
.group-row > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.group-row > summary::-webkit-details-marker { display: none; }
.group-row__name { font-weight: 600; }
.group-row__actions { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.group-row__actions form { display: inline; margin: 0; }
.group-row__body { padding: 0 12px 12px; }
/* "Edit" is a cue that expanding the row reveals the editor; the summary toggle
   handles the actual open, so this just needs to look like a button. */
.group-row[open] .group-row__edit { background: var(--surface-3, var(--surface-2)); }

/* Badges / dots */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-live { background: var(--ok-bg); color: var(--ok); padding: 4px 12px; font-weight: 800; letter-spacing: .02em; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); }
.badge-live .live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.badge-live .live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--ok); opacity: .6; animation: pulse 1.6s ease-out infinite; }
.badge-live .live-sep { opacity: .5; margin: 0 1px; }
.badge-live .live-sub { font-weight: 600; opacity: .85; }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.role-badge { text-transform: capitalize; padding: 2px 9px; border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.role-owner { background: var(--err-bg); color: var(--err); }
.role-admin { background: var(--info-bg); color: var(--info); }
.role-operator { background: var(--warn-bg); color: var(--warn); }
.role-viewer { background: var(--surface-2); color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; position: relative; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot-err { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot-muted { background: var(--muted-2); }
.dot-ok::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--ok); opacity: .6; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .6; } 100% { transform: scale(2.2); opacity: 0; } }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: 11px 13px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; transition: border-color var(--tx), box-shadow var(--tx);
}
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; transition: opacity var(--tx); }
input[type=date]:hover::-webkit-calendar-picker-indicator { opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { min-height: 170px; font-family: var(--mono); font-size: 13px; line-height: 1.6; resize: vertical; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 10px; }
.checks label { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--text); font-size: 14px; padding: 9px 11px; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 9px; cursor: pointer; transition: var(--tx); }
.checks label:hover { border-color: var(--border); }
.checks input { width: auto; accent-color: var(--brand); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 17px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--brand-grad); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-glow); transition: transform var(--tx), filter var(--tx), box-shadow var(--tx);
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); color: #fff; }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; box-shadow: none; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: linear-gradient(135deg, #fb7185, #ef4444); box-shadow: 0 12px 40px -12px rgba(239, 68, 68, .5); }
.btn-warn { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #3a2a06; box-shadow: none; }
.btn-link { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; box-shadow: none; }
.btn-link:hover { color: var(--text); transform: none; filter: none; }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Flash */
.flash { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; font-weight: 550; border: 1px solid transparent; box-shadow: var(--shadow-1); transition: opacity var(--tx), transform var(--tx); }
.flash-msg { flex: 1; min-width: 0; word-break: break-word; }
.flash-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: var(--tx); }
.flash-copy:hover { background: rgba(255,255,255,.16); }
.flash-copy svg { width: 15px; height: 15px; }
.flash-copy.is-copied { opacity: .85; }
.flash-close { flex: none; background: none; border: none; color: inherit; opacity: .6; cursor: pointer; font-size: 20px; line-height: 1; padding: 0 2px; }
.flash-close:hover { opacity: 1; }
.flash-persist { box-shadow: var(--shadow-2); }
.flash-hide { opacity: 0; transform: translateY(-6px); }
.flash-success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.flash-error { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 40%, transparent); color: var(--err); }
.flash-warning { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.flash-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 40%, transparent); color: var(--info); }

/* Auth (login) */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-hero {
  position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--brand-grad); color: #fff;
}
.auth-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 400px at 80% 10%, rgba(255,255,255,.22), transparent 55%), radial-gradient(500px 400px at 10% 100%, rgba(2,6,23,.28), transparent 60%); }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brandline { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.auth-hero .brandline img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.auth-hero h2 { color: #fff; font-size: 34px; line-height: 1.15; letter-spacing: -.02em; max-width: 12ch; margin: 0 0 14px; }
.auth-hero p { color: rgba(255,255,255,.85); max-width: 42ch; font-size: 15px; }
.auth-hero .feats { display: grid; gap: 12px; margin-top: 8px; }
.auth-hero .feat { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 14.5px; color: rgba(255,255,255,.95); }
.auth-hero .feat svg { width: 20px; height: 20px; flex: none; }
.auth-hero .foot-note { font-size: 12.5px; color: rgba(255,255,255,.7); }

.auth-panel {
  display: grid; place-items: center; background: var(--bg);
  padding: 40px max(28px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .mark { display: none; text-align: center; }
.auth-card h1 { font-size: 24px; }
.auth-card .subtitle { margin-bottom: 22px; }
.auth-card .btn { width: 100%; margin-top: 22px; padding: 12px; }
.auth-card .fineprint { margin-top: 20px; font-size: 12px; color: var(--muted-2); text-align: center; }

/* Offline page */
.offline-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.offline-card { text-align: center; max-width: 380px; }
.offline-card img { margin-bottom: 18px; }
.offline-card .btn { margin-top: 18px; }

/* Utilities */
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
code, pre { font-family: var(--mono); }
pre.code, pre.pre { background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 7px; padding: 2px 9px; font-size: 11px; margin: 0 4px 4px 0; color: var(--muted); font-weight: 600; }
.validation-out { margin-top: 12px; font-size: 13px; }

/* Snippet library (Send Code) */
.snip-cat { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.snip-cat > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; background: var(--surface-2); user-select: none; }
.snip-cat > summary::-webkit-details-marker { display: none; }
.snip-cat > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--muted-2); transition: transform var(--tx); }
.snip-cat[open] > summary::before { transform: rotate(90deg); }
.snip { padding: 12px 14px; border-top: 1px solid var(--border-soft); }
.snip__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.snip__preview { margin: 0; max-height: 160px; overflow: auto; }
.empty { text-align: center; color: var(--muted); padding: 48px 24px; }
.empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 10px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }

/* Users & Roles: narrow invite form + wide team table. The table needs the
   full row well before the generic 720px grid collapse — its 5 columns fit
   the 3fr panel only from ~1420px up (below that the Actions column hides
   behind a scroll nobody notices), so stack the panels earlier. */
.users-grid { grid-template-columns: 1fr; }
.users-grid--solo { grid-template-columns: 1fr; }
@media (max-width: 1420px) { .users-grid { grid-template-columns: 1fr; } }

@media (max-width: 1200px) {
  .auth-hero { padding: 40px 36px; }
  .auth-hero h2 { font-size: 28px; }
  .auth-hero p { font-size: 14px; }
}

@media (max-width: 960px) {
  .app-main { margin-left: 0; }
  .sidebar {
    width: min(84vw, var(--sidebar-w));
    transform: translateX(-102%); transition: transform var(--tx); box-shadow: var(--shadow-3);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }
  .nav-burger { display: inline-flex; }
  body.nav-open .sidebar .sidebar__close { display: inline-flex; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card .mark { display: block; margin-bottom: 14px; }
  .auth-card h1, .auth-card .subtitle { text-align: center; }
  .auth-card input { font-size: 16px; } /* ≥16px stops iOS focus-zoom */
}

@media (max-width: 720px) {
  .grid-2, .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 18px 16px 32px; }
  .app-header { padding: 0 14px; gap: 10px; }
  .hide-sm { display: none !important; }
  .app-header__title .crumb { display: none; }
  h1 { font-size: 21px; }
  .stat .num { font-size: 28px; }
  .app-footer { padding: 16px; }
  .app-footer__inner { justify-content: flex-start; }
  .app-footer__inner .right { margin-left: 0; width: 100%; }
}

@media (max-width: 420px) {
  .auth-panel { padding: 28px max(18px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  .auth-card { max-width: 100%; }
  .auth-card .mark img { width: 48px; height: 48px; }
  .auth-card h1 { font-size: 21px; }
  .auth-card .fineprint { font-size: 11px; }
}

/* Phone landscape: hero column wastes height, center panel instead */
@media (max-height: 480px) and (orientation: landscape) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card .mark { display: block; margin-bottom: 10px; }
  .auth-card .mark img { width: 40px; height: 40px; }
  .auth-panel { padding-top: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .usermenu__meta { display: none; }
  .usermenu__btn { padding: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* History-panel pager (AJAX in-place pagination) */
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pager .btn { min-width: 34px; justify-content: center; }
.pager__current {
  background: var(--accent, #4f46e5);
  color: #fff;
  border-color: transparent;
  cursor: default;
}
.pager__gap { padding: 0 2px; user-select: none; }
/* AJAX loading state: dim the panel and overlay a spinner. */
[data-partial] { position: relative; }
[data-partial].is-loading { pointer-events: none; }
[data-partial].is-loading > * { opacity: .45; transition: opacity .15s ease; }
[data-partial].is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: var(--accent, #4f46e5);
  animation: rsw-spin .7s linear infinite;
  z-index: 2;
}
@keyframes rsw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  [data-partial].is-loading::after { animation-duration: 1.6s; }
}

/* ---- Docs & Help ---- */
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-toc { position: sticky; top: 82px; padding: 14px 10px; }
.docs-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.docs-toc a:hover { background: var(--surface-2); color: var(--text); }
.docs-body { min-width: 0; }
.docs-section { margin-bottom: 20px; scroll-margin-top: 84px; }
.docs-section h3 { margin: 18px 0 8px; font-size: 14.5px; color: var(--text-strong); }
.docs-section p, .docs-section li { line-height: 1.65; }
.docs-section ul, .docs-section ol { padding-left: 22px; margin: 10px 0; }
.docs-section li { margin-bottom: 6px; }
.docs-section table td:first-child { white-space: nowrap; }
.callout { border: 1px solid var(--border-soft); border-left: 3px solid var(--info); background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 14px 0 4px; font-size: 13.5px; line-height: 1.6; }
.callout-warn { border-left-color: var(--warn); }
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; }
}

/* ---- kbd hint ---- */
kbd { font-family: var(--mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--border-soft); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--text); }

/* ---- Code editor (gutter + textarea) ---- */
.editor { display: flex; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); }
.editor__gutter {
  flex: none; width: 44px; padding: 12px 8px 12px 0; margin: 0; text-align: right;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--muted-2);
  background: var(--surface-2); border-right: 1px solid var(--border-soft);
  white-space: pre; overflow: hidden; user-select: none;
}
.editor textarea { flex: 1; min-height: 240px; margin: 0; border: 0; border-radius: 0; background: transparent; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; padding: 12px; }
.editor textarea:focus { outline: none; box-shadow: none; }
.editor:focus-within { border-color: var(--brand, #6366f1); }

/* ---- Log filters ---- */
.log-filters { display: flex; gap: 5px 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.log-filters > div { min-width: 130px; }
.log-filters label { margin-top: 0; }
.log-filters__search { flex: 1; min-width: 200px; }
.log-filters__actions { display: flex; gap: 8px; }
/* Hard wrap: message search (+ buttons) always start the second row */
.log-filters > .log-filters__break { flex-basis: 100%; min-width: 0; height: 0; }

/* Joined from→to date-range control: one bordered pill, two bare date inputs */
.date-range {
  display: flex; align-items: center; gap: 2px; padding: 0 4px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color var(--tx), box-shadow var(--tx);
}
.date-range:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.date-range input[type=date],
.date-range input[type=datetime-local] { width: auto; min-width: 0; border: 0; background: transparent; padding: 11px 8px; }
.date-range input[type=date]:focus,
.date-range input[type=datetime-local]:focus { border: 0; box-shadow: none; }
.date-range__sep { color: var(--muted-2); user-select: none; }

/* Inline "See more →" style text link (no button chrome) */
.link-arrow { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.link-arrow:hover { color: var(--text); }
.link-arrow span { transition: transform var(--tx); }
.link-arrow:hover span { transform: translateX(2px); }

/* ---- Team table (users) ---- */
/* Team table sits in the narrower side-by-side users-grid panel: the generic
   12px/14px cell padding alone pushes its natural width past the panel and
   grows a permanent horizontal scrollbar even on wide desktops. Tighter
   padding + nowrap on the relative-time cells keep it fitting at 1440px and
   scrolling cleanly (no two-line "8m ago") in the 1200–1400px squeeze. */
.team-table th, .team-table td { padding: 12px 9px; }
.team-table td.muted { white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 11px; }
.user-cell .avatar { width: 34px; height: 34px; font-size: 13px; }
.user-cell__meta { line-height: 1.3; min-width: 0; }
.user-cell__name { font-weight: 600; color: var(--text-strong); display: flex; align-items: center; gap: 7px; }
.user-cell__name .badge { font-size: 10px; padding: 1px 8px; }
.user-cell__email { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.team-table td { vertical-align: middle; }
.row-actions-cell { white-space: nowrap; }
.row-actions-cell .btn + .row-actions { margin-left: 6px; }

/* ---- Row actions (users) ---- */
.row-actions { display: inline-block; position: relative; }
/* The dropdown is position:absolute inside a .table-wrap scroll container —
   overflow-x:auto clips it / grows a scrollbar. While a menu is open, let the
   wrap overflow so the panel floats above the table instead of breaking it. */
.table-wrap:has(.row-actions[open]) { overflow: visible; }
.row-actions > summary { list-style: none; cursor: pointer; }
.row-actions > summary::-webkit-details-marker { display: none; }
.row-actions[open]::before { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); }
.row-actions__panel { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 60; width: min(92vw, 460px); max-height: 88vh; overflow-y: auto; margin: 0; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-3, 0 24px 70px rgba(0,0,0,.5)); text-align: left; }
.row-actions__panel { white-space: normal; } /* undo the cell's nowrap inside the dropdown */
.row-actions__panel .stack { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.row-actions__panel .stack:last-of-type { border-bottom: 0; }
.row-actions__panel label { display: block; font-size: 12px; margin-bottom: 4px; }
.row-actions__panel .btn { display: block; width: 100%; margin-top: 8px; }
.row-actions__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.row-actions__title { font-size: 12px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; }
.row-actions__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); cursor: pointer; transition: background var(--tx), color var(--tx), border-color var(--tx);
}
.row-actions__close:hover { background: var(--surface-2); color: var(--text-strong); border-color: var(--border-soft); }
.row-actions__close svg { width: 15px; height: 15px; }

/* Phones: the anchored-absolute panel gets clipped inside the scrolling
   .table-wrap, and the overflow:visible escape hatch widens the page (mobile
   shrink-to-fit then zooms the whole layout out). Keep the wrap scrollable and
   present the panel as a fixed centered sheet instead. Must stay AFTER the
   base .row-actions rules — same specificity, order decides. */
@media (max-width: 720px) {
  .table-wrap:has(.row-actions[open]) { overflow: auto; }
  .row-actions__panel {
    position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%);
    width: auto; max-height: min(80vh, 480px); overflow-y: auto; z-index: 60;
    box-shadow: var(--shadow-3, 0 18px 60px rgba(0,0,0,.45));
  }
}

/* Phones: the team table is ~630px at its narrowest — on a 390px screen the
   Actions column (and both time columns) sit off-screen behind a scroll the
   user has no cue to find, so Manage/Activity are effectively unreachable.
   Collapse each row into a stacked card: user block, then labelled inline
   facts (Role / Last login / Last active via data-label), then the action
   buttons on their own full-width line. */
@media (max-width: 720px) {
  .team-table, .team-table tbody, .team-table tr, .team-table td { display: block; }
  .team-table thead { display: none; }
  .team-table tr { padding: 13px 2px; border-bottom: 1px solid var(--border-soft); }
  .team-table tr:last-child { border-bottom: 0; }
  .team-table td { padding: 0; border-bottom: 0; }
  .team-table .user-cell { margin-bottom: 9px; }
  .team-table td[data-label] { display: inline-block; padding: 0 16px 9px 0; font-size: 13px; }
  .team-table td[data-label]::before {
    content: attr(data-label); display: inline-block; margin-right: 5px;
    color: var(--muted-2); font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
  }
  .team-table .row-actions-cell { white-space: normal; display: flex; gap: 8px; text-align: left; }
  .team-table .row-actions-cell .btn + .row-actions { margin-left: 0; }
}

/* ---- Bulk-select toolbar ---- */
.bulkbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); flex-wrap: wrap; }
.bulkbar[hidden] { display: none; }
.bulkbar__count { font-weight: 700; }
.bulkbar__form { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.chk-col { width: 34px; text-align: center; }
.chk-col input { width: auto; margin: 0; }

/* Tag chips: clickable filter/picker variants (wave 4) */
.tagbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tagbar--pickers { margin: 8px 0 0; }
.tag--pick { cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; transition: border-color var(--tx), color var(--tx), background var(--tx); }
a.tag, a.tag:hover { text-decoration: none; color: var(--muted); }
.tag--pick:hover { border-color: var(--border); color: var(--text); }
.tag--pick.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag--pick.is-active .muted { color: rgba(255,255,255,.75); }

/* Inline checkbox row (e.g. "push defaults" on the client form) */
.check-inline { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-weight: 500; }
.check-inline input { width: auto; margin-top: 3px; accent-color: var(--brand); }

/* Worker-status uptime graph (full-width minute bars) */
.worker-status .panel__head h2 { display: flex; align-items: center; gap: 9px; }
.wspark-wrap { margin-top: 4px; }
.wspark { display: block; width: 100%; height: 34px; }
.wspark__ok { fill: var(--ok); }
.wspark__gap { fill: var(--err-bg); }
:root[data-theme="light"] .wspark__gap { fill: #f1d4d4; }
.wspark-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; margin-top: 6px; }
.wspark-axis span:nth-child(2) { color: var(--muted-2); font-weight: 600; }
.worker-status__note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; }

/* Monitor sparklines (inline SVG, themed via CSS vars) */
.mspark { display: block; width: 120px; height: 26px; overflow: visible; }
.mspark polyline { stroke: var(--muted-2); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mspark__dot { fill: var(--brand-3); }
.mspark__fail { fill: var(--err); }
.mspark__ok { fill: var(--ok); opacity: .75; }
.mspark__err { fill: var(--err); }

/* Per-monitor interval inline editor. The input selector must match the
   global `input[type=number]` (width:100%) in specificity — a bare class
   loses and the field balloons to fill the cell, wrecking the row. */
.interval-form { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.interval-form input[type=number].interval-input { width: 84px; padding: 5px 8px; font-size: 13px; }

/* Maintenance-window quick-set presets */
.maint-presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* Monitors table: keep compact cells on one line; only Detail may wrap. */
.monitors-table td { white-space: nowrap; }
.monitors-table td.detail-cell { white-space: normal; min-width: 150px; max-width: 260px; }
.monitors-table td.actions form { display: inline-block; }

/* Onboarding checklist (dashboard first-run card) */
.onboarding__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.onboarding__steps li { display: flex; gap: 11px; align-items: flex-start; padding: 12px; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.onboarding__steps li.is-done { opacity: .62; }
.onboarding__mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--ok); margin-top: 1px; }
.onboarding__steps li.is-done .onboarding__mark { border-color: var(--ok); background: var(--ok-bg); }
.onboarding__label { font-weight: 600; color: var(--text-strong); }
a.onboarding__label:hover { color: var(--brand-3); }
.onboarding__hint { font-size: 12.5px; margin-top: 2px; }

/* Public status page (tokenized, unauthenticated) */
.status-page { max-width: 760px; margin: 0 auto; padding: 40px 18px 60px; }
.status-page__head { text-align: center; margin-bottom: 24px; }
.status-page__head img { margin-bottom: 10px; }
.status-page__head h1 { margin: 0 0 14px; }
.status-page__head .flash { display: inline-block; }
.status-client__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.status-client__head h2 { margin: 0; font-size: 17px; }
.status-page__foot { text-align: center; margin-top: 24px; font-size: 12.5px; }

/* ---- Command palette ---- */
.palette { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; }
.palette[hidden] { display: none; }
.palette__scrim { position: absolute; inset: 0; background: rgba(3, 6, 14, .55); backdrop-filter: blur(2px); }
.palette__box { position: relative; margin-top: 12vh; width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.4); overflow: hidden; }
.palette__input { width: 100%; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; font-size: 16px; padding: 16px 18px; }
.palette__input:focus { outline: none; box-shadow: none; }
.palette__list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette__item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.palette__item.is-active { background: var(--brand-grad, var(--surface-2)); color: #fff; }
.palette__item.is-active .muted { color: rgba(255,255,255,.8); }
.palette__kind { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.palette__empty { padding: 16px; text-align: center; }
.palette__hint { padding: 8px 14px; font-size: 11.5px; border-top: 1px solid var(--border-soft); }
@media (prefers-reduced-motion: reduce) { .palette__scrim { backdrop-filter: none; } }
