/* ╔═══════════════════════════════════════════════════════════════════╗
   ║  GANESHA UNIFIED THEME — Single Source of Truth                 ║
   ║  Global GUI for Admin · Client · Employee · Auth pages          ║
   ║  Dark / light mode, components, utilities                       ║
   ╚═══════════════════════════════════════════════════════════════════╝ */

/* Alpine.js cloak – hide elements before Alpine initialises */
[x-cloak] {
    display: none !important;
}

/* Hard reset – must be first */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Softer off-white page background – reduces eye strain in light mode */
body:not(.dark) {
    background-color: #ededea !important;
}

/* ============================================
   §1  DESIGN TOKENS (CSS Variables)
   ============================================ */

:root {
    /* Brand */
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --success: #16a34a;
    --success-light: #22c55e;
    --danger: #dc2626;
    --warning: #ca8a04;
    --info: #2563eb;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --text-primary: #1e293b;

    /* Surface */
    --card-bg: #ffffff;
    --card-bg-alt: var(--bg-light);
    --card-border: var(--border);
    --card-shadow: rgba(0, 0, 0, 0.06);
    --card-shadow-hover: rgba(0, 0, 0, 0.08);

    /* Table */
    --thead-bg: var(--bg-light);
    --thead-bg-alt: #f1f5f9;
    --th-color: #475569;
    --td-color: var(--text-primary);
    --tr-hover-bg: rgba(124, 58, 237, 0.04);
    --tr-hover-bg-alt: rgba(99, 102, 241, 0.02);

    /* Form */
    --input-bg: white;
    --input-border: var(--border);
    --input-color: var(--text-dark);

    /* Aliases (used by employee/public pages) */
    --text: var(--text-dark);
    --text-color: var(--text-dark);
    --card: var(--card-bg);
    --surface: var(--card-bg);
    --surface-alt: var(--card-bg-alt);

    /* Misc */
    --section-title-color: var(--text-dark);
    --empty-bg: rgba(124, 58, 237, 0.04);
    --empty-bg-alt: rgba(99, 102, 241, 0.02);
    --empty-border: var(--border);
}

/* ── Dark token overrides ── */
.dark {
    --border: #374151;
    --bg-light: #111827;
    --text-dark: #f9fafb;
    --text-primary: #e5e7eb;
    --muted: #9ca3af;
    --card-bg: #1f2937;
    --card-bg-alt: #111827;
    --card-border: #374151;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --card-shadow-hover: rgba(0, 0, 0, 0.4);
    --thead-bg: #1f2937;
    --thead-bg-alt: #1f2937;
    --th-color: #9ca3af;
    --td-color: #e5e7eb;
    --tr-hover-bg: rgba(124, 58, 237, 0.12);
    --tr-hover-bg-alt: rgba(99, 102, 241, 0.08);
    --input-bg: #1f2937;
    --input-border: #374151;
    --input-color: #f9fafb;
    --section-title-color: #f9fafb;
    --empty-bg: rgba(124, 58, 237, 0.08);
    --empty-bg-alt: rgba(99, 102, 241, 0.06);
    --empty-border: #374151;
    --text: #f9fafb;
    --text-color: #f9fafb;
    --card: #1f2937;
    --surface: #1f2937;
    --surface-alt: #111827;
}

/* ============================================
   §2  COMPONENT — Cards
   ============================================ */

.card {
    background: linear-gradient(135deg, var(--card-bg), var(--card-bg-alt));
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px var(--card-shadow);
    margin-bottom: 28px;
    color: var(--td-color);
}

.card:hover {
    box-shadow: 0 8px 24px var(--card-shadow-hover);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   §3  COMPONENT — Tables
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: linear-gradient(135deg, var(--thead-bg), var(--thead-bg-alt));
}

table thead tr {
    border-bottom: 3px solid var(--card-border);
}

table thead th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    color: var(--th-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr {
    border-bottom: 1px solid var(--card-border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

table tbody tr:hover {
    background: linear-gradient(135deg, var(--tr-hover-bg), var(--tr-hover-bg-alt));
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

table tbody td {
    padding: 16px;
    color: var(--td-color);
    font-size: 14px;
}

/* ============================================
   §4  COMPONENT — Buttons
   ============================================ */

.btn {
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    padding: 10px 18px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(99, 102, 241, 0.05));
    color: #4f46e5;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(99, 102, 241, 0.08));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

/* ============================================
   §5  COMPONENT — Badges
   ============================================ */

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-scheduled {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid rgba(30, 64, 175, 0.2);
}

.badge-in-progress,
.badge-ongoing {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid rgba(146, 64, 14, 0.2);
}

.badge-completed {
    background: #dcfce7;
    color: #166534;
    border: 1px solid rgba(22, 101, 52, 0.2);
}

.badge-cancelled {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid rgba(55, 65, 81, 0.2);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(37, 99, 235, 0.15);
    color: var(--info);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.dark .badge-scheduled {
    background: rgba(30, 64, 175, 0.25);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.3);
}

.dark .badge-in-progress,
.dark .badge-ongoing {
    background: rgba(146, 64, 14, 0.25);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.3);
}

.dark .badge-completed {
    background: rgba(22, 101, 52, 0.25);
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.3);
}

.dark .badge-cancelled {
    background: rgba(55, 65, 81, 0.4);
    color: #d1d5db;
    border-color: rgba(156, 163, 175, 0.3);
}

/* ============================================
   §6  COMPONENT — Progress Bar
   ============================================ */

.progress-bar {
    height: 6px;
    background: var(--card-border);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--input-border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

/* ============================================
   §7  COMPONENT — Form Elements
   ============================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--input-bg);
    color: var(--input-color);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ============================================
   §8  COMPONENT — Section Headers
   ============================================ */

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

.section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--section-title-color);
    letter-spacing: -0.3px;
}

/* ============================================
   §9  COMPONENT — Alerts
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 600;
    border-left: 4px solid;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left-color: var(--success);
}

.alert-error,
.alert-danger {
    background: #fee2e2;
    color: #7f1d1d;
    border-left-color: var(--danger);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-info {
    background: #dbeafe;
    color: #0c2d6b;
    border-left-color: var(--info);
}

.dark .alert-success {
    background: rgba(22, 163, 74, 0.15);
    color: #86efac;
}

.dark .alert-error,
.dark .alert-danger {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
}

.dark .alert-warning {
    background: rgba(202, 138, 4, 0.15);
    color: #fde68a;
}

.dark .alert-info {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
}

/* ============================================
   §10  COMPONENT — Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, var(--empty-bg), var(--empty-bg-alt));
    border-radius: 12px;
    border: 2px dashed var(--empty-border);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--section-title-color);
    font-weight: 700;
}

.empty-state-text {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

/* ============================================
   §11  UTILITY CLASSES
   ============================================ */

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--muted);
}

/* ╔═══════════════════════════════════════════════════════════════════╗
   ║  §12  UNIVERSAL DARK MODE — Tailwind Utility Overrides          ║
   ║  These rules fire when <html class="dark">.                     ║
   ║  They cover ALL pages: admin, client, employee, auth.           ║
   ╚═══════════════════════════════════════════════════════════════════╝ */

/* ── 12a  Global typography ── */
.dark .max-w-7xl,
.dark .max-w-6xl,
.dark .max-w-5xl,
.dark .max-w-4xl,
.dark .max-w-3xl,
.dark .max-w-2xl,
.dark .container,
.dark .container-fluid {
    color: #e5e7eb;
}

.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark h5,
.dark h6 {
    color: #f9fafb !important;
}

.dark p {
    color: #d1d5db;
}

.dark label {
    color: #e5e7eb;
}

.dark small,
.dark .text-xs,
.dark .text-sm {
    color: #9ca3af;
}

/* ── 12a-ii  Color-scheme — tells the browser to render native UI dark ── */
.dark,
.dark input,
.dark select,
.dark textarea {
    color-scheme: dark;
}

/* ── 12b  Tailwind text-gray-* ── */
.dark .text-gray-900 {
    color: #f9fafb !important;
}

.dark .text-gray-800 {
    color: #f3f4f6 !important;
}

.dark .text-gray-700 {
    color: #e5e7eb !important;
}

.dark .text-gray-600 {
    color: #d1d5db !important;
}

.dark .text-gray-500 {
    color: #9ca3af !important;
}

.dark .text-gray-400 {
    color: #9ca3af !important;
}

.dark .text-blue-700 {
    color: #93c5fd !important;
}

.dark .text-green-700 {
    color: #86efac !important;
}

.dark .text-green-600 {
    color: #6ee7b7 !important;
}

.dark .text-red-700 {
    color: #fca5a5 !important;
}

.dark .text-red-600 {
    color: #fca5a5 !important;
}

/* ── 12b-ii  Tailwind text-slate-* ── */
.dark .text-slate-900 {
    color: #f8fafc !important;
}

.dark .text-slate-800 {
    color: #f1f5f9 !important;
}

.dark .text-slate-700 {
    color: #e2e8f0 !important;
}

.dark .text-slate-600 {
    color: #cbd5e1 !important;
}

.dark .text-slate-500 {
    color: #94a3b8 !important;
}

.dark .text-slate-400 {
    color: #94a3b8 !important;
}

.dark strong.text-blue-700 {
    color: #93c5fd !important;
}

/* ── 12b-iii  Tailwind text-*-800 (badge / label text) ── */
.dark .text-red-800 {
    color: #fca5a5 !important;
}

.dark .text-orange-800 {
    color: #fdba74 !important;
}

.dark .text-yellow-800 {
    color: #fde68a !important;
}

.dark .text-green-800 {
    color: #86efac !important;
}

.dark .text-blue-800 {
    color: #93c5fd !important;
}

.dark .text-indigo-800 {
    color: #a5b4fc !important;
}

.dark .text-purple-800 {
    color: #c4b5fd !important;
}

.dark .text-pink-800 {
    color: #f9a8d4 !important;
}

.dark .text-amber-800 {
    color: #fcd34d !important;
}

.dark .text-emerald-800 {
    color: #6ee7b7 !important;
}

.dark .text-teal-800 {
    color: #5eead4 !important;
}

.dark .text-cyan-800 {
    color: #67e8f9 !important;
}

.dark .text-violet-800 {
    color: #c4b5fd !important;
}

.dark .text-rose-800 {
    color: #fda4af !important;
}

/* ── 12b-iv  Tailwind text-*-700 (badge / link text) ── */
.dark .text-emerald-700 {
    color: #6ee7b7 !important;
}

.dark .text-amber-700 {
    color: #fcd34d !important;
}

.dark .text-teal-700 {
    color: #5eead4 !important;
}

.dark .text-cyan-700 {
    color: #67e8f9 !important;
}

.dark .text-violet-700 {
    color: #c4b5fd !important;
}

.dark .text-indigo-700 {
    color: #a5b4fc !important;
}

.dark .text-orange-700 {
    color: #fdba74 !important;
}

.dark .text-purple-700 {
    color: #c4b5fd !important;
}

.dark .text-rose-700 {
    color: #fda4af !important;
}

.dark .text-yellow-700 {
    color: #fde68a !important;
}

.dark .text-pink-700 {
    color: #f9a8d4 !important;
}

/* ── 12b-v  Tailwind text-*-600 (labels / muted links) ── */
.dark .text-emerald-600 {
    color: #34d399 !important;
}

.dark .text-amber-600 {
    color: #fbbf24 !important;
}

.dark .text-teal-600 {
    color: #2dd4bf !important;
}

.dark .text-cyan-600 {
    color: #22d3ee !important;
}

.dark .text-violet-600 {
    color: #a78bfa !important;
}

.dark .text-indigo-600 {
    color: #818cf8 !important;
}

.dark .text-orange-600 {
    color: #fb923c !important;
}

.dark .text-purple-600 {
    color: #a78bfa !important;
}

.dark .text-rose-600 {
    color: #fb7185 !important;
}

.dark .text-yellow-600 {
    color: #facc15 !important;
}

.dark .text-pink-600 {
    color: #f472b6 !important;
}

/* ── 12b-vi  Tailwind text-*-500 (icons / accents — keep vivid) ── */
.dark .text-emerald-500 {
    color: #10b981 !important;
}

.dark .text-amber-500 {
    color: #f59e0b !important;
}

.dark .text-teal-500 {
    color: #14b8a6 !important;
}

.dark .text-cyan-500 {
    color: #06b6d4 !important;
}

.dark .text-violet-500 {
    color: #8b5cf6 !important;
}

.dark .text-indigo-500 {
    color: #6366f1 !important;
}

.dark .text-orange-500 {
    color: #f97316 !important;
}

.dark .text-purple-500 {
    color: #a855f7 !important;
}

.dark .text-rose-500 {
    color: #f43f5e !important;
}

.dark .text-yellow-500 {
    color: #eab308 !important;
}

.dark .text-pink-500 {
    color: #ec4899 !important;
}

/* ── 12c  Tailwind bg-white / bg-gray-* ── */
.dark .bg-white {
    background: #1f2937 !important;
}

.dark .bg-white\/90,
.dark [class*="bg-white/90"] {
    background: rgba(31, 41, 55, 0.92) !important;
    border-color: #374151 !important;
}

.dark .bg-white\/80,
.dark [class*="bg-white/80"] {
    background: rgba(31, 41, 55, 0.85) !important;
    border-color: rgba(55, 65, 81, 0.5) !important;
}

.dark .bg-white\/60,
.dark .bg-white\/50 {
    background: rgba(31, 41, 55, 0.8) !important;
    border-color: rgba(55, 65, 81, 0.5) !important;
}

.dark .bg-gray-50,
.dark .bg-gray-100 {
    background: #1f2937 !important;
}

.dark .bg-gray-200 {
    background: #374151 !important;
}

/* Hover state overrides for table rows & interactive elements */
.dark .hover\:bg-gray-50:hover,
.dark .hover\:bg-gray-100:hover {
    background: #374151 !important;
}

/* Colored hover backgrounds */
.dark .hover\:bg-blue-100:hover {
    background: rgba(59, 130, 246, 0.15) !important;
}

.dark .hover\:bg-cyan-100:hover {
    background: rgba(6, 182, 212, 0.15) !important;
}

.dark .hover\:bg-amber-100:hover {
    background: rgba(245, 158, 11, 0.15) !important;
}

.dark .hover\:bg-green-100:hover {
    background: rgba(22, 163, 74, 0.15) !important;
}

.dark .hover\:bg-red-100:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

.dark .hover\:bg-purple-100:hover {
    background: rgba(139, 92, 246, 0.15) !important;
}

.dark .hover\:bg-indigo-100:hover {
    background: rgba(99, 102, 241, 0.15) !important;
}

.dark .hover\:bg-orange-100:hover {
    background: rgba(249, 115, 22, 0.15) !important;
}

.dark .hover\:bg-rose-100:hover {
    background: rgba(244, 63, 94, 0.15) !important;
}

.dark .bg-gray-50.rounded-l-lg,
.dark span.inline-flex {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #d1d5db !important;
}

/* ── 12d  Tailwind bg-<color>-50/100 (alert-like) ── */
.dark .bg-green-50,
.dark .bg-green-100 {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #86efac !important;
}

.dark .bg-blue-50,
.dark .bg-blue-100 {
    background: rgba(37, 99, 235, 0.15) !important;
    color: #93c5fd !important;
}

.dark .bg-red-50,
.dark .bg-red-100 {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

.dark .bg-yellow-50,
.dark .bg-yellow-100 {
    background: rgba(245, 158, 11, 0.15) !important;
}

.dark .bg-indigo-50,
.dark .bg-indigo-100 {
    background: rgba(99, 102, 241, 0.15) !important;
}

.dark .bg-purple-50,
.dark .bg-purple-100 {
    background: rgba(139, 92, 246, 0.15) !important;
}

/* ── 12e  Icon background tints ── */
.dark .bg-blue-100 {
    background: rgba(59, 130, 246, 0.2) !important;
}

.dark .bg-green-100 {
    background: rgba(16, 185, 129, 0.2) !important;
}

.dark .bg-purple-100 {
    background: rgba(139, 92, 246, 0.2) !important;
}

.dark .bg-orange-100 {
    background: rgba(249, 115, 22, 0.2) !important;
    color: #fdba74 !important;
}

.dark .bg-yellow-100,
.dark .bg-yellow-200 {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #fde68a !important;
}

.dark .bg-pink-100 {
    background: rgba(236, 72, 153, 0.2) !important;
}

.dark .bg-indigo-100 {
    background: rgba(99, 102, 241, 0.2) !important;
}

.dark .bg-purple-200 {
    background: rgba(139, 92, 246, 0.15) !important;
}

.dark .bg-blue-200 {
    background: rgba(59, 130, 246, 0.15) !important;
}

/* ── 12e-ii  Additional icon/stat backgrounds ── */
.dark .bg-amber-50,
.dark .bg-amber-100 {
    background: rgba(245, 158, 11, 0.15) !important;
}

.dark .bg-emerald-50,
.dark .bg-emerald-100 {
    background: rgba(16, 185, 129, 0.15) !important;
}

.dark .bg-teal-50,
.dark .bg-teal-100 {
    background: rgba(20, 184, 166, 0.15) !important;
}

.dark .bg-cyan-50,
.dark .bg-cyan-100 {
    background: rgba(6, 182, 212, 0.15) !important;
}

.dark .bg-rose-50,
.dark .bg-rose-100 {
    background: rgba(244, 63, 94, 0.15) !important;
}

.dark .bg-red-100 {
    background: rgba(239, 68, 68, 0.15) !important;
}

.dark .bg-violet-50,
.dark .bg-violet-100 {
    background: rgba(139, 92, 246, 0.15) !important;
}

.dark .bg-lime-50,
.dark .bg-lime-100 {
    background: rgba(132, 204, 22, 0.15) !important;
}

.dark .bg-slate-50,
.dark .bg-slate-100 {
    background: #1e293b !important;
}

.dark .bg-slate-200 {
    background: #334155 !important;
}

.dark .border-slate-200,
.dark .border-slate-300 {
    border-color: #475569 !important;
}

/* ── 12f  Gradient from-*/
via-*/to-* (light tints → dark slate) ── */ .dark [class*="from-gray-50"],
.dark [class*="from-indigo-50"],
.dark [class*="from-blue-50"],
.dark [class*="from-purple-50"],
.dark [class*="from-green-50"],
.dark [class*="from-emerald-50"],
.dark [class*="from-red-50"],
.dark [class*="from-amber-50"],
.dark [class*="from-orange-50"],
.dark [class*="from-yellow-50"],
.dark [class*="from-pink-50"] {
    --tw-gradient-from: #1e293b !important;
    --tw-gradient-to: #1e293b !important;
    background: #1f2937 !important;
}

.dark [class*="via-orange-50"],
.dark [class*="via-indigo-50"],
.dark [class*="via-purple-50"],
.dark [class*="via-pink-50"] {
    --tw-gradient-via: #1e293b !important;
}

.dark [class*="to-indigo-50"],
.dark [class*="to-pink-50"],
.dark [class*="to-blue-50"],
.dark [class*="to-emerald-50"],
.dark [class*="to-yellow-50"],
.dark [class*="to-purple-50"],
.dark [class*="to-orange-50"] {
    --tw-gradient-to: #1e293b !important;
}

/* ── 12g  Borders ── */
.dark .border-white\/50,
.dark [class*="border-white/50"] {
    border-color: #374151 !important;
}

.dark .border-gray-100,
.dark .border-gray-200,
.dark .border-gray-300 {
    border-color: #4b5563 !important;
}

.dark .ring-gray-200 {
    --tw-ring-color: #4b5563 !important;
}

.dark .border-indigo-100,
.dark .border-indigo-200 {
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.dark .border-purple-100,
.dark .border-purple-200 {
    border-color: #374151 !important;
}

.dark .border-blue-100,
.dark .border-blue-200 {
    border-color: #374151 !important;
}

.dark .border-yellow-200,
.dark .border-green-200,
.dark .border-orange-200 {
    border-color: #374151 !important;
}

/* Colored badge/card borders — darken for dark mode */
.dark .border-emerald-100,
.dark .border-emerald-200,
.dark .border-emerald-300,
.dark .border-amber-100,
.dark .border-amber-200,
.dark .border-amber-300,
.dark .border-green-100,
.dark .border-green-300,
.dark .border-red-100,
.dark .border-red-200,
.dark .border-red-300,
.dark .border-blue-300,
.dark .border-orange-100,
.dark .border-orange-300,
.dark .border-cyan-200,
.dark .border-cyan-300,
.dark .border-teal-100,
.dark .border-teal-200,
.dark .border-teal-300,
.dark .border-purple-300,
.dark .border-indigo-300,
.dark .border-violet-100,
.dark .border-violet-200,
.dark .border-violet-300,
.dark .border-rose-200,
.dark .border-rose-300,
.dark .border-yellow-200 {
    border-color: #374151 !important;
}

.dark hr {
    border-color: #374151;
}

.dark [class*="divide-gray-"]>*+* {
    border-color: #374151;
}

/* ── 12h  Form inputs (catch-all with !important) ── */
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark input[type="date"],
.dark input[type="search"],
.dark input[type="url"],
.dark input[type="tel"],
.dark input[type="time"],
.dark input[type="datetime-local"],
.dark input[type="month"],
.dark input[type="week"],
.dark input:not([type]),
.dark textarea,
.dark select,
.dark .form-control {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

/* Ensure select options also render correctly in dark mode */
.dark select option {
    background: #1f2937;
    color: #f9fafb;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #6b7280 !important;
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    border-color: #7c3aed !important;
}

.dark input:read-only {
    background-color: #374151 !important;
}

.dark .validation-error {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

.dark .validation-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
}

/* ── 12j  Bootstrap modal dark override ── */
.dark .modal-content {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

.dark .modal-header {
    border-color: #374151 !important;
}

.dark .modal-footer {
    border-color: #374151 !important;
}

/* ── 12i  Shadows ── */
.dark .shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.dark .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4) !important;
}

.dark .backdrop-blur-sm {
    backdrop-filter: blur(12px);
}

/* ── 12j  Links ── */
.dark a:not([class*="bg-"]):not([class*="btn"]):not(.nav-item):not(.sidebar-link) {
    color: inherit;
}

/* ╔═══════════════════════════════════════════════════════════════════╗
   ║  §13  UNIVERSAL DARK MODE — Inline Style Selectors              ║
   ║  Catches views with hardcoded style="background:white" etc.     ║
   ╚═══════════════════════════════════════════════════════════════════╝ */

.dark [style*="background: white"],
.dark [style*="background:white"],
.dark [style*="background:#fff"],
.dark [style*="background: #fff"],
.dark [style*="background:#ffffff"],
.dark [style*="background: #ffffff"],
.dark [style*="background-color: white"],
.dark [style*="background-color:white"],
.dark [style*="background-color:#fff"],
.dark [style*="background-color: #fff"],
.dark [style*="background-color:#ffffff"],
.dark [style*="background-color: #ffffff"],
.dark [style*="background: #f8fafc"],
.dark [style*="background-color: #f8fafc"],
.dark [style*="background: #f9fafb"],
.dark [style*="background-color: #f9fafb"],
.dark [style*="background: #f1f5f9"],
.dark [style*="background-color: #f1f5f9"] {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}

/* ── 13b  Inline light-tint backgrounds → dark equivalents ── */
.dark [style*="background: #ecfdf5"],
.dark [style*="background:#ecfdf5"],
.dark [style*="background: #d1fae5"],
.dark [style*="background:#d1fae5"],
.dark [style*="background: #ccfbf1"],
.dark [style*="background:#ccfbf1"] {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.dark [style*="background: #fee2e2"],
.dark [style*="background:#fee2e2"] {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.dark [style*="background: #ede9fe"],
.dark [style*="background:#ede9fe"] {
    background: rgba(124, 58, 237, 0.15) !important;
    color: #c4b5fd !important;
    border-color: rgba(124, 58, 237, 0.3) !important;
}

.dark [style*="background: #dbeafe"],
.dark [style*="background:#dbeafe"] {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

.dark [style*="background: #fef3c7"],
.dark [style*="background:#fef3c7"],
.dark [style*="background: #fffbeb"],
.dark [style*="background:#fffbeb"] {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.dark [style*="background: #f3f4f6"],
.dark [style*="background:#f3f4f6"],
.dark [style*="background: #e5e7eb"],
.dark [style*="background:#e5e7eb"] {
    background: #374151 !important;
    color: #e5e7eb !important;
    border-color: #4b5563 !important;
}

.dark [style*="background: #eef2ff"],
.dark [style*="background:#eef2ff"] {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #a5b4fc !important;
}

.dark [style*="background: #fdf4ff"],
.dark [style*="background:#fdf4ff"],
.dark [style*="background: #fce7f3"],
.dark [style*="background:#fce7f3"] {
    background: rgba(236, 72, 153, 0.12) !important;
    color: #f9a8d4 !important;
}

/* ── 13c  Inline text colors — light-mode dark text → light text ── */
.dark [style*="color: #4b5563"],
.dark [style*="color:#4b5563"],
.dark [style*="color: #374151"],
.dark [style*="color:#374151"],
.dark [style*="color: #1f2937"],
.dark [style*="color:#1f2937"] {
    color: #e5e7eb !important;
}

.dark [style*="color: #6b7280"],
.dark [style*="color:#6b7280"] {
    color: #9ca3af !important;
}

.dark [style*="color: #64748b"],
.dark [style*="color:#64748b"] {
    color: #94a3b8 !important;
}

.dark [style*="border-color: #e5e7eb"],
.dark [style*="border: 1px solid #e5e7eb"],
.dark [style*="border:1px solid #e5e7eb"] {
    border-color: #374151 !important;
}

/* Catch inline linear-gradient backgrounds with light-mode colours */
.dark [style*="linear-gradient"][style*="#fafbfc"],
.dark [style*="linear-gradient"][style*="#f8fafc"],
.dark [style*="linear-gradient"][style*="#f3f4f6"],
.dark [style*="linear-gradient"][style*="#f1f5f9"],
.dark [style*="linear-gradient"][style*="#e5e7eb"],
.dark [style*="linear-gradient"][style*="#eef2ff"],
.dark [style*="linear-gradient"][style*="#f0fdf4"],
.dark [style*="linear-gradient"][style*="#ecfdf5"],
.dark [style*="linear-gradient"][style*="#fff7ed"],
.dark [style*="linear-gradient"][style*="#fef3c7"],
.dark [style*="linear-gradient"][style*="#fdf4ff"],
.dark [style*="linear-gradient"][style*="#fce7f3"] {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}

.dark [style*="linear-gradient"][style*="#d1fae5"],
.dark [style*="linear-gradient"][style*="#a7f3d0"] {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

.dark [style*="color: #1f2937"],
.dark [style*="color:#1f2937"],
.dark [style*="color: #374151"],
.dark [style*="color:#374151"],
.dark [style*="color: #111827"],
.dark [style*="color:#111827"],
.dark [style*="color: #0f172a"],
.dark [style*="color:#0f172a"] {
    color: #f9fafb !important;
}

.dark [style*="color: #6b7280"],
.dark [style*="color:#6b7280"],
.dark [style*="color: #475569"],
.dark [style*="color:#475569"],
.dark [style*="color: #64748b"],
.dark [style*="color:#64748b"],
.dark [style*="color: #4b5563"],
.dark [style*="color:#4b5563"] {
    color: #9ca3af !important;
}

/* ╔═══════════════════════════════════════════════════════════════════╗
   ║  §13d  UNIVERSAL DARK MODE — Shared Component Classes            ║
   ║  Wizard, trunk/textmode cards, lead panel, form groups, alerts   ║
   ║  Used across client events & employee events pages               ║
   ╚═══════════════════════════════════════════════════════════════════╝ */

/* ── Form controls ── */
.dark .form-label {
    color: #cbd5e1 !important;
}

.dark .help-text {
    color: #64748b !important;
}

/* ── Wizard ── */
.dark .wizard-step {
    background: #1e293b;
    color: #64748b;
}

.dark .wizard-step span {
    background: #475569;
}

.dark .wizard-step.active {
    background: #2e1065;
    color: #c4b5fd;
    border-color: #7c3aed;
}

.dark .wizard-step.active span {
    background: #7c3aed;
}

.dark .wizard-step.completed {
    background: #052e16;
    color: #6ee7b7;
    border-color: #10b981;
}

.dark .wizard-step.completed span {
    background: #10b981;
}

.dark .wizard-container {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.8)) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

.dark .wizard-group.invalid {
    background: rgba(239, 68, 68, 0.15);
}

.dark .wizard-hint {
    color: #f87171 !important;
}

.dark .section-divider {
    border-color: #334155 !important;
}

.dark .section-title {
    color: #e2e8f0 !important;
}

.dark .btn-wizard-back {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

.dark .btn-wizard-back:hover {
    background: #334155;
}

/* ── Trunk / Textmode cards ── */
.dark .trunk-card {
    border-color: #334155;
    background: rgba(255, 255, 255, 0.05) !important;
}

.dark .trunk-card:has(input:checked) {
    border-color: #7c3aed;
    background: #2e1065 !important;
}

.dark .trunk-label {
    color: #e2e8f0 !important;
}

.dark .trunk-card-body {
    background: #1e293b;
}

.dark .textmode-card {
    border-color: #334155;
    background: rgba(255, 255, 255, 0.05) !important;
}

.dark .textmode-card:has(input:checked) {
    border-color: #7c3aed;
    background: #2e1065 !important;
}

.dark .textmode-card-body {
    background: #1e293b;
}

.dark .textmode-label {
    color: #e2e8f0 !important;
}

.dark .textmode-subtitle {
    color: #64748b !important;
}

.dark .textmode-icon {
    background: linear-gradient(135deg, rgba(14, 165, 233, .2), rgba(56, 189, 248, .15)) !important;
}

/* ── Lead badges ── */
.dark .lead-badge.pitched {
    background: #052e16;
    color: #6ee7b7;
}

.dark .lead-badge.no-pitch {
    background: #450a0a;
    color: #fca5a5;
}

.dark .lead-badge.partial {
    background: #451a03;
    color: #fcd34d;
}

/* ── Slide-over / lead panel ── */
.dark #leadPanel {
    background: #0f172a !important;
    box-shadow: -6px 0 30px rgba(0, 0, 0, .4) !important;
}

.dark #leadPanelOverlay {
    background: rgba(0, 0, 0, .65) !important;
}

.dark .lp-body {
    background: #0f172a;
}

.dark .lp-info-grid {
    background: #1e293b !important;
}

.dark .lp-info-grid .lp-label {
    color: #94a3b8;
}

.dark .lp-info-grid .lp-val {
    color: #f1f5f9;
}

.dark .lp-section-title {
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

.dark .lp-form-group label {
    color: #cbd5e1 !important;
}

.dark .lp-form-group input,
.dark .lp-form-group select,
.dark .lp-form-group textarea {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.dark .lp-form-group input:focus,
.dark .lp-form-group select:focus,
.dark .lp-form-group textarea:focus {
    border-color: #7c3aed !important;
}

.dark .lp-footer {
    background: #0f172a !important;
    border-color: #334155 !important;
}

.dark .lp-btn-cancel {
    background: #1e293b;
    color: #94a3b8;
}

.dark .lp-msg.success {
    background: #052e16;
    color: #6ee7b7;
}

.dark .lp-msg.error {
    background: #450a0a;
    color: #fca5a5;
}

.dark .btn-view-entry {
    background: #1e293b;
    border-color: #7c3aed;
    color: #c4b5fd;
}

.dark .btn-view-entry:hover {
    background: #7c3aed;
    color: #fff;
}

/* ── Table search / pagination (mp-*) ── */
.dark .mp-table-search {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.dark .mp-table-search:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .15) !important;
}

.dark .mp-table-search::placeholder {
    color: #64748b !important;
}

.dark .mp-per-page {
    color: #94a3b8 !important;
}

.dark .mp-per-page select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.dark .mp-per-page select:focus {
    border-color: #7c3aed !important;
}

.dark .mp-bottom-row {
    border-color: #334155 !important;
}

.dark .mp-info {
    color: #64748b !important;
}

.dark .mp-pagination button {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

.dark .mp-pagination button:hover:not(:disabled) {
    background: #2e1065;
    border-color: #7c3aed;
    color: #c4b5fd;
}

.dark .mp-pagination button.active {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.dark .mp-sort-header.sort-asc:after,
.dark .mp-sort-header.sort-desc:after {
    color: #a78bfa !important;
}

/* ── Alert classes ── */
.dark .alert-success {
    background: #052e16 !important;
    color: #6ee7b7 !important;
    border-color: #064e3b !important;
}

.dark .alert-error {
    background: #450a0a !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}

.dark .alert-warning {
    background: #451a03 !important;
    color: #fcd34d !important;
    border-color: #78350f !important;
}

.dark .alert-info {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* ── Kanban components ── */
.dark .kanban-column {
    background: #0f172a !important;
    border-color: #334155 !important;
}

.dark .kanban-column.drag-over {
    border-color: #818cf8 !important;
    background: rgba(99, 102, 241, .08) !important;
}

.dark .kanban-column-header {
    border-color: #334155 !important;
}

.dark .kanban-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.dark .kanban-card:hover {
    border-color: #6366f1 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .15) !important;
}

/* ── Org chart nodes ── */
.dark .org-node {
    background: #1e293b !important;
}

.dark .org-children::before,
.dark .org-children>.org-node-group::before,
.dark .org-children>.org-node-group:not(:only-child)::after,
.dark .org-connector {
    background: #475569 !important;
}

/* ── Capability checkbox grid ── */
.dark .cap-item {
    color: #94a3b8 !important;
}

.dark .cap-item:hover {
    background: #334155 !important;
}

/* ── Background option / preview ── */
.dark .background-option div {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* ── Shimmer / Status badge (pending-approval, register) ── */
.dark .shimmer-bg,
.dark .animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent) !important;
    background-size: 200% 100% !important;
}

.dark .status-badge::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent) !important;
}

/* ╔═══════════════════════════════════════════════════════════════════╗
   ║  §14  UNIVERSAL DARK MODE — Custom Component Classes             ║
   ║  Stat cards, info cards, session cards, search bars, dropdowns   ║
   ╚═══════════════════════════════════════════════════════════════════╝ */

/* Stat cards (wallet, events, security, clients pages) */
.dark .stat-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

.dark .stat-card h3,
.dark .stat-card .stat-value,
.dark .stat-card .stat-label {
    color: #f9fafb !important;
}

.dark .stat-card p,
.dark .stat-card small {
    color: #9ca3af !important;
}

/* Card body / header / footer */
.dark .card-body {
    background: transparent;
    color: #e5e7eb;
}

.dark .card-header {
    background: #111827 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

.dark .card-footer {
    background: #111827 !important;
    border-color: #374151 !important;
    color: #d1d5db !important;
}

/* Info / detail / activity / session cards */
.dark .info-card,
.dark .detail-card,
.dark .activity-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

.dark .session-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

/* Table containers */
.dark .table-responsive,
.dark .table-container {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

.dark .table-responsive table,
.dark .table-container table {
    color: #e5e7eb;
}

/* Search / filter / pagination bars */
.dark .search-box,
.dark .filter-bar,
.dark .pagination-bar {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Dropdown / popover */
.dark .dropdown-menu,
.dark .popover {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Employees hardcoded dark classes */
.dark .bg-\[\#1e1e2e\] {
    background: #111827 !important;
}

.dark .border-\[\#2d2d3d\] {
    border-color: #374151 !important;
}

/* Dark-box (art-tools) */
.dark .dark-box {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Risk / severity badges */
.dark .risk-high,
.dark .severity-high {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

.dark .risk-medium,
.dark .severity-medium {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fde68a !important;
}

.dark .risk-low,
.dark .severity-low {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
}

/* Code / pre */
.dark pre,
.dark code {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}

/* FAQ <details> */
.dark details {
    background: #1e293b !important;
    border-color: #374151 !important;
}

.dark details summary {
    color: #e5e7eb !important;
}

.dark details p {
    color: #d1d5db !important;
}

.dark details .bg-white {
    background: #111827 !important;
}

.dark details .border-l-4 {
    border-color: #6366f1 !important;
}

/* Modal overrides (confirm / alert modals) */
.dark #confirmModal>div>div,
.dark #alertModal>div>div {
    background: #1f2937 !important;
}

.dark #confirmModal .bg-gray-200,
.dark #alertModal .bg-gray-200 {
    background: #374151 !important;
    color: #e5e7eb !important;
}

/* Gradient text helper */
.dark .gradient-text {
    -webkit-text-fill-color: unset;
    background: none;
    color: #c4b5fd !important;
}

/* Cancel / secondary gray buttons */
.dark .bg-gray-300 {
    background: #4b5563 !important;
    color: #e5e7eb !important;
}

.dark .bg-gray-300.text-gray-700 {
    background: #4b5563 !important;
    color: #e5e7eb !important;
}

/* ═══════════════════════════════════════════════════════════
   UNIVERSAL PREMIUM SCROLLBAR — Global, every element
   ═══════════════════════════════════════════════════════════ */

/* ---------- Webkit (Chrome, Edge, Brave, Safari, Opera) ---------- */

/* Vertical scrollbar */
::-webkit-scrollbar {
    width: 7px;
}

/* Horizontal scrollbar */
::-webkit-scrollbar:horizontal {
    height: 7px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 99px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    border-radius: 99px;
    border: 1px solid rgba(241, 245, 249, 0.4);
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}

::-webkit-scrollbar-thumb:active {
    background: #5b21b6;
}

::-webkit-scrollbar-corner {
    background: #f1f5f9;
}

/* ---------- Dark mode ---------- */

.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

.dark ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7c3aed, #6d28d9);
    border-color: rgba(15, 23, 42, 0.4);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8b5cf6, #7c3aed);
}

.dark ::-webkit-scrollbar-thumb:active {
    background: #8b5cf6;
}

.dark ::-webkit-scrollbar-corner {
    background: #0f172a;
}

/* ---------- Firefox ---------- */

* {
    scrollbar-width: thin;
    scrollbar-color: #7c3aed #f1f5f9;
}

.dark * {
    scrollbar-color: #6d28d9 #0f172a;
}

/* ---------- Narrow scrollbar utility (sidebars, dropdowns) ---------- */

.scroll-narrow::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar {
    width: 4px;
}

.scroll-narrow::-webkit-scrollbar:horizontal,
.custom-scroll::-webkit-scrollbar:horizontal {
    height: 4px;
}