﻿:root {
    --primary: #244e2d;
    --primary-hover: #1b3a21;
    --secondary: #47a433;
    --secondary-hover: #3b8a2a;
    --tertiary: #9ecc47;
    --dark: #0f172a;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --status-green: #10b981;
    --status-red: #ef4444;
    --status-orange: #f59e0b;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 15px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

h1, h2, h3, h4 {
    color: var(--primary);
}

/* NAVBAR INDEPENDIENTE (NO USA BOOTSTRAP) */
.navbar-aranda {
    background: var(--primary);
    color: white;
    padding: 0 1.5rem;
    min-height: 60px; /* CORRECCIÓN: Permite que el menú crezca en móvil */
    display: flex;
    flex-wrap: wrap; /* CORRECCIÓN: Permite que los items bajen a la siguiente línea */
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 9999; /* Capa superior asegurada */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.menu-toggle {
    display: none !important;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 10px 0; /* Espaciado para que respire en móvil */
}

.logo-img-wrapper {
    height: 38px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .logo-img-wrapper img {
        height: 100%;
        width: auto;
        object-fit: contain;
        border-radius: 4px;
    }

.logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: white;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    transition: all 0.3s;
}

.tab-btn {
    background: none;
    border: none;
    color: #e2e8f0;
    font-weight: 500;
    cursor: pointer;
    padding: 0 1rem;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

    .tab-btn:hover, .tab-btn.active {
        color: var(--tertiary);
        border-bottom-color: var(--tertiary);
    }

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.view {
    display: none;
    animation: fadeIn 0.3s;
}

    .view.active {
        display: block;
    }

.header-section {
    margin-bottom: 1.5rem;
}

.text-center {
    text-align: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.mt-2 {
    margin-top: 1rem;
}

.ml-1 {
    margin-left: 0.5rem;
}

.mx-auto {
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

    .form-group.full-width {
        grid-column: 1 / -1;
    }

    .form-group label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
    }

    .form-group input, .form-group select {
        padding: 0.65rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        outline: none;
        font-size: 0.95rem;
        background: #fff;
    }

        .form-group input:focus, .form-group select:focus {
            border-color: var(--secondary);
            box-shadow: 0 0 0 2px rgba(71, 164, 51, 0.1);
        }

.alert-box {
    padding: 1rem;
    border-radius: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 0.9rem;
    color: var(--primary);
}

.btn {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: 0.2s;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-hover);
    }

.btn-secondary {
    background: var(--secondary);
    color: white;
}

    .btn-secondary:hover {
        background: var(--secondary-hover);
    }

.btn-outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--primary);
}

    .btn-outline:hover {
        background: var(--bg-color);
        border-color: var(--primary);
    }

.btn-danger {
    background: var(--status-red);
    color: white;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.bg-green {
    background: #dcfce7;
    color: var(--status-green);
}

.bg-red {
    background: #fee2e2;
    color: var(--status-red);
}

.bg-orange {
    background: #fef3c7;
    color: var(--status-orange);
}

.bg-gray {
    background: #e2e8f0;
    color: #475569;
}

.badge-seat {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
}

.trip-card {
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 8px;
    background: white;
    transition: 0.2s;
}

    .trip-card:hover {
        border-color: var(--tertiary);
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    }

/* SILUETA TOYOTA HIACE EXACTA A LA IMAGEN */
.van-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.van-silhouette {
    background: linear-gradient(to right, #e2e8f0 0%, #f8fafc 50%, #e2e8f0 100%);
    border: 3px solid #cbd5e1;
    border-radius: 110px 110px 20px 20px;
    padding: 0;
    width: 320px;
    height: 650px;
    position: relative;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15), inset 0 0 10px rgba(0,0,0,0.05);
}

.van-headlights {
    position: absolute;
    top: 5px;
    left: 35px;
    right: 35px;
    height: 35px;
    background: transparent;
    border-radius: 50% 50% 0 0;
    box-shadow: -45px 0 15px -15px rgba(0,0,0,0.1), 45px 0 15px -15px rgba(0,0,0,0.1);
}

.van-windshield {
    position: absolute;
    top: 60px;
    left: 15px;
    right: 15px;
    height: 80px;
    background: #afb9c9;
    border-radius: 20px 20px 5px 5px;
    border-top: 3px solid #94a3b8;
    box-shadow: inset 0 10px 15px rgba(255,255,255,0.1);
    z-index: 2;
}

.van-mirror {
    position: absolute;
    top: 135px;
    width: 25px;
    height: 15px;
    background: #afb9c9;
    z-index: 1;
}

    .van-mirror.left {
        left: -18px;
        border-radius: 15px 5px 5px 15px;
        transform: rotate(15deg);
    }

    .van-mirror.right {
        right: -18px;
        border-radius: 5px 15px 15px 5px;
        transform: rotate(-15deg);
    }

.van-window-left, .van-window-right {
    position: absolute;
    top: 150px;
    bottom: 80px;
    width: 12px;
    background: #afb9c9;
    z-index: 1;
}

.van-window-left {
    left: 8px;
    border-radius: 0 5px 5px 0;
}

.van-window-right {
    right: 8px;
    border-radius: 5px 0 0 5px;
}

.van-rear-window {
    position: absolute;
    bottom: 15px;
    left: 40px;
    right: 40px;
    height: 20px;
    background: #afb9c9;
    border-radius: 5px 5px 15px 15px;
}

/* PISO INTERNO DONDE VAN LOS ASIENTOS */
.seats-area {
    position: absolute;
    top: 150px;
    left: 26px;
    right: 26px;
    bottom: 50px;
    background: #ffffff;
    border-radius: 5px;
    padding: 20px 15px;
    z-index: 3;
}

.seats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px 15px;
    justify-items: center;
    align-items: center;
}

.seat-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 44px;
}

.seat-btn {
    width: 44px;
    height: 50px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 8px solid rgba(0,0,0,0.15);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

    .seat-btn:hover:not(:disabled) {
        transform: scale(1.05);
    }

    .seat-btn.available {
        background-color: var(--secondary);
    }

    .seat-btn.occupied {
        background-color: #cbd5e1;
        color: #64748b;
        cursor: not-allowed;
        border-top-color: rgba(0,0,0,0.05);
        box-shadow: none;
    }

/* DISTANCIAMIENTO EXACTO DEL CONDUCTOR */
.row-1-gap {
    margin-bottom: 45px;
}

.legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    background: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border-top: 3px solid rgba(0,0,0,0.1);
}

    .box.available {
        background: var(--secondary);
    }

    .box.occupied {
        background: #cbd5e1;
        border-top-color: rgba(0,0,0,0.05);
    }

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

    .data-table th {
        padding: 1rem 0.8rem;
        text-align: left;
        border-bottom: 2px solid var(--border);
        font-size: 0.9rem;
        color: var(--primary);
    }

    .data-table td {
        padding: 0.8rem;
        text-align: left;
        border-bottom: 1px solid var(--border);
        font-size: 0.9rem;
    }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15,23,42,0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

    .modal.active {
        display: flex;
    }

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ticket-summary {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.summary-row.total {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    color: var(--primary);
}

.ticket-receipt {
    background: white;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    color: #000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

    .ticket-receipt .center {
        text-align: center;
    }

    .ticket-receipt .divider {
        border-bottom: 1px dashed #000;
        margin: 10px 0;
    }

    .ticket-receipt table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    .ticket-receipt td {
        padding: 3px 0;
        vertical-align: top;
    }

.text-right {
    text-align: right;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--dark);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .toast.success {
        background: var(--status-green);
    }

    .toast.info {
        background: var(--secondary);
    }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* MEDIA QUERIES RESPONSIVOS */
@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
        margin: 10px 0;
    }

    /* CORRECCIÓN: Fondo sólido verde natural empujando el contenido */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--primary) !important;
        padding: 0 0 1rem 0;
        /* Al quitar position:absolute el menú bajará el contenido de la web de manera natural */
    }

        .nav-links.active {
            display: flex;
        }

        .nav-links .tab-btn, .nav-links .btn, .nav-links span {
            padding: 1rem 1.5rem;
            width: 100%;
            text-align: left;
            border-left: 3px solid transparent;
            border-bottom: none;
            border-radius: 0;
            margin-top: 0 !important;
            height: auto;
            justify-content: flex-start;
        }

            .nav-links .tab-btn.active {
                border-left-color: var(--tertiary);
                background: rgba(255,255,255,0.05);
            }
}

/* CONTROLES DE TABLA (BUSCADOR Y PAGINACIÓN) */
.table-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

    .table-controls input {
        width: 100%;
        max-width: 300px;
        padding: 0.5rem 1rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        outline: none;
        font-size: 0.9rem;
    }

        .table-controls input:focus {
            border-color: var(--secondary);
            box-shadow: 0 0 0 2px rgba(71, 164, 51, 0.1);
        }

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.page-info {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* SELECT MODERNO Y LIMPIO */
.select-moderno {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    border: none !important;
    padding: 0px 18px 0px 4px;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0px center;
    background-size: 14px;
}

    .select-moderno:focus {
        outline: none;
    }

    .select-moderno option {
        background-color: #ffffff;
        color: #333333;
    }

#print-area {
    display: none;
}

@media print {
    html, body {
        background-color: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

        body > *:not(#print-area) {
            display: none !important;
        }

    #print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        min-height: 100vh;
        background-color: #ffffff !important;
    }
}
