/* ═══════════════════════════════════════════
   Droplet — Staff Interface
   Design: Poppins · Purple-Navy Dark Theme
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --navy:        #16161f;   /* topnav / header */
    --navy-light:  #1f1f2e;   /* nav hover state */
    --primary:     #5865f2;   /* indigo accent */
    --primary-bg:  rgba(88,101,242,0.14);
    --primary-glow:rgba(88,101,242,0.28);
    --green:       #10b981;
    --green-bg:    rgba(16,185,129,0.13);
    --red:         #ef4444;
    --red-bg:      rgba(239,68,68,0.13);
    --amber:       #f59e0b;
    --amber-bg:    rgba(245,158,11,0.13);
    --violet:      #8b5cf6;
    --violet-bg:   rgba(139,92,246,0.13);
    --bg:          #1a1a2e;   /* page background */
    --surface:     #252538;   /* cards, panels */
    --surface-2:   #2d2d45;   /* elevated / hover */
    --border:      #3a3a4e;   /* borders */
    --text:        #e8e8f5;   /* primary text */
    --text-muted:  #b4b4d0;   /* secondary text */
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
    --shadow:      0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg:   0 24px 60px rgba(0,0,0,0.6);
    --radius:      10px;
    --radius-lg:   14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #16161f 0%, #1a1a2e 50%, #1e1e33 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    font-size: 0.875rem;
    min-height: 100vh;
}

/* ═══ LOGIN PAGE ═══ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    background: var(--surface);
    padding: 44px 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}

.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══ FORMS ═══ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--text);
    background: rgba(26,26,46,0.5);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder { color: #4a4a68; }
.form-group textarea { resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group-inline label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.form-group-inline input {
    padding: 8px 11px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background: rgba(26,26,46,0.5);
}

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #5865f2 0%, #6366f1 100%);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4752c4 0%, #5558d9 100%);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: #555570;
}

.btn-success   { background: var(--green);  color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 16px rgba(16,185,129,0.3); transform: translateY(-1px); }

.btn-danger    { background: var(--red);    color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.75rem; border-radius: 7px; }

.btn-logout {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 7px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: #555570; }

/* ═══ MESSAGES ═══ */
.error-message {
    color: var(--red);
    text-align: center;
    margin-top: 14px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ═══ CARDS ═══ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

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

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

/* ═══ TABLES ═══ */
.table-container { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 11px 16px;
    text-align: left;
    background: linear-gradient(135deg, rgba(31,31,46,1) 0%, rgba(22,22,31,1) 100%);
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

.data-table tbody tr { cursor: pointer; transition: background 0.12s ease; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(88,101,242,0.12); }
.data-table tbody tr:hover td:first-child { border-left: 2px solid var(--primary); padding-left: 14px; }

/* ═══ STATUS BADGES ═══ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-badge.active    { background: var(--green-bg);  color: var(--green);  }
.status-badge.pending   { background: var(--amber-bg);  color: var(--amber);  }
.status-badge.suspended { background: var(--red-bg);    color: var(--red);    }

/* ═══ ACTIONS ═══ */
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ═══ SPINNER ═══ */
.spinner {
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 20px; height: 20px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ EMPTY STATE ═══ */
.empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.empty-state-icon { font-size: 2.2rem; margin-bottom: 12px; opacity: 0.35; }
.empty-state p { font-weight: 500; }

/* ═══ MODALS ═══ */
.modal {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    pointer-events: none;
    transition: background 0.25s ease, backdrop-filter 0.25s ease;
}

.modal.active {
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: all;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 94%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.16,1,0.3,1), opacity 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.modal-content::-webkit-scrollbar { width: 5px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.modal.active .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-wide { max-width: 900px; }
.modal-sm   { max-width: 460px; }

.modal-header {
    padding: 22px 28px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(31,31,46,1) 0%, rgba(22,22,31,1) 100%);
}

.modal-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.modal-body { padding: 28px 28px 20px; }

.modal-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(26,26,46,0.5);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.close-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.close-btn:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.35);
    color: var(--red);
}

/* 2-column modal form grid */
.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

.modal-form-grid .form-group { margin-bottom: 18px; }
.modal-form-grid .form-group.span-2 { grid-column: 1 / -1; }

.modal-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 4px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    grid-column: 1 / -1;
}

/* ═══════════════════════════════════════
   HOME — MODULE SELECTOR
═══════════════════════════════════════ */
.home-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.home-top {
    background: rgba(37, 37, 56, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 64px;
    border-bottom: 1px solid var(--border);
}

.home-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.home-logo-icon { font-size: 1.4rem; }

.home-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.home-company {
    background: var(--primary-bg);
    color: #a5b4fc;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.home-welcome {
    padding: 52px 40px 28px;
}

.home-welcome h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.home-welcome p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 0 40px 60px;
}

.module-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-left: 4px solid transparent;
    padding: 28px 24px;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #4a4a60;
}

.module-dispatch   { border-left-color: var(--primary); }
.module-dispatch:hover  { background: rgba(88,101,242,0.07); }

.module-management { border-left-color: var(--green); }
.module-management:hover { background: rgba(16,185,129,0.07); }

.module-accounts   { border-left-color: var(--violet); }
.module-accounts:hover  { background: rgba(139,92,246,0.07); }

.module-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.module-dispatch  .module-icon  { background: var(--primary-bg); }
.module-management .module-icon { background: var(--green-bg);   }
.module-accounts  .module-icon  { background: var(--violet-bg);  }

.module-info { flex: 1; }

.module-info h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.module-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    font-weight: 500;
}

.module-arrow {
    color: #4a4a68;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.18s, color 0.18s;
}
.module-card:hover .module-arrow { transform: translateX(3px); color: var(--text-muted); }

/* ═══════════════════════════════════════
   SHARED TOP NAV
═══════════════════════════════════════ */
.page-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topnav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: rgba(37, 37, 56, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 300;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topnav-left, .topnav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topnav-back {
    color: #555570;
    text-decoration: none;
    font-size: 1.1rem;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 7px;
    transition: all 0.15s;
}
.topnav-back:hover { background: var(--surface); color: var(--text); }

.topnav-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
}

.topnav-brand {
    color: var(--text);
    font-weight: 700;
    font-size: 0.875rem;
}

.topnav-sep {
    color: #3a3a55;
    font-size: 1rem;
}

.topnav-page {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.topnav-user {
    color: #555570;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ═══ SUB TOOLBAR ═══ */
.subtoolbar {
    position: fixed;
    top: 56px; left: 0; right: 0;
    height: 52px;
    background: rgba(37, 37, 56, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 200;
}

.subtoolbar-left, .subtoolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.subtoolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

/* ═══ TAB GROUP ═══ */
.tab-group {
    display: flex;
    align-items: center;
    background: rgba(26,26,46,0.5);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.tab:hover { color: var(--text); background: rgba(88,101,242,0.08); }

.tab.active { background: rgba(88,101,242,0.15); color: #a5b4fc; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

.tab-all.active       { background: rgba(88,101,242,0.2);  color: #a5b4fc;      }
.tab-green.active     { background: rgba(16,185,129,0.18); color: var(--green); }
.tab-red.active       { background: rgba(239,68,68,0.18);  color: var(--red);   }
.tab-amber.active     { background: rgba(245,158,11,0.18); color: var(--amber); }

.tab-count {
    background: rgba(255,255,255,0.08);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}

/* ═══ FILTER SELECT ═══ */
.filter-select {
    padding: 7px 32px 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: rgba(26,26,46,0.5);
    color: var(--text);
    font-size: 0.82rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b4b4d0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-select option { background: var(--surface); color: var(--text); }

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ═══ DATE RANGE GROUP ═══ */
.date-range-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.date-input {
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 0.78rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--text);
    background: rgba(26,26,46,0.5);
    cursor: pointer;
    transition: border-color 0.15s;
}
.date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.date-range-sep { color: #3a3a55; font-size: 0.75rem; }

/* ═══ PAGE MAIN ═══ */
.page-main {
    margin-top: 108px; /* 56 topnav + 52 subtoolbar */
    padding: 28px 32px;
    flex: 1;
}

/* ═══ METRICS GRID ═══ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid transparent;
}

.metric-green { border-left-color: var(--green);   }
.metric-red   { border-left-color: var(--red);     }
.metric-amber { border-left-color: var(--amber);   }
.metric-blue  { border-left-color: var(--primary); }

.metric-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.metric-green .metric-icon { background: var(--green-bg);   color: var(--green);   }
.metric-red   .metric-icon { background: var(--red-bg);     color: var(--red);     }
.metric-amber .metric-icon { background: var(--amber-bg);   color: var(--amber);   }
.metric-blue  .metric-icon { background: var(--primary-bg); color: #a5b4fc;        }

.metric-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ═══ TABLE CARD ═══ */
.table-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.table-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.table-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══ ROW ACTIONS ═══ */
.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.action-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.13s;
    white-space: nowrap;
}

.action-btn:hover {
    border-color: #555570;
    color: var(--text);
    background: var(--surface-2);
}
.action-btn.action-green:hover {
    border-color: rgba(16,185,129,0.5);
    color: var(--green);
    background: var(--green-bg);
}
.action-btn.action-red:hover {
    border-color: rgba(239,68,68,0.5);
    color: var(--red);
    background: var(--red-bg);
}

/* ═══ MISC COMPONENTS ═══ */
.badge-pill {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-bg);
    border: 1px solid rgba(88,101,242,0.25);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #a5b4fc;
    letter-spacing: 0.02em;
}

.field-optional {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
}

.modal-sm { max-width: 420px; }

.modal-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.modal-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.text-danger { color: var(--red); font-weight: 600; }
.text-muted  { color: var(--text-muted); }

/* ═══ FILTER BAR ═══ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 18px;
}

.filter-divider { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

/* ═══════════════════════════════════════
   DISPATCH PAGE
═══════════════════════════════════════ */
.dispatch-body {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.dispatch-header {
    height: 58px;
    background: rgba(37, 37, 56, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 10;
}

.dispatch-header-left,
.dispatch-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dispatch-title {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.dispatch-chip {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.chip-blue  { background: var(--primary-bg);  color: #a5b4fc; border: 1px solid rgba(88,101,242,0.3);  }
.chip-green { background: var(--green-bg);    color: var(--green); border: 1px solid rgba(16,185,129,0.3); }

.dispatch-clock {
    color: #3a3a55;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.dispatch-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.dispatch-panel {
    width: 150px;
    background: linear-gradient(180deg, #1f1f2e 0%, #16161f 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 8px;
    flex-shrink: 0;
}

.panel-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: rgba(26,26,46,0.5);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    text-align: center;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.panel-btn:hover {
    background: var(--primary-bg);
    border-color: rgba(88,101,242,0.4);
    color: #a5b4fc;
}

.panel-btn-icon { font-size: 1.2rem; }

/* Map area */
.dispatch-map { flex: 1; position: relative; overflow: hidden; }

.map-placeholder {
    width: 100%; height: 100%;
    background: #0f0f1e;
    background-image:
        linear-gradient(rgba(88,101,242,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88,101,242,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder-inner { text-align: center; user-select: none; }
.map-pin-icon { font-size: 2.5rem; margin-bottom: 10px; opacity: 0.2; }

.map-placeholder-inner h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2a2a42;
    margin-bottom: 4px;
}

.map-placeholder-inner p { font-size: 0.78rem; color: #1e1e35; }

/* Google Map */
#dispatchMap {
    width: 100%;
    height: 100%;
    background: #e5e5e5;
}

/* ═══ LIVE BAR ═══ */
.live-bar {
    height: 50px;
    background: rgba(37, 37, 56, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
}

.live-bar-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    color: var(--red);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-right: 1px solid var(--border);
    height: 100%;
    flex-shrink: 0;
}

.live-dot {
    width: 7px; height: 7px;
    background: var(--red);
    border-radius: 50%;
    animation: livepulse 1.4s ease-in-out infinite;
}

@keyframes livepulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}

.live-bar-scroll {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.live-bar-scroll::-webkit-scrollbar { display: none; }

.live-bar-empty {
    color: #2a2a42;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.live-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 13px;
    border-radius: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.78rem;
}

.live-upcoming {
    background: var(--primary-bg);
    border: 1px solid rgba(88,101,242,0.3);
}

.live-returned {
    background: var(--red-bg);
    border: 1px solid rgba(239,68,68,0.3);
}

.live-time   { color: var(--text);       font-weight: 700; font-variant-numeric: tabular-nums; }
.live-driver { color: var(--text-muted); font-weight: 500; }
.live-address { color: #555570;          font-weight: 500; }

.live-badge-returned {
    background: var(--red);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.live-bar-refresh {
    padding: 0 14px;
    border-left: 1px solid var(--border);
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.live-bar-refresh button {
    background: none; border: none;
    color: #2a2a42;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.15s;
    padding: 4px;
}
.live-bar-refresh button:hover { color: var(--text-muted); }

/* ═══ FORM UTILITIES ═══ */
.day-selector { display: flex; gap: 6px; flex-wrap: wrap; }

.day-check { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.day-check input { margin-bottom: 3px; accent-color: var(--primary); }
.day-check span { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }

/* ═══ ACCOUNTS STAT ITEMS ═══ */
.acct-stats { display: flex; gap: 14px; margin-bottom: 18px; }

.acct-stat-item {
    display: flex;
    flex-direction: column;
    padding: 16px 22px;
    border-radius: var(--radius);
    min-width: 130px;
    border: 1px solid transparent;
}

.acct-stat-item span {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
}

.acct-stat-item label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
}

.stat-completed { background: var(--green-bg);   color: var(--green); border-color: rgba(16,185,129,0.25);   }
.stat-cancelled { background: var(--red-bg);     color: var(--red);   border-color: rgba(239,68,68,0.25);    }
.stat-skipped   { background: var(--amber-bg);   color: var(--amber); border-color: rgba(245,158,11,0.25);   }
.stat-total     { background: var(--primary-bg); color: #a5b4fc;      border-color: rgba(88,101,242,0.25);   }

/* Row colouring for accounts */
.row-completed td { background: rgba(16,185,129,0.04); }
.row-cancelled td { background: rgba(239,68,68,0.04);  }
.row-skipped   td { background: rgba(245,158,11,0.04); }

.badge-completed { background: var(--green-bg);   color: var(--green); }
.badge-cancelled { background: var(--red-bg);     color: var(--red);   }
.badge-skipped   { background: var(--amber-bg);   color: var(--amber); }

/* ═══════════════════════════════════════
   MANAGEMENT SIDEBAR LAYOUT
═══════════════════════════════════════ */
.mgmt-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mgmt-layout {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

.mgmt-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1f1f2e 0%, #16161f 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.mgmt-sidebar-section { padding: 20px 12px 8px; }

.mgmt-sidebar-section + .mgmt-sidebar-section {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 16px;
}

.mgmt-sidebar-heading {
    display: block;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555570;
    padding: 0 8px;
    margin-bottom: 6px;
}

.mgmt-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.13s;
    cursor: pointer;
    margin-bottom: 2px;
}

.mgmt-nav-item:hover {
    background: rgba(26,26,46,0.5);
    color: var(--text);
}

.mgmt-nav-item.active {
    background: rgba(88,101,242,0.2);
    color: #a5b4fc;
    font-weight: 600;
}

.mgmt-nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.mgmt-nav-label { flex: 1; }

.mgmt-nav-count {
    background: var(--primary-bg);
    color: #a5b4fc;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
}

.mgmt-nav-soon {
    background: var(--navy-light);
    color: #555570;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--border);
}

.mgmt-sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.sidebar-home-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #5865f2 0%, #6366f1 100%);
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(88,101,242,0.4);
    transition: all 0.18s;
    box-shadow: 0 3px 10px rgba(59,75,255,0.25);
}

.sidebar-home-btn:hover {
    background: linear-gradient(135deg, #4752c4 0%, #5558d9 100%);
    box-shadow: 0 4px 16px rgba(59,75,255,0.35);
    transform: translateY(-1px);
    color: #fff;
}

.sidebar-home-icon { font-size: 1.1rem; line-height: 1; }

.mgmt-main {
    flex: 1;
    margin-left: 220px;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}

.mgmt-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 28px 32px;
}

.mgmt-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.mgmt-toolbar-left {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.mgmt-section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

.mgmt-section-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══ PAGE HEADER + CONTENT (shared legacy) ═══ */
.page-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 200;
    border-bottom: 1px solid var(--border);
}

.page-header-left, .page-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-content { margin-top: 60px; padding: 28px; max-width: 1400px; }

/* ═══ OLD LAYOUT FALLBACK ═══ */
.app-container { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px; background: var(--navy); color: var(--text);
    padding: 20px 0; position: fixed; height: 100vh; overflow-y: auto;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.sidebar-nav { padding: 16px 0; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: var(--text-muted);
    text-decoration: none; transition: all 0.15s; font-size: 0.82rem;
}
.nav-item:hover, .nav-item.active { background: var(--navy-light); color: var(--text); }
.main-content { flex: 1; margin-left: 240px; padding: 24px; }
.header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.header h1 { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.user-menu { display: flex; align-items: center; gap: 14px; }
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px; margin-bottom: 24px;
}
.stat-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    padding: 20px; display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.stat-icon.blue   { background: var(--primary-bg); }
.stat-icon.green  { background: var(--green-bg);   }
.stat-icon.orange { background: var(--amber-bg);   }
.stat-icon.red    { background: var(--red-bg);      }
.stat-info h3 { font-size: 1.7rem; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.stat-info p  { color: var(--text-muted); font-size: 0.78rem; }

/* Real-time indicator pulse */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

