/* =========================================
   TEMA MAESTRO: CARRIERS COLLABO 3.0
   ========================================= */

:root {
    /* PALETA DE COLORES */
    --primary: #2563eb;
    /* Azul Principal */
    --primary-dark: #1e40af;
    /* Azul Oscuro */
    --accent: #0f172a;
    /* Fondo Header / Oscuro */
    --bg-app: #f1f5f9;
    /* Fondo Gris Claro App */
    --card-bg: #ffffff;
    /* Fondo Blanco Tarjetas */

    /* TEXTOS */
    --text-main: #1e293b;
    /* Texto Principal */
    --text-muted: #64748b;
    /* Texto Secundario */
    --text-light: #94a3b8;
    /* Texto Terciario */

    /* ESTADOS */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* VARIABLES UI */
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --header-height: 60px;
    --nav-height: 60px;
}

/* =========================================
   BASE & RESET
   ========================================= */

/* BOTÓN DE COPIAR (Modern Icon Style) */
.btn-copy,
.btn-copy-below {
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    transition: all 0.2s;
    vertical-align: middle;
}

.btn-copy {
    padding: 6px;
    justify-content: center;
    margin-left: 8px;
    opacity: 0.8;
}

/* New Style: Below Text */
.btn-copy-below {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #f1f5f9;
    color: #64748b;
    margin-top: 5px;
    gap: 6px;
    font-weight: 500;
}

.btn-copy:hover {
    background-color: #eff6ff;
    /* Azul muy suave */
    transform: scale(1.1);
    opacity: 1;
}

.btn-copy-below:hover {
    background-color: #e2e8f0;
    color: var(--primary);
}

.btn-copy svg,
.btn-copy-below svg {
    display: block;
    /* Fix vertical alignment */
}

.btn-copy.copied {
    color: var(--success);
    transform: scale(1.1);
}

/* =========================================
   11. MODERN UPLOAD UI (Glassmorphism)
   ========================================= */

/* DATE SEPARATOR (WhatsApp Style) */
.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 10px 0;
    width: 100%;
    opacity: 0.8;
}

.separator-line {
    height: 1px;
    background: #e2e8f0;
    flex-grow: 1;
}

.separator-text {
    font-size: 0.75em;
    color: #94a3b8;
    background: #f8fafc;
    /* Matches default bg if needed, or transparent */
    padding: 0 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.upload-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin: 15% auto;
    position: relative;
    animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Separator ID | Name | Company */
.mini-separator {
    color: #cbd5e1;
    /* Light gray */
    margin: 0 8px;
    font-weight: 300;
}



@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3em;
    color: #94a3b8;
    margin-bottom: 10px;
    transition: 0.3s;
}

.upload-area:hover .upload-icon {
    color: var(--primary);
    transform: translateY(-5px);
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.doc-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.doc-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.doc-icon {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    margin-right: 12px;
    color: #64748b;
}

.doc-item.pdf .doc-icon {
    background: #fee2e2;
    color: #ef4444;
}

.doc-item.image .doc-icon {
    background: #e0f2fe;
    color: #0ea5e9;
}

.doc-info {
    flex: 1;
    overflow: hidden;
}

.doc-name {
    font-weight: 600;
    color: #334155;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-date {
    font-size: 0.75em;
    color: #94a3b8;
}

.btn-upload-trigger {
    background: white;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload-trigger:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    padding-bottom: calc(var(--nav-height) + 30px);
    /* Espacio para barra inferior */
    line-height: 1.5;
}

/* =========================================
   HEADER & NAVBAR
   ========================================= */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: var(--header-height);
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* MENÚ HAMBURGUESA (Clean style) */
.menu-chofer {
    position: relative;
    /* Contexto para el dropdown */
    display: flex;
    align-items: center;
}

/* El botón ahora es SOLO ICONO */
#btnMenu,
.menu-btn {
    background: transparent !important;
    /* Sin fondo */
    border: none !important;
    /* Sin borde */
    box-shadow: none !important;
    /* Sin sombra */
    color: white !important;
    /* Color blanco */
    font-size: 1.8rem !important;
    /* Tamaño grande para dedo */
    padding: 10px !important;
    /* Área táctil cómoda */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#btnMenu:active {
    transform: scale(0.9);
}

/* MENÚ DESPLEGABLE (Dropdown) */
.menu-opciones {
    position: absolute;
    top: calc(100% + 5px);
    /* Justo debajo del header */
    right: 0;
    background: white;
    min-width: 220px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    /* Oculto por defecto */
    z-index: 2000;
    border: 1px solid #e2e8f0;
}

.menu-opciones.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.menu-opciones a,
.menu-opciones button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: background 0.2s;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

.menu-opciones a:hover,
.menu-opciones button:hover {
    background-color: #f8fafc;
    color: var(--primary);
}

/* Animación soltar */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   BOTTOM NAVIGATION BAR (Móvil)
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 900;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    width: 100%;
    height: 100%;
    transition: color 0.2s;
}

.nav-item span {
    font-size: 1.2rem;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active span {
    transform: translateY(-2px);
}

.nav-item {
    position: relative;
    /* Para posicionar el badge */
}

.nav-item .badge {
    position: absolute;
    top: 5px;
    right: 25%;
    /* Ajustable según el icono */
    width: 10px;
    height: 10px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
    display: none;
    z-index: 999;
    /* Z-index MUY alto */
    pointer-events: none;
}

.nav-item .badge.show {
    display: block;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* =========================================
   COMPONENTES UI: TARJETAS & LISTAS
   ========================================= */
/* Grid de Cargas */
.cargas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .cargas {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tarjeta Individual */
.carga {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.carga:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.carga h2 {
    font-size: 1.1rem;
    margin: 5px 0;
    color: var(--text-main);
}

/* =========================================
   COMPONENTES UI: BOTONES E INPUTS
   ========================================= */
button {
    font-family: inherit;
}

/* Botón Principal (Azul) */
.btn-primary,
button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    transition: 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Inputs */
input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid #cbd5e1;
    background: white;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: border 0.2s;
    margin-top: 5px;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* =========================================
   UTILIDADES ESPECÍFICAS
   ========================================= */
/* Dashboard Chofer */
.metric-card {
    /* (Copiado de tu index.html previo, ahora centralizado) */
    background: linear-gradient(145deg, #1e293b, #0f172a);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-md);
    color: white;
    text-align: center;
}

/* KPI Panel (Mis Cargas) */
.kpi-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* NEW: DETAIL LIST STYLES (Load Card) - COMPACT V2 */
.detail-list-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    /* Reduced padding */
    border-bottom: 1px solid #e2e8f0;
}

.detail-list-item:last-child {
    border-bottom: none;
}

/* =========================================
   ADMIN ROW STYLES (Migrated from dashboard-admin.html)
   ========================================= */
.admin-row {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.admin-row:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    background: #fdfdfd;
}

.admin-row.expanded {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.admin-row-summary {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    flex-wrap: nowrap;
    /* Prevent wrapping */
    gap: 15px;
}

.row-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
    min-width: 0;
    /* Allow flex shrinking */
}

.row-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.admin-row-details {
    display: none;
    padding: 20px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Specific Overrides for Driver Inputs */
.input-rate-compact {
    width: 60px;
    padding: 4px;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9em;
}

.text-profit-row {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 500;
}

.text-net-row {
    font-size: 1.1em;
    font-weight: 700;
    color: #16a34a;
}


.detail-icon {
    width: 32px;
    /* Smaller icon box */
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    /* Tighter spacing */
    flex-shrink: 0;
}

.detail-icon svg {
    width: 16px;
    /* Smaller SVG */
    height: 16px;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75em;
    /* Smaller font as requested */
    font-family: 'Inter', system-ui, sans-serif;
}

.excel-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    /* Increased separation */
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 0.85em;
    /* Slightly larger header relative to body */
    letter-spacing: 0.05em;
}

.excel-table tbody td {
    padding: 10px 12px;
    /* Increased padding for separation */
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.kpi-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.kpi-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Modal */
.modal {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    position: fixed;
    inset: 0;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Alertas */
.mensaje-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 15px;
    border: 1px solid #fecaca;
}

/* =========================================
   COMPACT DRIVER CARD (Pro Style)
   ========================================= */
/* =========================================
   COMPACT DRIVER CARD (Flex Layout - Ultra Pro)
   ========================================= */


/* ATOMIC REFACTOR v12.0 */
.driver-card-fx-container {
    background: white;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.driver-header-fx {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 15px;
    cursor: pointer;
    background: white;
    width: 100%;
}

.driver-header-fx:hover {
    background-color: #f8fafc;
}

/* Force children to stay in row */
.driver-header-fx>div {
    flex-shrink: 0;
}

.driver-header-compact {
    background: white;
    /* Ensure background is explicit */
    width: 100%;
    box-sizing: border-box;
}

.driver-header-compact:hover {
    background-color: #f8fafc;
}

/* ACCORDION HIDDEN STATE */
/* ACCORDION ANIMATION & STATE */
.driver-details {
    display: none;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    padding: 15px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 1. IDENTITY SECTION */
.d-header-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    /* Ensure name has space */
}

/* 2. CENTRAL METRICS (Rate & Loads) */
.d-header-metrics {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

/* 3. FINANCE & ACTIONS (Right) */
.d-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 280px;
    /* Prevent squashing finance info */
    justify-content: flex-end;
}

/* Modern Pill Styles */
.pill-id {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

.pill-loads {
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.85em;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Modern Gradient Button */
.btn-release-modern {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px -2px rgba(14, 165, 233, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-release-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(14, 165, 233, 0.5);
    filter: brightness(1.1);
}

.btn-release-modern:active {
    transform: translateY(0);
}

/* Force items to stay on one line */
.d-header-identity,
.d-header-metrics,
.d-header-actions {
    flex-shrink: 0;
}

/* Financial Text */
.text-profit {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    font-size: 0.8em;
    color: #f97316;
    font-weight: 600;
}

.text-pay {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}

.text-pay span.label {
    font-size: 0.65em;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.text-pay span.value {
    font-size: 1.25em;
    font-weight: 800;
    color: #16a34a;
}

.btn-icon-success-small {
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}

/* Override input-mini for compactness */
.input-micro {
    width: 45px;
    padding: 1px 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    background: white;
}

/* =========================================
   LIGHT THEME POLISH UTILITIES
   ========================================= */
.driver-row {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.driver-row:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.driver-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-radius: 8px;
}

.driver-header:hover {
    background-color: #f8fafc;
}

.badge-subtle {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.input-mini {
    width: 55px;
    padding: 2px 5px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    color: #0f172a;
    background: white;
}

.input-mini:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.btn-icon-success {
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon-success:hover {
    background: #15803d;
}

.load-list-container {
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.load-list-header {
    background: #f1f5f9;
    padding: 8px 12px;
    font-size: 0.75em;
    font-weight: 700;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.5px;
}

.load-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85em;
    transition: background 0.1s;
}

.load-item:last-child {
    border-bottom: none;
}

.load-item:hover {
    background: #f8fafc;
}

.load-id-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

.load-id-badge.paid {
    background: #dcfce7;
    color: #16a34a;
}


/* TABS STYLE */
.admin-tabs {
    display: flex;
    background: white;
    padding: 10px 20px;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    position: sticky;
    top: 60px;
    z-index: 90;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* TOOLBAR & FILTROS */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-refresh {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    color: #475569;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.btn-refresh:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .toolbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        align-items: stretch;
    }

    .toolbar>div {
        justify-content: center;
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .toolbar h3 {
        font-size: 1.2rem !important;
    }

    .admin-list-container {
        padding-bottom: 80px;
        /* Space for bottom nav */
    }
}

/* ACORDEON / LISTA ROW */
.admin-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-row {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.admin-row:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.admin-row.expanded {
    border-color: #2563eb;
}

.admin-row-summary {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-row-summary:hover {
    background: #f8fafc;
}

/* =========================================
   NUEVAS UTILIDADES (REFRACTION)
   ========================================= */

/* BADGES DE ESTADO */
.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: white;
    display: inline-block;
}

.badge-status.disponible {
    background-color: #eab308;
}

.badge-status.tomada {
    background-color: #3b82f6;
}

.badge-status.en_curso {
    background-color: #f97316;
}

.badge-status.completada {
    background-color: #22c55e;
}

/* BOTONES DE ACCIÓN (Tarjetas) */
.action-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-group.vertical {
    flex-direction: column;
}

.btn-action {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s, opacity 0.2s;
}

.btn-action:active {
    transform: scale(0.98);
}

.btn-action.success {
    background: #16a34a;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.4);
}

.btn-action.primary {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}

.btn-action.danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-action.neutral {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.btn-action.upload {
    background: white;
    color: #334155;
    border: 1px solid #cbd5e1;
}

/* TEXTOS Y ALINEACIÓN */
.text-label {
    font-size: 0.7em;
    color: #64748b;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.text-value {
    font-weight: 600;
    color: #334155;
    font-size: 0.95em;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* MAPA */
.map-container {
    height: 200px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    background: #f1f5f9;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* MENSAJES VACÍOS */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 10px;
}

.row-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
    min-width: 250px;
    flex-wrap: wrap;
}

.row-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-row-details {
    display: none;
    padding: 20px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    animation: slideDown 0.3s ease-out;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

/* =========================================
   USER LIST ROW (Drivers/Warehouses)
   ========================================= */
.user-row {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Container for right side actions (Rate + ID) */
.user-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Rate Input Container Styling */
.rate-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.rate-label {
    font-size: 0.7em;
    font-weight: 700;
    color: #94a3b8;
}

.rate-symbol {
    font-size: 0.8em;
    color: #64748b;
}

.user-id-badge {
    font-size: 0.8em;
    color: #cbd5e1;
}

/* MOBILE ADJUSTMENTS */
@media (max-width: 768px) {
    .user-row {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        /* Context for absolute positioning if needed */
    }

    .user-row-actions {
        width: 100%;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f1f5f9;
        justify-content: space-between;
        /* Rate left, ID right */
    }

    /* Make ID bigger/clearer on mobile */
    .user-id-badge {
        font-weight: bold;
        color: #94a3b8;
    }
}

/* =========================================
   HISTORIAL ACORDEON (RESPONSIVE)
   ========================================= */
.history-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.history-summary {
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
    cursor: pointer;
}

.history-summary:active {
    background-color: #f8fafc;
}

.history-details {
    display: none;
    padding: 15px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9em;
    animation: slideDown 0.3s ease-out;
}

.history-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.history-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}

.history-time-row:last-child {
    border-bottom: none;
}

/* MOBILE FIXES */
@media (max-width: 480px) {
    .history-card {
        border-radius: 8px;
    }

    .history-summary {
        padding: 12px;
        gap: 10px;
        grid-template-columns: 1fr 20px;
        /* Flecha fija */
    }

    .history-details {
        padding: 12px;
    }

    .history-details-grid {
        grid-template-columns: 1fr;
        /* Stack total en móvil */
        gap: 15px;
    }

    .history-time-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .history-time-row span:last-child {
        align-self: flex-end;
        /* Alinear fecha a la derecha pero abajo */
        font-size: 0.9em;
    }
}


/* =========================================
   ESTILOS TECH / PRO (Reemplazo Final)
   ========================================= */

/* SVG ICONS */
.icon-tech {
    width: 20px;
    height: 20px;
    stroke: #64748b;
    /* Slate-500 default */
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.icon-tech.large {
    width: 64px;
    height: 64px;
    stroke: #94a3b8;
    /* Slate-400 */
    stroke-width: 1.5;
}

.icon-tech.accent {
    stroke: #3b82f6;
    /* Blue-500 */
}

/* Empty State Tech V2 (Clean) */
/* Empty State Tech V3 (Dark & Pro) */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 20px;
    margin-top: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Subtle glow background effect */
.empty-state::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    z-index: 1;
    animation: rotate 20s linear infinite;
}

.empty-state * {
    position: relative;
    z-index: 2;
}

.empty-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    padding: 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.empty-state h3 {
    color: white !important;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.empty-state p {
    color: #94a3b8 !important;
    font-size: 1rem !important;
    max-width: 300px;
    margin: 0 auto 30px auto !important;
    line-height: 1.5;
}

.btn-tech {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    color: white !important;
    padding: 14px 28px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4) !important;
    transition: all 0.3s ease !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
}

.btn-tech:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.5) !important;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* BOTTOM NAV - CYBER TECH STYLE */
/* BOTTOM NAV - LIGHT GLASS STYLE */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 10px 20px 10px;
    /* Extra bottom padding for mobile safe area */
    position: fixed;
    bottom: 0;
    width: 100%;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 6px 0;
    gap: 4px;
    width: 60px;
    border-radius: 12px;
}

.nav-item svg {
    width: 24px !important;
    height: 24px !important;
    stroke-width: 2;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 0 transparent);
    stroke: currentColor !important;
    /* Force color inheritance */
    display: block !important;
    /* Prevent hidden */
    opacity: 1 !important;
    /* Prevent transparent */
}

.nav-item.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.nav-item.active svg {
    stroke: #3b82f6 !important;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
    transform: translateY(-2px);
}

.nav-item span {
    opacity: 0.8;
    transition: opacity 0.3s;
}

.nav-item:active {
    transform: scale(0.95);
}



/* Tech decorative line */
.empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

/* Icon Container Circle */
.empty-icon-container {
    background: #f8fafc;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1px solid #e2e8f0;
}

.btn-tech {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    /* Deep metal look */
    color: #e2e8f0;
    padding: 14px 32px;
    border-radius: 8px;
    border: 1px solid #334155;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    /* Precision typography */
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    position: relative;
    font-family: 'Inter', sans-serif;
    margin-top: 10px;
}

.btn-tech:hover {
    border-color: #3b82f6;
    /* Electric Blue Accent */
    color: #ffffff;
    background: linear-gradient(145deg, #334155, #1e293b);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    /* Subtle Neon Glow */
    transform: translateY(-2px);
}

.btn-tech:active {
    transform: translateY(1px);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.2);
}


.btn-tech svg {
    stroke: #94a3b8;
    transition: stroke 0.3s ease;
}

.btn-tech:hover svg {
    stroke: #60a5fa;
}


/* Detail Items with SVG (Tech Grid) */
.tech-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    transition: border-color 0.2s;
}

.tech-item:hover {
    border-color: #cbd5e1;
    background: white;
}

.tech-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

/* Clean Header Typography */
.header-bar h1 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}



/* =========================================
   EXCEL-STYLE DATA TABLE (PRO ADMIN)
   ========================================= */
.table-container {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75em;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Updated Header Styles (Colors & Spacing) */
.excel-table thead th {
    background: #e0f2fe;
    /* Light Blue */
    color: #0369a1;
    /* Dark Blue text */
    font-weight: 700;
    text-align: left;
    padding: 10px 15px 10px 20px;
    /* More left spacing */
    border-bottom: 2px solid #bae6fd;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.05em;
}

.excel-table tbody td {
    padding: 10px 15px 10px 20px;
    /* Aligned with header */
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.excel-table tbody tr:last-child td {
    border-bottom: none;
}

.excel-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Specific Column Styles */
.col-id {
    font-family: monospace;
    color: #64748b;
}

.col-money {
    font-weight: 600;
    font-family: monospace;
    font-size: 1.05em;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Status Badges */
.badge-table {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-paid {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
}

.badge-processing {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
}

.badge-pending {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
    border: 1px solid #fde047 !important;
}

/* =========================================
   MOBILE OPTIMIZATIONS (Chofer)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Global Scale Reduction (Aggressive) */
    html {
        font-size: 13.5px;
    }

    body {
        font-size: 13.5px;
    }

    /* 2. Compact Load Cards */
    .carga {
        padding: 12px 15px;
        /* Less padding */
        border-radius: 12px;
    }

    .carga h2 {
        font-size: 1rem;
        /* Smaller titles */
    }

    /* 3. Compact Detail Lists inside Cards */
    /* 3. Compact Detail Lists inside Cards */
    .detail-list-item {
        padding: 4px 0;
        /* Ultra Tighter rows */
        font-size: 0.8em;
        /* Even Smaller text */
    }

    .detail-icon {
        width: 28px;
        /* Smaller icons */
        height: 28px;
        margin-right: 10px;
    }

    .detail-icon svg {
        width: 14px;
        height: 14px;
    }

    /* 4. Compact Excel Tables */
    .excel-table {
        font-size: 0.75em;
        /* Much smaller table font */
    }

    .excel-table thead th,
    .excel-table tbody td {
        padding: 6px 8px;
        /* Tighter cell padding */
    }

    .badge-table {
        padding: 2px 6px;
        font-size: 0.75em;
    }

    /* 5. Compact Inputs */
    input,
    select,
    textarea {
        padding: 8px;
        font-size: 0.95em;
    }

    .btn-primary {
        padding: 10px 16px;
        font-size: 0.9em;
        width: 100%;
        /* Full width buttons on mobile usually better */
    }

    .kpi-panel {
        gap: 10px;
        /* Tighter KPI grid */
    }

    .kpi-card {
        padding: 10px;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    /* Warehouse List: Reduced 30% from 1.25em -> ~0.9em */
    .admin-list-container,
    .admin-row {
        font-size: 0.9em;
    }

    .admin-list-container {
        gap: 6px;
        /* Tighter gap */
    }

    .admin-row-summary {
        padding: 8px 10px;
        /* Tighter padding */
    }

    /* Add Load Form: Increased 5% */
    .card-create,
    #formCrearCarga {
        font-size: 1.05em;
    }
}

/* =========================================
   NEW ROUTE VERTICAL STYLES
   ========================================= */
.route-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 5px;
}

.route-stop {
    display: flex;
    gap: 10px;
    /* Reduced from 15px to move text closer */
    position: relative;
}

.route-stop.pickup {
    margin-bottom: 0;
    min-height: auto;
}

.stop-icon-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
    flex-shrink: 0;
}

/* Dots */
.dot-pickup {
    width: 18px;
    /* Slightly smaller for elegance */
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    border: 3px solid #eff6ff;
    box-shadow: 0 0 0 1px #3b82f6;
    z-index: 2;
}

@keyframes pulse-blue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@-webkit-keyframes pulse-blue {
    0% {
        -webkit-transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        -webkit-transform: scale(1);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        -webkit-transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.dot-pickup.pulsing {
    -webkit-animation: pulse-blue 2s infinite;
    animation: pulse-blue 2s infinite;
    z-index: 10;
    position: relative;
    /* Ensure z-index works */
}

.dot-dropoff {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f97316;
    border: 3px solid #fff7ed;
    box-shadow: 0 0 0 1px #f97316;
    z-index: 2;
}

@keyframes pulse-orange {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

@-webkit-keyframes pulse-orange {
    0% {
        -webkit-transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    }

    70% {
        -webkit-transform: scale(1);
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
    }

    100% {
        -webkit-transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

.dot-dropoff.pulsing {
    -webkit-animation: pulse-orange 2s infinite !important;
    animation: pulse-orange 2s infinite !important;
    z-index: 10;
    position: relative;
}

/* Connector Line */
.line-vertical {
    width: 2px;
    background: repeating-linear-gradient(to bottom, #cbd5e1 0, #cbd5e1 4px, transparent 4px, transparent 8px);
    flex-grow: 1;
    margin-top: 0;
    /* Connected to dot */
    margin-bottom: -10px;
    /* Extend to touch next dot */
}



.route-info-col {
    flex: 1;
}

.route-label {
    font-size: 0.65em;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.route-address-box {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.route-address-text {
    font-size: 0.85rem;
    /* User requested even smaller */
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    margin-top: 2px;
}

.company-name-text {
    margin: 0;
    line-height: 1.2;
    padding-bottom: 2px;
}

.address-text {
    margin: 0;
    line-height: 1.2;
}

/* Mini Copy Button */
.btn-copy-mini {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-copy-mini:hover {
    background: #e2e8f0;
    color: #3b82f6;
}


/* =========================================
   NEW DASHBOARD STYLES (LOAD COUNTS ONLY)
   ========================================= */

.counts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.count-card {
    background: white;
    padding: 20px 10px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    /* Slate 200 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.count-card:active {
    transform: scale(0.95);
}

.count-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Distinct accents for visual separation */
.count-card:nth-child(1) {
    border-top: 5px solid #3b82f6;
}

/* Week - Blue */
.count-card:nth-child(2) {
    border-top: 5px solid #8b5cf6;
}

/* Month - Purple */
.count-card:nth-child(3) {
    border-top: 5px solid #10b981;
}

/* Year - Green */

.count-number {
    font-size: 2.2em;
    /* Bold and big */
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    margin-bottom: 5px;
}

.count-label {
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Mobile check: Ensure they fit side-by-side or stack nicely? 
   3 columns might be tight on very small screens. */
@media (max-width: 360px) {
    .counts-grid {
        grid-template-columns: 1fr;
        /* Stack on tiny screens */
    }
}

/* =========================================
   DASHBOARD CIRCULAR CHART (HIGHLIGHT)
   ========================================= */
.dashboard-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.circle-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    /* Space between circle and sub-stats */
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    /* Stroke Color managed by JS, default Blue */
    stroke: var(--primary);
    transition: stroke-dasharray 1.5s ease-out, stroke 0.5s;
    /* Smooth animation */
}

.circle-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.circle-label {
    font-size: 0.7em;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
    font-weight: 600;
}

.circle-value {
    font-size: 1.6em;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.5px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.stat-mini-card {
    background: #f8fafc;
    padding: 15px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.stat-mini-label {
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
}

/* =========================================
   GLOBAL SPINNER (Option 3: Dual Ring)
   ========================================= */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    width: 100%;
    color: #94a3b8;
}

.spinner-dual {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #3b82f6;
    border-bottom-color: #3b82f6;
    animation: spinDual 1.2s ease-in-out infinite;
    margin: 0 auto 10px auto;
}

@keyframes spinDual {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.stat-mini-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #334155;
}

/* ---------------------------------------------------- */
/* MODERN NOTIFICATIONS (Toasts) */
/* ---------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Allow clicks through container */
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 90vw;
    animation: slideUpFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.toast.success {
    border-left: 5px solid #10b981;
}

.toast.error {
    border-left: 5px solid #ef4444;
}

.toast.warning {
    border-left: 5px solid #f59e0b;
}

.toast.info {
    border-left: 5px solid #3b82f6;
}

.toast-icon {
    font-size: 1.2em;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast-message {
    color: #334155;
    font-weight: 500;
    font-size: 0.95em;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0;
    display: flex;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideDownFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* ---------------------------------------------------- */
/* MODERN CONFIRM MODAL */
/* ---------------------------------------------------- */
.confirm-overlay,
.modal-custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    /* Removed !important to allow inline display:none to work */
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.2s;
}

.modal-edit-card {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 480px;
    height: 85vh;
    /* Force height for internal flex scroll */
    max-height: 800px;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    margin: auto !important;
    position: relative;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden !important;
    z-index: 10001;
}

.modal-edit-header {
    padding: 24px 24px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    flex-shrink: 0 !important;
}

.modal-edit-content {
    padding: 20px 24px;
    overflow-y: auto !important;
    flex: 1 !important;
    background: white;
    scrollbar-width: thin;
}

.modal-edit-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex !important;
    gap: 12px;
    flex-shrink: 0 !important;
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100;
}

.modal-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
    transform: rotate(90deg);
}

.confirm-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

/* Bottom sheet style for mobile */
@media (max-width: 600px) {
    .confirm-overlay {
        align-items: flex-end;
    }

    .confirm-card {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding-bottom: 40px;
        /* Safe area */
        animation: slideUpSheet 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    }
}

.confirm-icon-box {
    width: 60px;
    height: 60px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    margin: 0 auto 15px auto;
}

.confirm-icon-box.info {
    background: #eff6ff;
    color: #3b82f6;
}

.confirm-icon-box.warning {
    background: #fffbeb;
    color: #f59e0b;
}

.confirm-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.confirm-message {
    color: #64748b;
    font-size: 0.95em;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    border: none;
    transition: transform 0.1s;
}

.confirm-btn:active {
    transform: scale(0.96);
}

.confirm-btn.cancel {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.confirm-btn.confirm {
    background: #0f172a;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
}

.confirm-btn.danger {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* =========================================
   12. TECH-GLASS UI (Admin User Creation)
   ========================================= */

.tech-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    min-height: 700px;
}

/* Background animated orbs */
.tech-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 1;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: #3b82f6;
    top: -100px;
    left: -50px;
    animation: floatOrb 8s ease-in-out infinite;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: #8b5cf6;
    bottom: -50px;
    right: -50px;
    animation: floatOrb 10s ease-in-out infinite reverse;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 30px);
    }
}

.tech-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 2.5rem;
    color: white;
}

.tech-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tech-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.tech-header p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.tech-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Floating Labels */
.input-group-tech {
    position: relative;
}

.input-tech {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-tech:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: rgba(15, 23, 42, 0.8);
}

.input-tech:placeholder-shown+.label-tech {
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1rem;
}

.label-tech {
    position: absolute;
    left: 16px;
    top: -10px;
    transform: translateY(0);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 1) 40%, rgba(15, 23, 42, 1) 60%, rgba(15, 23, 42, 0) 100%);
    /* Gradient cheat to mask line behind label without solid bg color mismatch */
    background: #0f172a;
    /* Fallback */
    padding: 0 6px;
    font-size: 0.75rem;
    color: #3b82f6;
    pointer-events: none;
    transition: all 0.3s ease;
    border-radius: 4px;
    z-index: 5;
}

/* Select specifics */
select.input-tech {
    appearance: none;
    cursor: pointer;
}

.input-tech:focus+.label-tech,
.input-tech:not(:placeholder-shown)+.label-tech {
    top: -10px;
    transform: translateY(0);
    font-size: 0.75rem;
    color: #3b82f6;
}

.btn-tech {
    margin-top: 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-tech:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
}

.btn-tech:active {
    transform: scale(0.98);
}

/* Success/Loading Animations */
.btn-tech.loading {
    color: transparent;
}

.btn-tech.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.validation-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
}

.input-tech.valid~.validation-icon {
    opacity: 1;
}

.input-tech.invalid {
    border-color: #ef4444;
}

.input-tech.invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* =========================================
   GALLERY / PREVIEW MODAL
   ========================================= */
.gallery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

.gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #0f172a;
    /* Dark background for focus */
    border-radius: 8px;
    min-height: 400px;
}

.gallery-main img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.gallery-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    object-fit: cover;
    transition: all 0.2s;
    background: #1e293b;
}

.gallery-thumb.active {
    border-color: var(--primary);
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumb:hover {
    opacity: 1;
}

.doc-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 10;
}

/* ---------------------------------------------------- */
/* ADMIN ACTION BUTTONS */
/* ---------------------------------------------------- */
.btn-action {
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-action.info {
    background: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-action.info:hover {
    background: #2563eb;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-action.danger {
    background: #ef4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-action.danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-action.success {
    background: #10b981;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-action.success:hover {
    background: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-action.upload {
    background: #8b5cf6;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.btn-action.upload:hover {
    background: #7c3aed;
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}