/* Michrock Logistics, Inc. - P&D Fleet Maintenance Tracking & Sat-Fri Dispatch Schedule Styles */

:root {
    /* Brand Colors */
    --brand-purple: #4d148c;
    --brand-purple-light: #6d28d9;
    --brand-purple-soft: #f3e8ff;
    --brand-purple-glow: rgba(77, 20, 140, 0.12);
    --brand-orange: #ea580c;
    --brand-orange-light: #fb923c;
    --brand-orange-soft: #fff7ed;
    --brand-orange-glow: rgba(234, 88, 12, 0.15);
    --brand-cyan: #0891b2;
    --brand-green: #16a34a;

    /* Light Theme Base Colors (Default) */
    --bg-dark: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.94);
    --card-bg-hover: #f8fafc;
    --card-border: #e2e8f0;
    --card-border-focus: #ea580c;

    /* Typography */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-heading: #1e1b4b;

    /* Operational Status Colors */
    --status-in-service: #15803d;
    --status-in-service-bg: #ecfdf5;
    --status-in-service-border: #86efac;
    --status-maintenance: #b45309;
    --status-maintenance-bg: #fffbeb;
    --status-maintenance-border: #fde68a;
    --status-in-shop: #6d28d9;
    --status-in-shop-bg: #f5f3ff;
    --status-in-shop-border: #ddd6fe;
    --status-grounded: #b91c1c;
    --status-grounded-bg: #fef2f2;
    --status-grounded-border: #fecaca;

    /* Border Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows & Transitions */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 4px 20px rgba(234, 88, 12, 0.14);
    --shadow-modal: 0 20px 50px -10px rgba(15, 23, 42, 0.25);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Optional Dark Theme Mode */
[data-theme="dark"] {
    --brand-purple: #4d148c;
    --brand-purple-light: #7c2cd8;
    --brand-purple-soft: rgba(77, 20, 140, 0.25);
    --brand-purple-glow: rgba(77, 20, 140, 0.35);
    --brand-orange: #ff6600;
    --brand-orange-light: #ff8533;
    --brand-orange-soft: rgba(255, 102, 0, 0.15);
    --brand-orange-glow: rgba(255, 102, 0, 0.35);
    --brand-cyan: #06b6d4;
    --brand-green: #10b981;

    --bg-dark: #0b0813;
    --bg-surface: #140f22;
    --bg-surface-elevated: #1e1732;
    --card-bg: rgba(26, 20, 42, 0.85);
    --card-bg-hover: rgba(36, 28, 58, 0.95);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-border-focus: rgba(255, 102, 0, 0.5);

    --text-primary: #ffffff;
    --text-secondary: #9da3b4;
    --text-muted: #6b7280;
    --text-heading: #ffffff;

    --status-in-service: #10b981;
    --status-in-service-bg: rgba(16, 185, 129, 0.15);
    --status-in-service-border: rgba(16, 185, 129, 0.3);
    --status-maintenance: #f59e0b;
    --status-maintenance-bg: rgba(245, 158, 11, 0.18);
    --status-maintenance-border: rgba(245, 158, 11, 0.35);
    --status-in-shop: #8b5cf6;
    --status-in-shop-bg: rgba(139, 92, 246, 0.18);
    --status-in-shop-border: rgba(139, 92, 246, 0.35);
    --status-grounded: #ef4444;
    --status-grounded-bg: rgba(239, 68, 68, 0.2);
    --status-grounded-border: rgba(239, 68, 68, 0.35);

    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(255, 102, 0, 0.25);
    --shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.8);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
}

html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Background Subtle Atmospheric Lighting */
.bg-ambient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.16;
    animation: floatOrb 22s infinite alternate ease-in-out;
}

[data-theme="dark"] .ambient-orb {
    opacity: 0.45;
}

.orb-purple {
    background: var(--brand-purple);
    width: 500px;
    height: 500px;
    top: -150px;
    left: -100px;
}

.orb-orange {
    background: var(--brand-orange);
    width: 450px;
    height: 450px;
    bottom: -100px;
    right: -100px;
    animation-delay: -8s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.1); }
}

.app-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 16px 90px 16px;
    box-sizing: border-box;
}

/* Top Navbar */
.top-navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-purple), var(--brand-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--brand-orange-glow);
    color: white;
}

.brand-icon svg {
    width: 24px;
    height: 24px;
}

.brand-titles h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, var(--brand-purple) 20%, var(--brand-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    white-space: nowrap;
}

[data-theme="dark"] .brand-titles h1 {
    background: linear-gradient(90deg, #ffffff 40%, var(--brand-orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-orange);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.workspace-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-in-service);
    box-shadow: 0 0 8px var(--status-in-service);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Nav Tabs */
.view-nav {
    display: flex;
    flex-wrap: wrap;
    background: var(--bg-surface-elevated);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    gap: 4px;
    overflow-x: hidden;
}

.nav-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.nav-tab-btn svg {
    width: 16px;
    height: 16px;
}

.nav-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-tab-btn.active {
    background: linear-gradient(135deg, var(--brand-purple), var(--brand-orange));
    color: #ffffff;
    box-shadow: 0 4px 12px var(--brand-orange-glow);
}

.nav-tab-btn .badge-counter {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.2;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--brand-orange);
    transform: translateY(-1px);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-accent, var(--brand-orange));
}

.kpi-card.accent-purple { --card-accent: var(--brand-purple-light); }
.kpi-card.accent-green { --card-accent: var(--status-in-service); }
.kpi-card.accent-amber { --card-accent: var(--status-maintenance); }
.kpi-card.accent-red { --card-accent: var(--status-grounded); }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kpi-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.25;
}

.kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.accent-purple .kpi-icon { background: var(--brand-purple-soft); color: var(--brand-purple); }
.accent-green .kpi-icon { background: var(--status-in-service-bg); color: var(--status-in-service); }
.accent-amber .kpi-icon { background: var(--status-maintenance-bg); color: var(--status-maintenance); }
.accent-red .kpi-icon { background: var(--status-grounded-bg); color: var(--status-grounded); }

.kpi-icon svg {
    width: 15px;
    height: 15px;
}

.kpi-value-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.kpi-subtext {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Views */
.app-view {
    display: none;
    animation: fadeInView 0.3s ease;
}

.app-view.active-view {
    display: block;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Control Bar */
.control-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: var(--bg-surface);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px var(--brand-orange-glow);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-pill-btn {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-pill-btn:hover {
    background: var(--card-border);
    color: var(--text-primary);
}

.filter-pill-btn.active {
    background: var(--brand-orange);
    color: #ffffff;
    border-color: var(--brand-orange);
    box-shadow: 0 2px 8px var(--brand-orange-glow);
}

/* Layout Switcher */
.layout-mode-group {
    display: flex;
    background: var(--bg-surface-elevated);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    gap: 3px;
}

.layout-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.layout-btn svg { width: 14px; height: 14px; }
.layout-btn:hover { color: var(--text-primary); background: var(--bg-surface); }
.layout-btn.active {
    background: linear-gradient(135deg, var(--brand-purple), var(--brand-orange));
    color: white;
    box-shadow: 0 2px 8px var(--brand-orange-glow);
}

/* ========================================================= */
/* SAT-FRI DISPATCH SCHEDULE & AVAILABILITY MATRIX STYLES     */
/* ========================================================= */
.schedule-subnav {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
}

.schedule-subtab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.schedule-subtab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.schedule-subtab-btn.active {
    background: var(--brand-purple);
    color: white;
    border-color: var(--brand-purple);
    box-shadow: 0 2px 10px var(--brand-purple-glow);
}

.week-navigation-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: var(--shadow-soft);
}

.week-date-badge {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-days-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: hidden;
}

.day-pill-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    min-width: 70px;
}

.day-pill-btn .day-title { display: block; font-size: 11px; text-transform: uppercase; }
.day-pill-btn .day-sub { display: block; font-size: 9px; color: var(--text-muted); }
.day-pill-btn:hover { background: var(--card-border); color: var(--text-primary); }
.day-pill-btn.active {
    background: var(--brand-orange);
    color: white;
    border-color: var(--brand-orange);
    box-shadow: 0 2px 8px var(--brand-orange-glow);
}
.day-pill-btn.active .day-sub { color: #fff; font-weight: 700; }

/* Matrix Table */
/* Matrix Table */
.matrix-table-wrapper {
    overflow-x: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.matrix-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: left;
}

.matrix-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    padding: 6px 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border-bottom: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    white-space: normal;
    overflow: hidden;
    box-sizing: border-box;
}

.matrix-table th.sat-day-header {
    /* Standardized with other days; only Today gets highlighted */
}

.matrix-table td {
    padding: 4px 4px;
    border-bottom: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    vertical-align: middle;
    color: var(--text-primary);
    overflow: hidden;
    box-sizing: border-box;
}

.matrix-table tr:hover td {
    background: var(--bg-surface-elevated);
}

.matrix-table td.driver-card-cell {
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.matrix-table td.driver-card-cell:hover {
    background: rgba(246, 130, 31, 0.08) !important;
}

.matrix-table td.driver-card-cell:hover .driver-cell-name > span:first-child {
    color: var(--brand-orange);
}

.driver-cell-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-cell-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-route-badge {
    font-weight: 800;
    color: var(--brand-purple);
    background: var(--brand-purple-soft);
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid var(--status-in-shop-border);
    font-size: 9.5px;
}

[data-theme="dark"] .driver-route-badge {
    color: #e2e8f0;
}

.driver-truck-badge {
    font-weight: 700;
    color: var(--brand-orange);
}

.driver-notes-text {
    color: var(--text-secondary);
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manager-badge {
    background: linear-gradient(135deg, var(--brand-purple-light), #ec4899);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    margin-left: auto;
    white-space: nowrap;
}

.matrix-shift-pill {
    position: relative;
    background: var(--brand-purple-soft);
    border: 1px solid var(--status-in-shop-border);
    border-radius: 5px;
    padding: 4px 5px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.matrix-shift-pill .btn-cell-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    z-index: 2;
}

.matrix-shift-pill:hover .btn-cell-remove {
    opacity: 1;
}

.matrix-shift-pill .btn-cell-remove:hover {
    background: #ef4444;
    color: #ffffff;
    transform: scale(1.15);
}

[data-theme="dark"] .matrix-shift-pill {
    background: rgba(77, 20, 140, 0.35);
    border: 1px solid rgba(124, 44, 216, 0.5);
}

.matrix-shift-pill:hover {
    border-color: var(--brand-orange);
    background: var(--brand-orange-soft);
    transform: translateY(-1px);
}

.matrix-shift-pill.off-duty {
    position: relative;
    background: var(--bg-surface-elevated);
    border: 1px dashed var(--card-border);
    color: var(--text-muted);
    text-align: center;
    justify-content: center;
    padding: 7px 8px;
}

.matrix-shift-pill.off-duty:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    border-style: solid;
    color: #10b981;
    transform: translateY(-1px);
}

.matrix-shift-pill.off-duty .btn-quick-add-text {
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.matrix-shift-pill.off-duty .btn-cell-edit-gear {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: none;
    background: transparent;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 2;
}

.matrix-shift-pill.off-duty:hover .btn-cell-edit-gear {
    opacity: 0.7;
}

.matrix-shift-pill.off-duty .btn-cell-edit-gear:hover {
    opacity: 1;
    background: var(--card-border);
}

.matrix-shift-pill.conflict-shift {
    background: var(--status-grounded-bg);
    border-color: var(--status-grounded-border);
}

.matrix-shift-pill.safety-alert {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35) !important;
}

.matrix-shift-pill.safety-alert .pill-route-name {
    color: #ef4444 !important;
    font-weight: 800;
}

/* Today's Column Highlight in Sat-Fri Matrix */
.matrix-table th.today-day-header {
    background: linear-gradient(180deg, rgba(246, 130, 31, 0.22) 0%, rgba(246, 130, 31, 0.12) 100%) !important;
    color: var(--brand-orange) !important;
    border-top: 3px solid var(--brand-orange) !important;
    border-left: 2px solid var(--brand-orange) !important;
    border-right: 2px solid var(--brand-orange) !important;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(246, 130, 31, 0.2);
}

.today-header-badge {
    display: inline-block;
    background: var(--brand-orange);
    color: #ffffff;
    font-size: 8.5px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 5px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    text-transform: uppercase;
    animation: pulseToday 2s infinite ease-in-out;
}

@keyframes pulseToday {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

.matrix-table td.today-cell-highlight {
    background: rgba(246, 130, 31, 0.05) !important;
    border-left: 2px solid rgba(246, 130, 31, 0.35) !important;
    border-right: 2px solid rgba(246, 130, 31, 0.35) !important;
}

[data-theme="dark"] .matrix-table td.today-cell-highlight {
    background: rgba(246, 130, 31, 0.08) !important;
    border-left: 2px solid rgba(246, 130, 31, 0.4) !important;
    border-right: 2px solid rgba(246, 130, 31, 0.4) !important;
}

.matrix-table tr:hover td.today-cell-highlight {
    background: rgba(246, 130, 31, 0.12) !important;
}

.matrix-table td.today-cell-highlight .matrix-shift-pill {
    border-color: rgba(246, 130, 31, 0.5);
    box-shadow: 0 2px 6px rgba(246, 130, 31, 0.15);
}

.matrix-table td.today-cell-highlight .matrix-shift-pill.off-duty {
    border-color: rgba(246, 130, 31, 0.4);
    background: rgba(246, 130, 31, 0.04);
}

.matrix-table tfoot td.today-foot-highlight {
    background: rgba(246, 130, 31, 0.15) !important;
    color: var(--brand-orange) !important;
    font-weight: 900 !important;
    border-left: 2px solid var(--brand-orange) !important;
    border-right: 2px solid var(--brand-orange) !important;
    border-bottom: 2px solid var(--brand-orange) !important;
}

.day-pill-btn.is-today {
    border-color: var(--brand-orange) !important;
    position: relative;
}

.day-pill-btn.is-today::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-orange);
}

.driver-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

tr:hover .driver-row-actions {
    opacity: 1;
}

.btn-row-action {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-row-action:hover {
    background: var(--brand-purple);
    color: white;
    border-color: var(--brand-purple);
}

.btn-row-action.clear:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-row-action.remove-driver {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
    margin-left: auto;
}

.btn-row-action.remove-driver:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.pill-route-name { font-weight: 800; font-size: 11px; color: var(--brand-purple); }
[data-theme="dark"] .pill-route-name { color: #ffffff; }
.pill-truck-num { font-size: 10px; font-weight: 700; color: var(--brand-orange); }
.pill-status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* Base Availability Checkbox Matrix */
.base-day-checkbox-group {
    display: flex;
    gap: 6px;
}

.day-check-chip {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--card-border);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.day-check-chip.checked {
    background: var(--brand-purple);
    color: white;
    border-color: var(--brand-purple);
}

.schedule-conflict-banner {
    background: var(--status-grounded-bg);
    border: 1px solid var(--status-grounded-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* ========================================================= */
/* ROSTER / KANBAN / SPLIT / GRID LAYOUTS                    */
/* ========================================================= */
.roster-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.roster-strip {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.roster-strip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--strip-status-color, var(--status-in-service));
}

.roster-strip.status-green { --strip-status-color: var(--status-in-service); }
.roster-strip.status-amber { --strip-status-color: var(--status-maintenance); }
.roster-strip.status-purple { --strip-status-color: var(--status-in-shop); }
.roster-strip.status-red { --strip-status-color: var(--status-grounded); }

.roster-strip:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--brand-orange);
    transform: translateX(3px);
    box-shadow: var(--shadow-soft);
}

.roster-main-info {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 320px;
    flex-shrink: 0;
}

.roster-truck-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.roster-vehicle-desc {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.roster-model { font-size: 13px; font-weight: 700; color: var(--brand-orange); }
.roster-vin { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); }

.roster-metrics {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: space-around;
}

.roster-metric-cell { display: flex; flex-direction: column; min-width: 110px; }
.roster-metric-cell.cell-odometer { text-align: right; align-items: flex-end; }
.roster-metric-cell.cell-owner { text-align: left; align-items: flex-start; }
.roster-metric-cell.cell-status { text-align: left; align-items: flex-start; }
.roster-metric-cell.cell-compliance { text-align: right; align-items: flex-end; }
.roster-metric-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.roster-metric-val { font-size: 13px; font-weight: 700; color: var(--text-primary); }

.roster-actions { display: flex; align-items: center; gap: 8px; }

/* Kanban Board */
.kanban-board-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 30px;
    overflow-x: hidden;
}

.kanban-column {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    min-height: 480px;
}

[data-theme="dark"] .kanban-column {
    background: rgba(15, 10, 24, 0.85);
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid;
}

.kanban-col-header.col-green { border-bottom-color: var(--status-in-service); }
.kanban-col-header.col-amber { border-bottom-color: var(--status-maintenance); }
.kanban-col-header.col-purple { border-bottom-color: var(--status-in-shop); }
.kanban-col-header.col-red { border-bottom-color: var(--status-grounded); }

.kanban-col-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-primary); }
.kanban-col-count { background: var(--card-border); color: var(--text-primary); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.kanban-cards-stack { display: flex; flex-direction: column; gap: 12px; flex: 1; }

.kanban-truck-card {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kanban-truck-card:hover { border-color: var(--brand-orange); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.kanban-card-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.kanban-truck-num { font-size: 18px; font-weight: 800; color: var(--text-primary); }

.kanban-quick-move {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--card-border);
}

.btn-kanban-move {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-kanban-move:hover { background: var(--brand-orange); color: white; border-color: var(--brand-orange); }

/* Split Pane */
.split-pane-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 18px;
    margin-bottom: 30px;
    min-height: 600px;
}

.split-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    max-height: 720px;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
}

.split-truck-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    margin-bottom: 6px;
    transition: var(--transition-fast);
    background: var(--bg-surface-elevated);
}

.split-truck-item:hover { background: var(--card-border); }
.split-truck-item.active {
    background: var(--brand-purple-soft);
    border-color: var(--brand-purple);
}

.split-item-left { display: flex; align-items: center; gap: 10px; }
.split-status-dot { width: 10px; height: 10px; border-radius: 50%; }
.split-status-dot.green { background: var(--status-in-service); }
.split-status-dot.amber { background: var(--status-maintenance); }
.split-status-dot.purple { background: var(--status-in-shop); }
.split-status-dot.red { background: var(--status-grounded); }

.split-detail-pane {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    overflow-y: auto;
    max-height: 720px;
    box-shadow: var(--shadow-soft);
}

.split-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--card-border);
}

.split-hero-num { font-size: 32px; font-weight: 800; color: var(--text-primary); }

/* Grid Tiles */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.truck-card {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
}

.truck-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-orange);
    box-shadow: var(--shadow-glow);
}

.truck-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.truck-identity { display: flex; flex-direction: column; }
.truck-number {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.truck-model { font-size: 13px; color: var(--brand-orange); font-weight: 600; margin-top: 2px; }
.truck-type-tag { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-in-service { background: var(--status-in-service-bg); color: var(--status-in-service); border: 1px solid var(--status-in-service-border); }
.status-maintenance { background: var(--status-maintenance-bg); color: var(--status-maintenance); border: 1px solid var(--status-maintenance-border); }
.status-in-shop { background: var(--status-in-shop-bg); color: var(--status-in-shop); border: 1px solid var(--status-in-shop-border); }
.status-grounded { background: var(--status-grounded-bg); color: var(--status-grounded); border: 1px solid var(--status-grounded-border); }

.truck-info-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 14px;
}

.info-item { display: flex; flex-direction: column; }
.info-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.info-val { font-size: 13px; color: var(--text-primary); font-weight: 600; }
.info-val.vin-val { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); }

.active-issue-banner {
    background: var(--status-grounded-bg);
    border: 1px solid var(--status-grounded-border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--status-grounded);
    font-weight: 600;
}

.active-issue-banner svg { width: 16px; height: 16px; color: var(--status-grounded); flex-shrink: 0; }
.active-issue-banner.warning { background: var(--status-maintenance-bg); border-color: var(--status-maintenance-border); color: var(--status-maintenance); }
.active-issue-banner.warning svg { color: var(--status-maintenance); }

.truck-card-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.btn-card-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-card-action:hover { background: var(--card-border); border-color: var(--brand-orange); }
.btn-card-action.primary { background: linear-gradient(135deg, var(--brand-purple), var(--brand-orange)); border: none; color: white; }
.btn-card-action.primary:hover { opacity: 0.95; transform: translateY(-1px); }
.btn-card-action.danger { background: var(--status-grounded-bg); border-color: var(--status-grounded-border); color: var(--status-grounded); }

/* Forms */
.form-card {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.form-row { margin-bottom: 16px; }
.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label .label-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); }

.form-select, .form-input, .form-textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.form-select:focus, .form-input:focus, .form-textarea:focus { border-color: var(--brand-orange); box-shadow: 0 0 0 3px var(--brand-orange-glow); }
.form-select option { background: var(--bg-surface); color: var(--text-primary); }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 10;
}

.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.btn-close-modal { background: transparent; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; }
.btn-close-modal:hover { color: var(--text-primary); }
.modal-body { padding: 22px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--card-border);
    background: var(--bg-surface-elevated);
}

/* Mechanic Board */
.mechanic-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.mechanic-truck-card {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow-soft);
}

.mechanic-truck-card.urgent-card {
    border-left: 4px solid var(--status-grounded);
}

.mechanic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.mechanic-truck-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.mechanic-issue-box {
    background: var(--status-maintenance-bg);
    border: 1px solid var(--status-maintenance-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.urgent-card .mechanic-issue-box {
    background: var(--status-grounded-bg);
    border-color: var(--status-grounded-border);
}

.mechanic-issue-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--status-maintenance);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.urgent-card .mechanic-issue-label {
    color: var(--status-grounded);
}

.mechanic-issue-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.mechanic-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.mechanic-meta-row strong {
    color: var(--text-primary);
    font-size: 12px;
}

/* Master Data Table */
.master-table-wrapper {
    overflow-x: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

.master-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.master-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    padding: 12px 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    border-bottom: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    white-space: nowrap;
}

.master-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    color: var(--text-primary);
    vertical-align: middle;
}

.master-table tr:hover td {
    background: var(--bg-surface-elevated);
}

.master-table .col-truck-num { width: 90px; text-align: left !important; }
.master-table .col-model { min-width: 240px; text-align: left !important; }
.master-table .col-vin { width: 175px; text-align: left !important; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.master-table .col-plate { width: 115px; text-align: left !important; }
.master-table .col-odometer { width: 120px; text-align: right !important; font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.master-table .col-status { width: 135px; text-align: left !important; }
.master-table .col-compliance { min-width: 160px; text-align: right !important; }
.master-table .col-docs { width: 90px; text-align: center !important; }
.master-table .col-actions { width: 130px; text-align: center !important; }

.td-truck-num {
    font-weight: 800;
    font-size: 15px;
    color: var(--brand-purple);
}

.td-vin {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.th-odometer,
.td-odometer {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

/* Timeline */
.timeline-container {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid var(--card-border);
    margin-top: 14px;
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
}

.timeline-dot {
    position: absolute;
    left: -27px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand-purple);
    border: 2px solid var(--bg-surface);
}

.timeline-dot.green { background: var(--status-in-service); }
.timeline-dot.amber { background: var(--status-maintenance); }
.timeline-dot.purple { background: var(--status-in-shop); }
.timeline-dot.red { background: var(--status-grounded); }

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-desc {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

.timeline-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

/* QR Canvas Preview */
.qr-preview-box {
    background: #ffffff;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: inline-block;
    margin: 10px auto;
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--status-in-service-border);
    box-shadow: var(--shadow-modal);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-normal);
    color: var(--text-primary);
    font-weight: 600;
}

.toast-notification.show { transform: translateY(0); opacity: 1; }
.toast-notification.error { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15); }
.toast-notification.success { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15); }

/* Attached Document Badges & Links */
.doc-badge-link {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.doc-badge-link:hover {
    background: var(--bg-surface);
    border-color: var(--brand-purple);
    color: var(--brand-purple);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

/* Document Categorization Styles */
.doc-categories-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    width: 100%;
}

.doc-category-group {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.doc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.doc-category-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-category-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.doc-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ========================================================= */
/* FAST RAPID-ENTRY GRID STYLES (DAY & FULL WEEK)            */
/* ========================================================= */
.fast-grid-table-wrapper {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}

.fast-grid-table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
}

.fast-grid-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 8px;
    background: var(--bg-surface-elevated);
    border-bottom: 2px solid var(--card-border);
    color: var(--text-muted);
    white-space: nowrap;
}

.fast-grid-table td {
    padding: 6px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--card-border);
}

.fast-input, .fast-select {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.fast-input:focus, .fast-select:focus {
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.fast-input.ils-input {
    text-align: center;
    font-weight: 800;
    color: #10b981;
}

.duty-toggle-btn {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: all 0.15s ease;
}

.duty-toggle-btn.status-working {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

.duty-toggle-btn.status-off {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border-color: var(--card-border);
}

.duty-toggle-btn.status-requested_off {
    background: var(--status-maintenance-bg);
    color: var(--status-maintenance);
    border-color: var(--status-maintenance-border);
}

.duty-toggle-btn.status-no_show {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
    font-weight: 800;
}

.duty-toggle-btn.status-sick {
    background: rgba(249, 115, 22, 0.2);
    color: #ea580c;
    border-color: rgba(249, 115, 22, 0.5);
    font-weight: 800;
}

/* Week Fast Spreadsheet Matrix */
.week-fast-cell {
    padding: 6px 5px !important;
    border: 1px solid var(--card-border) !important;
    min-width: 150px;
    vertical-align: top !important;
    background: var(--bg-surface);
}

.week-fast-cell.is-off {
    background: rgba(148, 163, 184, 0.05);
}

.week-fast-cell.is-safety {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.week-cell-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.week-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.week-date-badge.clickable {
    cursor: pointer;
    transition: all 0.15s ease;
}

.week-date-badge.clickable:hover {
    border-color: var(--brand-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.matrix-table th.clickable-day-header {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.matrix-table th.clickable-day-header:hover {
    background: rgba(139, 92, 246, 0.15) !important;
    color: var(--brand-purple) !important;
}

/* Gregorian Quarterly Safety & Compliance Styles */
.quarter-navigation-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
}

.quarter-pill-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.quarter-pill-btn:hover {
    color: var(--text-primary);
    border-color: var(--brand-purple);
    background: var(--bg-surface);
}

.quarter-pill-btn.active {
    background: linear-gradient(135deg, var(--brand-purple) 0%, #6d28d9 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.quarter-scorecard-table th {
    background: var(--bg-surface-elevated);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
}

.quarter-scorecard-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--card-border);
}

/* Single-Day Matrix Navigation Bar */
.matrix-day-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    background: var(--bg-surface-elevated);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
}

.matrix-nav-arrow-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.matrix-nav-arrow-btn:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
}

.matrix-nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 1024px) {
    .kanban-board-container { grid-template-columns: repeat(2, 1fr); }
    .split-pane-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .top-navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 10px;
    }
    .view-nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        gap: 6px;
    }
    .nav-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        justify-content: center;
        padding: 8px 12px;
        font-size: 12px;
    }
    .header-actions {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
    }
    .header-actions .btn-secondary {
        padding: 5px 9px;
        font-size: 11px;
    }

    /* Mobile 2x2 KPI Tiles Grid */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }
    .kpi-card {
        padding: 8px 10px !important;
        border-radius: var(--radius-sm) !important;
    }
    .kpi-header {
        margin-bottom: 4px !important;
    }
    .kpi-title {
        font-size: 11px !important;
        letter-spacing: 0.3px !important;
        line-height: 1.15 !important;
    }
    .kpi-value {
        font-size: 18px !important;
    }
    .kpi-subtext {
        font-size: 9.5px !important;
        margin-top: 2px !important;
    }

    /* Schedule Subtabs on Mobile */
    .schedule-subnav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        margin-bottom: 10px;
        gap: 6px;
    }
    .schedule-subtab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* 1-Day Focus Week Navigation on Mobile */
    .week-navigation-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 10px;
    }
    .week-navigation-banner > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    .week-date-badge {
        flex: 1;
        justify-content: center;
        font-size: 12px;
        padding: 6px 10px;
        text-align: center;
    }
    .week-days-strip {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        justify-content: flex-start;
        gap: 4px;
    }
    .day-pill-btn {
        min-width: 64px;
        padding: 6px 8px;
    }
    .day-pill-btn .day-title {
        font-size: 12px;
    }
    .day-pill-btn .day-sub {
        font-size: 9.5px;
    }
    .day-pill-btn.is-today {
        border-color: var(--brand-orange);
        box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.35);
    }

    .kanban-board-container { grid-template-columns: 1fr; }
    .roster-strip { flex-direction: column; align-items: flex-start; }
    .roster-metrics { flex-wrap: wrap; width: 100%; justify-content: space-between; }
    .matrix-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Precise Sticker & Label Printing */
@media print {
    body * {
        visibility: hidden !important;
    }
    #barcodePlacardContainer,
    #barcodePlacardContainer * {
        visibility: visible !important;
    }
    #barcodePlacardContainer {
        position: fixed !important;
        left: 50% !important;
        top: 20px !important;
        transform: translateX(-50%) !important;
        width: 480px !important;
        max-width: 480px !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .modal-overlay {
        background: transparent !important;
        padding: 0 !important;
    }
    .modal-dialog {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    @page {
        size: auto;
        margin: 10mm;
    }
}

/* ==========================================================================
   AUTHENTICATION LOCK / LOGIN GATE
   ========================================================================== */
.auth-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 15, 29, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
    animation: fadeInView 0.25s ease-out;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 32px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-orange), var(--brand-purple));
}

.auth-header {
    margin-bottom: 24px;
}

.auth-logo-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.auth-form {
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form .form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper svg {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.auth-input-wrapper .form-input {
    width: 100%;
    padding: 10px 38px 10px 36px;
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.auth-input-wrapper .form-input:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px var(--brand-orange-glow);
    outline: none;
}

.auth-eye-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.auth-eye-btn:hover {
    color: var(--text-primary);
}

.auth-remember-row {
    margin-bottom: 18px;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    accent-color: var(--brand-orange);
    cursor: pointer;
    width: 15px;
    height: 15px;
}

.auth-error-banner {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    animation: fadeInView 0.2s ease;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    cursor: pointer;
}

.auth-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}


