:root {
    --primary-blue: #0056b3;
    --accent-red: #ff3131;
    --bg-dark: #002d5e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #0056b3 0%, #001a35 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 20px;
}

/* Pestañas Admin */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid var(--glass-border);
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 10px;
}

.tab-btn.active {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 49, 49, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.app-container {
    width: 100%;
    max-width: 450px;
    text-align: center;
}

/* Logos */
.main-header {
    margin-bottom: 30px;
}

.main-logo {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.admin-logo-small {
    max-width: 80px;
    margin-bottom: 10px;
}

/* Grid para fecha/hora */
.form-group-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-group-row input {
    flex: 1;
}

/* Admin Dashboard */
.admin-dashboard {
    max-width: 900px;
    width: 95%;
    margin: 20px auto;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 15px;
}

input,
select {
    width: 100%;
    padding: 15px;
    background: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    color: #333;
    font-family: inherit;
    outline: none;
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Control de Etapas */
.stage-container {
    display: none;
}

.stage-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Loader */
.loader-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1.5rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 30px;
    overflow: hidden;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background: white;
    transform-origin: left;
    transform: scaleX(1);
}

/* Admin Table */
.table-container {
    margin-top: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pendiente {
    background: #ffd700;
    color: #333;
}

.status-aprobada {
    background: #28a745;
    color: white;
}

.status-rechazada {
    background: #dc3545;
    color: white;
}

.status-timeout {
    background: #6c757d;
    color: white;
}

.btn-small {
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    font-family: inherit;
}

.btn-approve {
    background: #28a745;
    color: white;
}

.btn-reject {
    background: #dc3545;
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

/* Alert Banner */
.alert-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4757;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 20px;
}

.alert-content button {
    background: white;
    color: #ff4757;
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
}

/* RESPONSIVE: TABLA A TARJETAS */
@media screen and (max-width: 768px) {
    .admin-dashboard {
        width: 100%;
        padding: 5px;
    }

    .table-container.glass {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100%;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 20px;
        border: 1px solid var(--glass-border);
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.05);
        padding: 15px;
    }

    td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        position: relative;
        padding: 12px 10px 12px 45%;
        text-align: right;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-height: 45px;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 40%;
        text-align: left;
        font-weight: 800;
        color: var(--text-secondary);
        font-size: 0.7rem;
        text-transform: uppercase;
    }

    .actions {
        gap: 10px;
        flex-direction: column;
    }

    .btn-small {
        width: 100%;
        text-align: center;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    margin-top: 40px;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* PWA Install Banner */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 15px 20px;
    background: rgba(0, 45, 94, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 9999;
    animation: slideUp 0.4s ease;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 1rem;
}

.btn-install {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 49, 49, 0.4);
}

.btn-install:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 49, 49, 0.5);
}

.btn-install:active {
    transform: scale(0.97);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}