/* ═══════════════════════════════════════════════════════════════
   E-BILLING ADMIN THEME — Light (default) & Dark Mode
   ═══════════════════════════════════════════════════════════════ */

/* ── LIGHT MODE (default) ─────────────────────────────────────── */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface2: #f0f2f5;
  --border: #e2e5ea;
  --accent: #4f8ef7;
  --green: #16a34a;
  --warn: #dc2626;
  --yellow: #d97706;
  --amber: #d97706;
  --purple: #7c3aed;
  --text: #1e293b;
  --muted: #64748b;

  /* Hardcoded color overrides for light mode */
  --hover-bg: #f1f3f7;
  --thead-bg: #f8f9fb;
  --success-bg: #ecfdf5;
  --error-bg: #fef2f2;
  --sks-badge-bg: #eff6ff;
  --dropdown-hover: #f1f3f7;
  --danger-hover-bg: #fef2f2;
  --selected-row-bg: rgba(220, 38, 38, 0.05);
  --selected-row-green-bg: rgba(22, 163, 74, 0.04);
  --bulk-amber-bg: rgba(217, 119, 6, 0.06);
  --bulk-amber-border: rgba(217, 119, 6, 0.2);
  --bulk-red-bg: rgba(220, 38, 38, 0.06);
  --bulk-red-border: rgba(220, 38, 38, 0.2);
  --checkbox-check-color: #fff;
  --checkbox-check-dark: #fff;
  --modal-overlay: rgba(0, 0, 0, 0.35);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ── DARK MODE ───────────────────────────────────────────────── */
html[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #1e2130;
  --border: #2a2d3a;
  --accent: #4f8ef7;
  --green: #34d399;
  --warn: #f87171;
  --yellow: #fbbf24;
  --amber: #f59e0b;
  --purple: #a78bfa;
  --text: #e2e8f0;
  --muted: #7a8ba0;

  --hover-bg: #1e2130;
  --thead-bg: #12151f;
  --success-bg: #162320;
  --error-bg: #231616;
  --sks-badge-bg: #1e2a3a;
  --dropdown-hover: #1e2130;
  --danger-hover-bg: #2a1616;
  --selected-row-bg: rgba(248, 113, 113, 0.06);
  --selected-row-green-bg: rgba(52, 211, 153, 0.05);
  --bulk-amber-bg: rgba(245, 158, 11, 0.08);
  --bulk-amber-border: rgba(245, 158, 11, 0.25);
  --bulk-red-bg: rgba(248, 113, 113, 0.08);
  --bulk-red-border: rgba(248, 113, 113, 0.25);
  --checkbox-check-color: #fff;
  --checkbox-check-dark: #0f1117;
  --modal-overlay: rgba(0, 0, 0, 0.7);
  --card-shadow: none;
}

/* ── THEME TOGGLE BUTTON ─────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.83rem;
  font-family: var(--mono, "Inter", sans-serif);
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--border);
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--hover-bg);
}

.theme-toggle .theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  line-height: 0;
}

.theme-toggle .theme-label {
  line-height: 1;
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Standalone toggle (for pages without dropdowns) */
.theme-toggle-standalone {
  align-items: right;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 998;
  color: var(--text);
}

.theme-toggle-standalone:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}

.theme-toggle-standalone svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-standalone .theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

/* ── SMOOTH TRANSITION ───────────────────────────────────────── */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease !important;
  transition-delay: 0s !important;
}
