/* ==========================================================================
   1. VARIABLES Y RESET (Paleta Beyond The Wall)
   ========================================================================== */
:root {
    --primary: #1e3a8a;
    /* Azul Profundo corporativo */
    --accent: #3b82f6;
    /* Azul Brillante para botones */
    --success: #22c55e;
    /* Verde para pagado */
    --danger: #ef4444;
    /* Rojo para deudas/descuentos */
    --warning: #f59e0b;
    /* Naranja para pendientes */

    --bg-main: #f1f5f9;
    /* Fondo principal (Gris azulado muy suave) */
    --bg-card: #f6f6f6;
    /* Blanco para las tarjetas */
    --bg-sidebar: #e1f5fb;
    /* Azul claro para la barra lateral */
    --text-main: #1e293b;
    /* Texto principal (Casi negro) */
    --text-muted: #64748b;
    /* Texto secundario (Gris) */
    --border: #e2e8f0;
    /* Color de bordes suaves */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

[v-cloak] {
    display: none;
}

/* Oculta el parpadeo de las llaves {{ }} al cargar Vue */

/* ==========================================================================
   2. ESTRUCTURA (Layout principal)
   ========================================================================== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* --- BARRA LATERAL (Sidebar fija) --- */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar .logo {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
}

.sidebar .logo h2 {
    font-size: 1.4rem;
    margin: 0;
}

.imagen {
    border-radius: 50px;
    margin-bottom: 10px;
}

.sidebar nav {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.sidebar nav button {
    background: transparent;
    border: none;
    padding: 12px 15px;
    border-radius: 6px;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar nav button:hover {
    background-color: var(--accent);
    color: var(--primary);
    font-weight: 600;
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;

}

.sidebar nav button.active {
    background-color: var(--accent);
    color: white;
    font-weight: 600;
}

.user-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- CONTENIDO PRINCIPAL --- */
.content {
    flex: 1;
    margin-left: 260px;
    /* Compensa el ancho de la barra fija */
    padding: 30px;
    max-width: 1400px;
}

header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 15px;
}

header h1 {
    color: var(--primary);
    font-size: 1.8rem;
    margin: 0;
}

/* ==========================================================================
   3. TARJETAS Y CONTENEDORES (Cards)
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 25px;
    margin-bottom: 20px;
    border-top: #1e293b 4px solid;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.grid-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Seguro contra el bug de altura infinita de Chart.js */
canvas {
    max-height: 300px !important;
}

.caligrafia {
    font-family: 'Pacifico', cursive;
    color: #d32f2f;
    font-size: 30px;
    text-shadow: #3498db 1px 1px 1px;
}

/* ==========================================================================
   4. FORMULARIOS E INPUTS (FLEXBOX RESCATADO)
   ========================================================================== */
.formulario-reserva {
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

.field-group {
    margin-bottom: 15px;
    /* width: 100%; <- ESTA ERA LA LÍNEA QUE ROMPÍA TU DISEÑO. Eliminada. */
}

.field-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

/* --- TU FLEX BIEN CHÉVERE --- */
.flex-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    /* Hace que las cajas de texto se alineen por debajo, sin importar el tamaño del Label */
    margin-bottom: 15px;
}

.flex-row .field-group {
    margin-bottom: 0;
    /* Evita que el contenedor sume doble margen */
}

/* --- ESTILOS DE LOS INPUTS --- */
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #fafafa;
    transition: all 0.2s ease;
    height: 42px;
    /* Obliga a que los inputs y los select tengan EXACTAMENTE el mismo alto */
    box-sizing: border-box;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    /* Efecto de luz azul al escribir */
}

/* --- RESUMEN EN VIVO (ZONA FINANCIERA) --- */
.resumen-pago {
    background-color: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
}

.resumen-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--primary);
    font-size: 1.1rem;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    font-weight: bold;
}

/* ==========================================================================
   5. BOTONES (Incluye la animación solicitada)
   ========================================================================== */
.btn-primary {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.4s ease;
    display: block;
    text-align: center;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent);
    color: rgb(248, 230, 230);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    border-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: white;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.btn-icon {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ==========================================================================
   6. TABLAS (Datagrid)
   ========================================================================== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: var(--bg-main);
    padding: 15px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

tbody tr:hover {
    background-color: #f8fafc;
}

/* Etiquetas de estado */
.status-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pagada {
    background: #dcfce7;
    color: #166534;
}

.status-pendiente {
    background: #fef3c7;
    color: #92400e;
}

/* ==========================================================================
   7. MODAL DE PAGOS (Gestión de cartera)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    /* Efecto cristal detrás del modal */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    width: 650px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* ==========================================================================
   8. PLANTILLA PDF (Oculta en pantalla, se usa para HTML2PDF)
   ========================================================================== */
#plantilla-recibo {
    padding: 40px;
    color: var(--text-main);
    background: white;
    width: 800px;
}

.header-recibo {
    display: flex;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.clear-fix {
    clear: both;
}

/* ==========================================================================
   9. GRID DEL FORMULARIO DE RESERVA (3 columnas con secciones)
   ========================================================================== */
.reserva-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    margin-bottom: 20px;
}

/* Campos que ocupan 2 columnas (Tour, Horario) */
.reserva-grid .span-2 {
    grid-column: span 2;
}

/* Campos que ocupan las 3 columnas (divisores, recibo, botón) */
.reserva-grid .span-3 {
    grid-column: 1 / -1;
}

/* --- Divisor de sección --- */
.section-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.section-divider span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* --- Ajustes internos del campo --- */
.reserva-grid .field-group {
    margin-bottom: 0;
}

.reserva-grid .field-group input,
.reserva-grid .field-group select {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
}

/* --- Botón de toggle $/ % del descuento --- */
.discount-toggle {
    font-size: 0.75rem;
    font-weight: bold;
    background: #eff6ff;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}

.discount-toggle:hover {
    background: var(--accent);
    color: white;
}

/* --- Indicador de unidad dentro del input (COP / %) --- */
.input-unit-wrap {
    position: relative;
}

.input-unit-wrap input {
    padding-right: 44px;
}

.unit-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

/* --- Recibo en vivo dentro del grid --- */
.live-receipt {
    grid-column: 1 / -1;
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 14px 18px;
}

.live-receipt h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 3px 0;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: bold;
    border-top: 2px dashed var(--border);
    margin-top: 8px;
    padding-top: 8px;
    color: var(--text-main);
}

/* ==========================================================================
   10. SIDEBAR ACORDEÓN
   ========================================================================== */
.nav-group {
    margin-bottom: 2px;
}

/* Cabecera del grupo (el botón que colapsa) */
.nav-group-header {
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: left;
}

.nav-group-header:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}

.nav-group-icon {
    font-size: 0.8rem;
    width: 14px;
    text-align: center;
}

/* Flecha que rota al abrir/cerrar */
.nav-chevron {
    margin-left: auto;
    font-size: 0.62rem;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.nav-group-header.open .nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Contenedor colapsable con transición suave */
.nav-group-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
    padding-left: 8px;
}

/* Botones hijos dentro del acordeón */
.nav-group-items button {
    width: 100%;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    padding: 9px 12px;
    border-radius: 0 6px 6px 0;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 2px;
}

.nav-group-items button i {
    width: 14px;
    text-align: center;
    font-size: 0.85rem;
}

.nav-group-items button:hover:not(:disabled) {
    background-color: rgba(59, 130, 246, 0.08);
    border-left-color: var(--accent);
    color: var(--primary);
}

.nav-group-items button.active {
    background-color: var(--accent);
    border-left-color: var(--primary);
    color: white;
    font-weight: 600;
}

.nav-group-items button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Badge "Pronto" para ítems en construcción */
.badge-soon {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ==========================================================================
   11. MINI SIDEBAR (Estado colapsado)
   ========================================================================== */

/* Botón de toggle (la flechita) */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 20px;
    right: -14px;
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    box-shadow: var(--shadow-md);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    z-index: 200;
}

.sidebar-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.sidebar-toggle i {
    font-size: 0.65rem;
    transition: transform 0.35s ease;
}

/* El logo necesita position: relative para que el botón se ancle bien */
.sidebar .logo {
    position: relative;
}

/* Transición suave del ancho del sidebar */
.sidebar {
    transition: width 0.35s ease;
    overflow: hidden;
}

/* --- ESTADO COLAPSADO --- */
.sidebar.collapsed {
    width: 62px;
}

/* Oculta texto del logo */
.sidebar.collapsed .sidebar-logo-img,
.sidebar.collapsed .sidebar-logo-text {
    display: none;
}

/* Centra la flechita cuando no hay logo */
.sidebar.collapsed .logo {
    display: flex;
    justify-content: center;
    padding: 18px 0;
}

.sidebar.collapsed .sidebar-toggle {
    position: static;
    margin: 0 auto;
}

/* Cabeceras de grupo: solo muestra el ícono, centra */
.sidebar.collapsed .nav-group-header {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
}

.sidebar.collapsed .nav-group-header span,
.sidebar.collapsed .nav-group-header .nav-chevron {
    display: none;
}

.sidebar.collapsed .nav-group-icon {
    font-size: 1rem;
    width: auto;
}

/* Ítems hijos: solo ícono, centrado, con tooltip nativo */
.sidebar.collapsed .nav-group-items {
    padding-left: 0;
}

.sidebar.collapsed .nav-group-items button {
    justify-content: center;
    padding: 10px 0;
    border-left: none;
    border-radius: 6px;
    gap: 0;
}

.sidebar.collapsed .nav-group-items button i {
    font-size: 1rem;
    width: auto;
}

/* Oculta el texto y el badge en los botones hijos */
.sidebar.collapsed .nav-text,
.sidebar.collapsed .badge-soon {
    display: none;
}

/* Tooltip sobre los íconos al colapsar */
.sidebar.collapsed .nav-group-items button {
    position: relative;
}

.sidebar.collapsed .nav-group-items button::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-main);
    color: white;
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 999;
}

.sidebar.collapsed .nav-group-items button:hover::after {
    opacity: 1;
}

/* Ajuste del contenido principal para el estado inicial */
.content {
    transition: margin-left 0.35s ease;
}

.select-compacto {
    padding-top: 8px;
    border-radius: 12px;
    border: 1px solid #e0f7b9;
    font-size: 0.8rem;
    background-color: lightcyan;
    color: #333;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    appearance: base-select;
    transition: border-color 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

.select-compacto:hover {
    border-color: #999;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.1);
}