:root {
    color-scheme: light;
    --ink: #0b1f3a;
    --petroleum: #0e4d6c;
    --accent: #1f6f8b;
    --paper: #f4f6f8;
    --card: #ffffff;
    --line: #d5dde5;
    --muted: #5c6b7a;
    --ok: #1b7f4e;
    --warn: #8a5a00;
    --focus: #0b1f3a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.5;
}

a {
    color: var(--petroleum);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--card);
    padding: 0.5rem 0.75rem;
}

.skip:focus {
    top: 1rem;
}

.shell {
    width: min(920px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.5rem 0 3rem;
}

.masthead {
    background: var(--ink);
    color: #f7fafc;
    padding: 1.5rem 0;
}

.masthead .shell {
    padding: 0;
}

.eyebrow {
    margin: 0 0 0.35rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--petroleum);
}

.masthead .eyebrow {
    color: #b7c9d6;
}

h1,
h2 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    margin: 0;
    font-size: 2rem;
}

h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.lede {
    max-width: 62ch;
    margin: 0.75rem 0 0;
    color: #d5e2ea;
}

.grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.25rem;
}

.card p {
    margin: 0.35rem 0 0;
}

.status {
    font-size: 1.05rem;
}

.muted {
    color: var(--muted);
}

.detail {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.steps {
    margin: 0.5rem 0 0;
    padding-left: 1.15rem;
}

.steps li + li {
    margin-top: 0.35rem;
}

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

    h1 {
        font-size: 1.6rem;
    }
}

/* Fase 1: formularios de acceso y panel */
.form-card {
    max-width: 440px;
    margin-top: 1.5rem;
}

.form-card form {
    display: grid;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    margin-top: 0.5rem;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 1px;
}

button[type="submit"] {
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    border: 0;
    border-radius: 6px;
    background: var(--petroleum);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button[type="submit"]:hover {
    background: var(--ink);
}

.alert {
    margin: 0.5rem 0;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.alert ul {
    margin: 0;
    padding-left: 1.1rem;
}

.alert-error {
    border-color: #b42318;
    background: #fdf1f0;
    color: #7a1a12;
}

.alert-ok {
    border-color: var(--ok);
    background: #eef8f2;
    color: #14583a;
}

.alert-warn {
    border-color: var(--warn);
    background: #fff7e6;
    color: #6b4500;
}

/* Menú lateral */
.app-frame {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
}

.sidenav {
    display: flex;
    flex-direction: column;
    width: 16.5rem;
    flex: 0 0 16.5rem;
    background: var(--ink);
    color: #f7fafc;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow: auto;
}

.sidenav-brand {
    margin: 0;
    padding: 1.15rem 1rem 0.35rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    overflow-wrap: anywhere;
}

.detail-list {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.detail-list dt {
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
}

.sidenav-section {
    margin: 0;
}

.sidenav .sidenav-heading {
    margin: 0.95rem 1rem 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #9bb0c3;
}

.sidenav-section:first-of-type .sidenav-heading {
    margin-top: 0.45rem;
}

.sidenav ul {
    margin: 0 0 0.2rem;
    padding: 0;
    list-style: none;
}

.sidenav a {
    display: block;
    color: #f7fafc;
    text-decoration: none;
    padding: 0.48rem 1rem;
    border-left: 3px solid transparent;
}

.sidenav a:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sidenav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #7ec8e3;
}

.sidenav-user {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.9rem 1rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidenav-user button[type="submit"] {
    margin-top: 0;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.sidenav-user button[type="submit"]:hover {
    background: rgba(255, 255, 255, 0.08);
}

.masthead-bar {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.2rem 0 0;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.menu-toggle-bars {
    position: relative;
    display: block;
    width: 1rem;
    height: 2px;
    background: #ffffff;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 1rem;
    height: 2px;
    background: #ffffff;
}

.menu-toggle-bars::before {
    top: -5px;
}

.menu-toggle-bars::after {
    top: 5px;
}

.sidenav-backdrop {
    display: none;
}

html.nav-collapsed .sidenav {
    width: 0;
    flex-basis: 0;
    overflow: hidden;
}

@media (max-width: 900px) {
    .app-frame {
        flex-direction: column;
    }

    .sidenav {
        position: relative;
        width: 100%;
        flex-basis: auto;
        height: auto;
        max-height: 70vh;
    }

    html.nav-enhanced .app-frame {
        display: block;
    }

    html.nav-enhanced .sidenav {
        position: fixed;
        z-index: 40;
        top: 0;
        left: 0;
        width: min(18rem, 88vw);
        height: 100vh;
        max-height: none;
        transform: translateX(-105%);
        transition: transform 0.18s ease;
    }

    html.nav-enhanced.nav-open .sidenav {
        transform: translateX(0);
        overflow: auto;
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.28);
    }

    html.nav-enhanced .sidenav-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(11, 31, 58, 0.48);
    }

    html.nav-collapsed .sidenav {
        width: min(18rem, 88vw);
        flex-basis: auto;
    }
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.toolbar h2 {
    margin: 0;
}

.button,
button.secondary {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    border: 1px solid var(--petroleum);
    background: var(--petroleum);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

button.secondary {
    margin-top: 0;
    background: #ffffff;
    color: var(--petroleum);
}

button.secondary:hover {
    background: var(--paper);
}

button.link-button,
button[type="submit"].link-button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--petroleum);
    font: inherit;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
}

form.inline {
    display: inline;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.filters .field {
    flex: 1 1 160px;
}

.filters .field-narrow {
    flex: 0 1 100px;
}

.filters .field-actions {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.field label,
.filters label {
    margin-top: 0;
}

select,
textarea,
input[type="number"],
input[type="tel"] {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
}

select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 1px;
}

.form-wide {
    margin-top: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}

.field-full,
.form-actions {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: #b42318;
}

.field-error {
    margin: 0;
    color: #7a1a12;
    font-size: 0.9rem;
}

.stack {
    display: grid;
    gap: 0.4rem;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.75rem;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table.data th,
table.data td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

table.data th {
    background: var(--paper);
    font-weight: 600;
    white-space: nowrap;
}

table.data .actions {
    white-space: nowrap;
}

.actions a + a,
.actions a + form,
.actions form + a {
    margin-left: 0.75rem;
}

.row-off td {
    color: var(--muted);
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.spaced {
    margin-top: 1rem;
}

.details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
    margin: 0.75rem 0;
}

.details dt {
    font-weight: 600;
}

.details dd {
    margin: 0;
}

.pre {
    white-space: pre-line;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ok { background: #eef8f2; color: #14583a; border-color: #9fd3b6; }
.badge-off { background: #eef1f4; color: #44515e; border-color: #c4ccd5; }`n.badge-warn { background: #fff7e6; color: #6b4500; border-color: #f0cf8c; }

/* Colores semánticos por estado (sección 6 del plan); el texto siempre acompaña al color. */
.estado-disponible { background: #eef8f2; color: #14583a; border-color: #9fd3b6; }
.estado-reservada { background: #eaf2fb; color: #174a7c; border-color: #a9c7e8; }
.estado-ocupada { background: #fdf1f0; color: #7a1a12; border-color: #f0b4ad; }
.estado-limpieza { background: #fff7e6; color: #6b4500; border-color: #f0cf8c; }
.estado-mantenimiento { background: #f3eefb; color: #4b2a7b; border-color: #c9b6e8; }
.estado-bloqueada { background: #eef1f4; color: #2f3a45; border-color: #9aa6b2; }
.estado-fuera-servicio { background: #2f3a45; color: #ffffff; border-color: #2f3a45; }

.status-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.status-summary li {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.status-count {
    font-size: 1.4rem;
    font-weight: 700;
}

@media (max-width: 760px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Tablas como tarjetas apiladas en pantallas pequeñas. */
    table.data thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    table.data,
    table.data tbody,
    table.data tr,
    table.data td {
        display: block;
        width: 100%;
    }

    table.data tr {
        border: 1px solid var(--line);
        border-radius: 6px;
        margin-bottom: 0.6rem;
        padding: 0.3rem 0;
    }

    table.data td {
        border-bottom: 0;
        padding: 0.25rem 0.75rem;
    }

    table.data td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
    }

    table.data .actions {
        white-space: normal;
    }
}

/* Fase 4: estados de reserva */
.badge.estado-res-solicitada { background: #eef2ff; color: #3730a3; }
.badge.estado-res-confirmada { background: #ecfdf5; color: #065f46; }
.badge.estado-res-pendiente { background: #fffbeb; color: #92400e; }
.badge.estado-res-checkin { background: #eff6ff; color: #1e40af; }
.badge.estado-res-checkout { background: #f3f4f6; color: #374151; }
.badge.estado-res-cancelada { background: #fef2f2; color: #991b1b; }
.badge.estado-res-no-show { background: #faf5ff; color: #6b21a8; }
.calendar-table .cal-day { text-align: center; min-width: 1.6rem; }
.calendar-table .cal-busy { background: #dbeafe; text-align: center; color: #1d4ed8; font-weight: 700; }

/* Fase 8 dashboards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}
.kpi-card {
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: #fff;
}
.kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.25rem 0 0;
}
.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #eef2ff;
    margin: 0.15rem;
    font-size: 0.85rem;
}
.badge-warn {
    background: #fff4e5;
}
.spaced {
    margin-top: 1.25rem;
}
meter {
    width: 100%;
    height: 0.75rem;
}

/* --- Hotel unico / lujo Iquique (2026-10-29) --- */
:root {
    --ink: #0a2744;
    --petroleum: #0c3d5c;
    --accent: #1a5f7a;
    --sand: #c4a574;
    --sand-soft: #e8dcc8;
    --paper: #f7f4ef;
    --card: #ffffff;
    --line: #d9d0c3;
    --muted: #5a6570;
    --ok: #1b7f4e;
    --warn: #8a5a00;
    --focus: #0a2744;
    --gold: #b8954f;
}

body {
    font-family: "Segoe UI", "Helvetica Neue", Georgia, serif;
    background:
        radial-gradient(ellipse at top right, rgba(184, 149, 79, 0.08), transparent 40%),
        var(--paper);
}

.masthead {
    background: linear-gradient(135deg, #071a2e 0%, #0a2744 55%, #0c3d5c 100%);
    border-bottom: 3px solid var(--gold);
}

.masthead .eyebrow {
    color: var(--sand-soft);
    letter-spacing: 0.12em;
}

.sidenav {
    background: #071a2e;
    color: #e8eef4;
}

.sidenav-brand {
    color: var(--sand-soft);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.sidenav a {
    color: #d5e0ea;
}

.sidenav a[aria-current="page"],
.sidenav a:hover {
    color: #fff;
    background: rgba(184, 149, 79, 0.18);
}

.card {
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(10, 39, 68, 0.06);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
}

.form-grid .field-span,
.form-grid .form-actions,
.form-grid .field-actions {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.2);
    outline: none;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
    border-color: #a33;
}

.field-error,
.error-text {
    color: #8b1e1e;
    font-size: 0.85rem;
    margin: 0.35rem 0 0;
}

button,
.button {
    background: linear-gradient(180deg, #1a5f7a, #0c3d5c);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.05);
}

.login-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: stretch;
    margin-top: 1rem;
}

.login-brand {
    background: linear-gradient(160deg, #071a2e, #0c3d5c 70%, #1a5f7a);
    color: #f7f4ef;
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid rgba(184, 149, 79, 0.35);
    box-shadow: 0 20px 50px rgba(7, 26, 46, 0.25);
}

.login-brand h1 {
    margin: 0.35rem 0 0.75rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: #fff;
}

.login-brand .lede {
    color: #d7e2ec;
    max-width: 36ch;
}

.login-perks {
    margin: 1.5rem 0 0;
    padding-left: 1.1rem;
    color: var(--sand-soft);
    line-height: 1.7;
}

.login-card {
    align-self: center;
}

.form-stack .field {
    margin-bottom: 1rem;
}

.badge-ok { background: #e6f5ec; color: #1b7f4e; }
.badge-warn { background: #fff4db; color: #8a5a00; }
.badge-off { background: #eee; color: #666; }

@media (max-width: 860px) {
    .login-hero { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
