/* ============================================
   OBSERVATORIO DE PASAJEROS - STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a1a1a;
    --secondary: #4a4a4a;
    --accent: #00a86b;
    --danger: #e63946;
    --warning: #f77f00;
    --bg: #fafafa;
    --card: #ffffff;
    --border: #e0e0e0;
    --text: #2d2d2d;
    --text-light: #6b6b6b;
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* HEADER */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 14px;
    color: var(--text-light);
}

.btn-logout {
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}

/* LOGIN SCREEN */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 50px;
}

.logo {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.tagline {
    font-size: 14px;
    color: var(--text-light);
}

.login-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* HAMBURGER MENU */
.menu-icon {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 1000;
}

.menu-icon span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s;
}

.menu-dropdown {
    position: absolute;
    top: 80px;
    right: 30px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 0;
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
    z-index: 999;
}

.menu-dropdown.active {
    display: block;
}

.menu-dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.menu-dropdown a:hover {
    background: var(--bg);
}

/* FORMS */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
    padding: 0;
}

.password-requirements {
    background: var(--bg);
    padding: 15px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

.password-requirements ul {
    margin-top: 8px;
    margin-left: 20px;
}

/* BUTTONS */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #000;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-icon {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ALERTS */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* TABS */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s;
    white-space: nowrap;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* CARDS */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 5px;
}

/* TABLES */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

tr {
    cursor: pointer;
    transition: background 0.2s;
}

tr:hover {
    background: var(--bg);
}

/* STATUS BADGES */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pago {
    background: #d4edda;
    color: #155724;
}

.status-prueba {
    background: #fff3cd;
    color: #856404;
}

.status-vencido {
    background: #f8d7da;
    color: #721c24;
}

/* TOGGLE SWITCH */
.toggle {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.active {
    background: var(--accent);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle.active::after {
    transform: translateX(18px);
}

/* FILTERS */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ACTION BUTTONS */
.action-btns {
    display: flex;
    gap: 8px;
}

/* SEARCH RESULTS */
.search-result {
    padding: 30px;
    text-align: center;
    border: 2px solid var(--accent);
    border-radius: 12px;
    background: #f0fdf4;
}

.search-result.warning {
    border-color: var(--danger);
    background: #fff5f5;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.result-data {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.data-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.data-label {
    font-weight: 600;
    width: 180px;
    color: var(--secondary);
}

.data-value {
    flex: 1;
}

.info-box {
    background: var(--primary);
    color: white;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
}

/* MODALS */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    line-height: 1;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 25px 0 15px;
    color: var(--secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.forgot-password {
    text-align: center;
    margin-top: 16px;
}

.forgot-password a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 14px;
}

.footer {
    text-align: center;
    margin-top: 40px;
    font-size: 13px;
    color: var(--text-light);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .tabs {
        overflow-x: auto;
    }

    table {
        font-size: 13px;
    }

    td, th {
        padding: 10px 8px;
    }

    .menu-icon {
        top: 20px;
        right: 20px;
    }

    .menu-dropdown {
        top: 70px;
        right: 20px;
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
