
/* =========================================
   DASHBOARD - FULL VIEWPORT
========================================= */

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.custodian-dashboard {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #1f2937;
    box-sizing: border-box;
}

    .custodian-dashboard * {
        box-sizing: border-box;
    }

.custodian-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .custodian-header h2 {
        font-size: 24px;
        font-weight: 700;
        margin: 0;
        color: #111827;
    }

.custodian-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 5px;
}

/* =========================================
   FILTER PANEL
========================================= */

.custodian-filter-panel {
    flex: 0 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.custodian-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.custodian-filter-fields {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.filter-field {
    display: flex;
    /*flex-direction: column;*/
    align-items: center;
    gap: 5px;
    /*min-width: 160px;*/
    /*flex: 1;*/
}

    .filter-field label {
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
    }

    .filter-field input {
        height: 38px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        padding: 0 12px;
        outline: none;
        background: #fff;
        font-size: 14px;
    }

        .filter-field input:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
        }

.custodian-search-btn,
.custodian-reset-btn {
    height: 38px;
    border-radius: 8px;
    padding: 0 18px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.custodian-search-btn {
    background: #2563eb;
    color: #fff;
}

    .custodian-search-btn:hover {
        background: #1d4ed8;
    }

.custodian-reset-btn {
    background: #f1f5f9;
    color: #334155;
}

    .custodian-reset-btn:hover {
        background: #e2e8f0;
    }

/* =========================================
   ERROR / LOADING
========================================= */

.custodian-error,
.custodian-loading {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.custodian-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.custodian-loading {
    background: #eff6ff;
    color: #1d4ed8;
}

/* =========================================
   MAIN CONTENT
========================================= */

.custodian-main-layout {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

/* =========================================
   WORKSPACE BASE
========================================= */

.custodian-workspace {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08);
}

/* =========================================
   VIEW 1 - CURRENT LOCATIONS
   MAP TOP, GRID BELOW
========================================= */

.current-workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
}

    .current-workspace .custodian-map-container {
        order: 1;
        flex: 1 1 60%;
        width: 100%;
        min-width: 0;
        min-height: 180px;
        display: flex;
        flex-direction: column;
    }

    .current-workspace .current-grid-panel {
        order: 2;
        flex: 1 1 40%;
        width: 100%;
        min-width: 0;
        min-height: 100px;
        border-top: 1px solid #e5e7eb;
        overflow: auto;
    }

/* =========================================
   VIEW 2 - HISTORY
========================================= */

.history-workspace {
    display: grid;
    grid-template-columns: minmax(0, var(--history-grid-width, 25%)) 8px minmax(0, 1fr);
    gap: 0;
}

/* =========================================
   HISTORY GRID PANEL
========================================= */

.custodian-grid-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #ffffff;
}

.history-grid-panel {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
}

    .history-grid-panel.grid-collapsed {
        display: none;
    }

/* =========================================
   HISTORY SEPARATOR
========================================= */

.history-grid-separator {
    grid-column: 2;
    grid-row: 1;
    width: 8px;
    min-width: 8px;
    height: 100%;
    margin: 0;
    padding: 0;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    background: #edf0f3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.history-grid-toggle {
    position: absolute;
    width: 22px;
    height: 36px;
    margin-left: 0;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    z-index: 7;
    transform: translateX(0);
}

    .history-grid-toggle:hover {
        background: #dbeafe;
        color: #1d4ed8;
    }

/* The range input is the no-JS resize control. */

.history-splitter-range {
    display: none;
}



/* Collapsed history grid. */

.history-workspace:has(.history-grid-panel.grid-collapsed) {
    grid-template-columns: 0 8px minmax(0, 1fr);
}

    .history-workspace:has(.history-grid-panel.grid-collapsed)
    .history-grid-separator {
        grid-column: 2;
    }

/* =========================================
   GRID CONTAINER
========================================= */

.history-grid-container {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    position: relative;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

    .history-grid-container::-webkit-scrollbar {
        width: 9px;
        height: 9px;
    }

    .history-grid-container::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    .history-grid-container::-webkit-scrollbar-thumb {
        background: #94a3b8;
        border-radius: 6px;
    }

        .history-grid-container::-webkit-scrollbar-thumb:hover {
            background: #64748b;
        }

/* =========================================
   GRID TABLE
========================================= */

.history-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: 12px;
}

    .history-grid thead {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .history-grid th {
        position: sticky;
        top: 0;
        background: #f1f5f9;
        color: #475569;
        font-weight: 700;
        text-align: left;
        padding: 11px 10px;
        border-bottom: 1px solid #e2e8f0;
        white-space: nowrap;
        z-index: 10;
    }

    .history-grid td {
        padding: 10px;
        border-bottom: 1px solid #f1f5f9;
        white-space: nowrap;
        color: #334155;
    }

    .history-grid tbody tr {
        cursor: pointer;
        transition: background 0.15s ease;
    }

        .history-grid tbody tr:hover {
            background: #eff6ff;
        }

        .history-grid tbody tr.selected-row {
            background: #dbeafe;
            box-shadow: inset 4px 0 0 #2563eb;
        }

            .history-grid tbody tr.selected-row td {
                color: #1e40af;
                font-weight: 600;
                white-space: nowrap;
            }

.history-row-selected {
    background: #eff6ff !important;
    outline: 1px solid #93c5fd;
}

/* History table */

.history-events-grid {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
}

    .history-events-grid th:nth-child(1),
    .history-events-grid td:nth-child(1) {
        min-width: 125px;
    }

    .history-events-grid th:nth-child(2),
    .history-events-grid td:nth-child(2) {
        min-width: 165px;
    }

    .history-events-grid th:nth-child(3),
    .history-events-grid td:nth-child(3) {
        min-width: 180px;
        white-space: nowrap;
    }

/* =========================================
   CURRENT GRID TRACK BUTTON
========================================= */

.track-button {
    padding: 5px 12px;
    border: 1px solid #2563eb;
    border-radius: 5px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

    .track-button:hover {
        background: #2563eb;
        color: #ffffff;
    }

/* =========================================
   CURRENT MAP TOOLBAR
========================================= */

.current-map-toolbar {
    position: relative;
    z-index: 15;
    flex: 0 0 auto;
    width: 100%;
    /*min-height: 54px;*/
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

/* =========================================
   MAP PANEL
========================================= */

.custodian-map-container {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
    background: #e5e7eb;
    position: relative;
}

.tracking-chevron-shadow {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}

.tracking-chevron-button {
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
    line-height: 0;
    cursor: pointer;
}

.tracking-duration-label {
    color: #000;
    font-size: 0;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.custodian-map {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
}

/* History map occupies third column. */

.history-workspace .custodian-map-container {
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

/* =========================================
   MAP OVERLAY
========================================= */

.custodian-map-overlay {
    position: absolute;
    top: 60px;
    right: 62px;
    transform: translate(-0%, -50%);
    display: flex;
    /*flex-direction: column;*/
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

    .custodian-map-overlay > * {
        pointer-events: auto;
    }

.history-workspace .custodian-map-overlay {
    top: 28px;
}

.map-mode-badge,
.map-count-badge {
    background: rgba(255, 255, 255, 0.96);
    padding: 8px 11px;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.12);
    font-size: 12px;
    font-weight: 600;
}

.map-mode-badge {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .map-mode-badge.live {
        color: #b91c1c;
    }

    .map-mode-badge.history {
        color: #1d4ed8;
    }

.mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.map-count-badge {
    color: #334155;
    box-shadow: 0px 1px 11px 1px;
}

.map-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    box-shadow: 0px 1px 11px 1px;
}

    .map-option input {
        margin: 0;
        cursor: pointer;
    }

/* =========================================
   HISTORY TIMELINE
========================================= */

.history-timeline-container {
    flex: 0 0 auto;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 8px 14px 7px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    box-sizing: border-box;
}

.history-timeline-employee {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.history-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.history-subtitle {
    margin-top: 3px;
    font-size: 11px;
    color: #64748b;
}

.history-separator {
    margin: 0 5px;
}

.history-current-info {
    font-size: 11px;
    color: #2563eb;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.history-no-gps-location {
    color: #6b7280;
}

.history-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
}

.history-timeline-track {
    position: relative;
    width: 100%;
    height: 60px;
    margin: 0;
    padding: 0;
}

/* =========================================
   MOVING SELECTED EVENT LABEL
========================================= */

.history-selected-event-label {
    position: absolute;
    top: 3px;
    z-index: 5;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    max-width: 180px;
    padding: 5px;
    background: #1d4ed8;
    color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.20);
    pointer-events: none;
    white-space: nowrap;
}

.selected-event-time {
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
}

/* =========================================
   STATIC EVENT MARKERS
========================================= */

.history-event-marker {
    position: absolute;
    top: 22px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    pointer-events: auto;
}

.history-event-marker-label {
    padding: 2px 5px;
    border-radius: 3px;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 9px;
    font-weight: 700;
    line-height: 13px;
    white-space: nowrap;
}

.history-event-marker-line {
    width: 2px;
    height: 13px;
    background: #64748b;
}

/* =========================================
   TIMELINE SLIDER
========================================= */

.history-slider {
    --timeline-track: linear-gradient(to right, #2563eb 0 var(--timeline-progress, 0%), #cbd5e1 var(--timeline-progress, 0%) 100%);
    position: absolute;
    left: 0;
    top: 58px;
    width: 100%;
    height: 8px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 6;
}

    .history-slider:focus {
        outline: none;
    }

    .history-slider::-webkit-slider-runnable-track {
        width: 100%;
        height: 5px;
        background: var(--timeline-track);
        border-radius: 3px;
    }

    .history-slider::-webkit-slider-thumb {
        appearance: none;
        -webkit-appearance: none;
        width: 12px;
        height: 28px;
        margin-top: -11.5px;
        border: 1px solid #1d4ed8;
        border-radius: 2px;
        background: #2563eb;
        cursor: ew-resize;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
    }

    .history-slider::-moz-range-track {
        width: 100%;
        height: 5px;
        background: var(--timeline-track);
        border-radius: 3px;
    }

    .history-slider::-moz-range-thumb {
        width: 12px;
        height: 28px;
        border: 1px solid #1d4ed8;
        border-radius: 2px;
        background: #2563eb;
        cursor: ew-resize;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
    }

/* =========================================
   TIMELINE FOOTER
========================================= */

.history-timeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    padding-top: 1px;
}

.history-empty-timeline {
    padding: 12px 4px;
    color: #64748b;
    font-size: 13px;
}

/* =========================================
   CURRENT LOCATION LABELS
========================================= */

.custodian-live-overlay {
    position: relative;
    width: max-content;
    max-width: 145px;
    font-family: Arial, sans-serif;
    pointer-events: auto;
    transform: translateY(-3px);
    cursor: pointer;
}

.custodian-live-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dbe2ea;
    border-radius: 6px;
    padding: 4px 7px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    color: #374151;
    white-space: nowrap;
    cursor: pointer;
    width: 100px;
}

.custodian-live-name {
    font-size: 11px;
    font-weight: 700;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.custodian-live-info {
    display: flex;
    align-items: left;
    gap: 5px;
    margin-top: 2px;
    font-size: 9px;
    color: #6b7280;
}

.custodian-live-duration {
    color: #1d4ed8;
    font-weight: 700;
}

.custodian-live-status {
    display: inline-block;
    margin-top: 3px;
    padding: 2px 4px;
    border-radius: 3px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 8px;
    font-weight: 600;
}

/* =========================================
   DURATION CIRCLES
========================================= */

.custodian-duration-circle {
    box-sizing: border-box;
    border: 2px solid rgba(230, 81, 0, 0.75);
    border-radius: 50%;
    background-color: rgba(251, 140, 0, 0.20);
    pointer-events: auto;
    cursor: pointer;
    display: block;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .custodian-duration-circle:hover {
        background-color: rgba(251, 140, 0, 0.35);
        border-color: rgba(230, 81, 0, 1);
    }

.custodian-current-duration-circle,
.custodian-history-duration-circle {
    border-color: rgba(230, 81, 0, 0.75);
}

.history-duration-circle {
    border-radius: 50%;
    box-sizing: border-box;
    background: rgba(251, 140, 0, 0.20);
    border: 1px solid #e65100;
    cursor: pointer;
    pointer-events: auto;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 768px) {

    .custodian-dashboard {
        gap: 7px;
    }

    .custodian-header h2 {
        font-size: 20px;
    }

    .custodian-filter-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-field {
        width: 100%;
        min-width: 0;
    }

    .history-timeline-employee {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .history-current-info {
        text-align: left;
    }

    .history-timeline-container {
        padding-left: 9px;
        padding-right: 9px;
    }

    .history-selected-event-label {
        min-width: 110px;
        padding: 4px 6px;
    }

    .custodian-map-overlay {
        left: 8px;
        top: 65px;
        gap: 5px;
    }

    .history-workspace .custodian-map-overlay {
        top: 8px;
    }

    .map-mode-badge,
    .map-count-badge {
        padding: 6px 8px;
        font-size: 11px;
    }

    .map-option {
        padding: 5px 7px;
        font-size: 11px;
    }

    .current-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
}

/* ET - Red */
.history-event-marker-label.event-marker-et {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
}

/* OL - Yellow */
.history-event-marker-label.event-marker-ol {
    background-color: #facc15;
    color: #000000;
    border-color: #ca8a04;
}

/* All other events - Green */
.history-event-marker-label.event-marker-other {
    background-color: #16a34a;
    color: #ffffff;
    border-color: #15803d;
}

/* =========================================
   ACTIVITY INTERVAL TIMELINE
========================================= */

.activity-timeline-section {
    width: 100%;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #e2e8f0;
}

.activity-timeline-heading {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 5px;
}

.activity-timeline-track {
    position: relative;
    width: 100%;
    min-height: 28px;
    margin: 0;
    padding: 0;
}

/* Individual activity interval */

.activity-timeline-bar {
    position: absolute;
    height: 21px;
    min-width: 3px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 0px;
    background: #2563eb;
    border: 1px solid white;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 19px;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
    cursor: default;
    text-align: center;
    justify-content: center;
}

.activity-timeline-bar-ticket {
    background: #dc2626;
}

.activity-timeline-label {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.activity-timeline-label-full {
    display: block;
    width: max-content;
    margin-inline: auto;
    padding-inline: 6px;
}

.activity-timeline-label-short {
    display: none;
}

.activity-timeline-label[data-compact] .activity-timeline-label-full {
    position: absolute;
    visibility: hidden;
}

.activity-timeline-label[data-compact] .activity-timeline-label-short {
    display: block;
}

.activity-timeline-label-prefix {
    width: max-content;
    margin-inline: auto;
}

/* Mobile */

@media (max-width: 768px) {

    .activity-timeline-heading {
        font-size: 10px;
    }

    .activity-timeline-bar {
        height: 20px;
        font-size: 9px;
    }

    .activity-timeline-label-full {
        padding-inline: 4px;
    }
}

/* =========================================
   EVENT NAME FILTER POPUP
========================================= */

.event-name-filter-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.event-name-filter-btn {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .event-name-filter-btn:hover {
        background: #f1f5f9;
    }

.event-name-filter-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-width: min(320px, 90vw);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.event-name-filter-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.event-name-popup-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

    .event-name-popup-close:hover {
        color: #0f172a;
    }

.event-name-filter-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 12px;
}

.event-name-filter-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 4px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}

    .event-name-filter-item:hover {
        background: #f8fafc;
    }

    .event-name-filter-item input[type="checkbox"] {
        flex-shrink: 0;
        cursor: pointer;
    }

.event-name-filter-popup-footer {
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    background: #f8fafc;
}

.event-name-filter-search-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 5px;
    background: #2563eb;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

    .event-name-filter-search-btn:hover {
        background: #1d4ed8;
    }


/* =========================================
   EVENT NAME POPUP - OUTSIDE CLICK
========================================= */

.event-name-filter-wrapper {
    position: relative;
    z-index: 1001;
}

/* Full-screen transparent click area */

.event-name-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: transparent;
}

/* Popup */

.event-name-filter-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1002;
    width: 300px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

/* Popup header */

.event-name-filter-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 13px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

/* Select all section */

.event-name-select-all {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.event-name-select-all-control {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 5px 4px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

    .event-name-select-all-control:hover {
        background: #f8fafc;
    }

.event-name-master-checkbox {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1px solid #94a3b8;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-sizing: border-box;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.event-name-master-checkmark,
.event-name-master-minus {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
}

.event-name-master-minus {
    font-size: 15px;
}

/* Event list */

.event-name-filter-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 7px 12px;
}

.event-name-filter-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 3px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}

    .event-name-filter-item:hover {
        background: #f8fafc;
    }

    .event-name-filter-item input {
        width: 14px;
        height: 14px;
        margin: 0;
        cursor: pointer;
    }

/* Footer */

.event-name-filter-popup-footer {
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
}

.event-name-filter-search-btn {
    padding: 7px 20px;
    border: none;
    border-radius: 4px;
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

    .event-name-filter-search-btn:hover {
        background: #1d4ed8;
    }

gap: 10px;
}

.tracking-heading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.live-locations-heading {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #dc2626;
    font-weight: 700;
    white-space: nowrap;
}

.current-tracking-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 760px) {
    .custodian-mode-tabs {
        width: 100%;
    }

    .custodian-mode-tab {
        flex: 1 1 50%;
        padding-inline: 8px;
    }

    .history-employee-heading {
        gap: 6px;
    }
}

/* =========================================================
   VIEW MODE TABS
========================================================= */

.custodian-mode-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid #dbe3ef;
    border-radius: 9px;
    background: #f1f5f9;
}

.custodian-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 13px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .custodian-mode-tab.active {
        background: #ffffff;
        color: #1d4ed8;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
    }

.live-tab-dot,
.live-heading-dot,
.tracking-blue-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.live-tab-dot,
.live-heading-dot {
    background: #dc2626;
}

.tracking-blue-dot {
    background: #2563eb;
}

/* =========================================================
   TRACKING / LIVE HEADINGS
========================================================= */

.history-employee-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tracking-heading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.live-locations-heading {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #dc2626;
    font-weight: 700;
    white-space: nowrap;
}

.current-tracking-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================================================
   HISTORY TIMELINE SPACING / OVERLAP
========================================================= */

.history-timeline-employee {
    margin-bottom: 3px;
}

.history-timeline-header {
    margin-bottom: 1px;
}

.history-slider {
    top: 43px;
}

.history-selected-event-label {
    background: rgba(29, 78, 216, 0.78);
}

@media (max-width: 760px) {
    .custodian-mode-tabs {
        width: 100%;
    }

    .custodian-mode-tab {
        flex: 1 1 50%;
        padding-inline: 8px;
    }

    .history-employee-heading {
        gap: 6px;
    }
}
