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

:root {
    --bg-primary: #0b111e;
    --bg-secondary: #151e2e;
    --bg-tertiary: #1e293b;
    --accent-teal: #0d9488;
    --accent-teal-hover: #14b8a6;
    --accent-gold: #d97706;
    --accent-gold-hover: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --glass-bg: rgba(21, 30, 46, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-sans: 'Outfit', sans-serif;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.2rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-container {
    max-width: 800px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo img, .logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #2dd4bf, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.logo-tag {
    font-size: 0.72rem;
    background: rgba(13, 148, 136, 0.15);
    color: var(--accent-teal-hover);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid rgba(13, 148, 136, 0.3);
    white-space: nowrap;
}

@media (max-width: 600px) {
    .header-container {
        padding: 0 0.2rem;
    }
    .logo {
        gap: 0.3rem;
    }
    .logo img, .logo-img {
        height: 26px;
    }
    .logo-text {
        font-size: 0.78rem;
        letter-spacing: -0.2px;
    }
    .logo-tag {
        display: none;
    }
    .admin-btn {
        padding: 0.25rem 0.45rem;
        font-size: 0.72rem;
    }
}

.admin-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.admin-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

main {
    flex: 1;
    max-width: 800px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-premium);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.info-alert {
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 12px;
    padding: 1rem;
    color: #f59e0b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.info-alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.form-control {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
}

.form-control:focus + svg {
    color: var(--accent-teal-hover);
}

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

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

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-teal), #0f766e);
    color: var(--text-primary);
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
    background: linear-gradient(135deg, var(--accent-teal-hover), var(--accent-teal));
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.routes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.route-card {
    background: var(--bg-primary);
    border: 1.5px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.route-card:hover {
    border-color: rgba(13, 148, 136, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.route-card.selected {
    border-color: var(--accent-teal);
    background: rgba(13, 148, 136, 0.08);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.route-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.route-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
}

.route-card.selected .route-badge {
    background: var(--accent-teal);
    color: var(--text-primary);
    border-color: var(--accent-teal);
}

.route-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.route-detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.capacity-container {
    margin-top: 0.5rem;
}

.capacity-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-teal);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.route-card.full {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: rgba(239, 68, 68, 0.2);
}

.route-card.full .progress-fill {
    background: var(--danger);
}

.route-card.full:hover {
    transform: none;
    border-color: rgba(239, 68, 68, 0.2);
}

.profile-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 148, 136, 0.08);
    border: 1px dashed var(--accent-teal);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.profile-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.logout-link {
    color: var(--accent-teal-hover);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.success-screen {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    width: 70px;
    height: 70px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--success);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.success-details {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 450px;
    margin: 0 auto 2rem auto;
    text-align: left;
}

.success-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.success-detail-row:last-child {
    border-bottom: none;
}

.success-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.success-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.text-center {
    text-align: center;
}

/* Animations */
@keyframes scaleUp {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255,255,255,0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--text-primary);
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Admin Dashboard Specific Styles */
.date-selector-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.admin-header-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.route-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.route-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    word-break: break-word;
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-1px);
}

.passenger-table-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.passenger-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.passenger-table th, .passenger-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.passenger-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
}

.passenger-table tr:last-child td {
    border-bottom: none;
}

.passenger-table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Celdas de fecha/hora en tabla inscritos */
.inscritos-table .fecha-cell {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}
.inscritos-table .hora-cell {
    color: var(--accent-teal-hover);
    font-size: 0.78rem;
}

.btn-action-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
}

.btn-action-danger:hover {
    background: var(--danger);
    color: white;
}

.badge-gerencia {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-teal-hover);
    border-bottom: 2px solid var(--accent-teal);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stats-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0.4rem 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    margin-top: auto;
}

/* Modales Administrativos */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 1rem;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    max-width: 550px;
    width: 100%;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.8rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}


/* ================================================================
   ADMIN PANEL — LAYOUT RESPONSIVE CON SIDEBAR
   Optimizado para Infinix Hot 50 Pro+ (1080×2436 / ~393px CSS)
   ================================================================ */

/* ── Cuerpo del panel admin ───────────────────────────────────── */
.admin-body {
    overflow-x: hidden;
}

/* ── Layout grid desktop: sidebar + contenido ────────────────── */
@media (min-width: 900px) {
    .admin-body {
        display: grid;
        grid-template-columns: 260px 1fr;
        min-height: 100vh;
    }
    .admin-sidebar {
        position: sticky;
        top: 0;
        height: 100dvh;
        transform: none !important;
        grid-column: 1;
        grid-row: 1 / 3;
        box-shadow: none;
    }
    .sidebar-overlay { display: none !important; }
    .sidebar-close-btn { display: none; }
    .admin-layout {
        grid-column: 2;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .admin-topbar {
        grid-column: 2;
    }
    .hamburger-btn { display: none !important; }
    .topbar-logo { display: none !important; }
    .admin-main {
        padding: 1.5rem 1.5rem 2rem;
    }
    .topbar-hide-mobile { display: inline-flex !important; }
}

/* ── Barra superior ──────────────────────────────────────────── */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.topbar-hide-mobile {
    display: none;
}

/* ── Botón hamburguesa ───────────────────────────────────────── */
.hamburger-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.hamburger-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-teal);
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

/* ── Overlay oscuro (móvil) ──────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 299;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.visible {
    display: block;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 275px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    z-index: 300;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
}
.admin-sidebar.open {
    transform: translateX(0);
}

/* ── Cabecera del sidebar ─────────────────────────────────────── */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    line-height: 1;
    transition: var(--transition-smooth);
}
.sidebar-close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ── Navegación del sidebar ───────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.7rem 0;
}

.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.2rem;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    border-radius: 0 12px 12px 0;
    margin-bottom: 2px;
}
.sidebar-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left-color: rgba(13, 148, 136, 0.4);
}
.sidebar-item.active {
    background: rgba(13, 148, 136, 0.1);
    color: var(--accent-teal-hover);
    border-left-color: var(--accent-teal);
    font-weight: 700;
}

.sidebar-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.sidebar-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Pie del sidebar ─────────────────────────────────────────── */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}
.sidebar-footer-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.sidebar-footer-danger { color: var(--danger) !important; }
.sidebar-footer-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ── Área de contenido ───────────────────────────────────────── */
.admin-layout {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 56px);
}

.admin-main {
    flex: 1;
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    padding: 1.1rem 0.85rem 2.5rem;
}

/* ================================================================
   RESPONSIVE — MÓVIL (≤ 640px)
   ================================================================ */
@media (max-width: 640px) {

    /* Tablas scrollables */
    .passenger-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .passenger-table th,
    .passenger-table td {
        padding: 0.5rem 0.65rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Cards */
    .card {
        padding: 1.1rem 0.9rem;
        border-radius: 14px;
    }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1rem; }

    /* Stats grid 2 columnas */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .stats-split-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .stat-value { font-size: 1.6rem; }

    /* Columna única para periodo resumen */
    #periodo-view-resumen {
        grid-template-columns: 1fr !important;
    }

    /* Modal */
    .modal-content {
        padding: 1.1rem;
        border-radius: 14px;
        max-height: 95dvh;
    }
    .modal-footer {
        flex-direction: column;
    }
    .modal-footer button { width: 100%; }

    .topbar-hide-mobile { display: none !important; }
}

/* ================================================================
   RESPONSIVE — MÓVIL PEQUEÑO (≤ 430px)
   ================================================================ */
@media (max-width: 430px) {

    .admin-topbar { padding: 0.6rem 0.75rem; }
    .logo-text { font-size: 1.05rem; }
    .logo-tag { font-size: 0.65rem; padding: 0.12rem 0.35rem; }

    .admin-main { padding: 0.85rem 0.7rem 2rem; }

    .card { padding: 0.95rem 0.8rem; border-radius: 12px; }

    .btn-primary, .btn-secondary {
        padding: 0.85rem;
        font-size: 0.93rem;
    }

    .stats-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 2rem; }

    .route-section-title {
        font-size: 1rem;
        width: 100%;
    }
}

/* ================================================================
   RESPONSIVE — FORMULARIO MÓVIL USUARIOS (index.html)
   ================================================================ */
@media (max-width: 480px) {

    main { padding: 0.85rem 0.7rem; }

    .route-details {
        grid-template-columns: 1fr;
    }

    .success-details { padding: 1rem 0.9rem; }

    .profile-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    header { padding: 0.9rem 1rem; }
    .header-container .admin-btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}

/* ================================================================
   MÓVIL ADICIONAL — CORRECCIONES DE DESBORDE Y DISEÑO CLÁSICO (TABS)
   ================================================================ */
@media (max-width: 768px) {
    /* Impedir desborde general del body */
    html, body {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    * {
        box-sizing: border-box !important;
    }

    /* Cabecera clásica de administración */
    header {
        padding: 0.8rem 0.6rem !important;
        width: 100% !important;
    }

    .header-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }

    .logo {
        width: 100% !important;
        justify-content: center !important;
        gap: 0.4rem !important;
    }

    .logo-text {
        font-size: 1.2rem !important;
    }

    .logo-tag {
        font-size: 0.65rem !important;
        padding: 0.1rem 0.4rem !important;
    }

    .header-container > div:last-child {
        display: flex !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        width: 100% !important;
    }

    .header-container .admin-btn {
        flex: 1 !important;
        padding: 0.5rem 0.4rem !important;
        font-size: 0.78rem !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    /* Pestañas de navegación clásicas responsivas */
    .tab-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        padding: 0.2rem 0.2rem 0.6rem 0.2rem !important;
        border-bottom: 1px solid var(--glass-border) !important;
        gap: 0.4rem !important;
        scrollbar-width: none !important; /* Firefox */
    }

    .tab-nav::-webkit-scrollbar {
        display: none !important; /* Ocultar barra de scroll en Chrome/Safari */
    }

    .tab-btn {
        flex-shrink: 0 !important;
        padding: 0.5rem 0.8rem !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }

    /* Contenedor principal de administración clásico */
    main[style*="max-width: 1000px"], 
    main {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0.8rem 0.5rem !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }

    /* Selector de fecha y botón de PDF */
    .date-selector-bar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }

    .date-input-wrapper {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .date-input-wrapper > div {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
    }

    .date-input-wrapper label {
        display: none !important; /* Ocultar para ahorrar espacio horizontal */
    }

    .date-input-wrapper input[type="date"] {
        width: 100% !important;
        padding: 0.45rem 0.6rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        height: auto !important;
    }

    #btn-pdf-diario {
        flex-shrink: 0 !important;
        padding: 0.45rem 0.75rem !important;
        font-size: 0.82rem !important;
        border-radius: 8px !important;
    }

    /* Ruta card cabecera de sección */
    .route-section-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
        margin-top: 1.5rem !important;
    }

    .route-section-title {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }

    .btn-whatsapp {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Ajuste de tarjetas de pasajeros en monitoreo */
    .admin-routes-container,
    #admin-routes-container {
        width: 100% !important;
    }

    /* Tarjetas de rutas */
        font-size: 1rem;
        width: 100%;
    }
}

/* ================================================================
   RESPONSIVE — FORMULARIO MÓVIL USUARIOS (index.html)
   ================================================================ */
@media (max-width: 480px) {

    main { padding: 0.85rem 0.7rem; }

    .route-details {
        grid-template-columns: 1fr;
    }

    .success-details { padding: 1rem 0.9rem; }

    .profile-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    header { padding: 0.9rem 1rem; }
    .header-container .admin-btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}

/* ================================================================
   MÓVIL ADICIONAL — CORRECCIONES DE DESBORDE Y DISEÑO CLÁSICO (TABS)
   ================================================================ */
@media (max-width: 768px) {
    /* Impedir desborde general del body */
    html, body {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    * {
        box-sizing: border-box !important;
    }

    /* Cabecera clásica de administración */
    header {
        padding: 0.8rem 0.6rem !important;
        width: 100% !important;
    }

    .header-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }

    .logo {
        width: 100% !important;
        justify-content: center !important;
        gap: 0.4rem !important;
    }

    .logo-text {
        font-size: 1.2rem !important;
    }

    .logo-tag {
        font-size: 0.65rem !important;
        padding: 0.1rem 0.4rem !important;
    }

    .header-container > div:last-child {
        display: flex !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        width: 100% !important;
    }

    .header-container .admin-btn {
        flex: 1 !important;
        padding: 0.5rem 0.4rem !important;
        font-size: 0.78rem !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    /* Pestañas de navegación clásicas responsivas */
    .tab-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        padding: 0.2rem 0.2rem 0.6rem 0.2rem !important;
        border-bottom: 1px solid var(--glass-border) !important;
        gap: 0.4rem !important;
        scrollbar-width: none !important; /* Firefox */
    }

    .tab-nav::-webkit-scrollbar {
        display: none !important; /* Ocultar barra de scroll en Chrome/Safari */
    }

    .tab-btn {
        flex-shrink: 0 !important;
        padding: 0.5rem 0.8rem !important;
        font-size: 0.8rem !important;
        border-radius: 6px !important;
    }

    /* Contenedor principal de administración clásico */
    main[style*="max-width: 1000px"], 
    main {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0.8rem 0.5rem !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }

    /* Selector de fecha y botón de PDF */
    .date-selector-bar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }

    .date-input-wrapper {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .date-input-wrapper > div {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
    }

    .date-input-wrapper label {
        display: none !important; /* Ocultar para ahorrar espacio horizontal */
    }

    .date-input-wrapper input[type="date"] {
        width: 100% !important;
        padding: 0.45rem 0.6rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        height: auto !important;
    }

    #btn-pdf-diario {
        flex-shrink: 0 !important;
        padding: 0.45rem 0.75rem !important;
        font-size: 0.82rem !important;
        border-radius: 8px !important;
    }

    /* Ruta card cabecera de sección */
    .route-section-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
        margin-top: 1.5rem !important;
    }

    .route-section-title {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }

    .btn-whatsapp {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Ajuste de tarjetas de pasajeros en monitoreo */
    .admin-routes-container,
    #admin-routes-container {
        width: 100% !important;
    }

    /* Tarjetas de rutas */
    .route-card {
        padding: 0.9rem !important;
        border-radius: 12px !important;
    }

    .route-details {
        grid-template-columns: 1fr !important;
        gap: 0.4rem !important;
    }
}

/* ==========================================
   SISTEMA DE ALERTAS Y CONFIRMACIONES PREMIUM
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transform: translateX(120%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-message {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: var(--transition-smooth);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--accent-gold);
}

.toast-info {
    border-left: 4px solid var(--accent-teal);
}

/* ================================================================
   RESPONSIVE — TABLA DE USUARIOS ADMIN + ACCIONES EN LOTE
   Optimizado para movil (tabla se convierte en tarjetas por fila)
   ================================================================ */
@media (max-width: 768px) {

    /* Barra de acciones en lote: apilar verticalmente en movil */
    #user-bulk-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    #user-bulk-actions button,
    #user-bulk-actions .btn-action-danger {
        width: 100% !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.85rem !important;
        text-align: center !important;
        justify-content: center !important;
    }
    #user-bulk-count {
        margin-right: 0 !important;
        margin-bottom: 0.3rem !important;
        text-align: center !important;
    }

    /* Tabla de usuarios: hacer scroll horizontal */
    .passenger-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px;
    }

    /* En la tabla de usuarios del admin: botones de accion apilados */
    .passenger-table td div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 0.3rem !important;
        align-items: stretch !important;
    }
    .passenger-table td div[style*="display:flex"] button,
    .passenger-table td div[style*="display:flex"] .admin-btn,
    .passenger-table td div[style*="display:flex"] .btn-action-danger {
        width: 100% !important;
        text-align: center !important;
        padding: 0.4rem 0.5rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    /* Ocultar columnas menos prioritarias en movil para la tabla de usuarios del ADMIN */
    /* Se excluye .inscritos-table para que la columna Fecha/Hora siga visible en ver-inscritos */
    .passenger-table:not(.inscritos-table) th:nth-child(4),
    .passenger-table:not(.inscritos-table) td:nth-child(4) {
        display: none !important;
    }

    /* Tabla de monitoreo de reservas: ocultar gerencia en movil */
    .passenger-table.admin-reserva-table th:nth-child(4),
    .passenger-table.admin-reserva-table td:nth-child(4) {
        display: none !important;
    }
}

@media (max-width: 500px) {
    /* Ocultar columnas menos prioritarias en pantallas muy pequeñas (solo tablas admin) */
    .passenger-table:not(.inscritos-table) th:nth-child(4),
    .passenger-table:not(.inscritos-table) td:nth-child(4),
    .passenger-table:not(.inscritos-table) th:nth-child(5),
    .passenger-table:not(.inscritos-table) td:nth-child(5) {
        display: none !important;
    }

    /* Modales: ocupar toda la pantalla en movil pequeño */
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 92dvh !important;
        margin-top: auto !important;
        padding: 1.2rem !important;
    }
    .modal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    /* Tabs de navegacion admin: minimizar texto */
    .tab-btn {
        padding: 0.45rem 0.6rem !important;
        font-size: 0.72rem !important;
    }

    /* Botones de la tarjeta de ruta en index: no apilar */
    .route-header > div {
        gap: 0.3rem !important;
    }
}

/* ================================================================
   RESPONSIVE — PANTALLA DE INSCRITOS (inscritos.html)
   ================================================================ */
@media (max-width: 600px) {
    .passenger-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .inscritos-table {
        min-width: 520px;
    }

    .inscritos-table th,
    .inscritos-table td {
        padding: 0.5rem 0.6rem !important;
        font-size: 0.82rem !important;
        white-space: nowrap;
    }

    .inscritos-table .fecha-cell {
        white-space: nowrap;
    }
}

/* ================================================================
   RESPONSIVE — INFINIX HOT 50 PRO+ y MOVILES ANDROID (~393px)
   Optimizacion especifica para pantallas de 390-420px de ancho
   ================================================================ */
@media (max-width: 430px) {

    /* === INDEX / CLIENTE === */

    /* Header: logo + admin btn en una sola fila compacta */
    header {
        padding: 0.75rem 1rem !important;
    }
    .header-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .logo-text {
        font-size: 1.2rem !important;
    }
    .logo-tag {
        font-size: 0.65rem !important;
        padding: 0.1rem 0.4rem !important;
    }
    .header-container .admin-btn {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }

    /* main container: padding reducido para aprovechar el ancho */
    main {
        padding: 0.85rem 0.75rem !important;
    }

    /* Cards: menos padding */
    .card {
        padding: 1.2rem !important;
        border-radius: 16px !important;
        margin-bottom: 1rem !important;
    }

    /* Perfil activo: wrap para que no se salga */
    .profile-card {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.85rem !important;
    }
    .profile-info h3 {
        font-size: 1rem !important;
    }
    .profile-info p {
        font-size: 0.78rem !important;
    }
    .logout-link {
        font-size: 0.8rem !important;
    }

    /* Tarjeta de ruta: reorganizar cabecera */
    .route-header {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: flex-start !important;
    }
    .route-header > div {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.4rem !important;
        width: 100% !important;
        justify-content: flex-end !important;
    }
    .route-name {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
    }
    .route-badge {
        font-size: 0.75rem !important;
        padding: 0.2rem 0.5rem !important;
        white-space: nowrap !important;
    }

    /* El boton "Ver Inscritos" en tarjeta de ruta */
    .route-header a.admin-btn {
        font-size: 0.72rem !important;
        padding: 0.25rem 0.5rem !important;
        white-space: nowrap !important;
    }

    /* Detalles de ruta: columna unica */
    .route-details {
        grid-template-columns: 1fr !important;
        gap: 0.3rem !important;
        font-size: 0.82rem !important;
    }

    /* Banner de reserva activa */
    #active-res-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }
    #active-res-cancel-btn {
        width: 100% !important;
    }

    /* Botones principales mas grandes para touch */
    .btn-primary {
        padding: 0.95rem !important;
        font-size: 1rem !important;
        min-height: 48px !important;
    }
    .btn-secondary {
        padding: 0.85rem !important;
        min-height: 44px !important;
        font-size: 0.95rem !important;
    }

    /* Inputs de texto mas altos para touch */
    .form-control {
        padding: 0.85rem 1rem 0.85rem 2.8rem !important;
        font-size: 1rem !important;
        min-height: 48px !important;
    }

    /* Titulos */
    h2 {
        font-size: 1.2rem !important;
    }
    h3 {
        font-size: 1rem !important;
    }
    .subtitle {
        font-size: 0.88rem !important;
    }

    /* Pantalla de exito */
    .success-screen {
        padding: 1rem 0.5rem !important;
    }
    .success-title {
        font-size: 1.3rem !important;
    }
    .success-details {
        padding: 0.85rem !important;
    }

    /* === ADMIN PANEL === */

    /* Topbar admin: compactar */
    .admin-topbar {
        padding: 0.65rem 0.75rem !important;
    }

    /* Tabs: scroll horizontal con texto compacto */
    .tab-nav {
        gap: 0.3rem !important;
        padding-bottom: 0.4rem !important;
    }
    .tab-btn {
        padding: 0.4rem 0.55rem !important;
        font-size: 0.7rem !important;
        border-radius: 6px !important;
    }

    /* admin-main padding */
    .admin-main {
        padding: 0.75rem 0.65rem 2rem !important;
    }

    /* Stats grid: 2 columnas */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }
    .stat-value {
        font-size: 1.5rem !important;
    }
    .stat-label {
        font-size: 0.75rem !important;
    }

    /* Modales: bottom sheet completo */
    .modal {
        align-items: flex-end !important;
        padding: 0 !important;
    }
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 94dvh !important;
        margin: 0 !important;
        padding: 1.1rem !important;
    }
    .modal-header h3 {
        font-size: 1rem !important;
    }
    .modal-footer {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .modal-footer button {
        width: 100% !important;
        min-height: 44px !important;
    }

    /* Barra de acciones en lote: compactar */
    #user-bulk-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0.65rem !important;
        gap: 0.4rem !important;
    }

    /* Barra selector fecha + PDF en admin */
    .date-selector-bar {
        flex-direction: column !important;
        gap: 0.6rem !important;
    }
}

@media (max-width: 768px) {

    /* Barra de acciones en lote: apilar verticalmente en movil */
    #user-bulk-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    #user-bulk-actions button,
    #user-bulk-actions .btn-action-danger {
        width: 100% !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.85rem !important;
        text-align: center !important;
        justify-content: center !important;
    }
    #user-bulk-count {
        margin-right: 0 !important;
        margin-bottom: 0.3rem !important;
        text-align: center !important;
    }

    /* Tabla de usuarios: hacer scroll horizontal */
    .passenger-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px;
    }

    /* En la tabla de usuarios del admin: botones de accion apilados */
    .passenger-table td div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 0.3rem !important;
        align-items: stretch !important;
    }
    .passenger-table td div[style*="display:flex"] button,
    .passenger-table td div[style*="display:flex"] .admin-btn,
    .passenger-table td div[style*="display:flex"] .btn-action-danger {
        width: 100% !important;
        text-align: center !important;
        padding: 0.4rem 0.5rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    /* Ocultar columnas menos prioritarias en movil para la tabla de usuarios */
    .passenger-table:not(.inscritos-table) th:nth-child(4),
    .passenger-table:not(.inscritos-table) td:nth-child(4) {
        display: none !important;
    }

    /* Tabla de monitoreo de reservas: ocultar gerencia en movil */
    .passenger-table.admin-reserva-table th:nth-child(4),
    .passenger-table.admin-reserva-table td:nth-child(4) {
        display: none !important;
    }
}

@media (max-width: 500px) {
    /* Ocultar columna de Telefono en pantallas muy pequeñas */
    .passenger-table:not(.inscritos-table) th:nth-child(4),
    .passenger-table:not(.inscritos-table) td:nth-child(4),
    .passenger-table:not(.inscritos-table) th:nth-child(5),
    .passenger-table:not(.inscritos-table) td:nth-child(5) {
        display: none !important;
    }

    /* Modales: ocupar toda la pantalla en movil pequeño */
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 92dvh !important;
        margin-top: auto !important;
        padding: 1.2rem !important;
    }
    .modal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    /* Tabs de navegacion admin: minimizar texto */
    .tab-btn {
        padding: 0.45rem 0.6rem !important;
        font-size: 0.72rem !important;
    }

    /* Botones de la tarjeta de ruta en index: no apilar */
    .route-header > div {
        gap: 0.3rem !important;
    }
}

/* ================================================================
   RESPONSIVE — PANTALLA DE INSCRITOS (inscritos.html)
   ================================================================ */
@media (max-width: 600px) {
    /* Tabla inscritos: legible en movil */
    .passenger-table th,
    .passenger-table td {
        padding: 0.55rem 0.7rem !important;
        font-size: 0.82rem !important;
    }

    /* Botón Volver: mas grande para touch */
    .btn-secondary {
        min-height: 44px;
        font-size: 0.95rem;
    }
}

/* --- ESTILOS DE RESPONSIVIDAD PARA EL CRUD DE GERENCIAS Y LA TARJETA DE PERFIL --- */
.admin-inline-form {
    display: flex;
    gap: 0.7rem;
    margin-top: 1.5rem;
    width: 100%;
}
.admin-inline-form #gerencia-input-name {
    max-width: 400px;
    flex: 1;
}

@media (max-width: 768px) {
    .admin-inline-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .admin-inline-form #gerencia-input-name {
        max-width: 100% !important;
        width: 100% !important;
    }
    .admin-inline-form button {
        width: 100% !important;
        margin: 0 !important;
    }
}

@media (max-width: 500px) {
    .profile-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
    }
    .profile-card .profile-actions {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }
    .profile-card .profile-actions-divider {
        display: none !important;
    }
    .profile-card .profile-actions a {
        flex: 1 !important;
        text-align: center !important;
        font-size: 0.82rem !important;
        padding: 0.5rem !important;
        border: 1px solid var(--accent-teal);
        border-radius: 6px !important;
        background: rgba(13, 148, 136, 0.05) !important;
    }
}

/* Botones de acción en tablas (Gerencias, etc.) */
.action-btn {
    background: transparent;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.action-btn.edit {
    color: var(--accent-teal);
    border: 1px solid rgba(13, 148, 136, 0.3);
}

.action-btn.edit:hover {
    background: rgba(13, 148, 136, 0.1);
    border-color: var(--accent-teal);
    color: var(--text-primary);
}

.action-btn.delete {
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: #ffffff;
}

/* Forzar padding normal a todos los inputs/selects del panel admin para que el texto no se oculte */
.admin-layout .form-control, .admin-layout select.form-control {
    padding-left: 1rem !important;
}


/* ================================================================
   RESPONSIVE — INFINIX HOT 50 / MÓVIL PEQUEÑO (≤ 400px)
   Pantalla CSS de ~393px de ancho
   ================================================================ */
@media (max-width: 400px) {

    /* ── CLIENTE: index.html ─────────────────────────────────────── */

    /* Header */
    header { padding: 0.75rem 0.75rem !important; }
    .logo img { height: 32px !important; }
    .logo-text { font-size: 1.05rem !important; }
    .logo-tag { font-size: 0.6rem !important; padding: 0.1rem 0.3rem !important; }
    .header-container .admin-btn {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.72rem !important;
    }

    /* Contenido principal */
    main { padding: 0.75rem 0.65rem !important; }

    /* Cards */
    .card {
        padding: 1rem 0.85rem !important;
        border-radius: 14px !important;
        margin-bottom: 1rem !important;
    }

    h2 { font-size: 1.1rem !important; gap: 0.4rem !important; }
    .subtitle { font-size: 0.88rem !important; margin-bottom: 1.1rem !important; }

    /* Inputs y selects: tamaño touch-friendly */
    .form-control {
        padding: 0.85rem 0.85rem 0.85rem 2.6rem !important;
        font-size: 0.95rem !important;
        min-height: 46px !important;
        border-radius: 10px !important;
    }

    /* Label superior de grupos */
    .form-group label { font-size: 0.82rem !important; }

    /* Botón confirmar/cambiar reserva */
    .btn-primary {
        padding: 0.95rem 1rem !important;
        font-size: 0.95rem !important;
        border-radius: 11px !important;
        min-height: 50px !important;
    }

    .btn-secondary {
        padding: 0.85rem 1rem !important;
        font-size: 0.92rem !important;
        border-radius: 11px !important;
        min-height: 46px !important;
    }

    /* Tarjetas de ruta */
    .route-card {
        padding: 0.85rem 0.9rem !important;
        border-radius: 12px !important;
    }

    /* route-header: nombre a izquierda, badges a derecha en fila */
    .route-header {
        gap: 0.4rem !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }

    .route-name {
        font-size: 0.95rem !important;
        line-height: 1.35 !important;
        flex: 1 !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }

    /* "Ver Inscritos" + hora salida: más pequeños */
    .route-card .admin-btn {
        font-size: 0.65rem !important;
        padding: 0.18rem 0.45rem !important;
    }

    .route-badge {
        font-size: 0.72rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    /* Conductor y placa: columna única */
    .route-details {
        grid-template-columns: 1fr !important;
        gap: 0.3rem !important;
        font-size: 0.8rem !important;
    }

    /* Progress bar más delgada */
    .progress-bar { height: 6px !important; }

    /* Barra de reserva activa */
    #active-res-banner {
        flex-direction: column !important;
        gap: 0.4rem !important;
        padding: 0.7rem 0.9rem !important;
        font-size: 0.82rem !important;
    }

    /* Banner de información (info-alert) */
    .info-alert {
        padding: 0.75rem !important;
        font-size: 0.82rem !important;
        gap: 0.6rem !important;
    }

    /* Pantalla de éxito */
    .success-icon { width: 58px !important; height: 58px !important; }
    .success-title { font-size: 1.3rem !important; }
    .success-details { padding: 1rem 0.8rem !important; }
    .success-label, .success-value { font-size: 0.82rem !important; }

    /* Profile card */
    .profile-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 0.85rem !important;
    }

    .profile-info h3 { font-size: 0.95rem !important; }
    .profile-info p { font-size: 0.78rem !important; }

    /* ── ADMIN: admin.html ───────────────────────────────────────── */

    .admin-topbar { padding: 0.55rem 0.65rem !important; }
    .topbar-logo .logo-text { font-size: 0.95rem !important; }
    .topbar-logo .logo-tag { display: none !important; }

    .admin-main { padding: 0.7rem 0.6rem 2rem !important; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 0.6rem !important; }
    .stat-value { font-size: 1.5rem !important; }
    .stat-label { font-size: 0.78rem !important; }

    /* Sección de ruta */
    .route-section-title { font-size: 0.92rem !important; }

    /* Tabla de pasajeros */
    .passenger-table th,
    .passenger-table td {
        padding: 0.45rem 0.55rem !important;
        font-size: 0.78rem !important;
    }

    /* Sidebar más estrecho en pantallas muy pequeñas */
    .admin-sidebar { width: 260px !important; }

    /* Botones de acción en tablas */
    .admin-btn, .btn-action-danger {
        font-size: 0.72rem !important;
        padding: 0.25rem 0.45rem !important;
    }

    /* Modal de fondo completo */
    .modal-content {
        padding: 1rem 0.85rem !important;
        border-radius: 14px 14px 0 0 !important;
        max-height: 95dvh !important;
    }
    .modal { align-items: flex-end !important; padding: 0 !important; }

    /* Tabs de navegación */
    .tab-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.73rem !important;
    }
}

/* ================================================================
   RESPONSIVE — LANDSCAPE MÓVIL (ancho > alto, pantalla estrecha)
   ================================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    header { padding: 0.5rem 1rem !important; }
    .logo img { height: 28px !important; }
    main { padding: 0.5rem 1rem !important; }
    .card { margin-bottom: 0.75rem !important; padding: 1rem !important; }
    .modal { align-items: center !important; }
    .modal-content { max-height: 85dvh !important; }
}

/* ================================================================
   ALERTA DE DESCONEXIÓN (OFFLINE BANNER)
   ================================================================ */
.offline-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: rgba(185, 28, 28, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 2px solid rgba(239, 68, 68, 0.5);
    padding: 12px 20px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
}
.offline-banner.active {
    display: flex;
    transform: translateY(0);
}
.offline-banner .offline-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    animation: pulse-offline 2s ease-in-out infinite;
}
@keyframes pulse-offline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.offline-banner .offline-text {
    font-weight: 500;
    text-align: center;
}
.offline-banner .offline-text strong {
    font-weight: 700;
}
.offline-banner .offline-retry {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.offline-banner .offline-retry:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ================================================================
   MEJORAS ADICIONALES DE CORRECCIÓN GENERAL Y OPTIMIZACIÓN MÓVIL
   ================================================================ */

/* ─── Drag and Drop Styling ─── */
.drag-handle {
    cursor: grab !important;
    user-select: none;
}
.drag-handle:active {
    cursor: grabbing !important;
}
tr.dragging, div.dragging {
    opacity: 0.45 !important;
    background: rgba(59, 130, 246, 0.25) !important;
    border: 1px dashed var(--accent-teal) !important;
}
/* ─── Ajustes de Tablas y Scroll Horizontal en Admin ─── */
.passenger-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}
.passenger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.passenger-table th, 
.passenger-table td {
    padding: 0.65rem 0.85rem;
    white-space: nowrap;
    text-align: left;
}

/* ─── Ajustes de Inputs, Selects y Tablas de Auditoría ─── */
.filters-bar input,
.filters-bar select {
    height: 42px !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.88rem !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
}

.filters-bar select option {
    background: #1e293b !important;
    color: #f8fafc !important;
    padding: 0.5rem !important;
}




