:root {
    --bs-primary: #EF5541; /* Burnt Orange */
    --bs-secondary: #CCCCC8; /* Light Grey */
    --bs-dark: #212120; /* Midnight Grey */
    --bs-light: #FFFFFF; /* White */
    
    /* Fonts */
    --bs-font-sans-serif: 'Montserrat', 'Inter', sans-serif;
}

/* Ensure Bootstrap classes reflect the new colors */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-primary:hover {
    background-color: #d94d3b; /* Darker shade for hover */
}
.text-primary {
    color: var(--bs-primary) !important;
}
.bg-primary {
    background-color: var(--bs-primary) !important;
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

/* Fix for progress bars - only default bars, not colored variants */
.progress-bar:not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info) {
    background-color: var(--bs-primary) !important;
}

.btn-outline-secondary {
    color: var(--bs-secondary);  /* Sets text color */
    border-color: var(--bs-secondary); /* Sets border color */
}

.btn-outline-secondary:hover {
    background-color: var(--bs-secondary); /* Fills with secondary color on hover */
    color: white; /* Ensures text is readable on hover */
    border-color: var(--bs-secondary);
}

.form-control, .form-select {
    background-color: white;
    border-color: var(--bs-secondary); /* Light Grey border */
    color: black;
    font-family: var(--bs-font-sans-serif);
    border-radius: 5px; /* Slightly rounded corners */
    padding: 10px; /* Add spacing for a better look */
}

/* When Focused */
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary); /* Burnt Orange */
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5); /* Subtle glow effect */
}

/* Placeholder Text */
::placeholder {
    color: #6c757d; /* Light grey for placeholders */
    opacity: 1;
}

.form-select {
    background-color: white;
    border-color: var(--bs-secondary); /* Light Grey border */
    color: black; /* Default text color */
    font-family: var(--bs-font-sans-serif);
}

/* Ensure the selected option uses the correct color */
.form-select option {
    background-color: white;
    color: black; /* Text color inside dropdown */
}

/* Fix for the active (selected) option */
.form-select:focus {
    border-color: var(--bs-primary); /* Burnt Orange */
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

/* Make sure the dropdown itself (when open) looks correct */
.form-select optgroup,
.form-select option:checked {
    background-color: var(--bs-secondary); /* Light Grey for selected */
    color: black; /* Ensure text remains readable */
}

/* Fix dropdown menu colors on hover */
.form-select option:hover {
    background-color: var(--bs-primary); /* Burnt Orange for hover */
    color: white;
}
* Default button outline styling */
.btn-check + .btn-outline-primary {
    color: var(--bs-primary); /* Primary text color */
    border-color: var(--bs-primary); /* Primary border */
}

/* When hovered, enforce primary color and remove Bootstrap's blue border */
.btn-outline-primary:hover,
.btn-check + .btn-outline-primary:hover {
    background-color: var(--bs-primary); /* Primary background */
    color: white; /* White text */
    border-color: var(--bs-primary); /* Ensure border stays primary */
    box-shadow: none !important; /* Remove default Bootstrap blue glow */
}

/* When focused (to prevent the blue focus ring) */
.btn-outline-primary:focus,
.btn-check:focus + .btn-outline-primary {
    background-color: var(--bs-primary); /* Primary background */
    color: white;
    border-color: var(--bs-primary);
    box-shadow: none !important; /* Remove blue glow */
    outline: none !important; /* Remove default blue focus outline */
}

/* When checked (selected), apply primary styles */
.btn-check:checked + .btn-outline-primary {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    box-shadow: none !important; /* Remove blue glow */
}


@media (max-width: 575px) { 
    .card {
        width: 100% !important;
    }
}
/* Modern State Filter Buttons */
.state-filter-btn{border:2px solid #e2e8f0;background:#fff;color:#4a5568;border-radius:8px;padding:.4rem 1rem;font-size:.85rem;font-weight:600;cursor:pointer;transition:all .2s;margin:.2rem}
.state-filter-btn:hover,.state-filter-btn.active{color:#fff;border-color:transparent}
.state-filter-btn.all-states{border-color:#667eea;color:#667eea}
.state-filter-btn.all-states:hover,.state-filter-btn.all-states.active{background:#667eea;color:#fff}
.state-filter-btn.dls{border-color:#667eea;color:#667eea}
.state-filter-btn.dls:hover,.state-filter-btn.dls.active{background:#667eea;color:#fff}
.state-filter-btn.hotnsw{border-color:#e53e3e;color:#e53e3e}
.state-filter-btn.hotnsw:hover,.state-filter-btn.hotnsw.active{background:#e53e3e;color:#fff}
.state-filter-btn.nsw{border-color:#3182ce;color:#3182ce}
.state-filter-btn.nsw:hover,.state-filter-btn.nsw.active{background:#3182ce;color:#fff}
.state-filter-btn.qld{border-color:#d69e2e;color:#d69e2e}
.state-filter-btn.qld:hover,.state-filter-btn.qld.active{background:#d69e2e;color:#fff}
.state-filter-btn.vic{border-color:#38a169;color:#38a169}
.state-filter-btn.vic:hover,.state-filter-btn.vic.active{background:#38a169;color:#fff}
.state-filter-btn.wa{border-color:#805ad5;color:#805ad5}
.state-filter-btn.wa:hover,.state-filter-btn.wa.active{background:#805ad5;color:#fff}
.state-filter-btn.total{border-color:#718096;color:#718096}
.state-filter-btn.total:hover,.state-filter-btn.total.active{background:#718096;color:#fff}


/* ===== Dark mode (v1) — Bootstrap 5.3 data-bs-theme. Bootstrap components (cards/tables/
   modals/badges/dropdowns/nav) flip automatically; this only darkens the custom-styled navbar
   (navbar.css hardcodes a light bg + dark links). Brand #EF5541 accent works on both themes.
   Heavy inline-hex pages (dashboard/notifications/OCR) stay light pending a v2 pass. ===== */
[data-bs-theme="dark"] .navbar { background-color: #1f1f1f; }
[data-bs-theme="dark"] .navbar-nav .nav-link { color: #e6e6e6 !important; }


/* ===== Dark mode v2 — reusable theme foundation (Claude-dark-inspired palette).
   :root light values EQUAL the original dashboard hexes -> light mode is byte-identical;
   [data-bs-theme="dark"] supplies the warm near-black Claude-like dark values.
   Vivid STATUS colors (#e74c3c/#27ae60/#3498db/#f39c12...) are intentionally NOT vars. ===== */
:root {
  --dl-text:    #2c3e50;   /* primary text/numbers/titles */
  --dl-muted:   #95a5a6;   /* muted labels */
  --dl-faint:   #bdc3c7;   /* faint sub-labels */
  --dl-card-bg: #ffffff;   /* lifted surfaces (timeline marker, chips) */
  --dl-page-bg: #ffffff;   /* page background */
  --dl-track:   #ecf0f1;   /* progress/bar tracks */
  --dl-border:  #dddddd;   /* separators, history-arrow lines */
  --dl-brand:   #EF5541;   /* brand orange */
}
[data-bs-theme="dark"] {
  --dl-text:    #ECECE9;   /* soft off-white (not pure white) */
  --dl-muted:   #9A9A92;
  --dl-faint:   #6E6E68;
  --dl-card-bg: #2A2A28;   /* card lifted off page */
  --dl-page-bg: #1E1E1C;   /* warm near-black */
  --dl-track:   #3A3A37;
  --dl-border:  #45453F;
  --dl-brand:   #FF7A5C;   /* brand lightened for dark */
}
/* utility classes (reusable; for elements without inline color + future tier-3) */
.dl-text { color: var(--dl-text) !important; }
.dl-muted { color: var(--dl-muted) !important; }
.dl-faint { color: var(--dl-faint) !important; }
.dl-card { background: var(--dl-card-bg) !important; }
.dl-track { background: var(--dl-track) !important; }
.dl-border-c { border-color: var(--dl-border) !important; }
.dl-brand-text { color: var(--dl-brand) !important; }
/* Dashboard: dark-only overrides for class bgs whose LIGHT hex != a foundation var
   (so light stays byte-identical; only dark changes). Prevents off-white-on-near-white. */
[data-bs-theme="dark"] .worker-table th { background: var(--dl-track); }
[data-bs-theme="dark"] .quick-link { background: var(--dl-track); }
[data-bs-theme="dark"] .trust-chip { background: var(--dl-track); color: var(--dl-text); }


/* ===== Dark mode tier-3 — GLOBAL fixes, applied on every base-extending page via custom.css.
   Strictly scoped under [data-bs-theme="dark"] so LIGHT mode is byte-identical (no rule applies
   without the dark attr). These OVERRIDE base2.css/base.css globals without editing those files:
   [data-bs-theme="dark"] body out-specifies base2.css `body{...!important}` (attr-on-html + element). ===== */
[data-bs-theme="dark"] body { background-color: var(--dl-page-bg) !important; color: var(--dl-text) !important; }
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-select option { background-color: var(--dl-card-bg); color: var(--dl-text); border-color: var(--dl-border); }
/* Dashboard status banners: light look kept inline; dark-flip the near-white bg (+ grey text only;
   the green/amber accents stay vivid). */
[data-bs-theme="dark"] .dl-statusbanner { background-color: var(--dl-card-bg) !important; }
[data-bs-theme="dark"] .dl-statusbanner.dl-sb-muted { color: var(--dl-muted) !important; }
/* Dashboard timeline status-marker interiors -> dark (vivid colored border kept). */
[data-bs-theme="dark"] .timeline-marker { background: var(--dl-card-bg) !important; }


/* ===== Dark mode tier-4 (final) — Bootstrap fixed-light variants (.table-light/.bg-light do NOT
   respond to data-bs-theme) + per-page custom white classes (Hours, Manage Invoices, state filters).
   All scoped under [data-bs-theme="dark"] -> light byte-identical. base2.css/base.css untouched. ===== */
/* A. Bootstrap fixed-light variants (14 .table-light theads + .bg-light banners/cards) */
[data-bs-theme="dark"] .table-light {
  --bs-table-bg: var(--dl-track);
  --bs-table-color: var(--dl-text);
  --bs-table-border-color: var(--dl-border);
}
[data-bs-theme="dark"] .bg-light { background-color: var(--dl-card-bg) !important; color: var(--dl-text); }
[data-bs-theme="dark"] .bg-light.text-dark { color: var(--dl-text) !important; }
/* B. Hours page (employee_assignments.html) */
[data-bs-theme="dark"] .hours-progress { background: var(--dl-card-bg); }
[data-bs-theme="dark"] .progress-bar-container { background: var(--dl-track); }
[data-bs-theme="dark"] .hours-stat .stat-lbl { color: var(--dl-muted); }
/* C. Manage Invoices (invoice_manage.html) */
[data-bs-theme="dark"] .invoice-filters,
[data-bs-theme="dark"] .invoice-table-container,
[data-bs-theme="dark"] .summary-card,
[data-bs-theme="dark"] .pagination-nav { background: var(--dl-card-bg); }
[data-bs-theme="dark"] .invoice-table thead th { background: var(--dl-track); color: var(--dl-muted); }
[data-bs-theme="dark"] #viewBooking table thead th { background: var(--dl-track) !important; }
/* D. State-filter buttons (option B): background-only -> inactive buttons KEEP their per-state
   text/border colors (NSW-blue, QLD-gold, VIC-green, WA-purple); only the white bg darkens.
   Active/hover per-state rules (0,3,0) out-specify this (0,2,0) -> vivid selection kept. */
[data-bs-theme="dark"] .state-filter-btn { background: var(--dl-card-bg); }

/* ===== Dark mode tier-5 — remaining high-impact uncovered Bootstrap fixed-light classes.
   All scoped under [data-bs-theme="dark"] -> light mode byte-identical. NO blanket .text-dark
   rule (it is on contextual badges - bg-info/bg-warning - which must keep dark text). ===== */
/* A. .btn-outline-dark renders dark-on-dark (invisible): New Job button, navbar dark-toggle +
   user dropdown, profile collapse toggle. */
[data-bs-theme="dark"] .btn-outline-dark { color: var(--dl-text); border-color: var(--dl-border); }
[data-bs-theme="dark"] .btn-outline-dark:hover { background: var(--dl-track); color: var(--dl-text); border-color: var(--dl-border); }
/* B. .bg-white panels (5 staff pages) -> lifted dark surface. (.bg-white never co-occurs with
   .text-dark in these templates, so no text re-assert needed.) */
[data-bs-theme="dark"] .bg-white { background-color: var(--dl-card-bg) !important; color: var(--dl-text); }
/* C. Onboarding-Date banner (employee_form.html) — inline #f0f4f8 kept for light (byte-identical);
   this flips it for dark only. */
[data-bs-theme="dark"] .dl-onboard-banner { background: var(--dl-card-bg) !important; color: var(--dl-text); }


/* ===== Dark mode tier-6 (wf26, 09/10/2026) -- this week's screens, from the sweep after Diogo's
   screenshot of the office digest. Theme variables only. Dark-only unless marked LIGHT+DARK (those
   failed WCAG AA in light mode too).
   A. Hours modal (employee_details_assignment.html, loaded into employee_assignments.html -- neither
      file is edited, no td/th moves): the bill-status line was #475467 (2.1:1 on the dark modal),
      and a locked day's readonly inputs kept their light #f1f3f5 under the dark theme's near-white
      text (about 1.1:1). ===== */
[data-bs-theme="dark"] .pd-bar { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] #assignmentsTable tr[data-paid-lock="1"] input.form-control[readonly],
[data-bs-theme="dark"] #assignmentsTable tr[data-paid-lock="1"] select { background-color: var(--bs-secondary-bg); color: var(--bs-body-color); }
/* LIGHT+DARK: the Adjustment button was Bootstrap's outline yellow, 1.6:1 on white. */
#assignmentsTable .btn-outline-warning.pdAdjust { --bs-btn-color: var(--bs-warning-text-emphasis); }
/* LIGHT+DARK: the Adjustment panel's Cancel is the site's light-grey outline (#CCCCC8, 1.6:1 on white). */
#pdAdjustPanel .btn-outline-secondary { color: var(--bs-secondary-color); border-color: var(--bs-secondary-color); }
#pdAdjustPanel .btn-outline-secondary:hover,
#pdAdjustPanel .btn-outline-secondary:focus-visible,
#pdAdjustPanel .btn-outline-secondary:active { color: var(--bs-body-bg); background-color: var(--bs-emphasis-color); border-color: var(--bs-emphasis-color); }
/* B. Onboarding approval marker, compact (the queue's table): the red reasons were #dc3545, 3.6:1 on
      the dark table (light keeps its red, 4.5:1). Hook: .ap-reason (onboarding_approval_marker.html). */
[data-bs-theme="dark"] .ap-reason.text-danger { color: var(--bs-danger-text-emphasis) !important; }
