/* Staff portal night view. Applied when <html data-bs-theme="dark">. */

[data-bs-theme="dark"] {
    --papd-dark-page: #16191d;
    --papd-dark-surface: #212529;
    --papd-dark-raised: #2b3035;
    --papd-dark-border: #3d434a;
    --papd-dark-text: #e2e8f0;
    --papd-dark-muted: #adb5bd;
    color-scheme: dark;
}

[data-bs-theme="dark"] body {
    background-color: var(--papd-dark-page);
}

/* Bootstrap utilities that stay light in dark mode */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
    background-color: var(--papd-dark-raised) !important;
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .bg-light.text-dark,
[data-bs-theme="dark"] .text-bg-light {
    background-color: var(--papd-dark-raised) !important;
    color: var(--papd-dark-text) !important;
}
[data-bs-theme="dark"] .table-light {
    --bs-table-color: var(--papd-dark-text);
    --bs-table-bg: var(--papd-dark-raised);
    --bs-table-border-color: var(--papd-dark-border);
    --bs-table-striped-bg: #32383e;
    --bs-table-striped-color: var(--papd-dark-text);
    --bs-table-active-bg: #373d43;
    --bs-table-active-color: var(--papd-dark-text);
    --bs-table-hover-bg: #343a40;
    --bs-table-hover-color: var(--papd-dark-text);
    color: var(--bs-table-color);
    border-color: var(--bs-table-border-color);
}

/* Header buttons and theme toggle */
.staff-theme-toggle {
    line-height: 1;
}
[data-bs-theme="dark"] .staff-header,
[data-bs-theme="dark"] .staff-mobile-bar,
[data-bs-theme="dark"] #staffNavOffcanvas .offcanvas-header {
    background: #0f2340;
}
[data-bs-theme="dark"] .staff-theme-toggle .bi-sun-fill {
    color: #f59f00;
}

/* Login */
[data-bs-theme="dark"] .login-container {
    background: #0f2340;
}
[data-bs-theme="dark"] .login-card {
    background: var(--papd-dark-surface);
}
[data-bs-theme="dark"] .login-title {
    color: var(--papd-dark-text);
}

/* Navigation */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: var(--papd-dark-border);
}
[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #ced4da;
}
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    color: #9fb0ff;
    border-bottom-color: #9fb0ff;
}
[data-bs-theme="dark"] .staff-mobile-nav .nav-link {
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .staff-mobile-nav .nav-link:hover {
    background: var(--papd-dark-raised);
}
[data-bs-theme="dark"] .staff-mobile-nav .nav-link.active {
    background: #2c5282;
    color: #fff;
}
[data-bs-theme="dark"] .staff-mobile-welcome {
    color: #ced4da;
    border-bottom-color: var(--papd-dark-border);
}
[data-bs-theme="dark"] .staff-mobile-nav-heading {
    color: var(--papd-dark-muted);
    border-top-color: var(--papd-dark-border);
}

/* Home */
[data-bs-theme="dark"] .home-hero {
    background: linear-gradient(135deg, #0f2340 0%, #1e3a64 100%);
}
[data-bs-theme="dark"] .home-section-title,
[data-bs-theme="dark"] .home-section-toggle {
    color: var(--papd-dark-muted);
}
[data-bs-theme="dark"] .home-section-toggle:hover,
[data-bs-theme="dark"] .home-section-toggle:focus-visible {
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .home-section-hint {
    background: #4a1d22;
    color: #f1aeb5;
}
[data-bs-theme="dark"] .home-attention .home-section-title {
    color: #ea868f;
}
[data-bs-theme="dark"] .home-attention-item {
    background: var(--papd-dark-surface);
    border-color: #6b2a31;
    border-left-color: #dc3545;
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .home-tile {
    background: var(--papd-dark-surface);
    border-color: var(--papd-dark-border);
    color: var(--papd-dark-text);
    box-shadow: none;
}
[data-bs-theme="dark"] .home-tile:active {
    background: var(--papd-dark-raised);
}
[data-bs-theme="dark"] .home-tile:hover {
    color: var(--papd-dark-text);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
[data-bs-theme="dark"] .home-tile-icon {
    background: #233650;
    color: #cfe0ff;
}
[data-bs-theme="dark"] .home-tile-desc {
    color: var(--papd-dark-muted);
}
[data-bs-theme="dark"] .home-tile-badge-alert {
    background: #4a1d22;
    color: #f1aeb5;
}
[data-bs-theme="dark"] .home-tile-badge-info {
    background: #1c2c44;
    color: #9ec5fe;
}

/* Manage Staff and Manage Permissions */
[data-bs-theme="dark"] .staff-row-name {
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .staff-row-meta,
[data-bs-theme="dark"] .perm-grid .perm-desc {
    color: var(--papd-dark-muted);
}
[data-bs-theme="dark"] .perm-grid thead th {
    background: var(--papd-dark-raised);
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .perm-grid .perm-group-row th {
    background: #343a40;
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .perm-level[data-level="viewer"] {
    background-color: #1c2c44;
    border-color: #2f5687;
}
[data-bs-theme="dark"] .perm-level[data-level="admin"] {
    background-color: #1c3a2c;
    border-color: #2f6b4f;
}
[data-bs-theme="dark"] .perm-level[data-level="on"] {
    background-color: #1c3a2c;
    border-color: #2f6b4f;
}
[data-bs-theme="dark"] .perm-level[data-level="none"],
[data-bs-theme="dark"] .perm-level[data-level="off"] {
    background-color: #3d1f24;
    border-color: #7a3540;
}
[data-bs-theme="dark"] .perm-grid .perm-exc {
    color: #6edff6;
}
[data-bs-theme="dark"] .access-pill {
    background: #343a40;
    color: var(--papd-dark-muted);
}
[data-bs-theme="dark"] .access-pill[data-level="viewer"] {
    background: #1c2c44;
    color: #9ec5fe;
}
[data-bs-theme="dark"] .access-pill[data-level="admin"],
[data-bs-theme="dark"] .access-pill[data-level="on"] {
    background: #1c3a2c;
    color: #a3cfbb;
}
[data-bs-theme="dark"] .perm-save-bar {
    background: var(--papd-dark-page);
    border-top-color: var(--papd-dark-border);
}

/* Parking Tickets */
[data-bs-theme="dark"] .parking-fine-display,
[data-bs-theme="dark"] .report-stat-owed .stat-value {
    color: #ff6b6b;
}
[data-bs-theme="dark"] .report-stat-paid .stat-value {
    color: #75b798;
}
[data-bs-theme="dark"] .citation-num-display.status-issued,
[data-bs-theme="dark"] .citation-number-banner.status-issued .label,
[data-bs-theme="dark"] .citation-number-banner .number.status-issued,
[data-bs-theme="dark"] .citation-number-banner .label,
[data-bs-theme="dark"] .citation-number-banner .number,
[data-bs-theme="dark"] .citation-num-display {
    color: #ff6b6b;
}
[data-bs-theme="dark"] .citation-num-display.status-paid,
[data-bs-theme="dark"] .citation-number-banner.status-paid .label,
[data-bs-theme="dark"] .citation-number-banner .number.status-paid {
    color: #75b798;
}
[data-bs-theme="dark"] .citation-num-display.status-contested,
[data-bs-theme="dark"] .citation-number-banner.status-contested .label,
[data-bs-theme="dark"] .citation-number-banner .number.status-contested {
    color: #a98eda;
}
[data-bs-theme="dark"] .citation-num-display.status-void,
[data-bs-theme="dark"] .citation-number-banner.status-void .label,
[data-bs-theme="dark"] .citation-number-banner .number.status-void {
    color: #d29a6b;
}
[data-bs-theme="dark"] .citation-num-display.status-flagged,
[data-bs-theme="dark"] .citation-number-banner.status-flagged .label,
[data-bs-theme="dark"] .citation-number-banner .number.status-flagged,
[data-bs-theme="dark"] .btn-outline-flagged {
    color: #3fd8ad;
}
[data-bs-theme="dark"] .btn-outline-void {
    color: #d29a6b;
}
[data-bs-theme="dark"] .btn-outline-court {
    color: #ff8c4a;
}
[data-bs-theme="dark"] .btn-final-notice {
    color: #f0a35e;
}
[data-bs-theme="dark"] .autocomplete-menu {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Shift Schedule */
[data-bs-theme="dark"] .scheduler-shift-pill {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
[data-bs-theme="dark"] .edit-photo {
    border-color: #495057;
}
[data-bs-theme="dark"] .edit-photo:has(.edit-photo-remove:checked) {
    border-color: #ea868f;
    background: #4a1d22;
}

/* TimeSheet, Submitted Time Sheets, Leave & OT Requests */
[data-bs-theme="dark"] .timesheet-certify {
    background: var(--papd-dark-raised);
    border-color: var(--papd-dark-border);
}
[data-bs-theme="dark"] .timesheet-meta .label,
[data-bs-theme="dark"] .timesheet-review-meta .label,
[data-bs-theme="dark"] .time-req-fields .label {
    color: var(--papd-dark-muted);
}
[data-bs-theme="dark"] .ts-forms-heading,
[data-bs-theme="dark"] .timesheet-audit .changes,
[data-bs-theme="dark"] .time-req-audit .changes {
    color: #ced4da;
}
[data-bs-theme="dark"] .time-req-fields .value {
    border-bottom-color: var(--papd-dark-border);
}
[data-bs-theme="dark"] .timesheet-grid {
    background: var(--papd-dark-surface);
}
[data-bs-theme="dark"] .timesheet-grid th {
    background: var(--papd-dark-raised);
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .timesheet-grid,
[data-bs-theme="dark"] .timesheet-grid > :not(caption) > * > * {
    border-color: #495057;
}
[data-bs-theme="dark"] .timesheet-grid .ts-total {
    background: var(--papd-dark-raised);
}
[data-bs-theme="dark"] .timesheet-grid tr.is-weekend td.ts-day,
[data-bs-theme="dark"] .timesheet-grid tr.is-weekend td.ts-date {
    color: var(--papd-dark-muted);
}
[data-bs-theme="dark"] .timesheet-grid tr.is-today td.ts-day {
    color: #6ea8fe;
}
[data-bs-theme="dark"] .timesheet-grid .ts-subtotal td {
    background: #25303d;
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .timesheet-grid .ts-grand-total td {
    background: #0b0d10;
    color: #fff;
}
[data-bs-theme="dark"] .timesheet-grid.is-editable,
[data-bs-theme="dark"] .timesheet-grid.is-editable tbody tr.ts-row td {
    background: var(--papd-dark-raised);
}
[data-bs-theme="dark"] .timesheet-grid.is-editable tbody tr.ts-row td.ts-total {
    background: #343a40;
}
[data-bs-theme="dark"] .timesheet-grid.is-editable .form-control {
    background: var(--papd-dark-page);
    border-color: #6c757d;
    color: var(--papd-dark-text);
}
[data-bs-theme="dark"] .timesheet-grid .ts-sched-times,
[data-bs-theme="dark"] .timesheet-grid .ts-sched.is-none {
    color: var(--papd-dark-muted);
}
[data-bs-theme="dark"] .timesheet-grid tbody tr.ts-row td.ts-sched.is-diff {
    background: #3d3207;
}
[data-bs-theme="dark"] .timesheet-grid .ts-sched-diff {
    color: #ffda6a;
}
[data-bs-theme="dark"] .ts-req-sched {
    background: #3d3207;
    color: #ffda6a;
}
@media (max-width: 575.98px) {
    [data-bs-theme="dark"] .timesheet-grid,
    [data-bs-theme="dark"] .timesheet-grid.is-editable {
        background: transparent;
    }
    [data-bs-theme="dark"] .timesheet-grid tr {
        background: var(--papd-dark-surface);
        border-color: #495057;
    }
    [data-bs-theme="dark"] .timesheet-grid.is-editable tr.ts-row {
        background: var(--papd-dark-raised);
    }
    [data-bs-theme="dark"] .timesheet-grid tr.is-today {
        border-color: #6ea8fe;
    }
    [data-bs-theme="dark"] .timesheet-grid .ts-subtotal {
        background: #25303d;
    }
    [data-bs-theme="dark"] .timesheet-grid .ts-grand-total {
        background: #0b0d10;
    }
}
[data-bs-theme="dark"] .ts-req-pending {
    background: #4a1d22;
    color: #f1aeb5;
}
[data-bs-theme="dark"] .ts-req-approved {
    background: #133a2a;
    color: #a3cfbb;
}
[data-bs-theme="dark"] .ts-req-denied {
    background: var(--papd-dark-raised);
    color: var(--papd-dark-muted);
    border-color: #6c757d;
}
[data-bs-theme="dark"] .ts-req-missing {
    background: var(--papd-dark-surface);
    color: #ea868f;
}
[data-bs-theme="dark"] .ts-req-add {
    background: var(--papd-dark-surface);
    border-color: #6c757d;
    color: #6c757d;
}
[data-bs-theme="dark"] .ts-req-add:hover {
    color: #6ea8fe;
    border-color: #6ea8fe;
}
