body {
    font-family: 'Inter', sans-serif;
    background-color: #f7f9fb;
    min-height: 100vh;
}

.card {
    background-color: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .1), 0 0px 10px -5px rgba(0, 0, 0, .04);
    transition: all .3s ease;
    border-radius: 1rem
}

.btn-primary {
    background-color: #3b82f6;
    transition: background-color .3s ease
}

.btn-primary:hover {
    background-color: #2563eb
}

#recaptcha-container {
    margin: 10px 0;
    display: flex;
    justify-content: center;
}

.grecaptcha-badge {
    visibility: hidden !important;
}

#fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #e2e8f0;
    padding: .75rem 0;
    text-align: center;
    font-size: .875rem;
    color: #4b5563;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, .05);
    z-index: 99
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100
}

.dashboard-container {
    width: 100%;
    min-height: 100vh;
    display: none;
    padding-bottom: 3rem;
}

/* LOADING SCREEN */
#app-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f7f9fb;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-btn {
    cursor: pointer;
    padding: 0.2rem;
}

.menu-logo-icon {
    height: 40px;
    width: auto;
    transition: transform 0.2s;
}

.menu-btn:hover .menu-logo-icon {
    transform: scale(1.05);
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar.show {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

@media (min-width: 1024px) {
    .sidebar {
        left: 0 !important;
        box-shadow: none;
        border-right: 1px solid #e5e7eb;
        top: 60px;
        height: calc(100% - 60px);
    }

    .sidebar-overlay {
        display: none !important;
    }

    .menu-btn {
        display: none;
    }

    .main-content {
        margin-left: 280px;
        padding: 2rem;
    }

    .header {
        padding-left: 1rem;
    }
}

.menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: background 0.2s;
    font-weight: 500;
    color: #374151;
}

.menu-item:hover {
    background: #f1f5f9;
}

.menu-item.has-submenu {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu {
    padding-left: 1rem;
    display: none;
}

.submenu.show {
    display: block;
}

.main-content {
    padding: 1rem;
    flex: 1;
    padding-bottom: 4rem;
}

.welcome-section {
    text-align: center;
    padding: 2rem;
    display: none;
    /* Hidden by default to prevent flicker */
}

.profile-modal {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.profile-field {
    margin-bottom: 1rem;
}

.profile-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #4b5563;
}

.profile-field .value {
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 0.375rem;
}

.avatar-upload {
    text-align: center;
    margin-bottom: 1.5rem;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 2px solid #e2e8f0;
}

.generic-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 0 auto;
}

.login-container {
    display: none;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.pasajeros-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    font-size: 0.75em;
}

@media (min-width: 1024px) {
    .pasajeros-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pasajero-item {
    padding: 2px 4px;
    background: #eff6ff;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1e3a8a;
}

.admin-list-item {
    border-left: 4px solid #3b82f6;
    transition: all 0.2s;
}

.admin-list-item:hover {
    transform: translateX(4px);
    background-color: #f8fafc;
}

.admin-list-container {
    max-height: 600px;
    overflow-y: auto;
}

.missing-dob {
    background-color: #fef08a !important;
    border-left-color: #eab308 !important;
}

.highlight {
    background-color: #fef08a;
    font-weight: bold;
}

.ticket-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.stat-card {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.ruta-option {
    cursor: pointer;
    transition: transform 0.2s;
}

.ruta-option:hover {
    transform: scale(1.02);
}

.history-detail {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

.history-item.active .history-detail {
    display: block;
}

.history-item {
    transition: background-color 0.2s;
}

.auditoria-modal {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.ticket-preview {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 10px;
    border: 1px solid #ccc;
    background: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* CHAT STYLES */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #f0f2f5;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 0.5rem 0.5rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-area {
    background: white;
    padding: 10px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #ddd;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.chat-input:focus {
    border-color: #3b82f6;
}

.send-btn {
    background: #3b82f6;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #2563eb;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    position: relative;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

.message-bubble.mine {
    align-self: flex-end;
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 5px;
}

.message-bubble.others {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-bubble.conductor {
    border: 2px solid #fbbf24;
    /* Amber/Yellow border for conductor */
}

.message-info {
    font-size: 0.75rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    opacity: 0.8;
}

.message-bubble.mine .message-info {
    color: #e0e7ff;
}

.message-sender {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}