:root {
  --bg-dark: #09090b;
  --bg-card: rgba(24, 24, 30, 0.85);
  --bg-card-solid: #18181e;
  --bg-sidebar: #0c0c10;
  --bg-input: #1c1c24;
  --bg-hover: #25252f;
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --text: #f0f0f5;
  --text-dim: #9ca3b0;
  --text-muted: #5c6370;
  --accent: #7c5cfc;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124, 92, 252, 0.25);
  --accent-soft: rgba(124, 92, 252, 0.1);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.1);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.1);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --duo-orange: #fb923c;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
  --glass: rgba(255,255,255,0.03);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -40%; left: -20%;
  width: 80vw; height: 80vw;
  background: radial-gradient(circle, rgba(124,92,252,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ──────────────────────────── */
.sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 4px 10px;
}

.brand-icon {
  font-size: 24px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.sidebar-brand h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--glass);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(124,92,252,0.18), rgba(167,139,250,0.08));
  color: white;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-dot.running {
  background: var(--success);
  box-shadow: 0 0 8px rgba(52,211,153,0.5);
  animation: pulse-glow 2s infinite;
}

.status-dot.stopped { background: var(--danger); }

@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(52,211,153,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 4px rgba(52,211,153,0.3); }
}

/* ─── Main ─────────────────────────────── */
.main {
  flex: 1;
  margin-left: 250px;
  padding: 28px 32px;
  min-height: 100vh;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, var(--text), var(--text-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-dim);
  margin-bottom: 18px;
  line-height: 1.5;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

/* ─── Stats Grid ───────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.stat-card:nth-child(1) .stat-icon { background: var(--accent-soft); color: var(--accent-light); }
.stat-card:nth-child(2) .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-card:nth-child(3) .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card:nth-child(4) .stat-icon { background: var(--info-soft); color: var(--info); }

.stat-icon {
  font-size: 22px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ─── Cards ────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
}

.card-header h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.card-body { padding: 18px 20px; }

.badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-light);
  font-weight: 600;
}

/* ─── Category Filter Cards ────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s ease;
  position: relative;
}

.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cat-color, var(--accent));
  opacity: 0.7;
  transition: opacity 0.2s;
}

.cat-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

.cat-card:hover::before { opacity: 1; }

.cat-card.disabled {
  opacity: 0.4;
}

.cat-card.disabled .cat-card-body {
  pointer-events: none;
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
}

.cat-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.cat-color-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(255,255,255,0.1);
}

.cat-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.cat-card-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  transition: background 0.15s;
}

.cat-option-row:hover {
  background: var(--bg-hover);
}

.cat-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.cat-option-label .opt-icon { font-size: 14px; }

.cat-delete-btn {
  width: 26px; height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}

.cat-delete-btn:hover {
  color: var(--danger);
  border-color: rgba(248,113,113,0.3);
  background: var(--danger-soft);
}

/* ─── Mini toggle ──────────────────────── */
.mini-toggle {
  position: relative;
  width: 36px; height: 20px;
  flex-shrink: 0;
}
.mini-toggle input { display: none; }
.mini-toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-hover);
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
}
.mini-toggle-slider::after {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  position: absolute;
  top: 2px; left: 2px;
  transition: all 0.25s;
}
.mini-toggle input:checked + .mini-toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.mini-toggle input:checked + .mini-toggle-slider::after {
  transform: translateX(16px);
  background: white;
}

/* Cat enable toggle */
.cat-enable-toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.cat-enable-toggle input { display: none; }
.cat-enable-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-hover);
  border-radius: 11px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
}
.cat-enable-slider::after {
  content: '';
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  top: 2px; left: 2px;
  transition: all 0.25s;
}
.cat-enable-toggle input:checked + .cat-enable-slider {
  background: var(--success);
  border-color: var(--success);
}
.cat-enable-toggle input:checked + .cat-enable-slider::after {
  transform: translateX(18px);
  background: white;
}

/* ─── Buttons ──────────────────────────── */
.btn {
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-success { background: var(--success); color: #0a0a0a; font-weight: 700; }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
}
.btn-outline:hover { background: var(--glass); color: var(--text); border-color: var(--text-muted); }

.btn-row { display: flex; gap: 8px; margin-top: 12px; }

/* ─── Forms ────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Interval Input ───────────────────── */
.interval-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.interval-input-row input[type="number"] {
  width: 100px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  transition: all 0.2s;
  -moz-appearance: textfield;
}

.interval-input-row input[type="number"]::-webkit-inner-spin-button,
.interval-input-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.interval-input-row input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Event Health LEDs ────────────────── */
.event-health {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.led.green {
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.led.red {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
  animation: led-blink 1.5s infinite;
}

.led.grey {
  background: var(--text-muted);
}

@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.health-label {
  font-size: 11px;
  color: var(--text-muted);
}

.health-label.ok { color: var(--success); }
.health-label.error { color: var(--danger); }


/* ─── Toggles ──────────────────────────── */
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.toggle input { display: none; }
.toggle-slider {
  width: 44px; height: 24px;
  background: var(--bg-hover);
  border-radius: 12px;
  position: relative;
  transition: all 0.25s;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.toggle-slider::after {
  content: '';
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  position: absolute;
  top: 2px; left: 2px;
  transition: all 0.25s;
}
.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: white;
}
.toggle-label {
  font-size: 14px;
  font-weight: 500;
}

/* ─── Settings Grid ────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.proxy-stats {
  margin: 10px 0;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ─── Events ───────────────────────────── */
.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.event-row:last-child { border-bottom: none; }

.event-info { flex: 1; }

.event-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.event-date {
  font-size: 12px;
  color: var(--text-muted);
}

.event-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.event-ticket-count {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
}

.event-ticket-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.event-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── Tickets ──────────────────────────── */
.tickets-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticket-chip {
  font-size: 11px;
  padding: 5px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.ticket-chip:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.ticket-chip .cat {
  color: var(--accent-light);
  font-weight: 600;
}

.ticket-chip .price {
  color: var(--success);
  font-weight: 600;
}

/* ─── Logs ─────────────────────────────── */
.logs-container {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.7;
  max-height: 600px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.logs-container::-webkit-scrollbar { width: 6px; }
.logs-container::-webkit-scrollbar-track { background: transparent; }
.logs-container::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.log-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 1px 0;
}

.log-line.error { color: var(--danger); }
.log-line.success { color: var(--success); }
.log-line.warn { color: var(--warning); }
.log-line.info { color: var(--info); }
.log-line.duo { color: var(--duo-orange); font-weight: 700; }

/* ─── Modal ────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 { margin-bottom: 18px; font-size: 16px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ─── Toast ────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  font-family: 'Inter', sans-serif;
  backdrop-filter: blur(12px);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Responsive ───────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
  body::before { display: none; }

  .app { flex-direction: column; padding-bottom: 68px; }

  /* Sidebar → bottom nav on mobile */
  .sidebar {
    position: fixed;
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%;
    height: 64px;
    flex-direction: row;
    padding: 0 8px;
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 200;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
  }

  .sidebar-brand { display: none; }
  .sidebar-footer { display: none; }

  .sidebar-nav {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    gap: 0;
  }

  .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px;
    font-size: 10px;
    text-align: center;
    border-radius: 8px;
    flex: 1;
  }

  .nav-item.active::before { display: none; }
  .nav-item.active {
    background: var(--accent-soft);
  }

  .nav-icon { font-size: 20px; width: auto; }

  .main {
    margin-left: 0;
    padding: 16px 14px;
    padding-bottom: 80px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header h2 { font-size: 20px; }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    gap: 10px;
  }

  .stat-icon {
    width: 40px; height: 40px;
    font-size: 18px;
    border-radius: 10px;
  }

  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }

  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }

  .settings-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr; }

  .event-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 0;
  }

  .event-status { margin-right: 0; }
  .event-actions { width: 100%; justify-content: flex-end; }

  .tickets-list { gap: 4px; }
  .ticket-chip { font-size: 10px; padding: 4px 8px; }

  /* Bigger touch targets */
  .btn { padding: 10px 16px; font-size: 13px; }
  .toggle-slider { width: 48px; height: 26px; }
  .toggle-slider::after { width: 20px; height: 20px; }
  .toggle input:checked + .toggle-slider::after { transform: translateX(22px); }

  .cat-card-body { padding: 10px 14px; }
  .cat-option-row { padding: 8px 10px; }
  .cat-option-label { font-size: 12px; }

  .modal { width: 95vw; padding: 20px; }

  .toast { left: 14px; right: 14px; bottom: 76px; text-align: center; }

  .logs-container { max-height: 400px; font-size: 10.5px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; }

  .page-header h2 { font-size: 18px; }

  .nav-item { font-size: 9px; padding: 6px 4px; }
  .nav-icon { font-size: 18px; }

  .cat-card-name { font-size: 12px; }
  .header-actions .btn { font-size: 12px; padding: 8px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Ce qui est PROPRE à TM Monitor.
   Tout ce qui précède est la feuille de sdf.julomi.net, copiée telle quelle
   pour que les deux sites se ressemblent vraiment — y compris sur mobile, où
   la barre latérale devient une barre du bas.

   ⚠️ Les ajouts vivent ICI, à la fin, et nulle part au milieu : le jour où la
   feuille de sdf évolue, on la recopie et on recolle ce bloc. Un ajout glissé
   entre deux règles d'origine se perdrait dans la copie suivante.
   ═══════════════════════════════════════════════════════════════════════════ */

/* La pastille d'état d'un événement, sur le tableau de bord.
   ⚠️ TROIS états, pas deux : « pas encore vu » n'est pas « en erreur ». Au
   démarrage, aucun événement n'a été visité — les peindre en rouge ferait
   chercher une panne qui n'existe pas. */
.event-row .event-status {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: none;
  margin-right: 14px;
  background: var(--text-muted);
}
.event-row .event-status.ok {
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.45);
}
.event-row .event-status.err {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.45);
}
.event-row .event-status.idle { background: var(--text-muted); }
.event-row .event-status.off {
  background: transparent;
  border: 2px solid var(--text-muted);
}

/* Le choix d'événement de la page Catégories. La feuille d'origine n'a pas de
   `select` — sdf n'en emploie aucun — d'où cette règle, calquée sur celle des
   champs texte pour que les deux se ressemblent. */
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%239ca3b0' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
