/* =============================================
   Controle de Frota SWT — Design System Premium
   Dark Mode · Glassmorphism · Inter Font
   ============================================= */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Cores principais */
    --bg-base:         #080f1f;
    --bg-primary:      #0f172a;
    --bg-secondary:    #1a2540;
    --bg-card:         #1e2d45;
    --bg-card-hover:   #243352;
    --bg-input:        #162035;
    --bg-input-focus:  #1d2d4a;

    /* Bordas */
    --border:          rgba(148, 163, 184, 0.08);
    --border-soft:     rgba(148, 163, 184, 0.12);
    --border-accent:   rgba(59, 130, 246, 0.35);

    /* Texto */
    --text-primary:    #f0f6ff;
    --text-secondary:  #94a3b8;
    --text-muted:      #5a7090;
    --text-disabled:   #3d5270;

    /* Accent Blue/Purple */
    --accent:          #3b82f6;
    --accent-hover:    #2563eb;
    --accent-light:    rgba(59, 130, 246, 0.12);
    --gradient:        linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-hover:  linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);

    /* Status */
    --success:         #10b981;
    --success-light:   rgba(16, 185, 129, 0.12);
    --warning:         #f59e0b;
    --warning-light:   rgba(245, 158, 11, 0.12);
    --error:           #ef4444;
    --error-light:     rgba(239, 68, 68, 0.12);

    /* Layout */
    --navbar-h:        64px;
    --radius-sm:       6px;
    --radius-md:       10px;
    --radius-lg:       16px;
    --radius-xl:       24px;

    /* Sombras */
    --shadow-sm:       0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:       0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg:       0 8px 32px rgba(0,0,0,0.5);
    --shadow-accent:   0 4px 20px rgba(59,130,246,0.3);
    --shadow-glow:     0 0 40px rgba(59,130,246,0.15);

    /* Transições */
    --transition:      all 0.2s cubic-bezier(0.4,0,0.2,1);
    --transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(ellipse at 10% 0%, rgba(59,130,246,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 90% 100%, rgba(139,92,246,0.06) 0%, transparent 60%);
    background-attachment: fixed;
}

/* ---- Scroll ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-card-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Splash Screen ---- */
.splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    min-height: 100vh;
    animation: fadeIn 0.4s ease;
}
.splash-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Spinner ---- */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ======================================
   NAVBAR
   ====================================== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 0;
    z-index: 100;
    animation: slideDown 0.3s ease;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    text-decoration: none;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    cursor: pointer;
}
.navbar-brand svg { flex-shrink: 0; }

.navbar-divider {
    width: 1px;
    height: 28px;
    background: var(--border-soft);
    margin: 0 20px;
    flex-shrink: 0;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    background: none;
}
.nav-link:hover { color: var(--text-primary); background: var(--accent-light); }
.nav-link.active { color: var(--accent); background: var(--accent-light); }

.nav-link svg { width: 16px; height: 16px; opacity: 0.75; }
.nav-link.active svg { opacity: 1; }

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
}
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.user-info { line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.role-admin { color: var(--accent); }
.role-dispatcher { color: var(--success); }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.btn-logout:hover { border-color: var(--error); color: var(--error); background: var(--error-light); }

/* ======================================
   PAGE WRAPPER
   ====================================== */
.page-wrapper {
    padding-top: calc(var(--navbar-h) + 32px);
    padding-bottom: 48px;
    min-height: 100vh;
    animation: slideUp 0.35s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-header {
    margin-bottom: 32px;
}
.page-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ======================================
   LOGIN PAGE
   ====================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    animation: fadeIn 0.5s ease;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.5s ease;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 36px;
}

/* ======================================
   CARDS
   ====================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}
.card:hover { border-color: var(--border-soft); box-shadow: var(--shadow-md); }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ======================================
   BUTTONS
   ====================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover:not(:disabled) {
    background: var(--gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(59,130,246,0.4);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-soft);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-danger {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover:not(:disabled) { background: var(--error); color: white; }

.btn-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}
.btn-success:hover:not(:disabled) { background: var(--success); color: white; }

.btn-ghost {
    background: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--accent-light); color: var(--accent); border-color: var(--border-accent); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ======================================
   FORM ELEMENTS
   ====================================== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-control::placeholder { color: var(--text-disabled); }
.form-control::-webkit-calendar-picker-indicator { filter: invert(0.5); }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-secondary); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* ======================================
   BADGE / PILL
   ====================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-admin    { background: var(--accent-light);   color: var(--accent); }
.badge-dispatcher { background: var(--success-light); color: var(--success); }
.badge-active   { background: var(--success-light);  color: var(--success); }
.badge-inactive { background: var(--error-light);    color: var(--error); }
.badge-warning  { background: var(--warning-light);  color: var(--warning); }

/* ======================================
   TABLE
   ====================================== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
td { padding: 14px 16px; color: var(--text-primary); vertical-align: middle; }
.td-actions { display: flex; gap: 6px; align-items: center; }

.table-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.table-empty svg { margin: 0 auto 12px; display: block; opacity: 0.3; }

/* ======================================
   TABS / BASE SELECTOR
   ====================================== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    padding: 5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
}
.tab-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-card); }
.tab-btn.active {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-accent);
}

/* ======================================
   DISPATCHER PAGE
   ====================================== */
.dispatcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.date-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.date-picker-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.date-input {
    padding: 9px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
}
.date-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.dispatcher-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .dispatcher-grid { grid-template-columns: 1fr; }
}

/* Tabela de modalidades */
.modality-table { width: 100%; }

.modality-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    gap: 16px;
}
.modality-row:last-child { border-bottom: none; }
.modality-row:hover { background: rgba(59,130,246,0.04); }

.modality-info { flex: 1; min-width: 0; }
.modality-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.modality-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quantity-input-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
    flex-shrink: 0;
}
.quantity-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--border-accent); }

.quantity-input {
    width: 70px;
    text-align: center;
    padding: 8px 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}
.quantity-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Painel de Resumo */
.summary-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: calc(var(--navbar-h) + 24px);
}
.summary-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}
.summary-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.summary-panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.summary-list { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.summary-item:hover { background: var(--bg-card-hover); }
.summary-item-name { font-size: 13px; color: var(--text-secondary); }
.summary-item-qty {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 32px;
    text-align: right;
}
.summary-item-qty.highlight { color: var(--accent); }

.summary-divider { height: 1px; background: var(--border); margin: 8px 16px; }
.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: var(--bg-primary);
}
.summary-total-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.summary-total-value {
    font-size: 28px;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-panel-footer { padding: 16px; }

.confirm-info {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

.confirmed-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--success-light);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: var(--radius-md);
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    animation: slideUp 0.3s ease;
}

/* ======================================
   ADMIN PAGES — CRUD Header
   ====================================== */
.crud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 0 14px;
    width: 240px;
    transition: var(--transition);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    padding: 10px 0;
    width: 100%;
}
.search-box input::placeholder { color: var(--text-disabled); }

/* ======================================
   REPORTS PAGE
   ====================================== */
.report-filters {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.report-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value {
    font-size: 32px;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.report-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}
.report-empty svg { margin: 0 auto 16px; display: block; opacity: 0.25; }
.report-empty h3 { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.report-empty p { font-size: 14px; }

/* ======================================
   MODAL
   ====================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 31, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none !important; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}
.modal-close:hover { background: var(--error-light); color: var(--error); }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

/* ======================================
   TOAST NOTIFICATIONS
   ====================================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 360px;
    animation: slideUp 0.3s ease;
    transition: var(--transition-slow);
}
.toast.toast-success { border-color: rgba(16,185,129,0.3); }
.toast.toast-error   { border-color: rgba(239,68,68,0.3); }
.toast.toast-warning { border-color: rgba(245,158,11,0.3); }

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
}
.toast-success .toast-icon { background: var(--success-light); color: var(--success); }
.toast-error   .toast-icon { background: var(--error-light);   color: var(--error); }
.toast-warning .toast-icon { background: var(--warning-light); color: var(--warning); }

.toast-fade { opacity: 0; transform: translateX(100%); }

/* ======================================
   TOGGLE (Active/Inactive Switch)
   ====================================== */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-soft);
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { background: white; transform: translateY(-50%) translateX(18px); }
.toggle-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ======================================
   LOADING STATE
   ====================================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ======================================
   RESPONSIVE
   ====================================== */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }
    .navbar-nav { display: none; }
    .container { padding: 0 16px; }
    .page-wrapper { padding-top: calc(var(--navbar-h) + 20px); }
    .dispatcher-header { flex-direction: column; align-items: flex-start; }
    .report-filters { flex-direction: column; }
    .report-filters .form-control,
    .report-filters .date-input { width: 100%; }
    .crud-header { flex-direction: column; align-items: flex-start; }
    .search-box { width: 100%; }
}
