/* ========== RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Inter, sans-serif;
}

em, i:not(.fas):not(.fab):not(.far) {
    font-family: Ubuntu, sans-serif;
    font-style: italic;
}

/* ========== VARIABLES ========== */
:root {
    --color-primary: #042A44;
    --color-accent: #005CB9;
    --color-accent-hover: #0E3064;
    --color-accent-muted: #005CB957;
    --color-border: #D8D8D8;
    --color-text-muted: #666;
    --color-danger: #dc3545;
    --primary-color: #005CB9;
    --primary-dark: #004a94;
    --text-dark: #0E3064;
    --text-gray: #626262;
    --text-light: #6A7E93;
    --border-color: #E5E4E4;
    --background-gray: #f4f7fa;
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

/* ========== TÍTULO PRINCIPAL ========== */
.page-title {
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 28px;
    color: #0E3064;
    padding: 0;
    margin-bottom: 20px;
}

    .page-title i {
        color: #005CB9;
        margin-right: 12px;
    }

/* ========== FILTROS BAR ========== */
.filtros-bar {
    background: #E8F0FE80;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: nowrap;
    margin-bottom: 14px;
    overflow-x: auto;
}

.acciones {
    font-family: Inter;
    font-weight: 400;
    font-size: 14px;
    line-height: 28px;
    text-align: right;
    vertical-align: middle;
    color: #626262;
}

.filtro-icon {
    color: #888;
    font-size: 13px;
    flex-shrink: 0;
}

.filtro-item {
    display: flex;
    align-items: center;
    padding: 0px 10px;
    width: 160px;
    height: 28px;
    background: white;
    white-space: nowrap;
    flex-shrink: 0;
}

    .filtro-select,
    .filtro-item select,
    .filtro-item input[type="date"] {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: none;
        border: none;
        background: transparent;
        font-size: 14px;
        color: #626262;
        outline: none;
        cursor: pointer;
        min-width: 140px;
    }

.filtro-buscador {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    background: white;
    border: 1px solid #005CB933;
    border-radius: 21px;
    padding: 5px 12px;
    height: 28px;
    min-width: 180px;
}

    .filtro-buscador i {
        color: #aaa;
        font-size: 13px;
    }

    .filtro-buscador input {
        border: none;
        background: transparent;
        font-size: 13px;
        color: #333;
        outline: none;
        flex: 1;
        min-width: 0;
    }

        .filtro-buscador input::placeholder {
            color: #bbb;
        }

.btn-limpiar-x {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
}

    .btn-limpiar-x:hover {
        color: #dc3545;
    }

/* ========== TOOLBAR USUARIOS ========== */
.select-cliente {
    border: none;
    outline: none;
    font-size: 0.85rem;
    color: #334155;
    background: transparent;
    cursor: pointer;
    min-width: 140px;
}

.buscador {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    background: #fff;
    flex: 1;
    max-width: 320px;
}

    .buscador i {
        color: #94a3b8;
    }

    .buscador input {
        border: none;
        outline: none;
        font-size: 0.85rem;
        color: #334155;
        width: 100%;
        background: transparent;
    }

/* ========== TABLAS ========== */
.tabla-wrapper {
    background: white;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    border: 1px solid #e8edf2;
}

.tabla-reservas {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

    .tabla-reservas thead tr {
        background: #E4EAF0;
        border-bottom: 1px solid #e8edf2;
    }

    .tabla-reservas th {
        padding: 0px 12px;
        text-align: center;
        font-weight: 600;
        color: #6A7E93;
        background: #E4EAF0;
        font-size: 14px;
        white-space: normal;
        line-height: 1.3;
    }

    .tabla-reservas td {
        padding: 9.5px 12px;
        border-bottom: 1px solid #f0f3f6;
        color: #2d3748;
        white-space: nowrap;
        vertical-align: middle;
        font-size: 12.5px;
        text-align: center;
    }

    .tabla-reservas tbody tr:hover {
        background: #f8fafc;
    }

/* ========== BADGES ========== */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    display: inline-block;
}

.badge-activo {
    background: #dcfce7;
    color: #16a34a;
}

.badge-inactivo {
    background: #ffebee;
    color: #c62828;
}

/* ========== BOTONES ÍCONO ========== */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 6px;
    color: #64748b;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

    .btn-icon:hover {
        background: #f1f5f9;
        color: #334155;
    }

    .btn-icon.btn-danger {
        color: #94a3b8;
    }

        .btn-icon.btn-danger:hover {
            background: #fee2e2;
            color: #dc2626;
        }

/* ========== LOADING / EMPTY ========== */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    gap: 12px;
}

    .empty-state i {
        font-size: 36px;
        color: #ccc;
    }

    .empty-state p,
    .loading-state p {
        font-size: 14px;
        margin: 0;
    }

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e7ef;
    border-top-color: #005CB9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== PAGINACIÓN ========== */
.paginacion {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 20px 0px;
    border-top: 1px solid #f0f3f6;
    background: #ffffff;
}

.total-label {
    font-size: 15px;
    color: #005CB9;
    font-weight: 500;
    justify-self: start;
}

.paginas {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: center;
}

.pag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #005CB9;
    background: none;
    border: none;
    padding: 4px 8px;
}

    .pag-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .pag-btn:hover:not(:disabled) {
        color: #0E3064;
    }

.pag-numero {
    min-width: 60px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #4b5563;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeInBg 0.2s ease-out;
}

@keyframes fadeInBg {
    from { background: rgba(0, 0, 0, 0); }
    to { background: rgba(0, 0, 0, 0.5); }
}

.modal-container {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-large {
    width: 490px;
    height: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        margin: 0;
        font-size: 1.25rem;
        color: #0E3064;
        font-family: Inter;
        font-weight: 600;
        font-size: 18px;
        line-height: 28px;
        letter-spacing: 0%;
        vertical-align: middle;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ========== FORMULARIOS ========== */
.form-group {
    margin-bottom: 1rem;
}

    .form-group label {
        font-family: Ubuntu;
        font-weight: 400;
        font-size: 12px;
        line-height: 100%;
        letter-spacing: 0%;
        vertical-align: middle;
    }

.form-control {
    width: 100%;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #005CB933;
    padding: 0 8px;
    font-size: 13px;
    box-sizing: border-box;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* ========== BOTONES ========== */
.btn-primary {
    background: #005CB9;
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary {
    background: #ecf0f1;
    color: #7f8c8d;
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* ========== ACCIONES BAR ========== */
.acciones-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

/* ========== SWEETALERT ========== */
.swal2-title {
    color: #0E3064;
    font-weight: 500;
    font-size: 16px;
}

.swal2-html-container {
    color: black;
    font-weight: 300;
    font-size: 13px;
}

.btn-mantener {
    background: white;
    width: 88px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #005CB980;
    margin-right: 18px;
    font-family: Ubuntu, sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 34px;
    text-align: center;
    color: #005CB9;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-mantener:hover {
        background: #005CB920;
        border-color: #005CB9;
    }

.btn-cancelar-alerta {
    background: white;
    width: 88px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #A92424;
    margin-right: 18px;
    font-family: Ubuntu, sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 34px;
    text-align: center;
    color: #A92424;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-cancelar-alerta:hover {
        background: #A9242420;
        border-color: #A92424;
    }

/* ========== SIDEBAR FIX ========== */
.sidebar i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-style: normal !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal-large {
    width: 490px;
    height: fit-content;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0f3f6;
    flex-shrink: 0;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f3f6;
    flex-shrink: 0;
    background: white;
    border-radius: 0 0 12px 12px;
}

.modal-body::-webkit-scrollbar {
    width: 0px;
}

/* Botón crear */
.btn-crear {
    background: #005CB9;
    color: white;
    border: none;
    padding: 9px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 2px 2px 4px 0px #00000040;
}

    .btn-crear:hover {
        background: #004a94;
    }

/* ========== TOGGLE SWITCH GLOBAL ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}

    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        border-radius: 50%;
        transition: 0.3s;
    }

.toggle-switch input:checked + .toggle-slider {
    background-color: #2563eb;
}

    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(20px);
    }

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.toggle-label {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
}

/* ========== ESTADO ICONS ========== */
.estado-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

    .estado-icon.confirmada {
        color: #46D3B2;
        border: 1px solid #46D3B2;
    }

    .estado-icon.cancelada {
        color: #E63A3A;
        border: 1px solid #E63A3A;
    }

.btn-cancelar {
    background: white;
    width: 88px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #005CB980;
    margin-right: 18px;
    font-family: Ubuntu, sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 34px;
    text-align: center;
    color: #005CB9;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-guardar {
    background: #005CB9;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.donut-totales-hidden {
    visibility: hidden;
}



.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
}

.btn-icon.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #6c757d !important;
    border-color: #f5c6cb !important;
}


/* Mensajes de error */
.error-message {
    color: #dc3545;
    font-size: 11px;
    margin-top: 4px;
    display: block;
}