/* ============================================================================
   CATCHME CRM — THEME 2 — DARK PALETTE
   ----------------------------------------------------------------------------
   Applied only when Theme 2 is active AND the CRM is in night mode:
   html[data-cm-theme="theme-2"][data-bs-theme="dark"].

   It re-points the Theme 2 tokens; theme-2.css already consumes them, so most
   components adapt automatically. Unlayered on purpose to outrank
   @layer cm-color-mode from catchme-dark.css.
   ============================================================================ */

html[data-cm-theme="theme-2"][data-bs-theme="dark"] {
    color-scheme: dark;

    --t2-bg: #080b11;
    --t2-bg-2: #0b1019;
    --t2-surface: #111827;
    --t2-surface-2: #151d2c;
    --t2-surface-3: #1a2334;
    --t2-border: #1e2a3d;
    --t2-border-2: #273650;
    --t2-text: #e8edf5;
    --t2-text-2: #9aa7ba;
    --t2-text-3: #5f6d82;

    --t2-teal: #2dd4bf;
    --t2-teal-strong: #14b8a6;
    --t2-blue: #38bdf8;
    --t2-violet: #818cf8;
    --t2-green: #34d399;
    --t2-amber: #fbbf24;
    --t2-red: #f87171;

    --t2-grad-soft: linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(56, 189, 248, 0.05) 58%, transparent);
    --t2-on-grad: #04120e;
    --t2-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --t2-shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);

    --t2-success-bg: #193d35;
    --t2-success-text: #86efc3;
    --t2-success-border: #2b5c4d;
    --t2-warning-bg: #42351f;
    --t2-warning-text: #fcd68a;
    --t2-warning-border: #655133;
    --t2-danger-bg: #442832;
    --t2-danger-text: #fda4af;
    --t2-danger-border: #6b3545;
    --t2-info-bg: #203653;
    --t2-info-text: #a5ceff;
    --t2-info-border: #3b5271;
    --t2-violet-bg: #352c50;
    --t2-violet-text: #d8b4fe;
    --t2-violet-border: #584373;
    --t2-neutral-bg: #29394f;
    --t2-neutral-text: #cbd5e1;
    --t2-neutral-border: #40516a;
    --t2-selected-bg: rgba(45, 212, 191, 0.16);
    --t2-selected-text: #5eead4;
    --t2-selected-border: rgba(45, 212, 191, 0.38);

    --t2-input-bg: #172235;
    --t2-sidebar-bg: linear-gradient(180deg, var(--t2-bg-2), var(--t2-bg));
    --t2-topbar-bg: rgba(8, 11, 17, 0.78);
    --t2-content-glow: radial-gradient(1100px 420px at 100% -12%, rgba(45, 212, 191, 0.10), transparent 62%);
    --t2-card-shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.5);
}

html[data-cm-theme="theme-2"][data-bs-theme="dark"] body.app-body,
html[data-cm-theme="theme-2"][data-bs-theme="dark"] :is(.app-content, .content-page, .app-content-page, #wrapper) {
    background: var(--t2-bg) !important;
    color: var(--t2-text) !important;
}

html[data-cm-theme="theme-2"][data-bs-theme="dark"] .app-sidebar-menu .sub-menu {
    border-left-color: var(--t2-border) !important;
}

html[data-cm-theme="theme-2"][data-bs-theme="dark"] :is(.drivers-table, .app-data-table, table.table) tbody tr:hover > td {
    background: var(--t2-surface-2) !important;
}

html[data-cm-theme="theme-2"][data-bs-theme="dark"] .modal-content {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55) !important;
}

html[data-cm-theme="theme-2"][data-bs-theme="dark"] .modal .btn-close {
    filter: invert(1) grayscale(1);
}

html[data-cm-theme="theme-2"][data-bs-theme="dark"] :is(input, textarea)::placeholder {
    color: var(--t2-text-3) !important;
}

html[data-cm-theme="theme-2"][data-bs-theme="dark"] .table-sticky-wrapper thead th {
    background: var(--t2-surface-2) !important;
}

/* Authentication pages */
html[data-cm-theme="theme-2"][data-bs-theme="dark"] {
    --auth-bg: var(--t2-bg);
    --auth-surface: var(--t2-surface);
    --auth-text: var(--t2-text);
    --auth-muted: var(--t2-text-2);
    --auth-border: var(--t2-border);
    --auth-soft: var(--t2-surface-2);
    --auth-link: var(--t2-teal);
}
