:root,
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #004aad;
  --accent: #004aad;
  --accent-hover: #00307a;
  --accent-light: #e8f0fe;
  --blue: #004aad;
  --red: #bf1a1a;
  --green: #22c55e;
  --amber: #f59e0b;
  --muted: #64748b;
  --red: #bf1a1a;
  --red-light: #fde8e8;
  --green: #22c55e;
  --green-light: #dcfce7;
  --yellow: #f59e0b;
  --yellow-light: #fef3c7;
  --warning: #f59e0b;
  --success: #22c55e;
  --danger: #bf1a1a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --surface2: #e2e8f0;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger-bg: rgba(191, 26, 26, 0.1);
  --chart-bar: #004aad;
  --omr-bg: #f8fafc;
  --omr-border: #e2e8f0;
  --code-bg: #f1f5f9;
  --input-bg: #ffffff;
  --navbar-bg: rgba(255,255,255,0.92);
  --badge-admin: #e8f0fe;
  --badge-admin-text: #00307a;
  --tag-blue-bg: #e8f0fe;
  --tag-blue-text: #00307a;
  --tag-green-bg: #dcfce7;
  --tag-green-text: #15803d;
  --tag-amber-bg: #fef3c7;
  --tag-amber-text: #92400e;
  --tag-red-bg: #fee2e2;
  --tag-red-text: #b91c1c;
  --tag-gray-bg: #f1f5f9;
  --tag-gray-text: #475569;
  --tag-purple-bg: #f3e8ff;
  --tag-purple-text: #004aad;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-focus: #3b82f6;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: #1e3a5f;
  --blue: #3b82f6;
  --red: #ef4444;
  --green: #22c55e;
  --amber: #f59e0b;
  --muted: #94a3b8;
  --red: #ef4444;
  --red-light: #3b1a1a;
  --green: #22c55e;
  --green-light: #1a3a1a;
  --yellow: #f59e0b;
  --yellow-light: #3a2e0a;
  --warning: #f59e0b;
  --success: #22c55e;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --surface2: #334155;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger-bg: rgba(239, 68, 68, 0.1);
  --chart-bar: #3b82f6;
  --omr-bg: #0f172a;
  --omr-border: #334155;
  --code-bg: #0f172a;
  --input-bg: #0f172a;
  --navbar-bg: rgba(15,23,42,0.92);
  --badge-admin: #1e3a5f;
  --badge-admin-text: #93c5fd;
  --tag-blue-bg: #1e3a5f;
  --tag-blue-text: #93c5fd;
  --tag-green-bg: #14532d;
  --tag-green-text: #86efac;
  --tag-amber-bg: #451a03;
  --tag-amber-text: #fcd34d;
  --tag-red-bg: #450a0a;
  --tag-red-text: #fca5a5;
  --tag-gray-bg: #1e293b;
  --tag-gray-text: #94a3b8;
  --tag-purple-bg: #1e1b4b;
  --tag-purple-text: #c4b5fd;
}

[data-theme="system"] {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-focus: #3b82f6;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: #1e3a5f;
    --blue: #3b82f6;
    --amber: #f59e0b;
    --muted: #94a3b8;
    --red: #ef4444;
    --red-light: #3b1a1a;
    --green: #22c55e;
    --green-light: #1a3a1a;
    --yellow: #f59e0b;
    --yellow-light: #3a2e0a;
    --warning: #f59e0b;
    --success: #22c55e;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
    --chart-bar: #3b82f6;
    --omr-bg: #0f172a;
    --omr-border: #334155;
    --code-bg: #0f172a;
    --input-bg: #0f172a;
    --navbar-bg: rgba(15,23,42,0.92);
    --badge-admin: #1e3a5f;
    --badge-admin-text: #93c5fd;
    --tag-blue-bg: #1e3a5f;
    --tag-blue-text: #93c5fd;
    --tag-green-bg: #14532d;
    --tag-green-text: #86efac;
    --tag-amber-bg: #451a03;
    --tag-amber-text: #fcd34d;
    --tag-red-bg: #450a0a;
    --tag-red-text: #fca5a5;
    --tag-gray-bg: #1e293b;
    --tag-gray-text: #94a3b8;
    --tag-purple-bg: #1e1b4b;
    --tag-purple-text: #c4b5fd;
  }

/* ── Theme widget (dark/light toggle) ── */
.theme-widget {
  display: table; table-layout: fixed;
  background: var(--surface2); border-radius: 8px;
  padding: 2px; border-spacing: 0; margin: 2px;
}
.theme-btn {
  display: table-cell; vertical-align: middle; text-align: center;
  width: 34px; height: 30px; border: none; border-radius: 0;
  background: transparent; cursor: pointer; padding: 0;
  color: var(--text-muted); line-height: 1;
  transition: all 0.12s;
}
.theme-btn:first-child { border-radius: 6px 0 0 6px; }
.theme-btn:last-child { border-radius: 0 6px 6px 0; }
.theme-btn:hover { color: var(--text); background: var(--surface-hover); }
.theme-btn.active {
  background: var(--surface); box-shadow: var(--shadow-sm);
  color: var(--accent);
}
.theme-btn svg { display: block; margin: 0 auto; width: 18px; height: 18px; }
