:root {
  --bg: #08080c;
  --bg-elev: #131319;
  --bg-elev-2: #1d1d27;
  --bg-hover: #24242f;
  --border: #2a2a37;
  --border-strong: #383848;
  --text: #ededf2;
  --text-dim: #9292a0;
  --text-faint: #6a6a78;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-ring: rgba(139, 92, 246, 0.40);
  --green: #2ecc71;
  --green-soft: rgba(46, 204, 113, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.13);
  --yellow: #eab308;
  --blue: #38bdf8;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --gradient-accent: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* ── Light Mode (umschaltbar unter Einstellungen) ── */
:root[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-elev: #ffffff;
  --bg-elev-2: #eef0f6;
  --bg-hover: #e7e9f2;
  --border: #e3e5ef;
  --border-strong: #d2d5e3;
  --text: #16161e;
  --text-dim: #62626f;
  --text-faint: #9b9ba8;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.10);
  --accent-ring: rgba(124, 58, 237, 0.30);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.10);
  --yellow: #b45309; /* dunkler für Lesbarkeit auf hellem Grund */
  --shadow-sm: 0 1px 2px rgba(16, 16, 30, 0.06);
  --shadow-md: 0 6px 22px rgba(16, 16, 30, 0.10);
  --shadow-lg: 0 24px 70px rgba(16, 16, 30, 0.18);
  --gradient-accent: linear-gradient(135deg, #8b5cf6, #7c3aed);
}
/* Theme-Auswahl auf der Einstellungsseite */
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 220px;
  padding: 14px;
  background: var(--bg-elev-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
}
.theme-option:hover { background: var(--bg-elev-2); border-color: var(--text-dim); }
.theme-option.active { border-color: var(--accent); }
.theme-option.active::after {
  content: '✓ active';
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.theme-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  height: 56px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid;
}
.theme-preview span {
  display: block;
  height: 10px;
  border-radius: 3px;
}
.theme-preview span:last-child { width: 60%; }

:root[data-theme="light"] .score-badge { color: var(--accent); }
:root[data-theme="light"] .plat-pill.of { color: var(--accent); }
:root[data-theme="light"] .plat-pill.fa { color: #0284c7; }
:root[data-theme="light"] .rev-chart .bar-g:hover .bar-hit { fill: rgba(0, 0, 0, 0.05); }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.score-badge {
  display: inline-block;
  min-width: 38px;
  padding: 2px 8px;
  border-radius: 6px;
  text-align: center;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-hover);
  cursor: help;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body {
  display: flex;
}

.hidden { display: none !important; }
.muted { color: var(--text-dim); font-size: 13px; }
.error { color: var(--red); margin-top: 12px; font-size: 13px; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); }

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
button:hover { background: var(--accent-hover); }
button.secondary {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
button.secondary:hover { background: var(--border); }

input, select {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

.sidebar {
  width: 220px;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 32px;
  color: var(--accent);
  font-size: 14px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar nav a {
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}
.sidebar nav a.active {
  background: var(--bg-elev-2);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-footer button {
  width: 100%;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.sidebar-footer button:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}

.refresh-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.1) !important;
  border-color: rgba(139, 92, 246, 0.3) !important;
  color: var(--accent) !important;
  font-weight: 500;
}
.refresh-btn:hover {
  background: rgba(139, 92, 246, 0.2) !important;
  color: var(--accent-hover) !important;
}
.refresh-icon {
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s;
}
.refresh-btn:hover .refresh-icon {
  transform: rotate(60deg);
}
.refresh-btn.spinning .refresh-icon {
  animation: spin 0.7s linear;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.auto-refresh {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 12px;
  cursor: pointer;
  user-select: none;
}
.auto-refresh input[type="checkbox"] {
  appearance: none;
  width: 30px;
  height: 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.auto-refresh input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.auto-refresh input[type="checkbox"]:checked {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--accent);
}
.auto-refresh input[type="checkbox"]:checked::before {
  transform: translateX(14px);
  background: var(--accent);
}

main {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  height: 100vh;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi-card .label {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.kpi-card .value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.kpi-card .delta {
  font-size: 12px;
  margin-top: 4px;
}

.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tr:hover td { background: var(--bg-elev-2); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.badge.green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge.red { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge.yellow { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.badge.gray { background: rgba(136, 136, 148, 0.15); color: var(--text-dim); }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
}
.alert.high { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); }
.alert.medium { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.3); }
.alert.low { background: rgba(136, 136, 148, 0.1); border: 1px solid var(--border); }

.loading {
  color: var(--text-dim);
  text-align: center;
  padding: 60px 0;
}

/* Login */
.login-body {
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 360px;
}
.login-card .brand {
  font-weight: 700;
  letter-spacing: 0.15em;
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 4px;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-top: 16px;
  align-items: end;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-grid input, .form-grid select {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}
.form-grid button {
  align-self: end;
  height: 38px;
}
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-small {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius);
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  margin-right: 4px;
  text-decoration: none;
  font-weight: 500;
}
.btn-small:hover { background: var(--border); color: var(--text); }
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); color: var(--red); }

.btn-small[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
}
.btn-link:hover { color: var(--accent-hover); }

.proxy-edit-row td {
  background: var(--bg-elev-2);
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--border);
}
.proxy-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.proxy-edit-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.proxy-input {
  font-family: monospace;
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
}
.proxy-session-select {
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
}
.proxy-col {
  min-width: 120px;
}
.proxy-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 4px;
}
.proxy-session-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}
.proxy-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.proxy-restart-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
}

.proxy-us-preview {
  grid-column: 1 / -1;
  font-size: 12px;
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.proxy-us-preview code {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
}

.form-grid label.hidden { display: none; }

table.clickable-rows tbody tr.shift-row { cursor: pointer; }
table.clickable-rows tbody tr.shift-row:hover { background: var(--bg-elev); }
table.clickable-rows tbody tr.shift-row.selected {
  background: var(--bg-elev);
  box-shadow: inset 3px 0 0 var(--accent);
}
.shift-detail h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.stat {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 18px; font-weight: 600; margin-top: 4px; }

/* ── Kalender-Wochenraster ── */
.cal-wrap { overflow-x: auto; }
.cal-grid { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.cal-grid th, .cal-grid td { vertical-align: top; }
.cal-grid thead th {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 4px;
  color: var(--text);
}
.cal-grid thead th.cal-today { color: var(--accent); }
.cal-corner { width: 90px; }
.cal-shift-label {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding-right: 8px;
}
.cal-cell {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-height: 56px;
}
.cal-chatter {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: capitalize;
}
.cal-cell.cal-clickable { cursor: pointer; transition: border-color 0.1s; }
.cal-cell.cal-clickable:hover { border-color: var(--accent); }
.cal-model {
  display: block;
  font-size: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-revenue {
  font-size: 16px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--green);
}
.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}
.inline-label select { text-transform: none; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mini-table th { color: var(--text-dim); font-size: 11px; text-transform: uppercase; }

/* ── Modal-Popup ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.modal-close:hover { color: var(--text); }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.checkbox-list .checkbox-item {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.checkbox-list .checkbox-item:hover { background: var(--bg-elev); }
.checkbox-list .checkbox-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.status-row td {
  background: var(--bg-elev-2) !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--accent);
}
.status-row .status-line { margin-bottom: 8px; }
.status-row .twofa-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.status-row .twofa-form input {
  font-size: 16px;
  letter-spacing: 0.15em;
  font-family: 'SF Mono', Menlo, monospace;
}

@media (max-width: 768px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; flex-direction: row; padding: 12px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; flex: 1; }
  .sidebar-footer { padding-top: 0; border-top: none; padding-left: 12px; border-left: 1px solid var(--border); }
  main { padding: 16px; height: auto; }
}

/* ─── Dashboard ─── */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dash-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-filters select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
  max-width: 220px;
}

.seg {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.seg button {
  background: transparent;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.seg button:hover { background: var(--bg-elev-2); color: var(--text); }
.seg button.active { background: var(--accent); color: #fff; }

.dash-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) 2fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 760px) { .dash-hero { grid-template-columns: 1fr; } }

.dash-total-card {
  background: linear-gradient(135deg, rgba(139,92,246,0.16), rgba(139,92,246,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-total-card .label {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.dash-total {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.dash-total-sub {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dash-total-sub .dot { margin-left: 8px; }

.dot, .chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  vertical-align: middle;
}
.dot.of, .chart-legend i.of { background: var(--accent); }
.dot.fa, .chart-legend i.fa { background: #38bdf8; }

.dash-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.dash-mini {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-mini .label {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.dash-mini .value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }

.chart-card { padding: 18px 20px 12px; }
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.chart-head h2 { margin: 0; border: 0; padding: 0; }
.chart-legend { display: flex; gap: 16px; color: var(--text-dim); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

.rev-chart { width: 100%; height: 260px; display: block; }
.rev-chart .grid { stroke: var(--border); stroke-width: 1; }
.rev-chart .ylab, .rev-chart .xlab { fill: var(--text-dim); font-size: 11px; }
.rev-chart .bar.of { fill: var(--accent); }
.rev-chart .bar.fa { fill: #38bdf8; }
.rev-chart .bar-hit { fill: transparent; }
.rev-chart .bar-g:hover .bar-hit { fill: rgba(255,255,255,0.04); }
.rev-chart .bar-g:hover .bar { filter: brightness(1.2); }

.plat-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.plat-pill.of { background: rgba(139,92,246,0.18); color: var(--accent-hover); }
.plat-pill.fa { background: rgba(56,189,248,0.18); color: #7dd3fc; }

/* ── Chatterakquise ── */

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Red Flags: klickbare Zeilen + Chat-Rekonstruktion ── */

.rf-row { cursor: pointer; }
.rf-row:hover td { background: var(--bg-elev-2); }
.rf-row.rf-open td { background: var(--bg-elev-2); border-bottom: none; }

.rf-ctx-row > td { padding: 0 12px 14px; background: var(--bg-elev-2); }
.rf-ctx-box { padding: 10px 4px 0; }
.rf-ctx-head {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 10px;
}

.rf-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}
.rf-msg {
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.rf-msg.fan { align-self: flex-start; border-bottom-left-radius: 4px; }
.rf-msg.creator {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.35);
}
.rf-msg.flagged {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}
.rf-msg-meta {
  color: var(--text-dim);
  font-size: 11px;
  margin-bottom: 4px;
}
.rf-msg-text {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Generic modal (used by Team edit dialog) ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.modal-card h2 { margin-bottom: 16px; }
.modal-card form { display: flex; flex-direction: column; gap: 12px; }
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--text-dim);
}
.modal-card label.row { flex-direction: row; align-items: center; gap: 8px; }
.modal-card input, .modal-card select { width: 100%; }
.modal-card input[type="checkbox"] { width: auto; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ════════════════════════════════════════════════════════════
   DESIGN REFRESH — modern, polished layer (overrides above)
   Keeps all existing class names & markup intact.
   ════════════════════════════════════════════════════════════ */

html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

/* Subtle ambient backdrop so the flat dark feels like depth */
body {
  background:
    radial-gradient(1100px 620px at 78% -8%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 60%),
    radial-gradient(900px 520px at -10% 110%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

::selection { background: var(--accent-ring); color: var(--text); }

/* Refined scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* Keyboard focus ring everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px var(--accent-ring);
  border-radius: var(--radius-sm);
}

/* Headings */
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }

/* ── Sidebar ── */
.sidebar {
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  backdrop-filter: blur(12px);
  padding: 22px 14px;
}
.sidebar .brand {
  font-size: 15px;
  letter-spacing: 0.22em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 26px;
  padding: 0 8px;
}
.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  padding: 9px 12px;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.sidebar nav a.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  box-shadow: inset 2px 0 0 var(--accent);
}
/* Line icons via SVG mask (inherit currentColor) */
.sidebar nav a[data-route]::before {
  content: '';
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--ico) center / 18px 18px no-repeat;
  mask: var(--ico) center / 18px 18px no-repeat;
  opacity: 0.92;
}
.sidebar nav a[data-route="overview"], .sidebar nav a[data-route="home"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="reports"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='20' x2='21' y2='20'/%3E%3Cline x1='6' y1='20' x2='6' y2='15'/%3E%3Cline x1='12' y1='20' x2='12' y2='9'/%3E%3Cline x1='18' y1='20' x2='18' y2='5'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="earnings"], .sidebar nav a[data-route="sales"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="chatters"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-8.5 8.5 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8A8.5 8.5 0 0 1 12.5 3a8.5 8.5 0 0 1 8.5 8.5z'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="subscribers"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="acquisition"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cline x1='19' y1='8' x2='19' y2='14'/%3E%3Cline x1='22' y1='11' x2='16' y2='11'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="shifts"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="redflags"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cline x1='4' y1='22' x2='4' y2='15'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="accounts"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Ccircle cx='8' cy='10' r='2'/%3E%3Cpath d='M5 16a3 3 0 0 1 6 0'/%3E%3Cline x1='14' y1='9' x2='19' y2='9'/%3E%3Cline x1='14' y1='13' x2='19' y2='13'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="reconciliation"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="health"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E"); }
.sidebar nav a[data-route="settings"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E"); }

/* ── Buttons ── */
button {
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: filter 0.15s, transform 0.06s, box-shadow 0.15s, background 0.15s;
}
button:hover { background: var(--gradient-accent); filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button.secondary {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}
button.secondary:hover { background: var(--bg-hover); filter: none; border-color: var(--border-strong); }

/* ── Inputs ── */
input, select, textarea {
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* ── Cards / KPIs ── */
.card {
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.2s;
}
.kpi-card, .dash-mini, .stat {
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.kpi-card:hover, .dash-mini:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.kpi-card .value, .dash-mini .value { letter-spacing: -0.03em; }
.dash-total-card {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: var(--shadow-md);
}

/* ── Tables ── */
table { font-variant-numeric: tabular-nums; }
th {
  font-size: 10.5px;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}
td { font-size: 13px; }
tr { transition: background 0.12s; }
tr:hover td { background: var(--bg-hover); }

/* ── Badges / pills (dot-leading, crisper) ── */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge.green  { border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.badge.red    { border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.badge.yellow { border-color: color-mix(in srgb, var(--yellow) 30%, transparent); }

/* ── Segmented / range controls ── */
.seg button.active,
.range-tabs button.active {
  background: var(--gradient-accent);
  box-shadow: var(--shadow-sm);
}

/* ── Modals: stronger elevation + backdrop blur ── */
.modal-overlay, .modal-backdrop {
  background: rgba(6, 6, 12, 0.62);
  backdrop-filter: blur(4px);
}
.modal, .modal-card {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.modal-card { border-radius: var(--radius-lg); padding: 26px; }

/* ── Login ── */
.login-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
}
.login-card .brand {
  font-size: 18px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Misc polish ── */
.alert { box-shadow: var(--shadow-sm); }

/* ════════════════════════════════════════════════════════════
   DESIGN REFRESH v2 — professional layout & components
   ════════════════════════════════════════════════════════════ */

/* ── Sidebar refinements ── */
.sidebar { width: 234px; gap: 2px; }
.sidebar nav { gap: 3px; }
.sidebar nav a:hover { color: var(--text); }
.sidebar-footer #whoami,
.sidebar-footer { font-size: 12px; }

/* ── Page / main spacing & hierarchy ── */
main { padding: 30px 38px 56px; }
main > h1:first-child,
#content > h1:first-child { margin-bottom: 4px; }
h1 { font-size: 25px; }
h1 + .muted, h1 + p.muted { margin-bottom: 22px; }

/* Section heading that sits directly in the page (not in a card) */
main > h2 { margin: 30px 0 14px; }

/* ── Cards: clearer structure + header treatment ── */
.card { padding: 22px 24px; border-radius: 14px; }
.card > h2:first-child,
.card > h3:first-child { margin-top: 0; }
.card > h2 {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.card > h2:only-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

/* ── KPI cards: accent edge + bigger numbers ── */
.kpi-grid { gap: 14px; }
.kpi-card { padding: 18px 18px 16px; border-radius: 13px; }
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.18s;
}
.kpi-card:hover::after { opacity: 0.9; }
.kpi-card .label { font-size: 11px; color: var(--text-faint); margin-bottom: 10px; }
.kpi-card .value { font-size: 25px; font-weight: 700; }
.dash-total-card::after { opacity: 1; width: 4px; }

/* ── Tables: roomier, cleaner, pro ── */
.card > table,
.card table { margin: 2px -4px 0; width: calc(100% + 8px); }
th, td { padding: 12px 14px; }
th {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-strong);
}
td { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: var(--bg-hover); }

/* ── Action buttons: tidy, consistent pills ── */
.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 8px;
  margin: 0 6px 6px 0;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  transition: background 0.13s, border-color 0.13s, color 0.13s, transform 0.06s;
}
.btn-small:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.btn-small:active { transform: translateY(0); }

/* ── Forms ── */
input, select, textarea { padding: 9px 12px; }
.form-grid { gap: 14px 18px; }
.form-grid label { font-size: 11px; color: var(--text-faint); gap: 7px; }
.form-grid input, .form-grid select { min-height: 40px; }
.form-grid button { height: 40px; }

/* ── Status / platform pills ── */
.plat-pill, .badge { font-size: 11px; }

/* ── Login: centered, premium ── */
.login-card { width: 380px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  main { padding: 22px 18px 40px; }
  .card { padding: 18px 16px; }
}

/* ════════════════════════════════════════════════════════════
   DESIGN REFRESH v3 — effects, motion & "gadgets"
   GPU-friendly (transform/opacity), honours reduced-motion.
   ════════════════════════════════════════════════════════════ */

/* ── Living aurora backdrop ── */
body::before {
  content: '';
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 120%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46% 38% at 18% 12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(42% 34% at 88% 8%,  color-mix(in srgb, #38bdf8 20%, transparent), transparent 70%),
    radial-gradient(48% 40% at 70% 92%, color-mix(in srgb, #ec4899 16%, transparent), transparent 72%);
  filter: blur(28px) saturate(1.05);
  opacity: 0.55;
  animation: aurora 26s ease-in-out infinite alternate;
}
:root[data-theme="light"] body::before { opacity: 0.4; }
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1);       }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.04); }
}

/* ── Animated brand sheen ── */
.sidebar .brand, .login-card .brand {
  background-size: 200% auto;
  animation: brand-sheen 6s linear infinite;
}
@keyframes brand-sheen {
  to { background-position: 200% center; }
}

/* ── Buttons: glossy light sweep on hover ── */
button, .btn-small {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
button::after, .btn-small::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.32), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
button:hover::after, .btn-small:hover::after { left: 145%; }
.btn-small::after { background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent) 28%, transparent), transparent); }

/* ── Cards: cursor-tracked spotlight glow (set --mx/--my via JS, graceful default) ── */
.card, .kpi-card { position: relative; }
.kpi-card {
  background:
    radial-gradient(180px 180px at var(--mx, 50%) var(--my, -40%), var(--accent-soft), transparent 70%),
    var(--bg-elev);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-ring), 0 12px 40px -12px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ── Entrance motion for content blocks ── */
.card, .kpi-card, .dash-mini, .stat {
  animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.kpi-grid .kpi-card:nth-child(2) { animation-delay: 0.04s; }
.kpi-grid .kpi-card:nth-child(3) { animation-delay: 0.08s; }
.kpi-grid .kpi-card:nth-child(4) { animation-delay: 0.12s; }
.kpi-grid .kpi-card:nth-child(5) { animation-delay: 0.16s; }
.kpi-grid .kpi-card:nth-child(6) { animation-delay: 0.20s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Sidebar nav: slide + glow on hover/active ── */
.sidebar nav a { transition: background 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s; }
.sidebar nav a:hover { transform: translateX(2px); }
.sidebar nav a:hover::before { opacity: 1; transform: scale(1.08); }
.sidebar nav a[data-route]::before { transition: opacity 0.15s, transform 0.15s; }
.sidebar nav a.active { box-shadow: inset 2px 0 0 var(--accent), 0 0 22px -10px color-mix(in srgb, var(--accent) 70%, transparent); }

/* ── Live status dots with pulse ── */
.badge.green, .badge.red, .badge.yellow { display: inline-flex; align-items: center; gap: 6px; }
.badge.green::before, .badge.red::before, .badge.yellow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}
.badge.green::before {
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 70%, transparent);
  animation: pulse-dot 2s ease-out infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 65%, transparent); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── KPI value: subtle accent glow ── */
.dash-total-card .value { text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ── Shimmer loading state ── */
.loading {
  position: relative;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toggle switch glow when on ── */
.auto-refresh input[type="checkbox"]:checked {
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ── Tables: animated row reveal on hover accent line ── */
tbody tr { position: relative; }

/* ── Respect reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  body::before { animation: none; }
}
