@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600;700&display=swap');

:root {
    /* Paleta Premium Hotel */
    --primary: #eb1b24;
    --primary-hover: #f32a33;
    --on-primary: #ffffff;
    
    /* Fondos */
    --bg-color: #0F0F10;
    --sidebar-bg: #151515;
    --surface: #1D1D1D;
    --surface-sec: #242424;
    
    /* Bordes */
    --border-color: #323232;
    
    /* Textos */
    --text-main: #FFFFFF;
    --text-muted: #B8B8B8;
    --text-disabled: #707070;
    
    /* Estados */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    
    --error: #DC2626;
    --error-bg: rgba(220, 38, 38, 0.1);
    
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Radios */
    --radius-btn: 12px;
    --radius-input: 12px;
    --radius-card: 16px;
    --radius-full: 9999px;

    /* Sombras y Animaciones */
    --shadow-card: 0 10px 30px -10px rgba(0,0,0,0.5);
    --glow-primary: 0 0 0 2px rgba(235, 27, 36, 0.3);
    --trans-soft: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --trans-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    margin-top: 0;
    font-weight: 500;
}

p { margin: 0 0 1rem 0; color: var(--text-muted); }
a { color: inherit; text-decoration: none; }

/* === LAYOUT (Sidebar + Content) === */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--trans-soft);
}

.brand {
    padding: 28px 24px;
    text-align: center;
}
.brand-logo,
.login-logo {
    display: block;
    height: 80px !important;
    width: auto;
    max-width: 100%;
    margin: 0 auto 12px;
    object-fit: contain;
}
.brand h1 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    gap: 8px;
}
.nav a, .nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-btn);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--trans-soft);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    width: 100%;
    text-align: left;
}
.nav a i, .nav button i {
    font-size: 20px;
}

.nav a:hover, .nav button:hover {
    background-color: var(--surface-sec);
    color: var(--text-main);
}
.nav a.active {
    background-color: var(--primary);
    color: var(--on-primary);
}
.nav a.active i {
    color: var(--on-primary);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0; /* previene desbordamiento en grid */
}

.top-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 40px;
    background: transparent;
    gap: 16px;
    flex-wrap: wrap;
}
.top-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.container {
    padding: 0 40px 40px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.menu-toggle { display: none; }

.sidebar-overlay {
    display: none;
    opacity: 0;
    transition: opacity var(--trans-soft);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* === COMPONENTES === */

/* Paneles/Cards */
.panel {
    background-color: var(--surface);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-color);
    padding: 32px;
    box-shadow: var(--shadow-card);
    margin-bottom: 32px;
    transition: transform var(--trans-soft), box-shadow var(--trans-soft), border-color var(--trans-soft);
    animation: fadeInUp 0.45s ease-out both;
}
.panel h2 {
    font-size: 18px;
    margin-bottom: 24px;
    font-weight: 600;
    color: var(--text-main);
}

/* Formularios & Inputs */
label {
    display: block;
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
.input-group { margin-bottom: 20px; }

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon-wrap > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}
.input-icon-wrap input {
    padding-left: 46px;
}
.input-icon-wrap input[type="date"] {
    padding-right: 12px;
}
.input-icon-wrap:focus-within > i {
    color: var(--primary);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256' fill='%23B8B8B8'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 42px;
    cursor: pointer;
}

input[type="text"], input[type="password"], input[type="number"], input[type="date"], select {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background-color: var(--surface-sec);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    transition: all var(--trans-soft);
    appearance: none;
}
input[type="date"] {
    color-scheme: dark;
    min-height: 48px;
    cursor: pointer;
    position: relative;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.75) sepia(1) saturate(5) hue-rotate(320deg);
    cursor: pointer;
    opacity: 0.85;
    padding: 4px;
    border-radius: 6px;
    transition: opacity var(--trans-soft);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
    color: var(--text-main);
}
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: var(--text-main);
    padding: 0 2px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow-primary);
}
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 8px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    min-height: 48px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: transform var(--trans-fast), background-color var(--trans-soft), border-color var(--trans-soft), opacity var(--trans-soft), box-shadow var(--trans-soft);
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-color);
    background-color: var(--surface-sec);
    color: var(--text-main);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn i { font-size: 18px; }

.btn:hover { background-color: var(--border-color); }

.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
    border: 1px solid var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--on-primary);
}

.btn-success { background-color: var(--success); color: #000; border-color: var(--success); }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background-color: var(--error); color: #fff; border-color: var(--error); }
.btn-danger:hover { filter: brightness(1.1); }

.panel--danger {
    border-color: rgba(220, 38, 38, 0.35);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.06) 0%, var(--surface) 120px);
}
.panel--danger h2 {
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 10px;
}
.panel--danger code {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-sec);
}

.btn-full { width: 100%; }

.btn:active:not(:disabled):not(.is-loading) {
    transform: scale(0.98);
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.88;
    color: transparent;
}

.btn-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn-spinner {
    display: block;
}

.btn-primary.is-loading .btn-spinner {
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
}

.btn:not(.btn-primary).is-loading .btn-spinner {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: var(--text-main);
}

/* Acciones */
.actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* Alertas */
.error, .ok {
    padding: 16px;
    border-radius: var(--radius-btn);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}
.error { background-color: var(--error-bg); color: var(--error); border: 1px solid rgba(220, 38, 38, 0.2); }
.ok { background-color: var(--success-bg); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.2); }

.alert-animate {
    animation: slideInDown 0.35s ease-out both;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert-animate.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

/* === PÁGINAS === */

/* Login */
.login-wrapper {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(24px, env(safe-area-inset-left));
    overflow: hidden;
    background-color: #080809;
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -5%, rgba(235, 27, 36, 0.18) 0%, transparent 58%),
        radial-gradient(ellipse 55% 45% at 100% 100%, rgba(196, 149, 88, 0.1) 0%, transparent 52%),
        radial-gradient(ellipse 45% 35% at 0% 85%, rgba(235, 27, 36, 0.08) 0%, transparent 48%),
        linear-gradient(165deg, #141416 0%, #0c0c0d 42%, #080809 100%);
}

.login-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-bg__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.7;
    animation: loginGlow 8s ease-in-out infinite alternate;
}

.login-bg__glow--primary {
    top: -8%;
    left: 50%;
    width: min(520px, 90vw);
    height: min(520px, 90vw);
    transform: translateX(-50%);
    background: rgba(235, 27, 36, 0.22);
}

.login-bg__glow--warm {
    bottom: -12%;
    right: -8%;
    width: min(420px, 75vw);
    height: min(420px, 75vw);
    background: rgba(196, 149, 88, 0.14);
    animation-delay: -4s;
}

.login-bg__pattern {
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.9) 1px, transparent 1px);
    background-size: 56px 72px;
    mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 20%, transparent 75%);
}

.login-bg__shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

@keyframes loginGlow {
    from { transform: translateX(-50%) scale(1); opacity: 0.55; }
    to { transform: translateX(-50%) scale(1.08); opacity: 0.85; }
}

.login-bg__glow--warm {
    animation-name: loginGlowWarm;
}

@keyframes loginGlowWarm {
    from { transform: scale(1); opacity: 0.45; }
    to { transform: scale(1.1); opacity: 0.75; }
}

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(22, 22, 24, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: fadeInUp 0.5s ease-out both;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.85;
}
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}
.login-brand .login-logo {
    margin-bottom: 16px;
}
.login-brand h1 {
    color: var(--primary);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}
.login-brand p {
    margin: 0;
    font-size: 14px;
}
/* Dashboard Summary */
.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}
.summary--two {
    grid-template-columns: repeat(2, 1fr);
}
.badge.free { background: var(--success-bg); color: var(--success); }
.badge.busy { background: var(--error-bg); color: var(--error); }
.badge.cleaning { background: var(--info-bg); color: var(--info); }

.subscription-trial { background: var(--info-bg); color: var(--info); }
.subscription-active { background: var(--success-bg); color: var(--success); }
.subscription-suspended { background: var(--warning-bg); color: var(--warning); }
.subscription-expired { background: var(--error-bg); color: var(--error); }

.stat {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 28px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform var(--trans-soft), box-shadow var(--trans-soft);
    animation: fadeInUp 0.45s ease-out both;
}
.stat:hover { transform: translateY(-2px); }

.stat--filterable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.stat--filterable:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.stat--filterable.active {
    border-color: var(--primary);
    background: rgba(235, 27, 36, 0.06);
    box-shadow: 0 0 0 1px rgba(235, 27, 36, 0.25);
}
.summary .stat:nth-child(1) { animation-delay: 0.05s; }
.summary .stat:nth-child(2) { animation-delay: 0.1s; }
.summary .stat:nth-child(3) { animation-delay: 0.15s; }
.summary .stat:nth-child(4) { animation-delay: 0.2s; }
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-btn);
    background: var(--surface-sec);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
}
.stat-info b {
    display: block;
    font-size: 32px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-info span {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Grilla de Habitaciones */
.rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}
.room {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform var(--trans-soft), border-color var(--trans-soft), box-shadow var(--trans-soft);
    cursor: pointer;
    animation: fadeInUp 0.4s ease-out both;
    -webkit-tap-highlight-color: transparent;
}
.room:hover {
    transform: translateY(-4px);
    border-color: var(--text-disabled);
    box-shadow: var(--shadow-card);
}
.room:active {
    transform: scale(0.98);
}
.rooms .room:nth-child(1) { animation-delay: 0.03s; }
.rooms .room:nth-child(2) { animation-delay: 0.06s; }
.rooms .room:nth-child(3) { animation-delay: 0.09s; }
.rooms .room:nth-child(4) { animation-delay: 0.12s; }
.rooms .room:nth-child(5) { animation-delay: 0.15s; }
.rooms .room:nth-child(6) { animation-delay: 0.18s; }
.rooms .room:nth-child(n+7) { animation-delay: 0.21s; }

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.room .num {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
}
.room-icon {
    font-size: 24px;
    color: var(--text-muted);
    opacity: 0.5;
}

.badge {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.room-footer {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.room-price {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-main);
}

/* Colores de estado en Rooms */
.room.free .badge { background: var(--success-bg); color: var(--success); }
.room.free .room-icon { color: var(--success); opacity: 1; }

.room.busy .badge { background: var(--error-bg); color: var(--error); }
.room.busy .room-icon { color: var(--error); opacity: 1; }

.room.cleaning .badge { background: var(--info-bg); color: var(--info); }
.room.cleaning .room-icon { color: var(--info); opacity: 1; }

.badge.inactive,
.room.inactive .badge { background: var(--surface-sec); color: var(--text-muted); }
.room.inactive { opacity: 0.55; border-style: dashed; }
.room.inactive .num { color: var(--text-muted); }

.room.is-expired {
    border-color: var(--warning);
    animation: expiredPulse 1.6s ease-in-out infinite;
}
.room.is-expired .badge { background: var(--warning-bg); color: var(--warning); }
.room.is-expired .room-icon { color: var(--warning); }

@keyframes expiredPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.room[hidden] { display: none; }

/* Check-in choice cards (rates, payment methods) */
.choice-options {
    display: grid;
    gap: 8px;
}
.choice-options--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.choice-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface-sec);
    cursor: pointer;
    transition: border-color var(--trans-soft), background-color var(--trans-soft);
    -webkit-tap-highlight-color: transparent;
}
.choice-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.choice-option__icon {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.choice-option__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}
.choice-option__price {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.1;
}
.choice-option__desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.25;
}
.choice-option:hover {
    border-color: var(--text-disabled);
}
.choice-option.active {
    border-color: var(--primary);
    background: rgba(235, 27, 36, 0.08);
}
.choice-option.active .choice-option__icon {
    color: var(--primary);
}

@media (max-width: 768px) {
    .choice-options { gap: 6px; }
    .choice-option { padding: 10px; border-radius: 8px; }
    .choice-option__icon { font-size: 16px; }
    .choice-option__title { font-size: 13px; }
    .choice-option__price { font-size: 16px; }
    .choice-option__desc { font-size: 10px; }
}

.consumption-items {
    display: grid;
    gap: 10px;
}

.consumption-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.consumption-item__fields {
    display: grid;
    gap: 8px;
}

.consumption-item__remove {
    padding: 10px 12px;
    border-color: var(--border-color);
}

.consumption-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin: 20px 0 24px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border-color);
    background: var(--surface-sec);
}

.consumption-summary span {
    font-size: 13px;
    color: var(--text-muted);
}

.consumption-summary b {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    color: var(--primary);
}

@media (min-width: 640px) {
    .consumption-item__fields {
        grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr);
    }
}

.settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

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

/* Room quick search */
.room-search {
    position: relative;
    max-width: 360px;
    margin-bottom: 24px;
}
.room-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}
.room-search input[type="text"] {
    padding-left: 44px;
    background-color: var(--surface);
}
.room-search-empty {
    text-align: center;
    padding: 32px 16px;
}

@media (max-width: 768px) {
    .room-search { max-width: none; }
}

.room-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
.room-type i {
    font-size: 18px;
    color: var(--text-main);
}

/* Stay countdown */
.countdown {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.countdown b {
    font-family: 'Poppins', sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}
.countdown-label--expired { display: none; }
.countdown.is-expired,
.countdown.is-expired b { color: var(--warning); }
.countdown.is-expired .countdown-label--active { display: none; }
.countdown.is-expired .countdown-label--expired { display: inline; font-weight: 600; }

.countdown--large {
    padding: 16px;
    background: var(--surface-sec);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-btn);
    font-size: 14px;
}
.countdown--large b { font-size: 28px; width: 100%; }
.countdown--large.is-expired { background: var(--warning-bg); border-color: var(--warning); }

@media (prefers-reduced-motion: reduce) {
    .room.is-expired { animation: none; }
}


/* Grillas */
.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* Tablas Premium */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-color);
    background: var(--surface);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 18px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    font-weight: 500;
    color: var(--text-muted);
    background-color: rgba(0,0,0,0.2);
    font-size: 13px;
    letter-spacing: 0.5px;
}
.table tr { transition: background-color var(--trans-fast); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background-color: rgba(235, 27, 36, 0.03); }


/* Configuración Grid */
.settings-rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.settings-room {
    background: var(--surface-sec);
    padding: 16px;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border-color);
}

/* Coming Soon / En desarrollo */
.coming-soon {
    max-width: 560px;
    margin: 40px auto;
    text-align: center;
    padding: 56px 40px;
}
.coming-soon-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    border-radius: var(--radius-card);
    background: var(--surface-sec);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary);
}
.coming-soon h2 {
    font-size: 22px;
    margin-bottom: 16px;
    border: none;
    padding: 0;
}
.coming-soon p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
}
.coming-soon-note {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px !important;
}

/* Reports */
.summary--four {
    grid-template-columns: repeat(4, 1fr);
}

.stat--compact {
    padding: 20px 24px;
}

.stat--compact .stat-info b {
    font-size: 22px;
}

.report-filters h2,
.report-panel--header h2 {
    margin-bottom: 8px;
}

.reports-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.reports-top .report-panel {
    margin-bottom: 0;
}

.report-panel--header {
    padding: 24px 28px;
}

.report-panel--header .report-filters-header {
    margin-bottom: 0;
}

.report-panel--filters {
    padding: 24px 28px;
}

.report-panel--filters .report-period-tabs {
    margin-bottom: 20px;
}

.report-panel--filters .report-range-label {
    margin-bottom: 0;
}

.report-filters p,
.report-panel--header p {
    margin: 0;
    font-size: 14px;
}

.report-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.report-export-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-period-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.report-period-tab {
    padding: 10px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--surface-sec);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--trans-soft);
    cursor: pointer;
}

.report-period-tab:hover {
    border-color: var(--text-disabled);
    color: var(--text-main);
}

.report-period-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.report-filters-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    align-items: end;
}

.report-filters-grid .input-group {
    margin-bottom: 0;
}

.report-filters-grid select,
.report-filters-grid input[type="date"] {
    height: 48px;
}

.report-filter-actions {
    margin-bottom: 0;
}

.report-range-label {
    margin: 20px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.report-chart-panel h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    margin-bottom: 20px;
}

.report-chart-panel h2 i {
    color: var(--primary);
}

.chart-container {
    position: relative;
    height: 280px;
}

.chart-container--short {
    height: 220px;
}

.report-method-breakdown {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-method-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface-sec);
    border-radius: var(--radius-btn);
    font-size: 13px;
}

.report-method-item b {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
}

.report-consumption-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-consumption-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface-sec);
    border-radius: var(--radius-btn);
    border: 1px solid var(--border-color);
}

.report-consumption-item span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.report-consumption-item b {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
}

.report-empty-hint {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

.report-table-empty {
    text-align: center;
    padding: 48px !important;
    color: var(--text-muted);
}

.report-table-footer td {
    background: rgba(235, 27, 36, 0.05);
    font-family: 'Poppins', sans-serif;
}

.badge.busy { background: var(--error-bg); color: var(--error); }

/* Payment detail */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.detail-label {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--text-muted);
}
.detail-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-family: 'Poppins', sans-serif;
}
.detail-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}
.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.detail-item span {
    font-size: 13px;
    color: var(--text-muted);
}
.detail-item b {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
}
.detail-item--highlight {
    grid-column: 1 / -1;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
.detail-summary {
    border-color: rgba(235, 27, 36, 0.25);
}
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Ticket Impresión */
.print-area { display: flex; justify-content: center; margin-bottom: 40px; }
.ticket {
    background: #FFFFFF;
    color: #000000;
    width: 100%;
    max-width: 340px;
    padding: 32px;
    font-family: 'Courier New', Courier, monospace;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ticket h3 { text-align: center; margin: 0 0 16px; font-size: 20px; font-weight: bold; color:#000; }
.ticket-subtitle { text-align: center; font-size: 12px; margin-bottom: 24px; color: #555; }
.ticket-section { font-size: 11px; margin: 12px 0 6px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }
.ticket-footer { text-align: center; font-size: 12px; color: #555; margin-top: 16px; }
.ticket hr { border: 0; border-top: 1px dashed #000; margin: 16px 0; }
.ticket-row { display: flex; justify-content: space-between; margin: 8px 0; font-size: 14px; }
.ticket-row--spaced { margin-top: 8px; }
.ticket-row--total { font-size: 16px; margin-top: 16px; }


/* === ANIMACIONES Y LOADING === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-content {
    animation: fadeIn 0.3s ease-out both;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    background: rgba(15, 15, 16, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--trans-soft), visibility var(--trans-soft);
}

.page-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.page-loader__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 160px;
    padding: 24px 28px;
    border-radius: var(--radius-card);
    background: var(--surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.3s ease-out both;
}

.page-loader__card span {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

body.is-loading {
    cursor: progress;
}

.nav a {
    transition: background-color var(--trans-soft), color var(--trans-soft), transform var(--trans-fast);
}

.nav a:active {
    transform: scale(0.98);
}

.table tr {
    animation: fadeIn 0.35s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .page-loader {
        transition: none;
    }
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        padding-top: env(safe-area-inset-top);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0,0,0,0.8);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 90;
    }
    .sidebar-overlay.visible {
        display: block;
        opacity: 1;
    }
    .main-content { margin-left: 0; }
    
    .top-header {
        padding: 0 24px;
        padding-top: env(safe-area-inset-top);
        justify-content: space-between;
        min-height: 64px;
        height: auto;
    }
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        color: var(--text-main);
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
    }
    
    .container {
        padding: 0 24px 24px 24px;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
    .grid2 { grid-template-columns: 1fr; }
    .actions .btn { flex: 1 1 100%; }
}

@media (max-width: 768px) {
    .page-loader__card {
        min-width: 140px;
        padding: 20px 24px;
    }

    .spinner {
        width: 32px;
        height: 32px;
    }

    .panel {
        animation-duration: 0.35s;
    }

    .room {
        animation-duration: 0.35s;
    }
    .summary, .summary--two, .summary--four { grid-template-columns: 1fr; gap: 16px; }
    .report-filters-grid { grid-template-columns: 1fr; }
    .report-filters-header { flex-direction: column; align-items: stretch; }
    .report-charts-grid { grid-template-columns: 1fr; }
    .report-export-actions { width: 100%; }
    .report-export-actions .btn { flex: 1; justify-content: center; min-width: 0; }
    .report-period-tabs { gap: 6px; }
    .report-period-tab { flex: 1 1 calc(50% - 6px); text-align: center; justify-content: center; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-header { flex-direction: column; }
    .detail-actions { width: 100%; }
    .detail-actions .btn { flex: 1 1 100%; }
    .rooms { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .panel { padding: 24px; margin-bottom: 24px; }
    .login-card {
        padding: 32px 24px;
        border-radius: 24px;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .login-bg__glow {
        filter: blur(40px);
    }
    .login-logo { margin-bottom: 12px; }
    .login-brand { margin-bottom: 32px; }
    .table th, .table td { padding: 14px 16px; }
    .stat { padding: 20px; }
    .stat-info b { font-size: 28px; }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="email"],
    input[type="tel"],
    select {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .rooms { grid-template-columns: 1fr; }
    .top-header h2 { font-size: 18px; }
    .container { padding-left: 16px; padding-right: 16px; }
    .top-header { padding-left: 16px; padding-right: 16px; }
    .login-wrapper { padding: 16px; }
    .login-card { padding: 28px 20px; }
    .settings-rooms { grid-template-columns: 1fr; }
    .report-period-tab { flex: 1 1 100%; }
}

/* Confirm dialog (mobile bottom sheet) */
.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.confirm-dialog[hidden] {
    display: none !important;
}
.confirm-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    animation: fadeIn 0.2s ease-out;
}
.confirm-dialog__sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 28px 24px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    animation: confirmSlideUp 0.28s ease-out;
}
.confirm-dialog__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    border: none;
    padding: 0;
}
.confirm-dialog__message {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}
.confirm-dialog__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}
.confirm-dialog__actions .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
}
body.confirm-open {
    overflow: hidden;
}

@keyframes confirmSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 769px) {
    .confirm-dialog {
        align-items: center;
        padding: 24px;
    }
    .confirm-dialog__sheet {
        border-radius: var(--radius-card);
        border: 1px solid var(--border-color);
        animation: fadeInUp 0.25s ease-out;
    }
    .confirm-dialog__actions {
        flex-direction: row-reverse;
    }
    .confirm-dialog__actions .btn {
        flex: 1;
    }
}

/* === PRINT === */
@media print {
    body { background: white; color: black; }
    .sidebar, .top-header, .container > *:not(.print-area), .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .print-area { margin: 0; padding: 0; display: flex !important; }
    .ticket { border: none; box-shadow: none; max-width: 80mm; padding: 0; }
}
