@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Cormorant+Garamond:wght@500;600;700&display=swap");

:root {
    --bg: #efe8d8;
    --paper: #f7f1e6;
    --card: #fbf7f0;
    --ink: #1a2420;
    --muted: #6e7368;
    --line: #d9cfbc;
    --acc: #1f4d3a;
    --yodo: #8a5a2b;
    --ok: #2f6b4f;
    --gold: #c4a574;
    --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { color: var(--ink); }

.nav-ico { width: 18px; height: 18px; flex-shrink: 0; }

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 20;
}
.marca {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.marca .nav-ico { width: 28px; height: 28px; color: var(--acc); }
.marca b {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 22px;
    display: block;
    line-height: 1;
}
.marca small {
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 10px;
}
.quien-top {
    margin-left: auto;
    text-align: right;
    min-width: 0;
}
.quien-top b {
    display: block;
    font-size: 14px;
    line-height: 1.2;
}
.quien-top small {
    color: var(--acc);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 10px;
}
.quien {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 5px solid var(--acc);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.quien span {
    display: inline-block;
    background: var(--acc);
    color: #f7f1e6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 6px;
}
.quien b {
    display: block;
    font-size: 22px;
    font-family: "Cormorant Garamond", Georgia, serif;
}
.quien p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.nav-top, .dock { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-top a, .dock a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    background: #efe8db;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.nav-top a.on, .nav-top a:hover,
.dock a.on, .dock a:hover {
    background: var(--acc);
    color: #f7f1e6;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 22px 16px 48px; }
body.body-app { padding-bottom: 24px; }

h1, h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; margin: 0 0 8px; }
h1 { font-size: 34px; letter-spacing: -.02em; }
.kicker {
    margin: 0 0 4px;
    color: var(--acc);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.muted { color: var(--muted); margin: 0 0 16px; }
.volver {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

#marcar { scroll-margin-top: 12px; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    margin: 0 0 14px;
    box-shadow: 0 10px 24px rgba(26, 36, 32, .04);
}

.camas {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.cama {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-decoration: none;
    border: 3px solid var(--line);
    border-radius: 16px;
    padding: 14px 10px 12px;
    background: #fffdf8;
    min-height: 118px;
    text-align: center;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.cama a { display: block; text-decoration: none; color: inherit; flex: 1; }
a.cama.libre, .cama.libre {
    border-style: dashed;
    border-color: #5a8f6c;
    background: #e7f3ea;
    color: #1f4d3a;
    justify-content: center;
}
a.cama.libre:hover { border-color: var(--acc); border-style: solid; background: #d5eadb; }
.cama b, .cama-n { display: block; font-size: 26px; font-family: "Cormorant Garamond", Georgia, serif; }
.cama span, .cama-nom, .cama-est { display: block; font-size: 12px; margin-top: 6px; }
.cama.libre span { color: #1f4d3a; font-weight: 700; }
.cama-est { font-weight: 700; }
.cama-lib { width: 100%; margin-top: 10px; padding: 8px 8px; font-size: 12px; }
.cama.ocupada {
    background: #e3b07a;
    border-color: #8a5a2b;
    color: #3a2410;
}
.cama.ocupada span, .cama.ocupada .cama-nom, .cama.ocupada .cama-est { color: #3a2410; }
.cama.lista {
    background: #2f6b4f;
    border-color: #1f4d3a;
    color: #f7f1e6;
    animation: cl-pulse 1.2s ease-in-out infinite;
}
.cama.lista span, .cama.lista .cama-nom, .cama.lista .cama-est { color: #f7f1e6; }
.cama.lista .cama-lib { color: #f7f1e6; border-color: rgba(247, 241, 230, .45); }
@keyframes cl-pulse {
    50% { background: #3f8a62; }
}
.cama.volteo {
    background: #e8a54b;
    border-color: #a86a12;
    color: #3a2410;
    animation: cl-pulse-oro 1.2s ease-in-out infinite;
}
.cama.volteo span, .cama.volteo .cama-nom, .cama.volteo .cama-est { color: #3a2410; }
@keyframes cl-pulse-oro {
    50% { background: #f0c36a; }
}

label { display: block; font-size: 13px; font-weight: 700; margin: 10px 0 4px; }
select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"] {
    width: 100%;
    padding: 13px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    background: #fffdf8;
}
.apps { display: grid; gap: 8px; }
.app {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffdf8;
}
.app:has(input:checked) {
    border-color: var(--acc);
    background: #eef4ef;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: var(--acc);
    color: #f7f1e6;
    font: inherit;
    font-weight: 700;
    padding: 13px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 12px;
}
form > .btn, .roles .btn, .card > .btn { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.chico { width: auto; margin: 0; padding: 8px 12px; font-size: 13px; }
.fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.fila:last-child { border-bottom: 0; }
.fila p { margin: 0; }
.fila .acc { display: flex; gap: 8px; flex-shrink: 0; }
.fila.off { opacity: .55; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.yodo { background: var(--yodo); color: #fff; }
.btn.wa { background: var(--ok); }
.roles { display: grid; gap: 10px; }
.roles button { width: 100%; }
.flash {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-left: 4px solid var(--acc);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.cuerpo-box { max-width: 320px; margin: 0 auto; }
svg.cuerpo { width: 100%; height: auto; display: block; touch-action: manipulation; cursor: crosshair; }
.caras { display: flex; gap: 8px; margin: 8px 0 12px; }
.caras button, .caras a.cara-btn {
    flex: 1;
    border: 1px solid var(--line);
    background: #fffdf8;
    border-radius: 999px;
    padding: 10px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: inherit;
}
.caras button.on, .caras a.cara-btn.on { background: var(--acc); color: #f7f1e6; }
.puntos { list-style: none; padding: 0; margin: 12px 0; }
.puntos li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.ticket b { font-size: 28px; font-family: "Cormorant Garamond", Georgia, serif; }

.kpi {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
}
a.card.kpi { text-decoration: none; color: inherit; }
a.card.kpi.on { border-color: var(--acc); background: #eef4ef; }
.kpi p { margin: 0; }
.kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.ticket-lineas p { margin: 4px 0; color: var(--muted); }
.filtro .btn { width: auto; }
@media print {
    .top, .dock, .filtro, .btn, .login-collage, .login-velo { display: none !important; }
    body { background: #fff; padding: 0; }
    .wrap { max-width: none; padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}

.dock {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px calc(8px + var(--safe));
    background: rgba(247, 241, 230, .96);
    border-top: 1px solid var(--line);
    justify-content: space-around;
    z-index: 30;
    backdrop-filter: blur(10px);
}
.dock a {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    background: transparent;
    font-size: 10px;
    padding: 6px 4px;
    min-width: 0;
}
.dock a .nav-ico { width: 22px; height: 22px; }
.dock a.on { background: var(--acc); }

.body-login {
    min-height: 100vh;
    min-height: 100dvh;
    background: #1a2420;
    overflow-x: hidden;
}
.login-collage {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.15fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #111;
}
.login-collage span {
    display: block;
    overflow: hidden;
    min-height: 0;
}
.login-collage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.login-velo {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(26, 36, 32, .35), rgba(26, 36, 32, .55)),
        radial-gradient(ellipse at 50% 40%, rgba(26, 36, 32, .1), rgba(26, 36, 32, .55));
}
.body-login .wrap {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
}
.login-escena {
    width: 100%;
    max-width: 420px;
}
.login-marca {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-align: center;
}
.login-marca .nav-ico { width: 46px; height: 46px; color: var(--acc); }
.login-marca b {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 36px;
    font-weight: 600;
    letter-spacing: .04em;
}
.login-marca small {
    color: var(--muted);
    letter-spacing: .16em;
    text-transform: uppercase;
    font-size: 11px;
}
.login-frase {
    display: none;
    text-align: center;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 22px;
    margin: 0 0 18px;
    color: #f7f1e6;
}
.login-card {
    width: 100%;
    margin: 0;
    padding: 22px 20px 18px;
    background: rgba(247, 241, 230, .96);
    position: relative;
    z-index: 2;
}
.login-rule {
    height: 1px;
    border: 0;
    margin: 16px 0;
    background: linear-gradient(90deg, transparent, #c4b396, transparent);
}
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 84px; }
.pass-ver {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: #efe8db;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.rol-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    background: #fffdf8;
    border-radius: 14px;
    padding: 14px;
    font: inherit;
    cursor: pointer;
    color: inherit;
}
.rol-btn input { margin: 0; flex-shrink: 0; }
.rol-btn .nav-ico { width: 26px; height: 26px; color: var(--acc); }
.rol-btn b { display: block; font-size: 16px; }
.rol-btn span { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.rol-btn:hover,
.rol-btn:has(input:checked) { border-color: var(--acc); background: #eef4ef; }
.login-foot { text-align: center; margin: 16px 0 0; font-size: 12px; }
.login-foot a { font-weight: 700; color: var(--acc); }

@media (min-width: 801px) {
    .login-escena {
        max-width: 1100px;
        display: grid;
        grid-template-columns: 1fr minmax(280px, 420px);
        gap: 40px;
        align-items: center;
    }
    .login-frase {
        display: block;
        text-align: left;
        font-size: clamp(2.2rem, 5vw, 3.8rem);
        line-height: 1.05;
        margin: 0;
        text-shadow: 0 12px 40px rgba(26, 36, 32, .55);
    }
}

@media (max-width: 800px) {
    .nav-top { display: none; }
    .quien-top { margin-left: auto; }
    .kpis { grid-template-columns: 1fr; }
    .dock { display: flex; }
    body.body-app { padding-bottom: calc(78px + var(--safe)); }
    .camas { grid-template-columns: 1fr 1fr; gap: 12px; }
    .cama { min-height: 132px; border-width: 4px; }
    .cama b, .cama-n { font-size: 30px; }
    .cama span, .cama-nom, .cama-est { font-size: 13px; font-weight: 700; }
    h1 { font-size: 28px; }
}
