/* ═══════════════════════════════════════════════════════════════
   Athena — custom.css
   Loaded after Bootstrap 4 to extend and override the framework.
   Sections:
     1.  Modal backdrop
     2.  AI Button
     3.  jQuery UI Datepicker
     4.  Athena theme classes (ath-*)
     5.  Base element overrides
     6.  Breadcrumb bar
     7.  Utility classes
     8.  Bootstrap component overrides (border-radius, misc)
     9.  Table headers (ath-thead)
    10.  Navbar overrides
    11.  Card components
    12.  DataTables
    13.  Button colours
    14.  Footer (ath-footer)
    15.  Diary navigation
    16.  Page-specific components
        16a. BOM page
        16b. Cash-flow chart
        16c. Client PO (live-save + file drop zone)
        16d. Contractor matrix (sticky thead)
        16e. DRA form
        16f. DRA locations map
        16g. EOD icon picker
        16h. Error page (404)
        16i. Login / access-denied page
        16j. Delete confirm modal
        16k. Popover (green override)
        16l. Datepicker popup (edit-member)
        16m. PDF wrap
        16n. Flash animations
═══════════════════════════════════════════════════════════════ */


/* ── 1. Modal backdrop ───────────────────────────────────────── */
.modal-backdrop.show {
    opacity: 0.8;
}


/* ── 2. AI Button ────────────────────────────────────────────── */
.btn-ai {
    background: linear-gradient(135deg, #6f42c1 0%, #8e5cf5 100%);
    border-color: #6f42c1;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.btn-ai:hover,
.btn-ai:focus {
    background: linear-gradient(135deg, #5a32a3 0%, #7a4ae0 100%);
    border-color: #5a32a3;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.35);
}
.btn-ai:active {
    background: #5a32a3;
    border-color: #4e2d8f;
    color: #fff;
}
.btn-ai.btn-warning {
    background: linear-gradient(135deg, #b07e10 0%, #d4a017 100%) !important;
    border-color: #b07e10 !important;
}
.btn-ai.btn-success {
    background: linear-gradient(135deg, #1a7a3c 0%, #28a745 100%) !important;
    border-color: #1a7a3c !important;
}
.btn-ai.btn-danger {
    background: linear-gradient(135deg, #a71d2a 0%, #dc3545 100%) !important;
    border-color: #a71d2a !important;
}


/* ── 3. jQuery UI Datepicker ─────────────────────────────────── */
.ui-datepicker {
    background-color: #fff;
    border: 1px solid #66afe9;
    border-radius: 0;
    box-shadow: 0 0 8px rgba(102, 175, 233, 0.6);
    display: none;
    margin-top: 4px;
    padding: 10px;
    width: 280px;
    z-index: 99999999;
}
.ui-datepicker a,
.ui-datepicker a:hover {
    text-decoration: none;
}
.ui-datepicker a:hover,
.ui-datepicker td:hover a {
    color: #2a6496;
    transition: color 0.1s ease-in-out;
}
.ui-datepicker .ui-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.ui-datepicker .ui-datepicker-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
}
.ui-datepicker .ui-datepicker-title select {
    font-weight: normal;
    font-size: 13px;
    padding: 1px 2px;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    background: none;
    color: #555;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-style: normal;
    font-weight: normal;
    font-size: 16px;
    line-height: 1.2;
    padding: 4px 8px;
    transition: color 0.15s, background-color 0.15s;
    float: none;
    flex-shrink: 0;
}
.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background-color: #f0f4ff;
    color: #0069d9;
}
.ui-datepicker .ui-datepicker-prev:before {
    content: "‹";
}
.ui-datepicker .ui-datepicker-next:before {
    content: "›";
}
.ui-datepicker .ui-icon {
    display: none;
}
.ui-datepicker .ui-datepicker-calendar {
    table-layout: fixed;
    width: 100%;
}
.ui-datepicker .ui-datepicker-calendar th {
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 6px 0;
}
.ui-datepicker .ui-datepicker-calendar td {
    border-radius: 4px;
    padding: 0;
    transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
}
.ui-datepicker .ui-datepicker-calendar td:hover {
    background-color: transparent;
    cursor: pointer;
}
.ui-datepicker .ui-datepicker-calendar td a,
.ui-datepicker .ui-datepicker-calendar td span {
    display: block;
    padding: 5px 0;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
}
.ui-datepicker .ui-datepicker-calendar td a:hover {
    background-color: #e2ecf7;
    color: #0053af;
}
.ui-datepicker .ui-datepicker-current-day {
    background-color: transparent;
}
.ui-datepicker .ui-datepicker-current-day a {
    background-color: #0069d9;
    color: #fff;
    font-weight: 700;
}
.ui-datepicker td.ui-datepicker-today a {
    background-color: #cce0ff;
    color: #003d99;
    font-weight: 600;
}
.ui-datepicker td.ui-datepicker-today.ui-datepicker-current-day a {
    background-color: #0069d9;
    color: #fff;
}
.ui-datepicker .ui-datepicker-other-month a {
    color: #bbb;
}
.ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover {
    background-color: transparent;
    cursor: default;
}


/* ── 4. Athena theme classes (ath-*) ─────────────────────────── */
.ath-card-primary {
    background-color: #0069d9;
    color: #fff;
    font-weight: bold;
}

.ath-table-header {
    background-color: #222;
    color: #fff;
    font-weight: bold;
}

.ath-header-primary {
    color: #fff;
    font-weight: bold;
    background-color: #007bff;
    border-radius: 0;
}

.hr-dotted {
    border-top: 1px dotted #8c8b8b;
    border-bottom: 1px dotted #fff;
}


/* ── 5. Base element overrides ───────────────────────────────── */
h1 {
    color: #006dd9;
    font-size: 24px;
    font-weight: bold;
    padding-bottom: 6px;
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 2px dotted #006dd9;
    text-shadow: 1px 1px 0 #f2f2f2;
}

h2 {
    color: #006dd9;
    font-size: 18px;
    font-weight: bold;
    padding-bottom: 4px;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 2px dotted #006dd9;
    text-shadow: 1px 1px 0 #f2f2f2;
}
h2 small {
    font-size: 0.65em;
    font-weight: normal;
    text-shadow: none;
}

a {
    font-weight: bold;
}

a:hover {
    text-decoration: underline dotted;
}

.alert {
    border-radius: 0;
    padding: 14px;
}
.alert-success {
    border-color: #5a9e6f;
}
.alert-warning {
    border-color: #d4a017;
}
.alert-danger {
    border-color: #b94040;
}
.alert-info {
    border-color: #1f86a8;
}

.table {
    margin-bottom: 0;
}

.input-group {
    margin-bottom: 12px;
}

.btn-group {
    margin-bottom: 12px;
}


/* ── 6. Breadcrumb bar ───────────────────────────────────────── */
/* Spacing between breadcrumb bar and page content */
.breadcrumb-bar + .container-fluid {
    padding-top: 0;
}

.breadcrumb-bar {
    font-weight: bold;
    background-color: #333;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.breadcrumb {
    margin-bottom: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 0;
    background-color: transparent;
}

.breadcrumb-item,
.breadcrumb-item * {
    color: #82b1ff;
}
.breadcrumb-item a {
    color: #82b1ff;
}
.breadcrumb-item a:hover {
    color: #fff;
}
.breadcrumb-item.active {
    color: #ccc;
}
.breadcrumb-item + .breadcrumb-item::before {
    color: #888;
}


/* ── 7. Utility classes ──────────────────────────────────────── */
/* Spacing */
.mb-10          { margin-bottom: 10px !important; }
.mt-10          { margin-top: 10px !important; }
.ml-10          { margin-left: 10px !important; }
.pb-10          { padding-bottom: 10px !important; }
.p-10           { padding: 10px !important; }
.spacer-sm      { height: 10px; }
.spacer-lg      { height: 20px; }

/* Sizing */
.h-30           { height: 30px !important; }
.w-60           { width: 60px !important; }
.max-w-110      { max-width: 110px !important; }
.max-w-140      { max-width: 140px !important; }
.max-w-200      { max-width: 200px !important; }
.max-w-210      { max-width: 210px !important; }

/* Typography */
.fs-hero        { font-size: 50px !important; }
.fs-status-icon { font-size: 34px; }

/* Layout */
.td-shrink          { width: 1px; white-space: nowrap; }
.cursor-pointer     { cursor: pointer !important; }
.align-self-center  { align-self: center !important; }
.flex-fill-min      { flex: 1; min-width: 0; }

/* Borders */
.border-bottom-0    { border-bottom: 0 !important; }
.divider-brand      { height: 2px; background-color: #006dd9; }

/* Colours */
.bg-dark-header { background-color: #222; color: #fff; font-weight: bold; }
.prepend        { font-weight: bold; }

.positive {
    background-color: #d4edda;
    color: #155724;
}

.negative {
    background-color: #f8d7da;
    color: #721c24;
}

.reverse-success {
    color: #d4edda;
    background-color: #155724;
}

.reverse-warning {
    color: #fff3cd;
    background-color: #856404;
}

.reverse-danger {
    color: #f8d7da;
    background-color: #721c24;
}

.bg-success-light {
    background-color: #7bdf92 !important;
}
.bg-success-light:hover,
a.bg-success-light:focus,
a.bg-success-light:hover,
button.bg-success:focus,
button.bg-success:hover {
    background-color: #57d774 !important;
}


/* ── 8. Bootstrap component overrides ───────────────────────── */
.btn {
    font-weight: bold;
    margin-right: 1px;
    border-radius: 0;
}

.badge {
    border-radius: 0;
}

.modal-title {
    font-size: 22px;
    font-weight: bold;
}

.modal-content,
.modal-footer,
.modal-header {
    border-radius: 0;
}

.card {
    margin-bottom: 10px;
    border-radius: 0;
    padding-bottom: 0;
}

.form-control {
    border-radius: 0;
}

.border-primary {
    border-radius: 0;
}

.card-header {
    border-radius: 0;
}

.input-group-text {
    border-radius: 0;
}

.nav-tabs {
    border-radius: 0;
}

.nav-item {
    border-radius: 0;
}

.nav-link {
    border-radius: 0;
}

.text-dark {
    color: #000;
}


/* ── 9. Table headers (ath-thead) ────────────────────────────── */
/* Dark table header — Bootstrap 4 native class + Athena alias */
.ath-thead,
thead.thead-dark,
thead.thead-dark > tr > th,
thead.thead-dark > tr > td {
    background-color: #222 !important;
    color: #fff !important;
    font-weight: bold;
    border-bottom: 0;
    border-color: #444 !important;
}


/* ── 10. Navbar overrides ────────────────────────────────────── */
.navbar {
    background-color: #1a1d20 !important;
    border-bottom: 2px solid #006dd9;
}
@media (min-width: 992px) {
    .navbar {
        border-top: 2px solid #006dd9;
    }
}
.navbar .nav-link {
    font-weight: bold;
    font-size: 13px;
    padding: 0.5rem 0.65rem;
    border-radius: 0;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #fff;
    background-color: #006dd9;
}
.navbar .nav-item.show > .nav-link {
    background-color: #006dd9;
    color: #fff;
}
/* Active nav item — persistent current-page indicator */
.navbar .nav-item.active > .nav-link {
    color: #fff;
    background-color: rgba(0, 109, 217, 0.2);
}
.navbar .dropdown-menu {
    background-color: #1a1d20;
    border: 1px solid #333;
    border-radius: 0;
    padding: 0;
    margin-top: 0;
}
.navbar .dropdown-item {
    color: #e0e0e0;
    font-size: 14px;
    padding: 9px 16px;
    font-weight: normal;
}
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: #006dd9;
    color: #fff;
}
.navbar .dropdown-item.active,
.navbar .dropdown-item:active {
    background-color: #006dd9;
    color: #fff;
}
.navbar .dropdown-divider {
    border-top-color: #333;
    margin: 4px 0;
}
.navbar .dropdown-header {
    color: #006dd9;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 8px 16px 4px;
    margin: 0;
}
/* No top-padding on the first header in each menu */
.navbar .dropdown-menu > .dropdown-header:first-child {
    padding-top: 10px;
}
.navbar .nav-item .badge-danger {
    font-size: 10px;
    vertical-align: top;
    margin-left: 2px;
}
/* Navbar toggler (mobile hamburger) */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
}
.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 109, 217, 0.4);
}
.navbar-toggler .toggler-icon {
    color: #fff;
    font-size: 20px;
    transition: transform 0.3s ease;
}
.navbar-toggler[aria-expanded="true"] .toggler-icon {
    transform: rotate(90deg);
    color: #006dd9;
}

/* ── Mega menu (desktop only) ────────────────────────────────── */
@media (min-width: 992px) {
    /* Remove per-item positioning so dropdown anchors to the navbar */
    .mega-dropdown {
        position: static !important;
    }
    /* Full-width panel, laid out as a flex row */
    .mega-dropdown .mega-menu {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
        padding: 0;
        margin-top: 0;
        border-top: 2px solid #006dd9;
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-shadow: 0 6px 16px rgba(0,0,0,0.4);
        z-index: 1050;
    }
    .mega-dropdown .mega-menu.show {
        display: flex !important;
    }
    /* Each section is a column */
    .mega-dropdown .mega-col {
        flex: 1;
        min-width: 0;
        border-right: 1px solid #2e3338;
        padding-bottom: 0.75rem;
    }
    .mega-dropdown .mega-col:last-child {
        border-right: none;
    }
    /* Items fill their column width */
    .mega-dropdown .mega-col .dropdown-item {
        white-space: normal;
        padding: 8px 16px;
    }
    /* Header sits flush at the top of each column */
    .mega-dropdown .mega-col .dropdown-header {
        padding-top: 10px;
    }
}

/* ── Mega-menu icon cards ─────────────────────────────────── */
.mega-items {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 10px 14px;
    gap: 6px;
}
.mega-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 88px;
    padding: 12px 6px 10px;
    border-radius: 8px;
    color: #b0bac8;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.mega-item:hover,
.mega-item:focus {
    background: #006dd9;
    color: #fff;
    text-decoration: none;
}
.mega-item i {
    font-size: 22px;
    margin-bottom: 8px;
    display: block;
}

/* ── 11. Card components ─────────────────────────────────────── */
.card-body-icon {
    position: absolute;
    z-index: 0;
    top: -1.25rem;
    right: -1rem;
    opacity: 0.4;
    font-size: 9rem;
    transform: rotate(15deg);
}


/* ── 12. DataTables → see css/custom-datatables.css ─────────── */


/* ── 13. Button colours ──────────────────────────────────────── */
/* btn-primary: Links / navigation (View, Open, Go to) — brand blue */
.btn-primary {
    background-color: #006dd9;
    border-color: #005fbd;
    color: #fff;
}
.btn-primary:hover {
    background-color: #005fbd;
    border-color: #0054a8;
    color: #fff;
}
.btn-primary:focus,
.btn-primary.focus {
    background-color: #005fbd;
    border-color: #0054a8;
    box-shadow: 0 0 0 0.2rem rgba(0, 109, 217, 0.4);
    color: #fff;
}
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: #0054a8;
    border-color: #004a94;
    color: #fff;
}

/* btn-success: Create / action (Add, Save, Submit, Approve) — green */
.btn-success {
    background-color: #28a745;
    border-color: #24963e;
    color: #fff;
}
.btn-success:hover {
    background-color: #24963e;
    border-color: #208637;
    color: #fff;
}
.btn-success:focus,
.btn-success.focus {
    background-color: #24963e;
    border-color: #208637;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.4);
    color: #fff;
}
.btn-success:active,
.btn-success:not(:disabled):not(.disabled):active {
    background-color: #208637;
    border-color: #1c7630;
    color: #fff;
}

/* Outline variants */
.btn-outline-primary {
    color: #006dd9;
    border-color: #006dd9;
}
.btn-outline-primary:hover {
    background-color: #006dd9;
    border-color: #006dd9;
    color: #fff;
}
.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 109, 217, 0.4);
}
.btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}
.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}
.btn-outline-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.4);
}

/* btn-secondary: Cancel / utility — grey */
.btn-secondary {
    background-color: #5a6268;
    border-color: #545b62;
    color: #fff;
}
.btn-secondary:hover {
    background-color: #4e555b;
    border-color: #484e53;
    color: #fff;
}


/* ── 14. Footer (ath-footer) ─────────────────────────────────── */
.ath-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px 0;
    margin-top: 0;
    font-size: 13px;
    color: #666;
}
.ath-footer a {
    color: #006dd9;
    font-weight: normal;
}
.ath-footer a:hover {
    color: #0054a8;
    text-decoration: none;
}
.ath-footer-sep {
    color: #ccc;
    margin: 0 8px;
}


/* ── 15. Diary navigation ────────────────────────────────────── */
.diary-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.diary-pills {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    padding: 4px 0;
}
.diary-pills::-webkit-scrollbar {
    display: none;
}

.diary-pill {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 0;
    border: 1px solid #006dd9;
    background: #fff;
    color: #006dd9;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.diary-pill:hover {
    background: #e8f0fe;
}
.diary-pill.active {
    background: #006dd9;
    color: #fff;
}
.diary-pill.today:not(.active) {
    border-color: #28a745;
    color: #28a745;
}
.diary-pill.today.active {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}
.diary-pill.weekend {
    border-color: #6c757d;
    color: #6c757d;
}
.diary-pill.weekend.active {
    background: #343a40;
    border-color: #343a40;
    color: #fff;
}

.diary-nav-arrow {
    flex: 0 0 auto;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

@media (max-width: 576px) {
    .diary-pill {
        padding: 8px 14px;
        font-size: 14px;
    }
    .diary-nav-arrow {
        min-width: 44px;
        min-height: 44px;
    }
}


/* ── 16. Page-specific components ────────────────────────────── */

/* ── 16a. BOM page ── */
.bom-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin-bottom: 1rem;
    border: none;
    background: transparent;
}
.bom-tabs .nav-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: #6c757d;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    transition: color 0.12s, background 0.12s, border-color 0.12s, box-shadow 0.12s;
    white-space: nowrap;
}
.bom-tabs .nav-link:hover {
    color: #495057;
    border-color: #ced4da;
    background: #e9ecef;
    text-decoration: none;
}
.bom-tabs .nav-link.has-items {
    color: #1a2a3a;
    border-color: #b8d4f5;
    background: #eaf3ff;
    font-weight: 600;
}
.bom-tabs .nav-link.active {
    background: #006dd9;
    color: #fff;
    border-color: #006dd9;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 109, 217, 0.35);
}
.bom-tabs .nav-link .badge {
    font-size: 0.62em;
    font-weight: 700;
    margin-left: 3px;
    vertical-align: middle;
    background: rgba(0, 109, 217, 0.12);
    color: #0062cc;
    border-radius: 8px;
    padding: 1px 5px;
}
.bom-tabs .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}
/* BOM card container */
.bom-card {
    border: 1px solid #dee2e6;
    overflow: hidden;
    margin-bottom: 1rem;
}
/* BOM order scroll area */
.bom-order-scroll {
    max-height: 340px;
    overflow-y: auto;
}
/* BOM items table */
.bom-items-table thead th {
    background: #1e3a52;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 10px;
    border: none;
    position: sticky;
    top: 0;
    z-index: 1;
}
.bom-items-table tbody tr:nth-of-type(odd) {
    background-color: #f5f5f0;
}
.bom-items-table tbody tr:not(.bom-cat-row):hover td {
    background-color: #e8f0f8;
}
.bom-items-table td {
    vertical-align: middle;
    font-size: 0.85rem;
    padding: 6px 10px;
}
.bom-items-table .bom-cat-row {
    background: #1e3a52 !important;
    border-top: none;
    border-left: 3px solid #006dd9;
    font-weight: 600;
}
.bom-items-table .bom-cat-row td {
    padding: 8px 10px;
    color: #fff;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bom-items-table .bom-spacer-row td {
    padding: 0;
    height: 1px;
    background: #dee2e6;
    border: none;
}
/* Row with a qty entered — subtle green left accent */
.bom-items-table tbody tr:has(.input-group-text.bg-primary) td:first-child {
    border-left: 3px solid #28a745;
}
.bom-items-table tbody tr:has(.input-group-text.bg-primary) {
    background-color: #f0faf2 !important;
}
/* Fixed bottom submit bar */
.bom-submit-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: #fff;
    border-top: 2px solid #006dd9;
    padding: 8px 15px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}


/* BOM card header tabs */
.bom-card-tabs {
    border-bottom: 0;
    margin: 0;
    padding: 6px 8px 0;
}
.bom-card-tabs .nav-link {
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid transparent;
    border-radius: 4px 4px 0 0;
    padding: 7px 16px;
    font-size: 0.83rem;
    font-weight: 600;
    transition: all 0.15s;
}
.bom-card-tabs .nav-link:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}
.bom-card-tabs .nav-link.active {
    color: #006dd9;
    background-color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    border-bottom-color: #fff;
}

/* BOM inline editing */
.qty-text {
    cursor: pointer;
    border-bottom: 1px dashed #aaa;
    padding: 1px 3px;
    display: inline-block;
    min-width: 28px;
}
.qty-text:hover {
    background: #fff3cd;
    border-radius: 2px;
    border-bottom-color: #f0ad4e;
}
.bom-edit-icon {
    font-size: 0.65rem;
    color: #bbb;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
}
.bom-edit-icon:hover {
    color: #555;
}
.qty-input {
    width: 62px !important;
}
.qty-input:not(.d-none) {
    display: inline-block !important;
}
/* BOM number change flash */
.total-text, #bom-grand-total {
    transition: color 0.3s ease;
}
/* BOM grand total display */
.bom-total-display {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.bom-total-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    font-weight: 600;
}
.bom-total-display strong {
    font-size: 1.1rem;
    color: #212529;
}

/* BOM master search */
#bom-search-wrap {
    position: relative;
}
.bom-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    max-height: 320px;
    overflow-y: auto;
}
.bom-search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    text-decoration: none;
}
.bom-search-item:hover {
    background: #eaf3ff;
    color: #006dd9;
    text-decoration: none;
}
.bom-search-desc {
    flex: 1;
    font-size: 0.88rem;
}
.bom-search-code {
    font-size: 0.78rem;
    color: #666;
    font-family: monospace;
    background: #f5f5f5;
    padding: 1px 5px;
    border-radius: 3px;
}
.bom-search-tab {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}
.bom-search-no-results {
    padding: 10px 12px;
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

/* ── 16b. Cash-flow chart ── */
.custom-tooltip {
    padding: 10px;
    width: 400px;
    max-width: 400px;
    font-family: inherit;
    font-size: 14px;
    background: rgba(0, 0, 0, 1);
    color: #fff;
    border: 1px solid #fff;
    border-radius: 0;
}
.ai-updated {
    background-color: #d4edda !important;
    border-color: #28a745 !important;
    color: #155724 !important;
    font-weight: bold;
}


/* ── 16c. Client PO — live-save + file drop zone ── */
.det-saving {
    opacity: 0.6;
    pointer-events: none;
}
.li-tick-wrap {
    position: relative;
    display: block;
}
.li-saved {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.15rem rgba(40, 167, 69, 0.25) !important;
    padding-right: 1.8rem !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.li-tick {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.6s ease;
    z-index: 5;
}
.li-tick.fade-out {
    opacity: 0;
}
#details-card {
    transition: background-color 0.4s ease;
}
#details-card.card-success {
    background-color: #28a745 !important;
}
.bootstrap-select > .btn.li-saved {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.15rem rgba(40, 167, 69, 0.25) !important;
}

/* Selectpicker buttons styled to match input-group form-controls */
.input-group .bootstrap-select > .btn,
.li-tick-wrap .bootstrap-select > .btn {
    border-radius: 0;
    border-color: #ced4da;
    background-color: #fff;
    color: #495057;
    font-size: 1rem;
    font-weight: 400;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 1.75rem 0.375rem 0.75rem;
    box-shadow: none;
}
.input-group .bootstrap-select > .btn:focus,
.li-tick-wrap .bootstrap-select > .btn:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.25);
    outline: 0;
}
.li-tick-wrap .bootstrap-select {
    max-width: 100%;
}
.li-tick-wrap .bootstrap-select > .btn {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
#drop-zone.drag-over {
    border-color: #007bff;
    background: #e8f0fe;
    color: #007bff;
}
#drop-zone.uploading {
    border-color: #ffc107;
    background: #fff8e1;
    color: #856404;
}
#drop-zone.upload-done {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}
/* Project attachment modal dropzone */
#proj-drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
#proj-drop-zone.drag-over  { border-color: #007bff; background: #e8f0fe; color: #007bff; }
#proj-drop-zone.uploading  { border-color: #ffc107; background: #fff8e1; color: #856404; }
#drop-zone-pdf, #drop-zone-data {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
#drop-zone-pdf.drag-over, #drop-zone-data.drag-over {
    border-color: #007bff;
    background: #e8f0fe;
    color: #007bff;
}
#drop-zone-pdf.upload-done, #drop-zone-data.upload-done {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}
#drop-zone-remittance {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
#drop-zone-remittance.drag-over {
    border-color: #007bff;
    background: #e8f0fe;
    color: #007bff;
}
#drop-zone-remittance.upload-done {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

/* ── 16c-hop. HOP requirement drop zone ── */
.hop-drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.hop-drop-zone.drag-over {
    border-color: #007bff;
    background: #e8f0fe;
    color: #007bff;
}
.hop-drop-zone.uploading {
    border-color: #ffc107;
    background: #fff8e1;
    color: #856404;
}

/* ── 16c-eod. EOD Yes/No/N/A option buttons ── */
.eod-option-group {
    display: flex;
    gap: 10px;
    padding: 2px 0;
}
.eod-option-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    opacity: 0.25;
    transition: opacity 0.15s, transform 0.1s;
    border-radius: 6px;
}
.eod-option-btn:focus { outline: none; box-shadow: none; }
.eod-option-btn.eod-active { opacity: 1; }
.eod-option-btn:hover { opacity: 0.6; }
.eod-option-btn.eod-active:hover { opacity: 1; }
.eod-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}
.eod-circle-yes { background: #28a745; }
.eod-circle-no  { background: #dc3545; }
.eod-circle-na  { background: #ffc107; }
.eod-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── 16c-eod. EOD photo drop zone ── */
#eod-drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
#eod-drop-zone.drag-over {
    border-color: #007bff;
    background: #e8f0fe;
    color: #007bff;
}
#eod-drop-zone.uploading {
    border-color: #ffc107;
    background: #fff8e1;
    color: #856404;
}


/* ── 16d. Contractor matrix — sticky thead ── */
.sticky-thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* ── 16e. DRA form ── */
.dra-form {
    display: none;
}
.dra-form.active {
    display: block;
}


/* ── 16f. DRA locations map ── */
#map {
    height: 600px;
    width: 100%;
    margin-bottom: 20px;
}
.custom-label {
    position: absolute;
    background: white;
    border: 2px solid black;
    padding: 4px 8px;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    transform: translateX(-50%);
    z-index: 100;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}


/* ── 16g. EOD icon picker ── */
.icon-picker {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}
.icon-picker .icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    min-width: 100px;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.15s ease;
    border-width: 2px;
}
.icon-picker .icon-option i {
    font-size: 2.5rem;
    line-height: 1;
}
.icon-picker .icon-option small {
    font-size: 0.75rem;
}
.icon-picker .icon-option:focus {
    box-shadow: none;
}


/* ── 16h. Error page (404) ── */
.error-page {
    min-height: 100vh;
    background-color: #191c1f;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0px,
        transparent 9px,
        #1f2327 9px,
        #1f2327 10px
    );
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 89px 15px 40px;
    overflow-y: auto;
}
.error-card {
    width: 100%;
    max-width: 480px;
}
.error-logo {
    text-align: center;
    margin-bottom: 35px;
}
.error-logo img {
    max-height: 70px;
}
.error-page .card {
    background-color: #333;
    border: 1px solid #444;
    border-top: 3px solid #ffc107;
    border-bottom: 3px solid #ffc107;
    border-radius: 0;
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.15), 0 4px 20px rgba(0, 0, 0, 0.3);
}
.error-page .btn {
    border-radius: 0;
}
.error-icon {
    font-size: 4rem;
    color: #ffc107;
    margin-bottom: 15px;
}
.error-code {
    font-size: 5rem;
    font-weight: 700;
    color: #ffc107;
    line-height: 1;
    margin-bottom: 10px;
}
.error-title {
    color: #e0e0e0;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
}
.error-message {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 25px;
}
.error-support {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 0.8rem;
}
.error-support a {
    color: #aaa;
}
.error-support a:hover {
    color: #ffc107;
}


/* ── 16i. Login / access-denied page ── */
/* Hide the navbar, loader, and dev banner on the login overlay */
.login-page ~ .navbar,
.login-page ~ .loader {
    display: none !important;
}

.login-page {
    min-height: 100vh;
    background-color: #191c1f;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0px,
        transparent 9px,
        #1f2327 9px,
        #1f2327 10px
    );
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 89px 15px 40px;
    position: fixed;
    inset: 0;
    z-index: 9998;
    overflow-y: auto;
}
.login-card {
    width: 100%;
    max-width: 480px;
}
.login-logo {
    text-align: center;
    margin-bottom: 35px;
}
.login-logo img {
    max-height: 70px;
}
.login-support {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 0.8rem;
}
.login-support a {
    color: #aaa;
}
.login-support a:hover {
    color: #006dd9;
}
.login-page .form-control.is-invalid {
    background-image: none;
    padding-right: 0.75rem;
}
/* Dark-themed inputs */
.login-page .form-control {
    background-color: #2a2d30;
    border-color: #444;
    color: #e0e0e0;
}
.login-page .form-control::placeholder {
    color: #888;
}
.login-page .form-control:focus {
    background-color: #2a2d30;
    border-color: #006dd9;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(0, 109, 217, 0.25);
}
.login-page .input-group-text {
    background-color: #006dd9;
    border-color: #006dd9;
    color: #fff;
}
/* Blue glow on card */
.login-page .card {
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 109, 217, 0.15), 0 4px 20px rgba(0, 0, 0, 0.3);
}
.login-page .btn,
.login-page .form-control,
.login-page .input-group-text,
.login-page .input-group > .form-control,
.login-page .input-group > .input-group-prepend > .input-group-text,
.login-page .input-group > .input-group-append > .input-group-text {
    border-radius: 0 !important;
}


/* ── 16j. Delete confirm modal ── */
.delete-confirm-content {
    border: none;
    border-top: 3px solid #dc3545;
    border-bottom: 3px solid #dc3545;
    box-shadow: 0 0 30px rgba(220, 53, 69, 0.15), 0 4px 20px rgba(0, 0, 0, 0.1);
}


/* ── 16k. Popover (green override) ── */
.popover {
    border: 2px solid #218838;
}
.popover-header {
    font-weight: bold;
    background-color: #218838;
    color: #fff;
}


/* ── 16l. Datepicker popup (edit-member) ── */
.datepicker-dropdown {
    padding: 10px !important;
    border-radius: 0 !important;
    border: 1px solid #007bff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    background-color: #fff !important;
}
.datepicker table tr td.day:hover {
    background: #007bff !important;
    color: #fff !important;
}
.datepicker table tr td.active {
    background-color: #28a745 !important;
    color: #fff !important;
    border-radius: 0 !important;
}
.datepicker table tr td.today {
    background: #ffe8a1 !important;
}


/* ── 16m. PDF wrap ── */
.pdf-wrap object {
    border: 1px solid #ccc;
    border-radius: 4px;
}


/* ── 16n. Flash animations ── */
.flash-success {
    animation: flashGreen 2s ease-in-out;
}
@keyframes flashGreen {
    0%   { background-color: #d4edda; }
    100% { background-color: transparent; }
}

.small-label {
    font-size: 0.85rem;
    color: #888;
}

.ai-box textarea,
.ai-box input {
    font-size: 0.85rem;
}


/* ── 16o. Outgoing / PO / Supplier PO — duplicate live-save + drop zone ── */
/* These classes are also defined in 16c for client-po.php.
   The rules below cover any page that also uses #drop-zone-quote. */
#drop-zone-quote {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
#drop-zone-quote.drag-over {
    border-color: #007bff;
    background: #e8f0fe;
    color: #007bff;
}
#drop-zone-quote.uploading {
    border-color: #ffc107;
    background: #fff8e1;
    color: #856404;
}
.details-saving {
    opacity: 0.6;
    pointer-events: none;
}
/* Hide number input spinners */
.li-qty::-webkit-outer-spin-button,
.li-qty::-webkit-inner-spin-button,
.li-cost::-webkit-outer-spin-button,
.li-cost::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.li-qty,
.li-cost {
    -moz-appearance: textfield;
}
/* Outgoing embed holder */
.sp-embed-holder {
    min-height: 40px;
}


/* ── 16p. Handling unit — dark-red button ── */
.btn-darkred {
    background-color: #800000 !important;
    color: #fff !important;
    border: 1px solid #660000;
    cursor: not-allowed;
}
.btn-danger[disabled],
.btn-darkred[disabled] {
    cursor: not-allowed !important;
    opacity: 0.85;
}


/* ── 16q. Page loader overlay (header.php) ── */
.loader {
    position: fixed;
    inset: 0;
    background: #111;
    z-index: 9999;
    opacity: 0.94;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-spinner {
    width: 160px;
    height: 160px;
    border: 18px solid rgba(0, 109, 217, 0.2);
    border-top: 18px solid #006dd9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ── 16r. Log / check-in kiosk ── */
body.log-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    background: #0a0f1e;
}
.buzz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    background: #0a0f1e;
    border-bottom: 3px solid #006DD9;
    flex-shrink: 0;
    box-shadow: 0 2px 16px rgba(0, 109, 217, 0.18);
}
.buzz-logo {
    max-height: 30px;
    width: auto;
}
.buzz-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.buzz-location {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.buzz-location i {
    color: #006DD9;
    margin-right: 6px;
}
.buzz-fire-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.buzz-fire-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.6);
}
.buzz-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.panel {
    flex: 0 0 auto;
    padding: 20px 24px;
    overflow-y: auto;
}
.panel-out {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
}
.panel-in {
    background: #0c1222;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}
.panel-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.panel-out .panel-title { color: #94a3b8; }
.panel-in .panel-title  { color: #22c55e; }
.panel-count {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
}
.panel-in .panel-count {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    color: #22c55e;
}
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 120px));
    gap: 10px;
    justify-content: center;
}
.user-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.user-card:hover {
    background: #334155;
    border-color: #475569;
    transform: translateY(-2px);
}
.user-card:active {
    transform: translateY(0);
}
.panel-in .user-card {
    background: rgba(74, 222, 128, 0.05);
    border-color: rgba(74, 222, 128, 0.15);
}
.panel-in .user-card:hover {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
}
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.panel-out .avatar { background: #475569; }
.panel-in .avatar  { background: #16a34a; }
.avatar-guest { background: #7c3aed !important; }
.user-card .name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.2;
}
.user-card .surname {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 2px;
}
.guest-card {
    border-style: dashed;
    border-color: #475569;
    background: transparent;
}
.guest-card:hover {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.05);
}
.guest-card .avatar {
    background: transparent;
    border: 2px dashed #64748b;
    color: #64748b;
}
.guest-card:hover .avatar {
    border-color: #7c3aed;
    color: #7c3aed;
}
.guest-card .name { color: #94a3b8; }
.fire-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 20px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.fire-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}
#statusOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
#statusOverlay.show {
    opacity: 1;
    pointer-events: all;
}
.overlay-checkin  { background: rgba(5, 46, 22, 0.95); }
.overlay-checkout { background: rgba(69, 10, 10, 0.95); }
#statusOverlay .overlay-icon { font-size: 5rem; margin-bottom: 20px; }
.overlay-checkin .overlay-icon  { color: #22c55e; }
.overlay-checkout .overlay-icon { color: #f87171; }
#statusOverlay .overlay-msg {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f8fafc;
}
#statusOverlay .overlay-sub {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-top: 8px;
}
/* log.php overrides Bootstrap modals with a dark theme */
.log-page .modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    color: #e2e8f0;
}
.log-page .modal-header {
    border-bottom: 1px solid #334155;
    padding: 16px 20px;
}
.log-page .modal-header .close { color: #94a3b8; text-shadow: none; opacity: 0.8; }
.log-page .modal-body   { padding: 24px 20px; }
.log-page .modal-footer { border-top: 1px solid #334155; padding: 16px 20px; }
.log-page .modal-header.hdr-primary { background: #1e40af; }
.log-page .modal-header.hdr-danger  { background: #991b1b; }
.log-page .modal .form-control {
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #e2e8f0;
    padding: 10px 14px;
}
.log-page .modal .form-control:focus {
    background: #0f172a;
    border-color: #3b82f6;
    color: #e2e8f0;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.log-page .modal label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
}
.btn-checkin {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-checkin:hover { background: #15803d; color: #fff; }
.btn-checkout {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-checkout:hover { background: #b91c1c; color: #fff; }
.btn-modal-secondary {
    background: #334155;
    color: #cbd5e1;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
}
.btn-modal-secondary:hover { background: #475569; color: #f1f5f9; }
.btn-modal-success {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
}
.btn-modal-success:hover { background: #15803d; color: #fff; }
.user-modal-icon { margin-bottom: 12px; }
.user-modal-icon i { font-size: 4rem; }
.user-modal-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}
.user-modal-company {
    color: #64748b;
    font-size: 0.9rem;
}
.last-out-tips {
    text-align: left;
    margin-top: 20px;
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    padding: 16px;
}
.last-out-tips h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 10px;
}
.last-out-tips ul { padding-left: 20px; margin: 0; }
.last-out-tips li {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 4px;
}
.fire-table { width: 100%; border-collapse: collapse; }
.fire-table th {
    background: #334155;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    text-align: left;
}
.fire-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #334155;
    font-size: 0.9rem;
}
.fire-table .btn-present {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.fire-table .btn-present:disabled {
    background: #334155;
    color: #64748b;
    cursor: default;
}
.panel-leave {
    background: #120f00;
    border-top: 1px solid #1e293b;
}
.panel-leave .panel-title { color: #fbbf24; }
.panel-leave .panel-count {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}
.panel-leave .user-card {
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.15);
    cursor: default;
}
.panel-leave .user-card:hover {
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.15);
    transform: none;
}
.avatar-leave { background: #b45309 !important; }


/* ── 16s. Meeting / Actions — attendee rows ── */
.attendee-row {
    padding: 6px;
    margin-top: 2px;
    margin-bottom: 2px;
}
.attendee-row:hover {
    background-color: #ccc;
    color: black;
}


/* ── 16t. Org chart ── */
.org-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0 20px 0;
}
.org-lr {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 10px 10px 20px 10px;
    min-width: 1200px;
}
.org-col {
    flex: 0 0 320px;
    position: relative;
}
.org-col:after {
    content: "";
    position: absolute;
    top: 0;
    right: -12px;
    width: 1px;
    height: 100%;
    background: #eee;
}
.org-col:last-child:after { display: none; }
.org-col-title {
    font-weight: 700;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 10px 0;
    text-align: center;
}
.org-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.org-node {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.org-person {
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}
.org-role {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
}
.org-meta {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}
@media (max-width: 768px) {
    .org-lr { gap: 16px; min-width: 900px; }
    .org-col { flex: 0 0 280px; }
}


/* ── 16u. Actions part — job action states ── */
.job-action-highlight {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}
.job-action-updated {
    animation: updatedFade 2.5s ease-out;
}
@keyframes updatedFade {
    0%   { background-color: #d4edda; }
    100% { background-color: transparent; }
}
.badge-updated {
    animation: badgePulse 2.5s ease-out forwards;
}
@keyframes badgePulse {
    0%   { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}
.job-action-saving > td {
    position: relative;
    pointer-events: none;
}
.job-action-saving > td::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}
.job-action-saving > td:first-child::after {
    content: '\f110';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #495057;
    animation: fa-spin 1s linear infinite;
}
.po-button.active {
    font-weight: bold;
    text-decoration: underline;
}
.job-action-row .btn {
    white-space: nowrap;
}


/* ── 16v. Map (parts/map.php) ── */
/* #map already defined in 16f (DRA locations). parts/map.php uses height:450px instead.
   Override with a modifier class rather than redefining #map. */
.map-sm { height: 450px; }


/* ── 16w. Payroll ── */
.payroll-title small { font-size: 60%; opacity: 0.85; }
.payroll-card .card-header { padding: 0.6rem 0.85rem; }
.payroll-card .card-body   { padding: 0.85rem; }
.payroll-meta p { margin-bottom: 0.35rem; }
.payroll-table td,
.payroll-table th    { vertical-align: middle; }
.payroll-table td    { padding: 0.4rem 0.5rem; }
.payroll-table th    { padding: 0.45rem 0.5rem; }
.payroll-summary td  { padding: 0.45rem 0.55rem; }
.payroll-deductions  { font-size: 0.95rem; }
.pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
}
.oncall-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.oncall-line:last-child { border-bottom: 0; }
.oncall-sub { color: #666; font-size: 0.95rem; }
.weekend-row td { font-weight: 700; }
.weekend-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
}
.badge-sat,
.badge-sun { background: rgba(13, 110, 253, 0.12); color: #0d6efd; }


/* ── 16x. Project — fullscreen modal ── */
.modal-fullscreen {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
}
.modal-fullscreen .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
}
.modal-fullscreen .modal-header,
.modal-fullscreen .modal-footer {
    border-radius: 0;
}
.modal-fullscreen .modal-body {
    overflow-y: auto;
}


/* ── 16y. Project management ── */
.pm-section-header {
    margin: 0;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #c9d5e3;
}
.pm-table {
    margin: 0;
    border-top: 0;
}


/* ── 16z. Sales chart ── */
#chart-wrapper {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 20px;
}
#salesChart {
    width: calc(150px * 14);
    max-width: none;
    height: 500px;
}


/* ── 16aa. Schedule planning — drag & drop ── */
.draggable-job {
    cursor: move;
    margin-bottom: 4px;
}
.droppable-day {
    min-height: 90px;
    padding: 4px;
    border: 1px dashed #ccc;
    background-color: #fafafa;
}
/* job-action-highlight already defined in 16u */


/* ── 16ab. Sites — toolbar layout ── */
.dt-container .dt-length,
.dt-container .dt-search,
#sites-toolbar-btns {
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 0.5rem;
}
#sites-toolbar-btns { margin-right: 1rem; }
#sites-toolbar-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}


/* ── 16ac. Teams — drag-over card ── */
.card-body.drag-over {
    background-color: #e8f4fd !important;
    border: 2px dashed #006dd9;
}


/* ── 16ad. Toolbox talks ── */
.tt-title {
    display: inline-block;
    margin-left: 6px;
}
.tt-unread { font-weight: 700; }
.tt-meta { margin-top: 2px; opacity: 0.85; }
.modal-dialog.modal-xl {
    width: 98%;
    max-width: 1400px;
    margin: 0.75rem auto;
}
@media (max-width: 576px) {
    .modal-dialog.modal-xl {
        width: 98%;
        max-width: 98%;
        margin: 0.5rem auto;
    }
    .modal-dialog.modal-xl .modal-body {
        height: 78vh !important;
        padding: 0.5rem;
    }
}


/* ── 16ae. Training — sticky thead (same as 16d, scoped here for safety) ── */
/* Uses .sticky-thead class defined in 16d */


/* ── 16af. Outgoings — table footer bold ── */
.table tfoot th,
.table tfoot td {
    font-weight: bold;
}


/* ── 16ag. Inline calendar — shared (.ath-cal-inline) ── */
/* Used on overview, schedule, outgoings, and any other inline week/date pickers */
.ath-cal-inline.ui-datepicker {
    display: block !important;
    width: 300px;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 12px;
    position: relative;
    margin: 0;
    z-index: 1;
    background: #fff;
}
.ath-cal-inline .ui-datepicker-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.ath-cal-inline .ui-datepicker-title { font-size: 15px; font-weight: 600; }
.ath-cal-inline .ui-datepicker-prev,
.ath-cal-inline .ui-datepicker-next {
    background: none;
    color: #555;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
    line-height: 1.2;
}
.ath-cal-inline .ui-datepicker-prev:hover,
.ath-cal-inline .ui-datepicker-next:hover {
    background-color: #f0f4ff;
    color: #0069d9;
}
.ath-cal-inline .ui-datepicker-prev .ui-icon,
.ath-cal-inline .ui-datepicker-next .ui-icon { display: none; }
.ath-cal-inline .ui-datepicker-calendar {
    border-collapse: collapse;
}
.ath-cal-inline .ui-datepicker-calendar th {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    padding: 4px 0;
    border: none;
}
.ath-cal-inline .ui-datepicker-calendar td {
    border: none;
    padding: 1px;
}
.ath-cal-inline .ui-datepicker-calendar td a,
.ath-cal-inline .ui-datepicker-calendar td span {
    display: block;
    padding: 5px 0;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    color: #333;
    border: none;
}
.ath-cal-inline .ui-datepicker-calendar td:hover { background-color: transparent; }
.ath-cal-inline .ui-datepicker-calendar td a:hover {
    background-color: #e8f0fc;
    color: #0053af;
}
.ath-cal-inline .ui-datepicker-current-day { background-color: transparent; }
.ath-cal-inline .ui-datepicker-current-day a {
    background-color: #0069d9 !important;
    color: #fff !important;
    font-weight: 700;
    border: none !important;
}
.ath-cal-inline td.ui-datepicker-today a {
    background-color: #cce0ff;
    color: #003d99;
    font-weight: 600;
    border: none;
}
.ath-cal-inline td.ui-datepicker-today.ui-datepicker-current-day a {
    background-color: #0069d9 !important;
    color: #fff !important;
}
.ath-cal-inline .ui-datepicker-other-month a { color: #ccc; }
/* Leave day highlights (annual-leave.php) */
.ath-cal-inline td.leave-pending a {
    background-color: #fff3cd;
    color: #856404;
    font-weight: 600;
}
.ath-cal-inline td.leave-pending a:hover {
    background-color: #ffe69c;
    color: #533f03;
}
.ath-cal-inline td.leave-approved a {
    background-color: #d1f0da;
    color: #155724;
    font-weight: 600;
}
.ath-cal-inline td.leave-approved a:hover {
    background-color: #b3e6c3;
    color: #0b3d1f;
}



/* ── 16ai. Invoices ── */
#ui-datepicker-div { z-index: 10000 !important; }
#xeroModal .modal-dialog {
    width: 90% !important;
    max-width: 90% !important;
}


/* ── 16aj. Inspections — horizontal scroll with fixed column ── */
#scroller {
    width: 100%;
    overflow-x: scroll;
}
#scroller .table.fixedCol {
    width: auto;
    position: absolute;
}
.table.fixedCol th,
.table.fixedCol td {
    background: white;
}


/* ── 16ak. Permission denied page ── */
.denied-page {
    min-height: 100vh;
    background: #1a1d20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 15px;
    position: fixed;
    inset: 0;
    z-index: 9998;
}
.denied-card {
    width: 100%;
    max-width: 480px;
}
.denied-logo {
    text-align: center;
    margin-bottom: 35px;
}
.denied-logo img { max-height: 70px; }
.denied-support {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 0.8rem;
}
.denied-support a { color: #aaa; }
.denied-support a:hover { color: #dc3545; }
.denied-page .card {
    box-shadow: 0 0 30px rgba(220, 53, 69, 0.15), 0 4px 20px rgba(0, 0, 0, 0.3);
}


/* ── 16al. HR events — icon picker hover ── */
.icon-picker:hover { color: #007bff !important; }


/* ── 16am. Waste transfer note ── */
#api-client-result {
    width: 92px;
    height: 38px;
    border: 1px solid lightgray;
    font-size: 11px;
}


/* ── 16an. Storage summary — card spacing override ── */
/* .card already has margin-bottom:10px in section 8. */
/* storage-summary.php used 20px — keep as utility class instead */


/* ── 16ao. Quote / outgoings — datepicker z-index ── */
/* #ui-datepicker-div already defined in 16ai */


/* ── 16ap. Copyable elements ── */
.copyable { cursor: pointer; }


/* ── 16aq. Scope / notes card hover ── */
#notes .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease-in-out;
}
#notes .card-header small {
    font-size: 12px;
    opacity: 0.9;
}


/* ── 16ar. Site map (400px height variant) ── */
/* #map default height is 600px (DRA locations, section 16f).
   Override with .map-xs for 400px site maps, .map-sm for 450px. */
.map-xs { height: 400px; }


/* ── 16as. File upload (transactions) ── */
.fileUpload {
    position: relative;
    overflow: hidden;
    margin: 0;
}
.fileUpload input.upload {
    cursor: pointer;
}

/* ── 17. Inspection Status Picker ── */
.insp-status-picker { display: flex; gap: 10px; }
.insp-status-opt { margin: 0; flex: 1; }
.insp-status-opt input[type="radio"] { display: none; }
.insp-status-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 6px;
    text-align: center;
    line-height: 1.3;
    transition: filter 0.15s;
}
.insp-status-btn:hover { filter: brightness(0.95); }
.insp-status-pass        { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.insp-status-quarantine  { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.insp-status-scrap       { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.insp-status-opt input:checked + .insp-status-pass        { background: #28a745; color: #fff; border-color: #1e7e34; }
.insp-status-opt input:checked + .insp-status-quarantine  { background: #ffc107; color: #212529; border-color: #d39e00; }
.insp-status-opt input:checked + .insp-status-scrap       { background: #dc3545; color: #fff; border-color: #bd2130; }


/* ── 18. Save card (job-spec.php inline AJAX save) ── */
.save-card { transition: background-color 0.4s ease; }
.save-card.card-success { background-color: #28a745 !important; }

/* ── 19. Project action calendar ─────────────────────────── */
.ath-cal-month-header {
    background: #222;
    color: #fff;
    padding: 5px 10px;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 4px 4px 0 0;
}
.ath-cal-dow-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    background: #dee2e6;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    border-top: 2px solid #fff;
    width: 100%;
}
.ath-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    background: #dee2e6;
    border: 1px solid #dee2e6;
    border-top: none;
    width: 100%;
}
.ath-cal-dow {
    background: #343a40;
    color: #fff;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 2px;
    min-width: 0;
    overflow: hidden;
}
.ath-cal-cell {
    background: #fff;
    min-height: 60px;
    padding: 5px;
    font-size: 0.7rem;
    min-width: 0;
    overflow: hidden;
    word-break: break-word;
}
.ath-cal-cell--action { background: #eaf4fb; }
.ath-cal-cell--today  { background: #cce5ff; box-shadow: inset 0 0 0 2px #004085; }
.ath-cal-day-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ced4da;
    line-height: 1;
    margin-bottom: 4px;
}
.ath-cal-cell--action .ath-cal-day-num { color: #1a5276; }
.ath-cal-cell--today  .ath-cal-day-num { color: #004085; }
.ath-cal-badge { font-size: 0.6rem !important; white-space: normal; }
.ath-cal-action-card {
    background: rgba(255,255,255,0.7);
    border-left: 3px solid #2e86c1;
    border-radius: 2px;
    padding: 3px 4px;
    margin-bottom: 3px;
}
.ath-cal-action-name {
    font-weight: 700;
    font-size: 0.68rem;
    color: #1a5276;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ath-cal-action-link { color: #1a5276; }
.ath-cal-action-link:hover { color: #2e86c1; text-decoration: none; }
.ath-cal-attendees { font-size: 0.65rem; color: #495057; line-height: 1.3; }

/* ── Calendar summary modal: notes + photo thumbnails ── */
.cal-summary-note {
    font-size: 0.85rem;
    color: #495057;
    border-left: 3px solid #dee2e6;
    padding: 4px 8px;
    margin: 4px 0 8px;
    white-space: pre-line;
    background: #f8f9fa;
    border-radius: 0 3px 3px 0;
}
.cal-thumb-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.cal-thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.cal-thumb-dl {
    font-size: 0.68rem;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
}
.cal-thumb-dl:hover { color: #2e86c1; text-decoration: none; }
.cal-thumb-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid #dee2e6;
    transition: border-color 0.15s;
}
.cal-thumb-wrap:hover { border-color: #2e86c1; }
.cal-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cal-thumb-ovr {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.cal-thumb-wrap:hover .cal-thumb-ovr { opacity: 1; }

/* ── Photo viewer: zoom grab cursor ── */
#cal-pv-img[style*="grab"] { cursor: grab; }
#cal-pv-scroll { scrollbar-width: thin; scrollbar-color: #555 #111; }

/* === Admin Dashboard === */
.ath-dashboard-stat {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

/* Bootstrap 4 dropped btn-xs — restore it */
.btn-xs {
    padding: 0.1rem 0.35rem;
    font-size: 0.72rem;
    line-height: 1.4;
    border-radius: 0.2rem;
}

/* Cron overdue row highlights (dark theme) */
body.admin-page tr.cron-overdue-warn  { background-color: rgba(234,179,8,0.12) !important; }
body.admin-page tr.cron-overdue-error { background-color: rgba(239,68,68,0.12) !important; }
body.admin-page tr.cron-overdue-warn td  { border-color: rgba(234,179,8,0.2) !important; }
body.admin-page tr.cron-overdue-error td { border-color: rgba(239,68,68,0.2) !important; }

/* === Admin Dashboard — dark theme === */
body.admin-page {
    background: #0f172a;
    color: #e2e8f0;
}
body.admin-page .breadcrumb-bar {
    background-color: #1e293b;
}
body.admin-page .breadcrumb-bar .breadcrumb {
    background-color: transparent;
}
body.admin-page .breadcrumb-bar .breadcrumb-item a,
body.admin-page .breadcrumb-bar .breadcrumb-item.active,
body.admin-page .breadcrumb-bar .breadcrumb-item + .breadcrumb-item::before {
    color: #94a3b8;
}
body.admin-page .card {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
body.admin-page .card-header.ath-table-header {
    background-color: #152238;
    border-bottom-color: #334155;
    color: #e2e8f0;
}
body.admin-page .card.border-secondary {
    border-color: #475569 !important;
}
body.admin-page .card.border-secondary .card-header {
    background-color: #334155 !important;
}
body.admin-page .table {
    color: #e2e8f0;
}
body.admin-page .table td,
body.admin-page .table th {
    border-color: #334155;
}
body.admin-page .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.03);
}
body.admin-page .table-striped tbody tr:nth-of-type(even) {
    background-color: transparent;
}
body.admin-page .ath-thead th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}
body.admin-page .text-muted {
    color: #94a3b8 !important;
}
body.admin-page code {
    background-color: #0f172a;
    color: #a78bfa;
    padding: 0.1em 0.35em;
    border-radius: 3px;
}
body.admin-page strong {
    color: #e2e8f0;
}
body.admin-page .alert-success {
    background-color: #14532d;
    border-color: #166534;
    color: #bbf7d0;
}
body.admin-page .alert-success .close {
    color: #bbf7d0;
}
body.admin-page .btn-outline-danger {
    color: #f87171;
    border-color: #f87171;
}
body.admin-page .btn-outline-danger:hover {
    background-color: #991b1b;
    color: #fff;
    border-color: #991b1b;
}
body.admin-page .alert-danger {
    background-color: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}
body.admin-page h1, body.admin-page h2,
body.admin-page h3, body.admin-page h4 {
    color: #e2e8f0;
}

/* === Admin pages — tabs === */
body.admin-page .nav-tabs {
    border-bottom-color: #334155;
}
body.admin-page .nav-tabs .nav-link {
    color: #94a3b8;
    border-color: transparent;
    background: transparent;
}
body.admin-page .nav-tabs .nav-link:hover {
    color: #e2e8f0;
    border-color: #334155 #334155 transparent;
}
body.admin-page .nav-tabs .nav-link.active {
    background-color: #1e293b;
    border-color: #334155 #334155 #1e293b;
    color: #e2e8f0;
}

/* === Admin pages — form controls === */
body.admin-page .form-control,
body.admin-page .form-control-sm,
body.admin-page select.form-control {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
body.admin-page .form-control:focus,
body.admin-page .form-control-sm:focus {
    background-color: #0f172a;
    border-color: #3b82f6;
    color: #e2e8f0;
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.25);
}
body.admin-page select.form-control option {
    background-color: #1e293b;
    color: #e2e8f0;
}

/* === Admin pages — permissions page specifics === */
.matrix-check { background: #28a745; color: #fff; }
.matrix-deny  { background: #dc3545; color: #fff; }
.matrix-cell  { text-align: center; vertical-align: middle !important; padding: 3px 4px !important; width: 70px; }
.matrix-group { background: #343a40 !important; color: #fff; font-weight: 600; }
.level-col    { text-align: center; white-space: nowrap; vertical-align: middle; }
.level-select-matrix { font-size: 0.76rem; padding: 1px 4px; height: auto; }

body.admin-page .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.05);
}
body.admin-page .table-bordered,
body.admin-page .table-bordered td,
body.admin-page .table-bordered th {
    border-color: #334155 !important;
}
body.admin-page .text-dark {
    color: #a5b4fc !important;
}
body.admin-page .badge-light {
    background-color: #334155;
    color: #e2e8f0;
    border-color: #475569;
}
body.admin-page .btn-outline-secondary {
    color: #94a3b8;
    border-color: #475569;
}
body.admin-page .btn-outline-secondary:hover {
    background-color: #334155;
    color: #e2e8f0;
    border-color: #64748b;
}
body.admin-page .btn-sm.btn-outline-danger {
    color: #f87171;
    border-color: #7f1d1d;
}
body.admin-page .btn-sm.btn-outline-danger:hover {
    background-color: #7f1d1d;
    color: #fff;
}

/* === Training Matrix: company header row === */
.ath-company-row td {
    background-color: #bec5cb !important;
    font-weight: 600;
}

/* === Page Presence === */
/* Pulsing green dot */
.ath-presence-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    animation: ath-pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes ath-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(40,167,69,.6); }
    70%  { box-shadow: 0 0 0 6px rgba(40,167,69,0); }
    100% { box-shadow: 0 0 0 0 rgba(40,167,69,0); }
}

/* Presence indicator — inline with AI button, docked right */
#ath-presence-bar {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #28a745;
    border-radius: 4px;
    color: #155724;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 8px 5px 10px;
    line-height: 1;
}
#ath-presence-bar:empty {
    display: none;
}

/* Presence badge in overview HOP column */
.ath-presence-badge {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #28a745;
    border-radius: 4px;
    color: #155724;
    font-size: 0.75rem;
    padding: 3px 8px 3px 6px;
    margin-top: 10px;
    white-space: nowrap;
}
.ath-presence-badge:empty {
    display: none;
}

/* ── Mobile fullscreen modal (edit-update) ──────────────────────────── */
@media (max-width: 576px) {
    .modal-dialog.modal-dialog-scrollable {
        margin: 0;
        max-width: 100%;
        height: 100%;
        min-height: 100%;
    }
    .modal-dialog.modal-dialog-scrollable .modal-content {
        height: 100%;
        border: none;
        border-radius: 0;
    }
}

/* ── Overview filter bar – mobile stacking only ──────────────────────── */
@media (max-width: 576px) {
    .ath-overview-filter-bar {
        flex-wrap: wrap;
    }
    /* Hide icons on mobile */
    .ath-overview-filter-bar .input-group-prepend {
        display: none;
    }
    /* Each selectpicker fills the full row with rounded corners */
    .ath-overview-filter-bar .bootstrap-select {
        flex: 0 0 100% !important;
        width: 100% !important;
    }
    .ath-overview-filter-bar .bootstrap-select > .btn {
        width: 100% !important;
        border-radius: 4px !important;
    }
    /* Filter button full width on its own row */
    .ath-overview-filter-bar .input-group-append {
        flex: 0 0 100%;
        margin-top: 6px;
    }
    .ath-overview-filter-bar .input-group-append .btn {
        width: 100%;
    }
}

/* ── Overview table – mobile min-width (table-responsive handles scroll) */
@media (max-width: 768px) {
    .ath-overview-table {
        min-width: 1280px;
    }
}

/* ── Mobile calendar list view ──────────────────────────────────────── */
.ath-cal-list-item {
    border-left: 3px solid #dee2e6;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 0 4px 4px 0;
}
.ath-cal-list-item--today {
    border-left-color: #007bff;
    background: #f0f6ff;
}
.ath-cal-list-date {
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 4px;
}
.ath-cal-list-item--today .ath-cal-list-date {
    color: #007bff;
}
.ath-cal-list-action {
    padding: 4px 0;
}
.ath-cal-list-action + .ath-cal-list-action {
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
    padding-top: 6px;
}

/* ── Weather table — borders & readability ───────────────────────────── */
.ath-weather-table {
    border-collapse: separate !important;
    border-spacing: 0 1px !important;
    background: #fff;
}
/* Column dividers between data cells */
.ath-weather-table td {
    border-right: 2px solid #fff !important;
    border-top: none !important;
    border-bottom: none !important;
}
.ath-weather-table td:first-child {
    border-left: none !important;
}
.ath-weather-table td:last-child {
    border-right: none !important;
}
/* Text shadow on all coloured cell content for readability */
.ath-weather-table tbody td:not(:first-child) {
    text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* ── Weather table — hide alternate time columns on mobile ─────────── */
@media (max-width: 576px) {
    .ath-weather-table tr td:nth-child(3),
    .ath-weather-table tr td:nth-child(5) {
        display: none !important;
    }
}

/* ── Update row header ──────────────────────────────────────────────── */
.ath-update-header {
    background-color: #e8f2ff;
    border-radius: 4px;
    padding: 4px 8px;
    margin-bottom: 6px;
}

/* ── Schedule: empty-day drop-zone (assign action button) ────────────── */
.sched-dropzone {
    border: 2px dashed #d0d0d0;
    border-radius: 4px;
    padding: 10px 6px;
    text-align: center;
    color: #c0c0c0;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
    user-select: none;
}
.sched-dropzone:hover {
    border-color: #999;
    color: #666;
    background-color: #f8f8f8;
}

/* ── Schedule: special avoid blocks (Standby / Holiday / Bank Holiday) ── */
.sched-bank-holiday-banner {
    background: repeating-linear-gradient(
        -45deg,
        #eef2ff,
        #eef2ff 6px,
        #c7d2f8 6px,
        #c7d2f8 12px
    );
    color: #1e3a8a;
    border-left: 3px solid #4f6fd4;
    border-radius: 0 3px 3px 0;
    margin-bottom: 8px;
    font-weight: bold;
    padding: 6px;
}

.sched-holiday-block {
    background: repeating-linear-gradient(
        -45deg,
        #eef2ff,
        #eef2ff 6px,
        #c7d2f8 6px,
        #c7d2f8 12px
    );
    color: #1e3a8a;
    border-left: 3px solid #4f6fd4;
    border-radius: 0 3px 3px 0;
}

/* ── Schedule: shared avoid-block layout (centred, taller) ─────── */
.sched-standby-block,
.sched-holiday-block,
.sched-yard-block,
.sched-office-block,
.sched-training-block,
.sched-absent-block,
.sched-compassionate-block,
.sched-bank-holiday-banner,
.sched-available-block,
.sched-unavailable-block {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 68px;
}

.sched-available-block,
.sched-unavailable-block {
    font-weight: bold;
    line-height: 1.5;
}

/* ── Schedule: Weekend availability blocks ───────────────────────── */
.sched-available-block {
    background: repeating-linear-gradient(
        -45deg,
        #f0fff4,
        #f0fff4 6px,
        #bbf7d0 6px,
        #bbf7d0 12px
    );
    color: #14532d;
    border-left: 3px solid #22c55e;
    border-radius: 0 3px 3px 0;
    padding: 6px;
}

.sched-unavailable-block {
    background: repeating-linear-gradient(
        -45deg,
        #fff5f5,
        #fff5f5 6px,
        #ffd5d5 6px,
        #ffd5d5 12px
    );
    color: #6b1a1a;
    border-left: 3px solid #dc3545;
    border-radius: 0 3px 3px 0;
    padding: 6px;
}

.sched-avail-block {
    flex-direction: column;
}

.btn-avail-toggle {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 3px;
    color: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.btn-avail-toggle:hover {
    background: rgba(0,0,0,0.22);
}

.sched-avail-changed-by {
    opacity: 0.7;
    font-style: italic;
}

/* ── Schedule: Yard block ────────────────────────────────────────── */
.sched-yard-block {
    background: repeating-linear-gradient(
        -45deg,
        #f8f9fa,
        #f8f9fa 6px,
        #dee2e6 6px,
        #dee2e6 12px
    );
    color: #343a40;
    border-left: 3px solid #6c757d;
    border-radius: 0 3px 3px 0;
}

/* ── Schedule: Office block ──────────────────────────────────────── */
.sched-office-block {
    background: repeating-linear-gradient(
        -45deg,
        #f0fdfa,
        #f0fdfa 6px,
        #ccfbf1 6px,
        #ccfbf1 12px
    );
    color: #0f766e;
    border-left: 3px solid #14b8a6;
    border-radius: 0 3px 3px 0;
}

/* ── Schedule: Training block (8 Point 8 / XI) ───────────────────── */
.sched-training-block {
    background: repeating-linear-gradient(
        -45deg,
        #fefce8,
        #fefce8 6px,
        #fef08a 6px,
        #fef08a 12px
    );
    color: #713f12;
    border-left: 3px solid #eab308;
    border-radius: 0 3px 3px 0;
}

/* ── Schedule: Absent block ──────────────────────────────────────── */
.sched-absent-block {
    background: repeating-linear-gradient(
        -45deg,
        #fdf2f8,
        #fdf2f8 6px,
        #f5d0e8 6px,
        #f5d0e8 12px
    );
    color: #831843;
    border-left: 3px solid #db2777;
    border-radius: 0 3px 3px 0;
}

/* ── Schedule: Compassionate Leave block ─────────────────────────── */
.sched-compassionate-block {
    background: repeating-linear-gradient(
        -45deg,
        #f5f3ff,
        #f5f3ff 6px,
        #ddd6fe 6px,
        #ddd6fe 12px
    );
    color: #4c1d95;
    border-left: 3px solid #7c3aed;
    border-radius: 0 3px 3px 0;
}

/* ── Schedule: Standby block ─────────────────────────────────────── */
.sched-standby-block {
    background: repeating-linear-gradient(
        -45deg,
        #fff5f5,
        #fff5f5 6px,
        #ffd5d5 6px,
        #ffd5d5 12px
    );
    color: #6b1a1a;
    border-left: 3px solid #dc3545;
    border-radius: 0 3px 3px 0;
}

.sched-remove-standby {
    display: block;
    color: #dc3545;
    cursor: pointer;
    font-size: 11px;
    padding: 3px 0 1px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.sched-remove-standby:hover {
    opacity: 1;
}

/* ── Schedule: Assign Action modal tile grid ─────────────────────── */
.assign-grid {
    display: grid;
    gap: 6px;
    margin-bottom: 6px;
}
.assign-grid--3 { grid-template-columns: repeat(3, 1fr); }
.assign-grid--2 { grid-template-columns: repeat(2, 1fr); }

.assign-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    margin: 4px 0 2px;
}

.assign-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 0;
    border: 2px solid #ddd;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
    margin: 0;
}
.assign-tile input[type="radio"] { display: none; }
.assign-tile i { font-size: 18px; }
.assign-tile:hover { border-color: #aaa; }
.assign-tile.selected {
    border-color: currentColor;
    box-shadow: inset 0 0 0 1px currentColor;
}

.assign-tile--standby      { background: #fff0f0; color: #c0392b; border-color: #f5c6c6; }
.assign-tile--standby.selected { background: #ffd5d5; }

.assign-tile--office       { background: #f0fdfa; color: #0f766e; border-color: #b2ece4; }
.assign-tile--office.selected  { background: #ccfbf1; }

.assign-tile--yard         { background: #f8f9fa; color: #495057; border-color: #ced4da; }
.assign-tile--yard.selected    { background: #dee2e6; }

.assign-tile--training     { background: #fefce8; color: #92400e; border-color: #fde68a; }
.assign-tile--training.selected { background: #fef08a; }

.assign-tile--absent       { background: #fdf2f8; color: #9d174d; border-color: #f0b8d8; }
.assign-tile--absent.selected  { background: #f5d0e8; }

.assign-tile--compassionate { background: #f5f3ff; color: #5b21b6; border-color: #c4b5fd; }
.assign-tile--compassionate.selected { background: #ddd6fe; }

/* ── Schedule: job modal corner rounding (first/last day) ────────── */
.modal-content.modal-first-day  { border-radius: 20px 0 0 20px; overflow: hidden; }
.modal-content.modal-last-day   { border-radius: 0 20px 20px 0; overflow: hidden; }
.modal-content.modal-single-day { border-radius: 20px; overflow: hidden; }

/* ── Schedule: compliance checklist in job modal ─────────────────── */
.sched-modal-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sched-check-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
}
.sched-check-ok   { background: #d1fae5; color: #065f46; }
.sched-check-fail { background: #fee2e2; color: #991b1b; }
.sched-check-ok a   { color: #065f46; text-decoration: underline; }
.sched-check-fail a { color: #991b1b; }
.sched-preview-btn {
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
    font-size: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}
