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

:root {
  --bg: #0a0e15; --bg-grad: radial-gradient(1200px 600px at 20% -10%, rgba(34, 211, 238, .08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(99, 102, 241, .07), transparent 55%);
  --surface: #10161f; --surface-2: #151d29; --surface-3: #1b2533;
  --line: #1e293b; --line-2: #26344a;
  --text: #e6ebf2; --text-2: #b6c0cf; --muted: #7b879a;
  --accent: #22d3ee; --accent-2: #38bdf8; --accent-bg: rgba(34, 211, 238, .12); --accent-line: rgba(34, 211, 238, .35);
  --ok: #34d399; --ok-bg: rgba(52, 211, 153, .12); --ok-line: rgba(52, 211, 153, .35);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12); --warn-line: rgba(251, 191, 36, .35);
  --bad: #f87171; --bad-bg: rgba(248, 113, 113, .12); --bad-line: rgba(248, 113, 113, .35);
  --grey-bg: rgba(148, 163, 184, .12); --grey-line: rgba(148, 163, 184, .25);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --radius: 10px; --radius-sm: 6px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f9; --bg-grad: radial-gradient(1200px 600px at 20% -10%, rgba(14, 165, 233, .10), transparent 60%);
  --surface: #ffffff; --surface-2: #f7f9fc; --surface-3: #eef2f7;
  --line: #e3e8ef; --line-2: #d3dae4;
  --text: #0f172a; --text-2: #334155; --muted: #64748b;
  --accent: #0284c7; --accent-2: #0ea5e9; --accent-bg: rgba(2, 132, 199, .10); --accent-line: rgba(2, 132, 199, .35);
  --ok: #059669; --ok-bg: rgba(5, 150, 105, .10); --ok-line: rgba(5, 150, 105, .35);
  --warn: #b45309; --warn-bg: rgba(180, 83, 7, .10); --warn-line: rgba(180, 83, 7, .35);
  --bad: #dc2626; --bad-bg: rgba(220, 38, 38, .10); --bad-line: rgba(220, 38, 38, .35);
  --grey-bg: rgba(100, 116, 139, .12); --grey-line: rgba(100, 116, 139, .3);
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .15);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed; color: var(--text);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono, code, pre { font-family: var(--mono); font-size: 12px; }
.mono { color: var(--text-2); letter-spacing: .01em; }
pre { background: var(--surface-2); border: 1px solid var(--line); padding: 12px; border-radius: var(--radius-sm);
  overflow: auto; max-height: 380px; margin: 8px 0 0; color: var(--text-2); }
b { font-weight: 600; }

/* ---------------------------------------------------------------- top bar */
#topbar { display: flex; align-items: center; gap: 28px; padding: 0 28px; height: 58px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #6366f1); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 12px -4px var(--accent); }
.brand .mark svg { width: 15px; height: 15px; fill: #fff; }
.brand .muted { font-weight: 500; font-size: 12px; margin-left: 2px; }
#nav { display: flex; gap: 4px; }
#nav a { color: var(--text-2); padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 500; }
#nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
#nav a.active { color: var(--accent); background: var(--accent-bg); }
#who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#who .me { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
#who .me b { font-size: 13px; }
#main { max-width: 1240px; margin: 0 auto; padding: 28px 28px 80px; }

/* ---------------------------------------------------------------- typography */
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; display: flex; align-items: center; gap: 12px; }
h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 36px 0 12px; }
h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.crumbs { margin-bottom: 10px; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .value.ok { color: var(--ok); } .kpi .value.bad { color: var(--bad); } .kpi .value.accent { color: var(--accent); } .kpi .value.warn { color: var(--warn); }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tr.dim td { color: var(--muted); }
tr.dim b { color: var(--text-2); }
td .small.muted { margin-top: 2px; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .02em; white-space: nowrap; background: var(--grey-bg); color: var(--text-2); border: 1px solid var(--grey-line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.badge.accent { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748b; margin-right: 7px; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg), 0 0 10px var(--ok); }
.dot.off { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }

/* ---------------------------------------------------------------- controls */
button, .btn { font: inherit; font-weight: 500; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); cursor: pointer; color: var(--text); transition: background .12s, border-color .12s, transform .06s; }
button:hover { background: var(--surface-3); border-color: var(--grey-line); }
button:active { transform: translateY(1px); }
button.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #04101a; font-weight: 600;
  box-shadow: 0 4px 14px -6px var(--accent); }
:root[data-theme="light"] button.primary { color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-bg); border-color: var(--bad-line); }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--surface-3); }
button.sm { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input::placeholder { color: var(--muted); }
input[type=number] { width: 120px; font-variant-numeric: tabular-nums; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
select { padding-right: 26px; }

/* date / time fields: text inputs with a themed popup (app.js, dpRender) */
input[data-picker] { font-variant-numeric: tabular-nums; padding-right: 30px; cursor: pointer;
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b879a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E"); }
input[data-picker="time"] { width: 96px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b879a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
input[data-picker="date"] { width: 142px; }
input[data-picker="datetime"] { width: 182px; }
input[data-picker]:invalid:not(:placeholder-shown):not(:focus) { border-color: var(--bad-line); }
#datepicker { position: fixed; z-index: 40; width: 272px; padding: 12px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: 0 12px 36px -10px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .02); font-size: 13px; }
#datepicker.kind-time { width: auto; }
#datepicker .dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#datepicker .dp-title { font-weight: 600; text-transform: capitalize; }
#datepicker .dp-nav { padding: 2px 10px; font-size: 16px; line-height: 1.2; background: transparent; border-color: transparent; color: var(--text-2); }
#datepicker .dp-nav:hover { background: var(--surface-3); }
#datepicker .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
#datepicker .dp-wd { text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 2px 0 4px; }
#datepicker .dp-day { padding: 0; height: 32px; border-radius: var(--radius-sm); border-color: transparent; background: transparent;
  color: var(--text); font-variant-numeric: tabular-nums; font-weight: 400; }
#datepicker .dp-day:hover { background: var(--surface-3); }
#datepicker .dp-day.out { color: var(--muted); opacity: .6; }
#datepicker .dp-day.today { border-color: var(--accent-line); color: var(--accent); }
#datepicker .dp-day.sel { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 600; }
#datepicker .dp-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
#datepicker.kind-time .dp-time { margin-top: 0; padding-top: 0; border-top: 0; }
#datepicker .dp-label { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-right: auto; padding-right: 10px; }
#datepicker .dp-time input { width: 58px; padding: 5px 6px; text-align: center; font-variant-numeric: tabular-nums; }
#datepicker .dp-foot { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
#datepicker .dp-foot [data-act="now"] { margin-right: auto; }
textarea { width: 100%; font-family: var(--mono); font-size: 12px; min-height: 280px; line-height: 1.5; }
label { display: inline-flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
label > input, label > select { font-size: 13.5px; color: var(--text); font-weight: 400; }
.search-select { display: inline-flex; gap: 6px; }
.search-select > input, .search-select > select { font-size: 13.5px; color: var(--text); font-weight: 400; }
label.inline { flex-direction: row; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); font-weight: 400; }
form.row, .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.stack { display: flex; flex-direction: column; gap: 14px; }
.error { color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad-line); padding: 10px 12px; border-radius: var(--radius-sm); }
.conflicts { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }
details { margin-top: 12px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .12s; }
details[open] summary::before { transform: rotate(45deg); }
details summary::-webkit-details-marker { display: none; }
td details { margin: 0; }
td details summary { font-size: 12px; }
.strategy-fields { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------------------------------------------------------------- login */
.login-wrap { max-width: 980px; margin: 24px auto 0; }
.login-wrap h1 { font-size: 30px; }
.login { display: grid; gap: 28px; margin-top: 28px; }
.login .group { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.user { text-align: left; padding: 12px 14px; display: flex; gap: 12px; align-items: center; border-radius: var(--radius);
  background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.user:hover { border-color: var(--accent-line); background: var(--surface-2); transform: translateY(-1px); }
.user .avatar { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--accent-bg), rgba(99, 102, 241, .2));
  color: var(--accent); border: 1px solid var(--accent-line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: 13px; }
.user .name { font-weight: 600; }
.user .small { margin-top: 1px; }
.user.inactive { opacity: .45; }

/* ---------------------------------------------------------------- timeline */
.tl-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.tl-toolbar select { min-width: 220px; }
.tl-toolbar input[data-picker] { padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
.tl-toolbar .tl-nav { display: inline-flex; gap: 2px; }
.tl-toolbar .tl-nav button { min-width: 30px; }
.tl-toolbar .tl-range { margin-left: auto; font-family: var(--mono); }
.timeline { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 8px; overflow: hidden; box-shadow: var(--shadow); min-height: 76px; }
.timeline { display: flex; }
.tl-gutter { position: relative; flex: 0 0 76px; border-right: 1px solid var(--line); background: var(--surface-2); }
.tl-body { position: relative; flex: 1; min-width: 0; cursor: crosshair; user-select: none; touch-action: none; }
.tl-body.selecting { cursor: col-resize; }
.timeline .tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); pointer-events: none; }
.timeline .tick.major { border-left-color: var(--line-2); }
.timeline .tick span { position: absolute; top: 5px; left: 6px; font-size: 10.5px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.timeline .tick.major span { color: var(--text-2); }
.timeline .now { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--accent); z-index: 2; box-shadow: 0 0 12px var(--accent); pointer-events: none; }
.timeline .now span { position: absolute; top: 5px; left: 6px; font-size: 10.5px; color: var(--accent); font-weight: 700; font-family: var(--mono); }
.timeline .bar { position: absolute; height: 20px; border-radius: 4px; font-size: 11px; line-height: 20px; padding: 0 8px; font-weight: 500;
  overflow: hidden; white-space: nowrap; color: var(--text-2); background: var(--grey-bg); border: 1px solid var(--grey-line); }
.timeline .bar:hover { filter: brightness(1.25); z-index: 1; }
.timeline .bar.resolved { height: 18px; line-height: 18px; border-radius: 3px; }
.timeline .bar.resolved.default { background: transparent; border-style: dashed; color: var(--muted); font-weight: 400; }
.timeline .tl-label { position: absolute; left: 10px; height: 20px; line-height: 20px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.timeline .tl-divider { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-2); pointer-events: none; }
#tooltip { position: fixed; z-index: 30; min-width: 300px; max-width: 440px; padding: 10px 12px; background: var(--surface-3); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); box-shadow: 0 8px 28px -8px rgba(0, 0, 0, .6); font-size: 12px; pointer-events: none; }
#tooltip .kv { gap: 3px 12px; }
#tooltip .kv dt { font-size: 11px; }
#tooltip .tip-head { font-weight: 600; margin-bottom: 6px; color: var(--text); }
.timeline .bar.running { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.timeline .bar.pending { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.timeline .bar.stopped, .timeline .bar.interrupted { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.timeline .tl-empty { position: absolute; left: 0; right: 0; top: 28px; text-align: center; font-size: 12px; pointer-events: none; }
.timeline .tl-cursor { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--grey-line); pointer-events: none; z-index: 3; }
.timeline .tl-cursor span { position: absolute; bottom: 4px; left: 6px; font-size: 10.5px; font-family: var(--mono); color: var(--text-2);
  background: var(--surface-3); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.timeline .tl-sel { position: absolute; top: 0; bottom: 0; background: var(--accent-bg); border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); pointer-events: none; z-index: 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.legend .hint { margin-left: auto; }
.status-toggles .toggle { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: transparent; border: 1px solid transparent; color: var(--text-2); }
.status-toggles .toggle:hover { background: var(--surface-3); border-color: var(--line-2); }
.status-toggles .toggle:disabled { opacity: 1; cursor: default; color: var(--muted); }
.status-toggles .toggle:disabled:hover { background: transparent; border-color: transparent; }
.status-toggles .toggle.off { color: var(--muted); text-decoration: line-through; opacity: .6; }
.status-toggles .toggle.off .sw { background: transparent !important; }
.status-toggles .count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--grey-line); background: var(--grey-bg); }
.sw.running { background: var(--ok-bg); border-color: var(--ok-line); }
.sw.pending { background: var(--accent-bg); border-color: var(--accent-line); }
.sw.stopped, .sw.interrupted { background: var(--warn-bg); border-color: var(--warn-line); }
.sw.cancelled { background: var(--bad-bg); border-color: var(--bad-line); }
.sw.default { background: transparent; border-style: dashed; }
.sw.active { background: var(--ok-bg); border-color: var(--ok-line); }
.timeline .bar.cancelled { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); text-decoration: line-through; opacity: .7; }
.timeline .bar.hidden-status { display: none; }

/* ---------------------------------------------------------------- misc */
.toolbar { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; }
.toolbar input { min-width: 320px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line-2); padding: 10px 16px; border-radius: var(--radius-sm); z-index: 20; max-width: 620px; box-shadow: var(--shadow); }
#toast.bad { border-color: var(--bad-line); color: var(--bad); }
.theme-toggle { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; }
.theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------------------------------------------------------------- lists: filters, pager, tabs, chips */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 14px; }
.filters input.search { min-width: 320px; flex: 1; max-width: 520px; }
.filters select { min-width: 150px; }
.pager { display: flex; align-items: center; gap: 18px; padding: 10px 4px 0; font-size: 13px; }
.pager .pages { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.pager .pages .mono { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.pager .pages button { min-width: 30px; font-size: 16px; line-height: 1; }
.pager select { padding: 3px 24px 3px 8px; font-size: 12px; }
.loading { opacity: .55; transition: opacity .15s; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); }
.chip:hover { border-color: var(--grey-line); }
.chip.on { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 14px; color: var(--text-2); margin-bottom: -1px; }
.tab:hover { background: transparent; color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
tr.panel td { background: var(--surface-2); padding: 14px 16px; }
.access-editor .filters { margin: 0 0 10px; }
.access-editor .filters b { margin-right: 8px; }
table.compact { box-shadow: none; background: var(--surface); }
table.compact td { padding: 7px 12px; }
td.right { text-align: right; white-space: nowrap; }
td.right button + button { margin-left: 6px; }

/* ---------------------------------------------------------------- inline pickers and card actions */
.picker { margin: 10px 0 4px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.picker .filters { margin: 0 0 10px; }
.picker .filters b { margin-right: 4px; }
.picker .filters .close { margin-left: auto; }
tr.panel .picker { margin: 0; background: transparent; border: 0; padding: 0; }
h3 .card-action { float: right; margin-top: -4px; text-transform: none; letter-spacing: 0; }
.unlink-asset { padding: 0 6px; line-height: 1.3; font-size: 13px; }
input.site-pick { cursor: pointer; }

/* ---------------------------------------------------------------- recurring rule form */
.weekdays { display: inline-flex; gap: 4px; }
.weekdays .day { flex-direction: row; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.weekdays .day:has(input:checked) { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.weekdays .day input { margin: 0; }
.rule-preview { min-height: 18px; }

/* ---------------------------------------------------------------- clients page */
a.btn { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
a.btn:hover { background: var(--surface-3); text-decoration: none; }
.inline-edit { align-items: center; gap: 6px; }
.inline-edit input { padding: 4px 8px; }

/* ---------------------------------------------------------------- asset connection params */
.asset-list { display: flex; flex-direction: column; gap: 10px; }
.asset-row { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.asset-row:last-child { border-bottom: 0; padding-bottom: 0; }
.asset-head { display: flex; align-items: center; gap: 10px; }
.asset-head .actions { margin-left: auto; display: inline-flex; gap: 2px; }
.params-chip { display: inline-flex; flex-wrap: wrap; column-gap: 6px; align-items: baseline; max-width: 100%; padding: 1px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.params-chip > span { min-width: 0; overflow-wrap: anywhere; }
.params-form { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.picker .params-form { margin: 0; padding: 0; border: 0; background: transparent; }
.create-params { display: flex; flex-direction: column; gap: 4px; }
.create-params:not([hidden]) { flex-basis: 100%; }

/* ---------------------------------------------------------------- site form and projected config */
.site-form .form-group { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.site-form .form-group:last-of-type { border-bottom: 0; }
.site-form .group-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.ems-line { margin-top: 4px; color: var(--text-2); }
.config-current { margin-bottom: 12px; padding: 12px 16px; }
.config-current pre { margin-top: 10px; }
.change { line-height: 1.5; word-break: break-all; }

/* ---------------------------------------------------------------- model catalogue */
.driver-label { align-self: center; padding: 4px 10px; border-radius: 4px; background: var(--surface-3); }
.new-model { margin-top: 10px; }

/* ---------------------------------------------------------------- fleetctl-ui */
#nav a[aria-current="page"] { color: var(--accent); background: var(--accent-bg); }
.auth-box { max-width: 400px; margin: 56px auto 0; }
.auth-box h1 { margin-bottom: 16px; }
.auth-box form input { width: 100%; }
.auth-box form label { display: flex; }
.auth-box .hint { margin-top: 14px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 32px 0 12px; }
.section-head h2 { margin: 0; }
