/* Reset y variables - Diseño Elegante */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d97706;
    --primary-dark: #92400e;
    --primary-light: #f59e0b;
    --secondary-color: #78716c;
    --accent-color: #ea580c;
    --success-color: #0d9488;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #78716c;
    
    --bg-gradient: linear-gradient(135deg, #1c1917 0%, #44403c 100%);
    --bg-color: #fafaf9;
    --bg-secondary: #f5f5f4;
    --card-bg: #ffffff;
    --card-bg-hover: #fafaf9;
    --text-color: #1c1917;
    --text-secondary: #57534e;
    --text-light: #a8a29e;
    --border-color: #e7e5e4;
    --border-light: #f5f5f4;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-display: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg-color);
    background-image: url('https://controlmarvi.com/img/Marvi2-fa410e55-2304w.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Tipografía Marvi — misma línea que el login */
h1, h2, h3, h4, h5, h6,
.dashboard-title,
.dashboard-eyebrow,
.section-title,
.section-eyebrow,
.chofer-section-title,
.nav-brand-text,
.btn,
.btn-hero-action,
.stat-card-value,
.stat-card-label,
.modal-ruta-header-text h2,
.empresa-card-name,
.ruta-title,
.page-header h2 {
    font-family: var(--font-display);
}

.dashboard-eyebrow,
.section-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.95);
}

.dashboard-title,
.section-title {
    font-weight: 700;
    letter-spacing: -0.04em;
}

.dashboard-subtitle,
.section-subtitle {
    color: rgba(250, 250, 249, 0.68);
    font-weight: 400;
    line-height: 1.65;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(250, 250, 249, 0.88) 0%, rgba(245, 245, 244, 0.92) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background: rgba(28, 25, 23, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.18);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    min-height: 68px;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.nav-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.25s;
}

.nav-logo:hover {
    transform: scale(1.04);
}

.nav-brand-text {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: #fafaf9;
    letter-spacing: -0.03em;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: rgba(250, 250, 249, 0.65);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
    display: block;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.nav-link::before {
    display: none;
}

.nav-link:hover {
    color: #fafaf9;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #fafaf9;
    background: rgba(217, 119, 6, 0.22);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.nav-link-logout {
    color: rgba(250, 250, 249, 0.55);
    margin-left: 0.25rem;
}

.nav-link-logout:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    padding: 0.625rem;
    gap: 5px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: #fafaf9;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Main content */
.main-content {
    min-height: calc(100vh - 80px);
    padding: 3rem 0;
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(1px);
    z-index: -1;
    pointer-events: none;
}

.page {
    display: none !important;
    animation: fadeIn 0.4s ease-in-out;
}

.page.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.page-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.04em;
    margin: 0;
}

.page-header p {
    margin: 0;
    font-size: 1rem;
}

/* Cards Elegantes y Ejecutivas */
.card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 8px 28px rgba(28, 25, 23, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    border: 1px solid rgba(231, 229, 228, 0.9);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(217, 119, 6, 0.25);
    background: rgba(255, 255, 255, 0.98);
}

.card:hover::before {
    transform: scaleX(1);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.card p {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -1px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Dashboard — Página de inicio */
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.5rem 2.75rem;
    margin-bottom: 2.5rem;
    background:
        radial-gradient(ellipse 70% 80% at 90% 20%, rgba(217, 119, 6, 0.22) 0%, transparent 55%),
        linear-gradient(135deg, #0c0a09 0%, #1c1917 48%, #44403c 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 50px rgba(28, 25, 23, 0.25);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
    flex: 1;
}

.dashboard-eyebrow {
    margin-bottom: 0.75rem;
}

.dashboard-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: #fafaf9;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.dashboard-title span {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-subtitle {
    font-size: 1rem;
    max-width: 480px;
    margin: 0;
}

.dashboard-hero-actions {
    margin-top: 1.25rem;
    position: relative;
    z-index: 1;
}

.empleado-cta {
    display: none !important;
}

.empleado-cta.is-visible {
    display: block !important;
}

.dashboard-hero-actions.empleado-cta.is-visible {
    display: block !important;
}

.stat-card-action-btn.empleado-cta.is-visible {
    display: inline-flex !important;
}

.stat-card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.28);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 2;
}

.stat-card-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.35);
}

.dashboard-hero-badge {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 50%;
    backdrop-filter: blur(8px);
}

.dashboard-hero-logo {
    height: 56px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(28, 25, 23, 0.06);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.1);
    border-color: rgba(217, 119, 6, 0.28);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 18px 18px 0 0;
}

.stat-card-rutas::after {
    background: linear-gradient(90deg, #92400e, #f59e0b);
}

.stat-card-reservas::after {
    background: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.stat-card-reservas {
    overflow: visible;
}

.stat-card-buses::after {
    background: linear-gradient(90deg, #44403c, #a8a29e);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(28, 25, 23, 0.1);
    border-color: rgba(217, 119, 6, 0.2);
}

.stat-card-top {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 22px;
    height: 22px;
}

.stat-card-rutas .stat-card-icon {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.stat-card-reservas .stat-card-icon {
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
}

.stat-card-buses .stat-card-icon {
    background: rgba(68, 64, 60, 0.1);
    color: #44403c;
}

.stat-card-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.stat-card-value {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin: 0 0 0.5rem;
}

.stat-card-rutas .stat-card-value {
    color: #b45309;
}

.stat-card-reservas .stat-card-value {
    color: #0f766e;
}

.stat-card-buses .stat-card-value {
    color: #44403c;
}

.stat-card-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin: 0;
}

/* Sección — encabezados de página */
.section-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    border-radius: 18px;
    flex-wrap: wrap;
}

.section-hero-empresas {
    background:
        radial-gradient(ellipse 70% 80% at 90% 10%, rgba(217, 119, 6, 0.2) 0%, transparent 55%),
        linear-gradient(135deg, #0c0a09 0%, #1c1917 55%, #44403c 100%);
    box-shadow: 0 16px 40px rgba(28, 25, 23, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.section-hero-empresas::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.section-hero-content {
    position: relative;
    z-index: 1;
}

.section-eyebrow {
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #fafaf9;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.9375rem;
    margin: 0;
    max-width: 520px;
}

.btn-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(146, 64, 14, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.btn-hero-action svg {
    width: 18px;
    height: 18px;
}

.btn-hero-secondary {
    background: #fff;
    color: var(--primary-dark);
    border: 1.5px solid rgba(146, 64, 14, 0.25);
    box-shadow: 0 2px 8px rgba(28, 25, 23, 0.06);
}

.btn-hero-secondary:hover {
    background: rgba(251, 191, 36, 0.12);
    box-shadow: 0 4px 12px rgba(146, 64, 14, 0.15);
}

.btn-hero-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(146, 64, 14, 0.4);
}

/* Grid de empresas */
.empresas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.empresa-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.05);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.empresa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.1);
    border-color: rgba(217, 119, 6, 0.25);
}

.empresa-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.empresa-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--primary-dark);
    font-size: 1.125rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.empresa-card-title h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.25rem;
    letter-spacing: -0.2px;
}

.empresa-nit {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.empresa-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-light);
}

.empresa-info-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.empresa-info-row svg {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    flex-shrink: 0;
}

.empresa-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.5rem;
}

.empresa-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.empresa-action-btn svg {
    width: 15px;
    height: 15px;
}

.empresa-action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-light);
    color: var(--text-color);
}

.empresa-action-primary {
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.2);
    color: var(--primary-dark);
}

.empresa-action-primary:hover {
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.35);
    color: var(--primary-dark);
}

.empresa-action-link {
    color: #0f766e;
    border-color: rgba(13, 148, 136, 0.25);
    background: rgba(13, 148, 136, 0.08);
}

.empresa-action-link:hover:not(:disabled) {
    background: rgba(13, 148, 136, 0.16);
    border-color: rgba(13, 148, 136, 0.4);
    color: #0f766e;
}

.empresa-action-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.empresa-action-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

.empresas-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 2px dashed var(--border-color);
    border-radius: 18px;
}

.empresas-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 16px;
    background: rgba(217, 119, 6, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.empresas-empty-icon svg {
    width: 32px;
    height: 32px;
}

.empresas-empty h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empresas-empty p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

/* Modal Empresa */
.modal-empresa-content {
    max-width: 560px;
    padding: 0;
    overflow: hidden;
}

.modal-empresa-content::before {
    display: none;
}

.modal-empresa-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.75rem 1.75rem 1.25rem;
    background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-empresa-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(217, 119, 6, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
}

.modal-empresa-header-icon svg {
    width: 22px;
    height: 22px;
}

.modal-empresa-header-text {
    flex: 1;
    min-width: 0;
}

.modal-empresa-header-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fafaf9;
    margin: 0 0 0.25rem;
    letter-spacing: -0.3px;
}

.modal-empresa-header-text p {
    font-size: 0.8125rem;
    color: rgba(250, 250, 249, 0.6);
    margin: 0;
    line-height: 1.5;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(250, 250, 249, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fafaf9;
}

.modal-empresa-form {
    padding: 1.5rem 1.75rem 1.75rem;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
}

.modal-field-full {
    grid-column: 1 / -1;
}

.modal-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.modal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.modal-input-icon {
    position: absolute;
    left: 0.875rem;
    width: 16px;
    height: 16px;
    color: var(--text-light);
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
}

.modal-input-wrap-textarea .modal-input-icon {
    top: 0.875rem;
    align-self: flex-start;
}

.modal-input-wrap input,
.modal-input-wrap textarea {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--bg-color);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.modal-input-wrap textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-input-wrap input::placeholder,
.modal-input-wrap textarea::placeholder {
    color: var(--text-light);
}

.modal-input-wrap input:focus,
.modal-input-wrap textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

.modal-input-wrap:focus-within .modal-input-icon {
    color: var(--primary-color);
}

.modal-empresa-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.btn-modal-save {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modal-save svg {
    width: 16px;
    height: 16px;
}

/* Botón volver */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem 0.375rem 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(250, 250, 249, 0.75);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-back svg {
    width: 16px;
    height: 16px;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fafaf9;
}

.section-hero-rutas,
.section-hero-choferes,
.section-hero-buses,
.section-hero:not(.section-hero-empresas) {
    background:
        radial-gradient(ellipse 70% 80% at 90% 10%, rgba(217, 119, 6, 0.18) 0%, transparent 55%),
        linear-gradient(135deg, #0c0a09 0%, #1c1917 55%, #44403c 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.section-hero-choferes::before,
.section-hero-buses::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 280px;
    height: 280px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.14) 0%, transparent 70%);
}

.section-hero-choferes::before {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.14) 0%, transparent 70%);
}

.section-hero-buses::before {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.14) 0%, transparent 70%);
}

.usuario-modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: -0.5rem 0 1.25rem;
    line-height: 1.5;
}

.reserva-dias-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: 1rem 0 0.5rem;
}

.ruta-agenda-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.125rem;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    background: #f8fafc;
}

.ruta-agenda-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.ruta-agenda-title {
    margin: 0 0 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
}

.ruta-agenda-desc {
    margin: 0;
}

.ruta-agenda-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ruta-fechas-agenda-grid {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.ruta-agenda-semana-label {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.ruta-agenda-semana-dias {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.375rem;
}

@media (max-width: 640px) {
    .ruta-agenda-semana-dias {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ruta-agenda-fecha-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.5rem 0.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    font: inherit;
    position: relative;
}

.ruta-agenda-fecha-card:disabled {
    cursor: not-allowed;
}

.ruta-agenda-fecha-activa {
    border-color: rgba(217, 119, 6, 0.65);
    background: rgba(251, 191, 36, 0.18);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
}

.ruta-agenda-fecha-opera {
    border-color: rgba(59, 130, 246, 0.35);
}

.ruta-agenda-fecha-no-opera {
    opacity: 0.5;
}

.ruta-agenda-fecha-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.125rem;
}

.ruta-agenda-fecha-pasada {
    opacity: 0.45;
    cursor: not-allowed;
}

.ruta-agenda-fecha-dia {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.ruta-agenda-fecha-num {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-color);
}

.ruta-reservas-block {
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}

.ruta-reservas-list {
    max-height: 220px;
    overflow: auto;
    margin-top: 0.5rem;
}

.ruta-reservas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.ruta-reservas-table th,
.ruta-reservas-table td {
    padding: 0.5rem 0.625rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.ruta-reservas-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: #fff;
    position: sticky;
    top: 0;
}

.ruta-reserva-pasada {
    opacity: 0.65;
}

.ruta-reserva-estado {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
    background: #e2e8f0;
    color: #475569;
}

.ruta-reserva-estado-confirmada {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.ruta-reserva-estado-pendiente {
    background: rgba(251, 191, 36, 0.2);
    color: #b45309;
}

.reserva-dia-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
}

.reserva-dia-card:has(.reserva-dia-check:checked) {
    border-color: rgba(217, 119, 6, 0.4);
    background: rgba(251, 191, 36, 0.08);
}

.reserva-dia-fecha {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

.reserva-dia-tipo {
    min-width: 140px;
    padding: 0.375rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.8125rem;
    background: #fff;
}

.reserva-card-hoy {
    border-color: rgba(217, 119, 6, 0.35);
    box-shadow: 0 8px 28px rgba(217, 119, 6, 0.12);
}

.reserva-companeros-block {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.08) 0%, rgba(248, 250, 252, 1) 100%);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.reserva-companeros-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.reserva-companeros-head strong {
    font-size: 0.9375rem;
    color: var(--text-color);
}

.reserva-companeros-head span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.reserva-mi-turno {
    margin: 0 0 0.625rem;
    padding: 0.4375rem 0.625rem;
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-left: 2px solid rgba(217, 119, 6, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.reserva-mi-turno-kicker {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #92400e;
    line-height: 1.3;
}

.reserva-mi-turno small {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #78716c;
    line-height: 1.35;
}

.reserva-mi-turno-now {
    background: rgba(255, 251, 235, 0.9);
    border-color: rgba(217, 119, 6, 0.22);
    border-left-color: #d97706;
}

.reserva-mi-turno-now .reserva-mi-turno-kicker {
    color: #b45309;
}

.reserva-mi-turno-done .reserva-mi-turno-kicker {
    color: #047857;
}

.reserva-mi-turno-done {
    border-left-color: #10b981;
}

.reserva-mi-turno-miss .reserva-mi-turno-kicker {
    color: #b91c1c;
}

.reserva-mi-turno-miss {
    border-left-color: #ef4444;
}

.reserva-companeros-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reserva-companero {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    gap: 0.625rem;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border-color);
}

.reserva-companero-me {
    border-color: rgba(217, 119, 6, 0.45);
    background: rgba(255, 251, 235, 0.9);
}

.reserva-companero-num {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.8125rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
}

.reserva-companero-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.reserva-companero-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

.reserva-companero-name em {
    font-style: normal;
    color: #b45309;
    font-weight: 700;
}

.reserva-companero-parada {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reserva-companero-estado {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.reserva-companero-pending .reserva-companero-estado {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.reserva-companero-done {
    opacity: 0.72;
}

.reserva-companero-done .reserva-companero-estado {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.reserva-companero-miss .reserva-companero-estado {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.reserva-companero-now {
    border-color: rgba(217, 119, 6, 0.5);
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.15);
}

.reserva-companero-now .reserva-companero-num {
    background: #d97706;
    color: #fff;
}

.reserva-companero-now .reserva-companero-estado {
    background: rgba(217, 119, 6, 0.18);
    color: #92400e;
}

.form-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.125rem;
    margin-top: 0.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: #f8fafc;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.form-toggle-row:has(input:checked) {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.07);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.form-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.form-toggle-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
}

.form-toggle-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.form-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
}

.form-toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.form-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.25s ease;
}

.form-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-toggle-switch input:checked + .form-toggle-slider {
    background: #10b981;
}

.form-toggle-switch input:checked + .form-toggle-slider::before {
    transform: translateX(20px);
}

.form-toggle-switch input:focus-visible + .form-toggle-slider {
    outline: 2px solid rgba(217, 119, 6, 0.55);
    outline-offset: 2px;
}

.form-toggle-switch:hover .form-toggle-slider {
    background: #94a3b8;
}

.form-toggle-switch input:checked:hover + .form-toggle-slider {
    background: #059669;
}

/* Admin — Choferes y Buses */
.admin-entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.admin-entity-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.admin-entity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.1);
    border-color: rgba(217, 119, 6, 0.25);
}

.admin-entity-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-entity-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.125rem;
}

.admin-entity-avatar-chofer {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.admin-entity-avatar-bus {
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.admin-entity-avatar-bus svg {
    width: 24px;
    height: 24px;
}

.admin-entity-info h3 {
    margin: 0 0 0.375rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-color);
}

.entity-estado-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
}

.entity-estado-activo {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.entity-estado-inactivo {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.admin-entity-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.admin-entity-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.admin-entity-row svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.65;
}

.admin-entity-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.usuario-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.usuario-card-actions .empresa-action-btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 2.25rem;
    white-space: nowrap;
}

.usuario-card-actions .empresa-action-btn-usuario-wide {
    flex: 1 1 100%;
}

@media (min-width: 420px) {
    .usuario-card-actions .empresa-action-btn-usuario-wide {
        flex: 1 1 auto;
    }
}

.admin-entity-avatar-empleado {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.admin-entity-avatar-admin-empresa {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.entity-tipo-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
}

.entity-tipo-empleado {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.entity-tipo-admin-empresa {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.usuario-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.admin-entity-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
}

.admin-entity-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-entity-empty-icon svg {
    width: 32px;
    height: 32px;
}

.admin-entity-empty h3 {
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.admin-entity-empty p {
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
}

/* Vista rutas de empresa */
.rutas-empresa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.ruta-empresa-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.05);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.ruta-empresa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0f766e, #2dd4bf);
    border-radius: 16px 16px 0 0;
}

.ruta-empresa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.1);
    border-color: rgba(13, 148, 136, 0.25);
}

.ruta-empresa-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.ruta-empresa-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ruta-empresa-icon svg {
    width: 22px;
    height: 22px;
}

.ruta-empresa-info h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.375rem;
    letter-spacing: -0.2px;
}

.ruta-estado-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
}

.ruta-estado-activa {
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.ruta-estado-en-curso {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.ruta-estado-pendiente {
    background: rgba(107, 114, 128, 0.1);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.ruta-estado-inactiva {
    background: rgba(120, 113, 108, 0.1);
    color: #78716c;
    border: 1px solid rgba(120, 113, 108, 0.2);
}

.ruta-empresa-route {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.ruta-empresa-stop {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ruta-stop-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.ruta-stop-start {
    background: #0f766e;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.ruta-stop-end {
    background: #b45309;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.ruta-stop-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 0.125rem;
}

.ruta-stop-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

.ruta-empresa-line {
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, #0f766e, #b45309);
    margin: 0.375rem 0 0.375rem 4px;
    border-radius: 2px;
}

.ruta-empresa-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-asignacion-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.field-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.field-hint:empty {
    display: none;
}

.dias-semana-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ruta-asignaciones-header {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.ruta-asignaciones-grid {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-color);
}

.ruta-asign-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.ruta-asign-table th,
.ruta-asign-table td {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.ruta-asign-table th {
    background: rgba(13, 148, 136, 0.06);
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.ruta-asign-table th.ruta-asign-am {
    color: #b45309;
    border-top: 2px solid #f59e0b;
}

.ruta-asign-table th.ruta-asign-pm {
    color: #4338ca;
    border-top: 2px solid #6366f1;
}

.ruta-asign-table tr:last-child td {
    border-bottom: none;
}

.ruta-asign-table tr.ruta-asign-inactive td {
    opacity: 0.45;
}

.ruta-asign-day {
    font-weight: 700;
    white-space: nowrap;
    min-width: 3.5rem;
}

.ruta-asign-table select {
    width: 100%;
    min-width: 7rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8125rem;
    background: #fff;
}

.ruta-bus-picker {
    position: relative;
    min-width: 9rem;
}

.ruta-bus-picker-input {
    width: 100%;
    padding: 0.4rem 1.75rem 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8125rem;
    background: #fff;
}

.ruta-bus-picker-input:focus {
    outline: none;
    border-color: rgba(13, 148, 136, 0.55);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.12);
}

.ruta-bus-picker-clear {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.ruta-bus-picker-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.ruta-bus-picker-list {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.ruta-bus-picker-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.8125rem;
}

.ruta-bus-picker-option:hover,
.ruta-bus-picker-option:focus {
    background: rgba(13, 148, 136, 0.08);
    outline: none;
}

.ruta-bus-picker-option strong {
    color: var(--text-primary);
}

.ruta-bus-picker-option span {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.ruta-bus-picker-empty {
    padding: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
}

.ruta-empresa-actions .empresa-action-btn + .empresa-action-btn,
.ruta-actions .ruta-tracking-btn + .ruta-tracking-btn {
    margin-left: 0.35rem;
}

.dia-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.dia-checkbox input {
    accent-color: #0d9488;
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.dia-checkbox:has(input:checked) {
    border-color: rgba(13, 148, 136, 0.45);
    background: rgba(13, 148, 136, 0.08);
    color: #0f766e;
}

.dia-checkbox:hover {
    border-color: rgba(13, 148, 136, 0.35);
}

.ruta-empresa-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.ruta-empresa-meta svg {
    width: 14px;
    height: 14px;
    color: var(--text-light);
}

.ruta-empresa-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.rutas-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 2px dashed var(--border-color);
    border-radius: 18px;
}

.rutas-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 16px;
    background: rgba(13, 148, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f766e;
}

.rutas-empty-icon svg {
    width: 32px;
    height: 32px;
}

.rutas-empty h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.rutas-empty p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

/* Modal Ruta */
.modal.modal-ruta .modal-content.modal-ruta-content {
    max-width: 90vw;
    width: 90vw;
    margin: 1.5rem auto;
    padding: 0;
    overflow: hidden;
}

.modal-ruta-content::before {
    display: none;
}

.modal-ruta-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.75rem 1.75rem 1.25rem;
    background: linear-gradient(135deg, #1c1917 0%, #134e4a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-ruta-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.15);
    border: 1px solid rgba(45, 212, 191, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5eead4;
    flex-shrink: 0;
}

.modal-ruta-header-icon svg {
    width: 22px;
    height: 22px;
}

.modal-ruta-header-text {
    flex: 1;
    min-width: 0;
}

.modal-ruta-header-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fafaf9;
    margin: 0 0 0.25rem;
}

.modal-ruta-header-text p {
    font-size: 0.8125rem;
    color: rgba(250, 250, 249, 0.6);
    margin: 0;
}

.modal-ruta-form {
    padding: 1.5rem 2rem 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.modal-ruta-form-grid {
    grid-template-columns: 1fr 2fr;
    gap: 1rem 1.5rem;
}

.modal-field-span-2 {
    grid-column: span 1;
}

@media (min-width: 900px) {
    .modal-ruta-form-grid {
        grid-template-columns: 1fr 2fr;
    }

    .modal-ruta-form-grid .modal-field-full {
        grid-column: 1 / -1;
    }

    .parada-form-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.modal-input-wrap select {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--bg-color);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input-wrap select:focus {
    outline: none;
    border-color: #0d9488;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.modal-paradas-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.modal-paradas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.modal-paradas-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.25rem;
}

.modal-paradas-header p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

.btn-add-parada {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px dashed rgba(13, 148, 136, 0.4);
    border-radius: 10px;
    background: rgba(13, 148, 136, 0.06);
    color: #0f766e;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-add-parada svg {
    width: 16px;
    height: 16px;
}

.btn-add-parada:hover {
    background: rgba(13, 148, 136, 0.12);
    border-color: rgba(13, 148, 136, 0.6);
}

.paradas-add-bottom {
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.btn-add-parada-wide {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
}

.paradas-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.paradas-container[hidden],
.paradas-container:empty {
    display: none !important;
}

.paradas-container:empty::after {
    content: none;
    display: none;
}

.ruta-empleados-por-dia {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.ruta-emp-tablist {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.5rem;
    overflow-x: auto;
    background: rgba(28, 25, 23, 0.03);
    border-bottom: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.ruta-emp-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s, color 0.15s;
}

.ruta-emp-tab:hover {
    background: rgba(217, 119, 6, 0.08);
    color: var(--text-color);
}

.ruta-emp-tab.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #fff;
    box-shadow: 0 4px 12px rgba(146, 64, 14, 0.28);
}

.ruta-emp-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

.ruta-emp-tab.active .ruta-emp-tab-count {
    background: rgba(255, 255, 255, 0.22);
}

.ruta-emp-panels {
    position: relative;
}

.ruta-emp-panel {
    display: none;
    padding: 0.85rem;
    max-height: 280px;
    overflow-y: auto;
}

.ruta-emp-panel.active {
    display: block;
}

.ruta-emp-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ruta-emp-panel-toolbar strong {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.ruta-emp-panel-actions {
    display: flex;
    gap: 0.4rem;
}

.ruta-emp-panel-actions button {
    appearance: none;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
}

.ruta-emp-panel-actions button:hover {
    border-color: rgba(217, 119, 6, 0.4);
    color: var(--primary-dark);
    background: rgba(217, 119, 6, 0.06);
}

.ruta-emp-dia-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.45rem;
}

.ruta-emp-dia-list label,
.ruta-emp-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.65rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    cursor: pointer;
    font-size: 0.875rem;
    min-height: 3.25rem;
}

.ruta-emp-dia-list label:hover,
.ruta-emp-row:hover {
    border-color: rgba(217, 119, 6, 0.35);
    background: rgba(217, 119, 6, 0.05);
}

.ruta-emp-dia-list label:has(input:checked),
.ruta-emp-row:has(input:checked) {
    border-color: rgba(217, 119, 6, 0.45);
    background: rgba(217, 119, 6, 0.08);
}

.ruta-emp-dia-list label input[type="checkbox"],
.ruta-emp-row > input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.ruta-emp-row-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.ruta-emp-row-name {
    font-weight: 600;
    line-height: 1.3;
}

.ruta-emp-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

.ruta-emp-tipo {
    width: 100%;
    max-width: 100%;
    margin-top: 0.1rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 0.8rem;
    color: var(--text-color);
    cursor: pointer;
}

.ruta-emp-tipo:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--bg-color);
}

.ruta-emp-badge-reserva {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 600;
    vertical-align: middle;
}

.ruta-emp-dia-empty {
    padding: 1.5rem 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

.ruta-horarios-grid {
    margin-top: 0.25rem;
}

.ruta-preview-wrap {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.ruta-empleados-save-hint {
    margin-top: 0.75rem !important;
    margin-bottom: 0;
}

.ruta-map-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.ruta-map-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ruta-map-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ruta-map-tab:hover {
    border-color: var(--primary-color);
    color: var(--text-color);
}

.ruta-map-tab[data-sentido="am"].active {
    background: rgba(245, 158, 11, 0.12);
    border-color: #f59e0b;
    color: #b45309;
}

.ruta-map-tab[data-sentido="pm"].active {
    background: rgba(99, 102, 241, 0.12);
    border-color: #6366f1;
    color: #4338ca;
}

.ruta-map-panel {
    position: relative;
}

.ruta-route-map {
    width: 100%;
    height: 560px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: #e5e7eb;
}

.ruta-map-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-color);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.ruta-endpoints-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ruta-preview-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ruta-preview-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
}

.ruta-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

.ruta-endpoint-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    min-height: 0;
}

.ruta-endpoint-am {
    border-top: 3px solid #f59e0b;
}

.ruta-endpoint-pm {
    border-top: 3px solid #6366f1;
}

.ruta-endpoint-card strong {
    display: block;
    font-size: 0.8125rem;
    margin-bottom: 0.35rem;
    color: var(--primary-color);
}

.ruta-endpoint-card p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.ruta-endpoints-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.ruta-endpoints-compare {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.ruta-endpoints-warn {
    color: #b45309;
}

.ruta-chain-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
    line-height: 1.35;
}

.ruta-chain-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.ruta-chain-list li {
    margin: 0.15rem 0;
}

.ruta-chain-list li:last-child strong {
    color: var(--primary-color);
}

@media (max-width: 720px) {
    .ruta-preview-grid {
        grid-template-columns: 1fr;
    }

    .ruta-route-map {
        height: 480px;
    }
}

.ruta-empresa-locked-label {
    display: block;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    font-weight: 600;
}

/* legacy blocks (por si quedan) */
.ruta-emp-dia-block {
    display: none;
}

.parada-item {
    background: var(--bg-color);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.parada-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.parada-item-number {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-color);
}

.parada-item-number span {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.15);
    color: #0f766e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.parada-remove-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.375rem;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.parada-remove-btn svg {
    width: 16px;
    height: 16px;
}

.parada-remove-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.parada-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem 1rem;
}

.parada-field-full {
    grid-column: 1 / -1;
}

.parada-form-grid .modal-field label {
    font-size: 0.75rem;
    margin-bottom: 0.375rem;
}

.parada-form-grid input,
.parada-form-grid textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-color);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.parada-form-grid input:focus,
.parada-form-grid textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.modal-ruta-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Estilos específicos para tarjetas de rutas */
.ruta-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    overflow: hidden;
    position: relative;
}

.ruta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-left-color: var(--primary-color);
}

.ruta-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.ruta-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(30, 64, 175, 0.2);
    flex-shrink: 0;
}

.ruta-title-section {
    flex: 1;
    min-width: 0;
}

.ruta-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.ruta-estado {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ruta-activa {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.ruta-inactiva {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.1) 0%, rgba(148, 163, 184, 0.1) 100%);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.estado-icon {
    font-size: 0.75rem;
}

.ruta-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ruta-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(30, 64, 175, 0.03);
    border-radius: 10px;
    transition: all 0.2s;
}

.ruta-info-item:hover {
    background: rgba(30, 64, 175, 0.06);
    transform: translateX(4px);
}

.ruta-info-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 64, 175, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.ruta-info-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.ruta-info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ruta-info-value {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ruta-info-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.35;
    color: #78716c;
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
}

.ruta-info-item-hora .ruta-info-value {
    white-space: normal;
}

@media (min-width: 640px) {
    .ruta-info-item-hora {
        grid-column: span 2;
    }
}

.ruta-ruta {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.02) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-radius: 12px;
    border: 1px solid rgba(30, 64, 175, 0.1);
}

.ruta-origen,
.ruta-destino {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ruta-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding-left: 28px;
}

.ruta-line-dash {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

.ruta-line-dots {
    color: var(--primary-color);
    font-size: 0.75rem;
    letter-spacing: 0.25rem;
}

.ruta-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ruta-marker-start {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.ruta-marker-end {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.ruta-location {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.ruta-location-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ruta-location-name {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ruta-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
}

.ruta-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.ruta-actions .btn span {
    font-size: 1rem;
}

/* Forms Elegantes */
.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    letter-spacing: -0.2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-control {
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Buttons Elegantes */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn::before {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(146, 64, 14, 0.28);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(146, 64, 14, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, #64748b 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Página de Login — Split Screen */
:root {
    --login-accent: #d97706;
    --login-accent-dark: #92400e;
    --login-accent-light: #f59e0b;
    --login-surface: #fafaf9;
    --login-dark: #1c1917;
}

body.login-active {
    overflow: hidden;
}

body.login-active .navbar {
    display: none;
}

body.login-active .main-content {
    padding: 0;
    min-height: 100vh;
}

body.login-active .main-content::before {
    display: none;
}

.login-page {
    min-height: 100vh;
    padding: 0;
    background: var(--login-surface);
}

.login-page.active {
    display: flex !important;
}

.login-page:not(.active) {
    display: none !important;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
}

/* Panel izquierdo — marca */
.login-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: url('https://controlmarvi.com/img/Marvi2-fa410e55-2304w.webp') center / cover no-repeat;
    overflow: hidden;
}

.login-brand-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(217, 119, 6, 0.28) 0%, transparent 55%),
        linear-gradient(
            155deg,
            rgba(12, 10, 9, 0.94) 0%,
            rgba(28, 25, 23, 0.88) 48%,
            rgba(68, 40, 12, 0.72) 100%
        );
    pointer-events: none;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
    color: #fff;
    animation: loginSlideIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-brand-logo {
    height: 72px;
    width: auto;
    margin-bottom: 1.75rem;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.login-brand-title {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 3.2vw, 2.65rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin: 0 0 1rem;
}

.login-brand-eyebrow {
    display: inline-block;
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.9);
}

.login-brand-tagline {
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin: 0 0 2.75rem;
    font-weight: 400;
    max-width: 22em;
}

.login-brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.login-brand-features li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    border-radius: 0;
    border-left: none;
    border-right: none;
    backdrop-filter: none;
    animation: loginFeatureIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-brand-features li:nth-child(1) { animation-delay: 0.25s; }
.login-brand-features li:nth-child(2) { animation-delay: 0.38s; }
.login-brand-features li:nth-child(3) { animation-delay: 0.5s; }

.login-feature-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
    color: #fbbf24;
    font-size: inherit;
}

.login-feature-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.login-feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.login-feature-text strong {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.96);
}

.login-feature-text em {
    font-style: normal;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
}

/* Panel derecho — formulario */
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: var(--login-surface);
}

.login-card {
    width: 100%;
    max-width: 400px;
    animation: loginFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.login-card-header {
    margin-bottom: 2.25rem;
}

.login-card-header h2 {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--login-dark);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.login-card-header h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--login-accent-dark), var(--login-accent-light));
    border-radius: 2px;
    margin-top: 0.75rem;
}

.login-card-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}

.login-input-wrap input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input-wrap:has(.login-toggle-password) input {
    padding-right: 2.75rem;
}

.login-input-wrap input::placeholder {
    color: #94a3b8;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: var(--login-accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.12);
}

.login-input-wrap:focus-within .login-input-icon {
    color: var(--login-accent);
}

.login-toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.login-toggle-password:hover {
    color: #475569;
    background: #f1f5f9;
}

.login-toggle-password svg {
    width: 18px;
    height: 18px;
}

.login-error {
    padding: 0.875rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.9375rem 1.5rem;
    margin-top: 0.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--login-accent-dark) 0%, var(--login-accent) 100%);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 14px rgba(146, 64, 14, 0.3);
}

.login-submit svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(146, 64, 14, 0.38);
}

.login-submit:hover svg {
    transform: translateX(3px);
}

.login-submit:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #94a3b8;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginFeatureIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table Elegante y Ejecutiva */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

table th {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    vertical-align: middle;
}

table td .btn {
    margin: 0 0.25rem;
    white-space: nowrap;
}

table tr {
    transition: all 0.2s;
}

table tr:hover {
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.04) 0%, rgba(59, 130, 246, 0.02) 100%);
}

table tr:last-child td {
    border-bottom: none;
}

/* Modal Elegante y Ejecutivo */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 2rem 0;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: block;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 2rem auto;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    max-width: 650px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-large {
    max-width: 950px;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close:hover {
    color: var(--text-color);
    background: var(--bg-secondary);
    transform: rotate(90deg);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

/* Parada item */
.parada-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-light);
    transition: all 0.3s;
}

.parada-item:hover {
    border-color: var(--primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.parada-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.parada-item-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
}

/* Map */
.map-container {
    margin-top: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.map {
    width: 100%;
    height: 600px;
    min-height: 400px;
}

.tracking-controls {
    margin-bottom: 1.5rem;
}

.tracking-info {
    margin-top: 2rem;
}

.tracking-buses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.bus-tracking-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 
                0 2px 8px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bus-tracking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: 20px 0 0 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 8px rgba(30, 64, 175, 0.3);
}

.bus-tracking-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(30, 64, 175, 0.05) 0%, transparent 70%);
    border-radius: 0 0 0 100%;
    pointer-events: none;
}

.bus-tracking-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 
                0 4px 16px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.95);
    border-color: rgba(30, 64, 175, 0.2);
}

.bus-tracking-card:hover::before {
    width: 6px;
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
    box-shadow: 3px 0 12px rgba(30, 64, 175, 0.4);
}

.bus-tracking-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(30, 64, 175, 0.08);
    position: relative;
}

.bus-tracking-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    border-radius: 2px;
}

.bus-tracking-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-radius: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
}

.bus-tracking-card:hover .bus-tracking-icon {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bus-tracking-placa {
    flex: 1;
}

.bus-tracking-placa h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: 1px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.bus-tracking-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    padding: 0.5rem 0;
}

.bus-tracking-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(30, 64, 175, 0.05);
    transition: all 0.3s ease;
}

.bus-tracking-card:hover .bus-tracking-info-item {
    background: rgba(248, 250, 252, 0.8);
    border-color: rgba(30, 64, 175, 0.1);
    transform: translateX(4px);
}

.bus-tracking-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.bus-tracking-label-icon {
    font-size: 1.125rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.bus-tracking-value {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.6;
    margin-top: 0.25rem;
}

.bus-tracking-velocidad {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    margin-top: 0.5rem;
}

.bus-tracking-velocidad-numero {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    letter-spacing: -0.5px;
}

.bus-tracking-velocidad-unidad {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.5px;
}

.bus-tracking-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(30, 64, 175, 0.08);
    font-size: 0.875rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bus-tracking-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2),
                0 2px 8px rgba(16, 185, 129, 0.3);
    animation: pulse-elegant 2s infinite;
    position: relative;
}

.bus-tracking-status-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes pulse-elegant {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2),
                    0 2px 8px rgba(16, 185, 129, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.1),
                    0 4px 16px rgba(16, 185, 129, 0.2);
        transform: scale(1.1);
    }
}

#trackingRutaMap,
#trackingReservaMap {
    width: 100%;
    height: 600px;
    min-height: 400px;
    border-radius: var(--radius-lg);
}

.tracking-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s;
}

.tracking-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Estilos para módulo del chofer */
.chofer-hero {
    margin-bottom: 2rem;
}

.chofer-rutas-section {
    margin-bottom: 2rem;
}

.chofer-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.chofer-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.25rem;
    letter-spacing: -0.03em;
}

.chofer-section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
    text-transform: capitalize;
}

.chofer-rutas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.chofer-ruta-card {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.375rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 4px 16px rgba(28, 25, 23, 0.05);
    position: relative;
    overflow: hidden;
}

.chofer-ruta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d97706, #f59e0b);
    opacity: 0;
    transition: opacity 0.2s;
}

.chofer-ruta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
}

.chofer-ruta-card-selected {
    border-color: #d97706;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, #fff 100%);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.15);
}

.chofer-ruta-card-selected::before {
    opacity: 1;
}

.chofer-ruta-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.chofer-ruta-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chofer-ruta-card-icon svg {
    width: 22px;
    height: 22px;
}

.chofer-ruta-card-info {
    flex: 1;
    min-width: 0;
}

.chofer-ruta-card-info h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.25rem;
    letter-spacing: -0.2px;
}

.chofer-ruta-empresa {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.chofer-ruta-card-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    transition: all 0.2s;
}

.chofer-ruta-card-check svg {
    width: 14px;
    height: 14px;
}

.chofer-ruta-card-selected .chofer-ruta-card-check {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.chofer-ruta-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.chofer-ruta-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.chofer-ruta-meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.chofer-ruta-dias {
    background: rgba(13, 148, 136, 0.1);
    color: #0f766e;
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
    font-weight: 600;
}

.chofer-ruta-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chofer-rutas-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
}

.chofer-rutas-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chofer-rutas-empty-icon svg {
    width: 32px;
    height: 32px;
}

.chofer-rutas-empty h4 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}

.chofer-rutas-empty p {
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.6;
}

.chofer-operacion-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chofer-ruta-control-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.ruta-recorrido-status {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.chofer-pasajeros-card {
    margin-bottom: 1.5rem;
}

.chofer-pasajeros-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chofer-pasajeros-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.chofer-pasajeros-title h3 {
    margin: 0;
    font-size: 1.05rem;
}

.chofer-pasajeros-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.chofer-pasajeros-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.chofer-btn-refresh {
    padding: 0.4rem 0.55rem;
    min-width: 2.25rem;
}

.pasajeros-orden-hint {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pasajeros-resumen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.pasajeros-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: #f8fafc;
    text-align: center;
}

.pasajeros-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.pasajeros-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pasajeros-stat-pending {
    border-color: rgba(217, 119, 6, 0.35);
    background: rgba(251, 191, 36, 0.08);
}

.pasajeros-stat-pending .pasajeros-stat-num {
    color: #b45309;
}

.pasajeros-stat-done {
    border-color: rgba(5, 150, 105, 0.35);
    background: rgba(5, 150, 105, 0.06);
}

.pasajeros-stat-done .pasajeros-stat-num {
    color: #047857;
}

.pasajeros-stat-detail {
    grid-column: 1 / -1;
    padding: 0.5rem 0.75rem;
    background: #fff;
}

.pasajeros-stat-sub {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pasajeros-seccion-titulo {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.pasajeros-seccion-titulo-done {
    margin-top: 1rem;
}

.pasajeros-cards-done {
    opacity: 0.85;
}

.pasajero-sin-reserva {
    font-size: 0.75rem;
    color: #b45309;
    font-weight: 600;
}

.chofer-config-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.chofer-config-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.chofer-config-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chofer-config-icon svg {
    width: 24px;
    height: 24px;
}

.chofer-config-header h3 {
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
}

.chofer-config-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.chofer-gps-card h3 {
    margin-bottom: 1rem;
}

.gps-status {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-light);
}

.gps-status p {
    margin: 0.75rem 0;
    font-size: 1.05rem;
}

.gps-status strong {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.05rem;
}

.gps-status #gpsStatusText {
    font-size: 1.1rem;
    font-weight: 600;
}

.gps-status #lastPosition,
.gps-status #currentSpeed {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-color);
}

.pasajeros-list {
    max-height: 450px;
    overflow-y: auto;
    border-radius: var(--radius);
}

.pasajeros-empty {
    color: var(--text-secondary);
    margin: 0;
    padding: 0.5rem 0;
}

.pasajeros-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pasajero-card {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
}

.pasajero-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}

.pasajero-card-orden {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    background: rgba(30, 64, 175, 0.1);
    color: #1e40af;
    font-size: 0.8125rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pasajero-card-head {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.pasajero-card-nombre {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.pasajero-card-estado {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.pasajero-card-estado.pasajero-estado-pendiente {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.pasajero-card-estado.pasajero-estado-ok {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
}

.pasajero-card-estado.pasajero-estado-nosalio {
    background: rgba(185, 28, 28, 0.1);
    color: #b91c1c;
}

.pasajero-card-dir {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pasajero-card-dir-indent {
    padding-left: 2.375rem;
}

.pasajero-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}

.pasajero-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.pasajero-card-hora {
    color: var(--text-secondary);
}

.pasajero-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.pasajero-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.pasajero-card-info {
    min-width: 0;
}

.pasajero-card-info h4 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-color);
}

.pasajero-sentido {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
    vertical-align: middle;
}

.pasajero-ruta-line,
.pasajero-dir {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.pasajero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.pasajero-estado-ok {
    color: #059669;
}

.pasajero-estado-pendiente {
    color: #d97706;
}

.pasajero-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.btn-waze {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: #33ccff;
    color: #0b1f2a;
    font-weight: 700;
    font-size: 0.8125rem;
    text-decoration: none;
    border: none;
}

.btn-waze .waze-logo {
    flex-shrink: 0;
}

.btn-waze:hover {
    background: #1ab8ef;
    color: #0b1f2a;
}

.pasajero-sin-waze {
    font-size: 0.75rem;
    color: var(--text-light);
}

.pasajero-card-actions-stack {
    flex-direction: column;
    align-items: stretch;
}

.pasajero-estado-nosalio {
    color: #b91c1c;
    font-weight: 600;
}

.pasajero-card-recogido {
    border-color: rgba(5, 150, 105, 0.35);
    background: rgba(5, 150, 105, 0.04);
}

.pasajero-card-nosalio {
    border-color: rgba(185, 28, 28, 0.3);
    background: rgba(185, 28, 28, 0.04);
}

.chofer-bus-display {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(30, 64, 175, 0.08);
    border: 1px solid rgba(30, 64, 175, 0.15);
    font-weight: 600;
    color: var(--text-color);
}

.ops-ruta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ops-ruta-header h3 {
    margin: 0;
}

.ops-pasajero-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border-light);
}

.ops-pasajero-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ops-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.ops-foto-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.ops-sin-foto {
    font-size: 0.75rem;
    color: var(--text-light);
}

.pasajeros-list table {
    width: 100%;
    border-collapse: collapse;
}

.pasajeros-list table th,
.pasajeros-list table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

@media (max-width: 640px) {
    .chofer-pasajeros-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .chofer-pasajeros-actions {
        width: 100%;
    }

    .chofer-pasajeros-actions .btn {
        flex: 1 1 auto;
    }

    .pasajero-card {
        padding: 0.75rem;
    }

    .pasajero-card-dir,
    .pasajero-card-dir-indent {
        padding-left: 0;
    }

    .pasajero-card-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .pasajero-card-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .pasajero-card-actions .btn,
    .pasajero-card-actions .btn-waze {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }
}

.usuarios-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--card-bg);
}

.usuario-item {
    transition: all 0.2s;
    cursor: pointer;
}

.usuario-item:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    transform: translateX(4px);
}

/* Alerts Elegantes */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    box-shadow: var(--shadow);
    font-weight: 600;
    line-height: 1.45;
}

.alert-toast {
    border: 1px solid transparent;
    border-left-width: 5px;
    box-shadow: 0 12px 32px rgba(28, 25, 23, 0.18);
    backdrop-filter: none;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left-color: var(--error-color);
}

.alert-toast.alert-error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #7f1d1d;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left-color: var(--success-color);
}

.alert-toast.alert-success {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #064e3b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    border-left-color: var(--info-color);
}

.alert-toast.alert-info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left-color: #f59e0b;
}

.alert-toast.alert-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #78350f;
}

@media (max-width: 768px) {
    .alert-toast {
        left: 1rem !important;
        right: 1rem !important;
        max-width: none !important;
    }
}

/* Loading Elegante */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 5px solid rgba(30, 64, 175, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 0 0.5rem;
        gap: 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 0.5rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 1rem;
    }

    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
    }

    .dashboard-hero-badge {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card-action-btn.empleado-cta.is-visible {
        padding: 0.85rem 1rem;
        font-size: 0.9375rem;
    }

    .section-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.75rem 1.5rem;
    }

    .btn-hero-action {
        width: 100%;
        justify-content: center;
    }

    .empresas-grid {
        grid-template-columns: 1fr;
    }

    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-empresa-actions {
        flex-direction: column-reverse;
    }

    .modal-empresa-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .rutas-empresa-grid {
        grid-template-columns: 1fr;
    }

    .parada-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-ruta-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-ruta-form-grid .modal-field-span-2 {
        grid-column: span 1;
    }

    .modal.modal-ruta .modal-content.modal-ruta-content {
        width: 95vw;
        max-width: 95vw;
    }

    .modal-ruta-actions {
        flex-direction: column-reverse;
    }

    .modal-ruta-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-paradas-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-add-parada {
        width: 100%;
        justify-content: center;
    }

    .stat-card-value {
        font-size: 2.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h2 {
        font-size: 2rem;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .login-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body.login-active {
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.login-active .main-content {
        min-height: auto;
        height: auto;
    }

    .login-page {
        min-height: 100dvh;
        min-height: 100vh;
        height: auto;
        overflow-y: visible;
    }

    .login-brand {
        padding: 1.25rem 1.25rem 1rem;
        min-height: auto;
    }

    .login-brand-logo {
        height: 44px;
        margin-bottom: 0.75rem;
    }

    .login-brand-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .login-brand-tagline {
        font-size: 0.875rem;
        margin-bottom: 0;
        line-height: 1.5;
    }

    .login-brand-features {
        display: none;
    }

    .login-panel {
        padding: 1.25rem 1.25rem 2rem;
        align-items: flex-start;
    }

    .login-card-header {
        margin-bottom: 1.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    table {
        font-size: 0.9rem;
    }

    table th,
    table td {
        padding: 0.875rem 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .nav-brand-text {
        font-size: 1rem;
    }

    .page-header h2 {
        font-size: 1.75rem;
    }

    .card {
        padding: 1.25rem;
    }

    .login-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-brand {
        padding: 1rem 1.25rem 0.75rem;
        min-height: auto;
    }

    .login-brand-title {
        font-size: 1.35rem;
    }

    .login-brand-features {
        display: none;
    }

    .login-panel {
        padding: 1rem 1.25rem 1.75rem;
    }

    .login-card-header h2 {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 2rem 0;
    }
}

/* Compatibilidad con navegadores antiguos */
@supports not (display: grid) {
    .dashboard-cards,
    .cards-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .card {
        flex: 1 1 300px;
        margin: 1rem;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para teclado */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

/* Efectos adicionales */
.page-header button {
    box-shadow: var(--shadow-md);
}

.page-header button:hover {
    box-shadow: var(--shadow-lg);
}

/* Consistencia visual Marvi (misma línea que login) */
.nav-link {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.modal-content > h2,
.modal-ruta-header-text h2,
#viajeConfigTitle,
#rutaModalTitle,
#usuarioQRTitle {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.pasajero-card h4,
.ops-ruta-header h3,
.ruta-empresa-info h3,
.chofer-config-header h3,
.empresa-card h3 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

.stat-card-value {
    letter-spacing: -0.04em;
}

.stat-card-icon {
    background: rgba(251, 191, 36, 0.12) !important;
    border: 1px solid rgba(251, 191, 36, 0.22);
    color: var(--primary-dark);
    border-radius: 50% !important;
}

.stat-card-icon svg {
    stroke: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}
