:root {
    --color-teja: #B83A24;
    --color-teja-dark: #8F2716;
    --color-adobe: #D9C3A5;
    --color-adobe-light: #F8F4EE;
    --color-madera: #5C3A21;
    --color-madera-dark: #382112;
    --color-verde: #27AE60;
    --color-naranja: #E67E22;
    --color-azul: #2980B9;
    --color-rojo: #C0392B;
    --color-dorado: #C99738;
    --color-bg: #F4EBE1;
    --color-card: #FFFFFF;
    --color-texto: #2C2523;
    --color-texto-muted: #7F746B;
    --color-borde: #E3D3C2;
    --font-serif: 'Cinzel', 'Playfair Display', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --sombra: 0 4px 20px rgba(56, 33, 18, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-texto);
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR COLONIAL */
.admin-sidebar {
    width: 280px;
    background: var(--color-madera-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 3px solid var(--color-dorado);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.sidebar-brand {
    padding: 1.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border-bottom: 1px solid rgba(217, 195, 165, 0.2);
}

.brand-badge {
    width: 44px;
    height: 44px;
    background: var(--color-teja);
    color: #fff;
    border: 2px solid var(--color-dorado);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: bold;
    font-size: 1.3rem;
}

.brand-title h2 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: #fff;
    line-height: 1.2;
}

.brand-title span {
    font-size: 0.72rem;
    color: var(--color-dorado);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    list-style: none;
    padding: 1.2rem 0;
    flex-grow: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.6rem;
    color: var(--color-adobe);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border-left: 4px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background: rgba(184, 58, 36, 0.35);
    color: #fff;
    border-left-color: var(--color-dorado);
}

.sidebar-nav li a .badge {
    margin-left: auto;
    background: var(--color-teja);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: bold;
}

.sidebar-footer {
    padding: 1.2rem 1.5rem;
    border-top: 1px solid rgba(217, 195, 165, 0.2);
    font-size: 0.8rem;
    color: var(--color-adobe);
}

.tz-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0,0,0,0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    color: var(--color-dorado);
    font-family: monospace;
}

/* MAIN CONTENT */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

/* TOP NAVBAR */
.admin-header {
    background: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-borde);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left h1 {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    color: var(--color-madera-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.btn-hotel-link {
    background: var(--color-adobe-light);
    color: var(--color-madera-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--color-borde);
    transition: all 0.2s ease;
}
.btn-hotel-link:hover {
    background: var(--color-teja);
    color: #fff;
}

/* CONTAINER */
.admin-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* TARJETAS DE MÉTRICAS */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--color-card);
    padding: 1.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-borde);
    box-shadow: var(--sombra);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-data h3 {
    font-size: 1.85rem;
    font-family: var(--font-serif);
    color: var(--color-madera-dark);
}

.metric-data p {
    font-size: 0.85rem;
    color: var(--color-texto-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.metric-icon.pending { background: rgba(230, 126, 34, 0.15); color: var(--color-naranja); }
.metric-icon.approved { background: rgba(39, 174, 96, 0.15); color: var(--color-verde); }
.metric-icon.upcoming { background: rgba(41, 128, 185, 0.15); color: var(--color-azul); }
.metric-icon.canceled { background: rgba(192, 57, 43, 0.15); color: var(--color-rojo); }

/* VISTAS MODULARES */
.view-section {
    display: none;
}
.view-section.active {
    display: block;
}

/* PANEL CARD */
.panel-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-borde);
    box-shadow: var(--sombra);
    margin-bottom: 2rem;
    overflow: hidden;
}

.panel-header {
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--color-borde);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-header h2 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--color-madera-dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* BOTONES */
.btn {
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.btn-primary { background: var(--color-teja); color: #fff; }
.btn-primary:hover { background: var(--color-teja-dark); }

.btn-success { background: var(--color-verde); color: #fff; }
.btn-success:hover { background: #219653; }

.btn-danger { background: var(--color-rojo); color: #fff; }
.btn-danger:hover { background: #A93226; }

.btn-outline { background: transparent; border: 1px solid var(--color-borde); color: var(--color-texto); }
.btn-outline:hover { background: var(--color-adobe-light); }

/* TABLAS DE RESERVAS */
.table-responsive {
    overflow-x: auto;
}

.table-reservas {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.table-reservas th {
    background: var(--color-adobe-light);
    color: var(--color-madera-dark);
    padding: 0.9rem 1.2rem;
    font-family: var(--font-serif);
    font-weight: 600;
    border-bottom: 2px solid var(--color-borde);
}

.table-reservas td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--color-borde);
    vertical-align: middle;
}

.table-reservas tr:hover {
    background: rgba(217, 195, 165, 0.08);
}

/* BADGES DE ESTADO */
.badge-status {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.badge-status.pendiente { background: rgba(230, 126, 34, 0.15); color: var(--color-naranja); border: 1px solid rgba(230, 126, 34, 0.4); }
.badge-status.aprobada { background: rgba(39, 174, 96, 0.15); color: var(--color-verde); border: 1px solid rgba(39, 174, 96, 0.4); }
.badge-status.cancelada { background: rgba(192, 57, 43, 0.15); color: var(--color-rojo); border: 1px solid rgba(192, 57, 43, 0.4); }

/* CALENDARIO FULLCALENDAR EN PANEL */
#calendar {
    padding: 1.5rem;
    background: #fff;
    min-height: 650px;
}
.fc-toolbar-title {
    font-family: var(--font-serif) !important;
    color: var(--color-madera-dark);
    font-size: 1.4rem !important;
}
.fc-button-primary {
    background-color: var(--color-madera) !important;
    border-color: var(--color-madera-dark) !important;
}
.fc-button-primary:hover {
    background-color: var(--color-teja) !important;
    border-color: var(--color-teja) !important;
}
.fc-event {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* MATRIZ DE DÍAS DISPONIBLES POR HABITACIÓN */
.availability-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.6rem;
    padding: 1.5rem;
}

.day-box {
    border-radius: var(--radius-sm);
    padding: 0.8rem 0.5rem;
    text-align: center;
    border: 1px solid var(--color-borde);
    position: relative;
    transition: all 0.2s ease;
}

.day-box .day-number {
    font-size: 1.15rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.2rem;
}

.day-box .day-status {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 600;
}

.day-box.disponible {
    background: #E8F8F0;
    border-color: #A9DFBF;
    color: #1E8449;
}

.day-box.ocupado {
    background: #FDEDEC;
    border-color: #F5B7B1;
    color: #922B21;
}

.day-box.pasado {
    background: #F2F3F4;
    border-color: #D5D8DC;
    color: #7F8C8D;
    opacity: 0.7;
}

/* MODALES */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-backdrop.show {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 100%;
    border: 1px solid var(--color-borde);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 1.2rem 1.5rem;
    background: var(--color-adobe-light);
    border-bottom: 1px solid var(--color-borde);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-family: var(--font-serif);
    color: var(--color-madera-dark);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--color-texto-muted);
}

.modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--color-adobe-light);
    border-top: 1px solid var(--color-borde);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

/* FORMULARIOS EN MODAL */
.form-group-admin {
    margin-bottom: 1rem;
}
.form-group-admin label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-madera-dark);
    margin-bottom: 0.35rem;
}
.form-control-admin {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-borde);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.92rem;
}
.form-control-admin:focus {
    outline: none;
    border-color: var(--color-teja);
    box-shadow: 0 0 0 3px rgba(184, 58, 36, 0.1);
}

/* RESPONSIVE */
@media (max-width: 992px) {
    body { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; }
    .availability-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
    .availability-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-content { padding: 1rem; }
}
