:root {
    --color-bg: #f4f7fb;
    --color-bg-card: #ffffff;
    --color-primary: #125b96;
    --color-primary-dark: #0d3e66;
    --color-primary-soft: #e0eef9;
    --color-border: #d7e0ec;
    --color-text: #1f2933;
    --color-text-muted: #6b7280;
    --color-error: #d9534f;
    --color-success: #1c9c68;
    --radius-card: 14px;
    --shadow-soft: 0 18px 35px rgba(15, 23, 42, 0.12);
    --transition-fast: 0.2s ease;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #e0eef9 0, #f4f7fb 55%, #d6e2f5 100%);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* WRAPPER GENERAL DE AUTENTICACIÓN */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 16px;
}

.auth-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 28px 26px 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

/* CABECERA: LOGO + TÍTULO */
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #ffffff;
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 10px;
    box-shadow: 0 10px 25px rgba(18, 91, 150, 0.45);
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--color-primary-dark);
}

.auth-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
}

/* FORMULARIO */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 14px;
    color: var(--color-text-muted);
}

.form-input {
    border-radius: 9px;
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    background-color: #f9fbff;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(18, 91, 150, 0.12);
    background-color: #ffffff;
}

.form-input::placeholder {
    color: #9ca3af;
}

/* AYUDAS DE TEXTO / ERRORES */
.form-help {
    font-size: 11px;
    color: var(--color-text-muted);
}

.form-error {
    font-size: 12px;
    color: var(--color-error);
}

/* BOTONES */
.btn-primary {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-position 0.3s ease;
    background-size: 150% 150%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(18, 91, 150, 0.35);
    background-position: right center;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(18, 91, 150, 0.3);
}

/* ENLACES / FOOTER */
.auth-footer {
    margin-top: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--color-primary-dark);
}

/* ENLACES EN LÍNEA */
.link-inline {
    font-size: 13px;
    text-align: right;
    margin-top: -6px;
    margin-bottom: 4px;
}

.link-inline a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 12px;
}

.link-inline a:hover {
    text-decoration: underline;
}

/* MENSAJES GLOBALES */
.alert {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

.alert-error {
    background-color: #fde2e1;
    color: #842029;
    border: 1px solid #f5c2c0;
}

.alert-success {
    background-color: #e0f5eb;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* RESPONSIVE PEQUEÑO */
@media (max-width: 480px) {
    .auth-card {
        padding: 22px 18px 20px;
    }

    .auth-title {
        font-size: 20px;
    }
}
/* ============================
   ESTILOS APP INTERNA (DASHBOARD)
   ============================ */

.app-body {
    margin: 0;
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #e0eef9 0, #f4f7fb 55%, #d6e2f5 100%);
    color: var(--color-text);

    /* 🔥 Override del body del login */
    display: block;
    width: 100%;
    min-height: 100vh;
}
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;   /* 👈 importante para ocupar todo el ancho */
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER SUPERIOR */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-badge-small {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 18px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.app-header-text {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-weight: 700;
    font-size: 18px;
}

.app-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.app-user-info {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.app-user-name {
    font-weight: 600;
}

.app-user-email {
    opacity: 0.8;
}

/* LAYOUT PRINCIPAL */

.app-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 64px);
}

/* SIDEBAR */

.app-sidebar {
    background: #0f2940;
    color: #e5edf7;
    padding: 16px 10px;
    box-shadow: 6px 0 18px rgba(15, 23, 42, 0.45);
}

.app-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    transition: background-color var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
}

.app-menu-item span {
    flex: 1;
}

.app-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    opacity: 1;
    transform: translateX(2px);
}

.app-menu-item-active {
    background: linear-gradient(135deg, #1f6fb3, #2b8bdc);
    opacity: 1;
}

/* CONTENIDO PRINCIPAL */

.app-main {
    padding: 22px 24px;
}

.app-main-section {
    max-width: 100%;
    margin: 0 auto;
}

.app-main-title {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--color-primary-dark);
}

.app-main-subtitle {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--color-text-muted);
}

/* TARJETAS */

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 10px;
}

.card {
    background: #ffffff;
    border-radius: var(--radius-card);
    padding: 16px 16px 14px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.card-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.card-text {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* BOTONES APP */

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-secondary {
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--color-primary);
    background: #ffffff;
    color: var(--color-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(18, 91, 150, 0.2);
}

.btn-ghost {
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.85);
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        display: none; /* Versión sencilla: ocultamos sidebar en móvil */
    }

    .app-main {
        padding: 18px 16px;
    }

    .app-main-section {
        max-width: 100%;
    }
}


/* TABLAS Y BADGES */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead {
    background: var(--color-primary-soft);
}

.table th,
.table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: 600;
    color: var(--color-primary-dark);
}

.table tbody tr:hover {
    background: #f5f8ff;
}

.table-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
}

/* BADGES ESTADO SALA */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-active {
    background: #e0f5eb;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.badge-inactive {
    background: #fde2e1;
    color: #842029;
    border: 1px solid #f5c2c0;
}

/* HEADER DE CARD CON BOTÓN */

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

/* LINKS DE ACCIÓN EN TABLAS */
.table-link {
    font-size: 12px;
    color: var(--color-primary);
    text-decoration: none;
    margin-right: 10px;
    font-weight: 500;
}

.table-link:hover {
    text-decoration: underline;
}

.table-link-danger {
    color: #b91c1c;
}

/* BOTÓN PELIGRO (por si lo usas luego) */
.btn-danger {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #dc2626;
    background: #fee2e2;
    color: #b91c1c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-danger:hover {
    background: #fecaca;
    transform: translateY(-1px);
    box-shadow: 0 8px 14px rgba(220, 38, 38, 0.25);
}
/* USER DROPDOWN EN HEADER */

.app-user-dropdown {
    position: relative;
}

.app-user-toggle {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(15, 23, 42, 0.15);
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ffffff;
    font: inherit;
}

.app-user-toggle:hover {
    background: rgba(15, 23, 42, 0.3);
}

.app-user-caret {
    font-size: 10px;
    opacity: 0.85;
}

.app-user-menu {
    position: absolute;
    right: 0;
    top: 110%;
    min-width: 160px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
    padding: 6px 0;
    z-index: 50;
    display: none;
}

.app-user-dropdown.is-open .app-user-menu {
    display: block;
}

.app-user-menu-item {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
}

.app-user-menu-item:hover {
    background: #eef2ff;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}
/* ===========================
   CALENDARIO RESERVAS
   =========================== */

.calendar-grid {
    display: grid;
    gap: 8px;
}

/* Vista mensual: 7 columnas (L-D) */
.calendar-grid-month {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-top: 12px;
}

/* Cabecera de días (L, M, X, ...) */
.calendar-header {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

/* Celdas vacías antes del día 1 */
.calendar-cell-empty {
    background: transparent;
}

/* Cada día del mes */
.calendar-cell {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 6px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
}

/* Cabecera de la celda (número del día) */
.calendar-cell-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.calendar-cell-day {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 999px;
}

/* Día de hoy resaltado en azul */
.calendar-cell-today {
    background: #1d4ed8;
    color: #ffffff;
}

/* Contenido de la celda (reservas) */
.calendar-cell-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Chip de reserva dentro del calendario */
.calendar-reserva-pill {
    font-size: 11px;
    line-height: 1.3;
    padding: 3px 6px;
    border-radius: 999px;
    background: #eff6ff;           /* azul muy claro */
    color: #1d4ed8;                /* azul principal */
    border: 1px solid #bfdbfe;     /* borde azul suave */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Mensaje "Sin reservas" / vacío */
.table-empty {
    font-size: 13px;
    color: #94a3b8;
}

/* Botón activo en filtros (Mes/Semana/Día) */
.btn-ghost-active {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
}

@media (max-width: 768px) {
    .calendar-grid-month {
        gap: 6px;
    }

    .calendar-cell {
        min-height: 60px;
        padding: 4px;
    }

    .calendar-reserva-pill {
        font-size: 10px;
    }
}

/* ===========================
   Mini calendario en nueva reserva
   =========================== */

.calendar-grid-mini {
    margin-top: 10px;
}

.calendar-mini-title {
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
}

/* Las celdas del mini calendario son clicables (cuando no son pasadas) */
.calendar-cell-selectable {
    cursor: default;
}

.calendar-cell-selectable .calendar-date-button {
    width: 100%;
    border: none;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    padding: 3px 4px;
    border-radius: 999px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.calendar-cell-selectable .calendar-date-button:hover {
    background: #dbeafe;
}

/* Día seleccionado en el mini calendario */
.calendar-cell-selected {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

/* Días pasados: desactivados */
.calendar-cell-disabled {
    opacity: 0.5;
}

.calendar-cell-disabled .calendar-date-button {
    display: none;
}

.calendar-past-text {
    font-size: 10px;
    color: #9ca3af;
}

/* ===========================
   Formulario de nueva reserva más compacto
   =========================== */

.reserva-form-compact .form-group {
    margin-bottom: 10px;
}

.reserva-form-compact .form-group:last-of-type {
    margin-bottom: 0;
}

/* Grupo de fecha + horas en línea, pero con menos hueco */
.form-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-group-inline-item {
    flex: 1 1 120px;
    min-width: 120px;
}

.reserva-form-compact .form-help {
    margin-top: 2px;
    margin-bottom: 6px;
}

@media (max-width: 768px) {
    .calendar-grid-month.calendar-grid-mini {
        gap: 6px;
    }

    .calendar-cell {
        min-height: 60px;
        padding: 4px;
    }

    .calendar-cell-selectable .calendar-date-button {
        font-size: 10px;
        padding: 2px 4px;
    }
}
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #b91c1c;
    background: #ef4444;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #b91c1c;
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}
