/* Dark theme overrides — forces text and background visibility for Bootstrap components
   that don't respond to CSS variable inheritance alone.
   Loaded as part of the core CSS bundle in layouts/app.php.              */

[data-theme="dark"] body,
[data-theme="dark"] .main-content,
[data-theme="dark"] .container,
[data-theme="dark"] .container-fluid,
[data-theme="dark"] .card,
[data-theme="dark"] .card-body,
[data-theme="dark"] .card-header {
    color: #e4e6ea !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] label,
[data-theme="dark"] small,
[data-theme="dark"] strong,
[data-theme="dark"] .form-label,
[data-theme="dark"] .form-control-plaintext {
    color: #e4e6ea !important;
}

[data-theme="dark"] .text-muted {
    color: #8a8d91 !important;
}

[data-theme="dark"] a {
    color: #6db3f8 !important;
}

[data-theme="dark"] .main-content {
    background-color: #1a1d23 !important;
}

[data-theme="dark"] .card {
    background-color: #22252b !important;
}

[data-theme="dark"] .card-header.bg-white {
    background-color: #2c2f36 !important;
}

/* Bootstrap alert and badge backgrounds in dark mode */
[data-theme="dark"] .alert-warning {
    background-color: #3a3000 !important;
    border-color: #665500 !important;
    color: #ffd966 !important;
}

[data-theme="dark"] .alert-warning strong,
[data-theme="dark"] .alert-warning small,
[data-theme="dark"] .alert-warning span,
[data-theme="dark"] .alert-warning p {
    color: #ffd966 !important;
}

[data-theme="dark"] .card-header.bg-warning {
    background-color: #3a3000 !important;
    color: #ffd966 !important;
}

[data-theme="dark"] .card-header.bg-warning h5,
[data-theme="dark"] .card-header.bg-warning h4 {
    color: #ffd966 !important;
}

/* ── Duty Blue theme — dark navy, matching duty.blue landing page (kept
   working under both [data-theme="duty-blue"] and the legacy
   [data-theme="peelpot"] value already stored for existing users) ── */

/* Bootstrap bg-dark is hardcoded; the navbar and sidebar need explicit overrides */
[data-theme="duty-blue"] .navbar.bg-dark,
[data-theme="peelpot"] .navbar.bg-dark {
    background-color: #0f172a !important;
}

/* Main content area */
[data-theme="duty-blue"] body,
[data-theme="peelpot"] body,
[data-theme="duty-blue"] .main-content,
[data-theme="peelpot"] .main-content,
[data-theme="duty-blue"] .container,
[data-theme="peelpot"] .container,
[data-theme="duty-blue"] .container-fluid,
[data-theme="peelpot"] .container-fluid {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

/* Cards — dark card on dark background */
[data-theme="duty-blue"] .card,
[data-theme="peelpot"] .card {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

[data-theme="duty-blue"] .card-header,
[data-theme="peelpot"] .card-header,
[data-theme="duty-blue"] .card-header.bg-white,
[data-theme="peelpot"] .card-header.bg-white {
    background-color: #0d1b2e !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}

[data-theme="duty-blue"] .card-body,
[data-theme="peelpot"] .card-body {
    color: #f1f5f9 !important;
}

/* Text colour resets */
[data-theme="duty-blue"] h1,
[data-theme="peelpot"] h1,
[data-theme="duty-blue"] h2,
[data-theme="peelpot"] h2,
[data-theme="duty-blue"] h3,
[data-theme="peelpot"] h3,
[data-theme="duty-blue"] h4,
[data-theme="peelpot"] h4,
[data-theme="duty-blue"] h5,
[data-theme="peelpot"] h5,
[data-theme="duty-blue"] h6,
[data-theme="peelpot"] h6,
[data-theme="duty-blue"] p,
[data-theme="peelpot"] p,
[data-theme="duty-blue"] span,
[data-theme="peelpot"] span,
[data-theme="duty-blue"] div,
[data-theme="peelpot"] div,
[data-theme="duty-blue"] label,
[data-theme="peelpot"] label,
[data-theme="duty-blue"] small,
[data-theme="peelpot"] small,
[data-theme="duty-blue"] strong,
[data-theme="peelpot"] strong,
[data-theme="duty-blue"] .form-label,
[data-theme="peelpot"] .form-label,
[data-theme="duty-blue"] .form-control-plaintext,
[data-theme="peelpot"] .form-control-plaintext {
    color: #f1f5f9 !important;
}

[data-theme="duty-blue"] .text-muted,
[data-theme="peelpot"] .text-muted {
    color: #94a3b8 !important;
}

[data-theme="duty-blue"] a,
[data-theme="peelpot"] a {
    color: #818cf8 !important;
}

/* Brand primary overrides */
[data-theme="duty-blue"] .bg-primary,
[data-theme="peelpot"] .bg-primary {
    background-color: #4f46e5 !important;
}

[data-theme="duty-blue"] .text-primary,
[data-theme="peelpot"] .text-primary {
    color: #818cf8 !important;
}

/* Buttons */
[data-theme="duty-blue"] .btn-primary,
[data-theme="peelpot"] .btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%) !important;
    border: none !important;
    color: #ffffff !important;
}

[data-theme="duty-blue"] .btn-primary:hover,
[data-theme="peelpot"] .btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #0891b2 100%) !important;
}

[data-theme="duty-blue"] .btn-outline-primary,
[data-theme="peelpot"] .btn-outline-primary {
    color: #818cf8 !important;
    border-color: #4f46e5 !important;
    background: transparent !important;
}

[data-theme="duty-blue"] .btn-outline-primary:hover,
[data-theme="peelpot"] .btn-outline-primary:hover {
    background-color: rgba(79, 70, 229, 0.20) !important;
    color: #a5b4fc !important;
}

[data-theme="duty-blue"] .btn-outline-secondary,
[data-theme="peelpot"] .btn-outline-secondary {
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
}

/* Form controls */
[data-theme="duty-blue"] .form-control,
[data-theme="peelpot"] .form-control,
[data-theme="duty-blue"] .form-select,
[data-theme="peelpot"] .form-select {
    background-color: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
}

[data-theme="duty-blue"] .form-control:focus,
[data-theme="peelpot"] .form-control:focus,
[data-theme="duty-blue"] .form-select:focus,
[data-theme="peelpot"] .form-select:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.35) !important;
}

[data-theme="duty-blue"] .input-group-text,
[data-theme="peelpot"] .input-group-text {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #94a3b8 !important;
}

/* Tables */
[data-theme="duty-blue"] .table,
[data-theme="peelpot"] .table {
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="duty-blue"] .table thead th,
[data-theme="peelpot"] .table thead th,
[data-theme="duty-blue"] .table > thead,
[data-theme="peelpot"] .table > thead {
    background-color: #0d1b2e !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="duty-blue"] .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-theme="peelpot"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: #f1f5f9 !important;
}

/* Dropdowns */
[data-theme="duty-blue"] .dropdown-menu,
[data-theme="peelpot"] .dropdown-menu {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

[data-theme="duty-blue"] .dropdown-item,
[data-theme="peelpot"] .dropdown-item {
    color: #f1f5f9 !important;
}

[data-theme="duty-blue"] .dropdown-item:hover,
[data-theme="peelpot"] .dropdown-item:hover,
[data-theme="duty-blue"] .dropdown-item:focus,
[data-theme="peelpot"] .dropdown-item:focus {
    background-color: rgba(79, 70, 229, 0.18) !important;
    color: #a5b4fc !important;
}

[data-theme="duty-blue"] .dropdown-divider,
[data-theme="peelpot"] .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.10) !important;
}

[data-theme="duty-blue"] .dropdown-header,
[data-theme="peelpot"] .dropdown-header {
    color: #94a3b8 !important;
}

/* Sidebar nav-link active state */
[data-theme="duty-blue"] .sidebar .nav-link.active,
[data-theme="peelpot"] .sidebar .nav-link.active {
    background-color: rgba(79, 70, 229, 0.30) !important;
    color: #c7d2fe !important;
    border-left-color: #4f46e5 !important;
}

/* Alerts */
[data-theme="duty-blue"] .alert-warning,
[data-theme="peelpot"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.40) !important;
    color: #fde68a !important;
}

/* Badges */
[data-theme="duty-blue"] .badge.bg-light,
[data-theme="peelpot"] .badge.bg-light {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* Modals */
[data-theme="duty-blue"] .modal-content,
[data-theme="peelpot"] .modal-content {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="duty-blue"] .modal-header,
[data-theme="peelpot"] .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="duty-blue"] .modal-footer,
[data-theme="peelpot"] .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}
