/* ---------- Paleta ---------- */
:root {
  --bg: #f4f3ee; --panel: #ffffff; --ink: #1b2420; --muted: #667069; --line: #e6e3d9; --soft: #faf9f5;
  --brand: #0F5C47; --brand-ink: #ffffff; --brand-soft: #e4f1ec;
  --azul: #0F5C47; --naranja: #ea580c; --verde: #059669; --violeta: #7c3aed; --ambar: #d97706; --rosa: #e11d48; --cian: #0891b2;
  --ok: #047857; --warn: #b45309; --bad: #be123c;
  --ok-bg: #d1fae5; --warn-bg: #fef3c7; --bad-bg: #ffe4e6;
  --ocupado: #c8e6da; --entrada: #3aa384; --salida: #fcd34d; --cambio: #c4b5fd; --conflicto: #fb7185;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .05);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1613; --panel: #15201b; --ink: #e9efe9; --muted: #94a39b; --line: #26352e; --soft: #19261f;
    --brand: #4FB596; --brand-ink: #06241b; --brand-soft: #12352c;
    --azul: #4FB596; --naranja: #fb923c; --verde: #34d399; --violeta: #a78bfa; --ambar: #fbbf24; --rosa: #fb7185; --cian: #22d3ee;
    --ok: #6ee7b7; --warn: #fcd34d; --bad: #fda4af;
    --ok-bg: #0f3d2e; --warn-bg: #44330c; --bad-bg: #4a1626;
    --ocupado: #1c4a3b; --entrada: #3aa384; --salida: #a16207; --cambio: #6d4fc4; --conflicto: #be123c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }

/* ---------- Encabezado ---------- */
header { background: linear-gradient(120deg, #08392d 0%, #0F5C47 55%, #146B54 100%); position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 12px rgba(8, 57, 45, .35); }
.bar { display: flex; align-items: center; gap: 16px; padding: 0 20px; max-width: 1440px; margin: 0 auto; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 15px; padding: 5px 0; color: #fff; display: flex; align-items: center; gap: 10px; letter-spacing: .01em; }
.logo svg { width: 32px; height: 32px; }
.logo .pill { font-size: 10px; padding: 1px 7px; background: #fde68a; color: #78350f; border-color: transparent; }
nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
nav button { background: none; border: 0; padding: 5px 10px; margin: 5px 0; color: #cfe8df; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 9px; transition: background .15s, color .15s; }
nav button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
nav button.on { background: rgba(255, 255, 255, .95); color: #0F5C47; font-weight: 700; }
main { max-width: 1440px; margin: 0 auto; padding: 18px 24px; }
h2 { margin: 0 0 16px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel > h3::before, .panel > .row > h3::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--brand); display: inline-block; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.grow { flex: 1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow); }

/* ---------- Tarjetas de indicadores ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { --acento: var(--brand); position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px 11px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--acento); }
.card::after { content: ''; position: absolute; right: -28px; top: -28px; width: 110px; height: 110px; border-radius: 50%; background: var(--acento); opacity: .07; }
.card .t { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 7px; line-height: 1.25; }
.card .ic { width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--acento) 14%, transparent); color: var(--acento); flex: none; }
.card .ic svg { width: 14px; height: 14px; }
.card .v { font-size: 21px; font-weight: 800; margin-top: 8px; white-space: nowrap; color: var(--acento); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.card .v.neg { color: var(--bad); } .card .v.pos { color: var(--acento); }
.card .s { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.3; }
.t-azul { --acento: var(--azul); } .t-naranja { --acento: var(--naranja); } .t-verde { --acento: var(--verde); } .t-violeta { --acento: var(--violeta); }
.t-ambar { --acento: var(--ambar); } .t-rosa { --acento: var(--rosa); } .t-cian { --acento: var(--cian); } .t-rojo { --acento: var(--rosa); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 18px; }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: var(--soft); position: sticky; top: 0; z-index: 1; border-bottom: 2px solid var(--line); }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--brand) 5%, transparent); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.sub td { font-weight: 800; background: var(--brand-soft); border-top: 2px solid color-mix(in srgb, var(--brand) 30%, var(--line)); color: var(--ink); }
tr.apagada td { opacity: .55; }
.scroll { overflow: auto; max-height: 68vh; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.scroll table { min-width: 100%; }

/* ---------- Botones y campos ---------- */
button.b, a.b { background: var(--brand); color: var(--brand-ink); border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 0 1px 2px rgba(15, 92, 71, .3); transition: filter .15s, transform .05s; }
button.b:hover, a.b:hover { filter: brightness(1.08); }
button.b:active { transform: translateY(1px); }
button.b.sec, a.b.sec { background: var(--panel); color: var(--ink); border-color: var(--line); box-shadow: none; }
button.b.sec:hover, a.b.sec:hover { background: var(--brand-soft); border-color: var(--brand); filter: none; }
button.b.sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
button.b.danger { background: var(--bad); color: #fff; }
button.b:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); max-width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
label.f input, label.f select, label.f textarea { color: var(--ink); font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ---------- Etiquetas y estados ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--soft); border: 1px solid var(--line); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.canal { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.canal::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.canal.c-Airbnb { --c: var(--rosa); } .canal.c-Booking { --c: var(--violeta); } .canal.c-Directo { --c: var(--verde); } .canal.c-Otro { --c: var(--muted); }
.chip { display: inline-block; padding: 1px 9px; border-radius: 8px; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.muted { color: var(--muted); }
.neg { color: var(--bad); font-weight: 600; } .pos { color: var(--ok); font-weight: 600; }
.bar-h { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; min-width: 90px; }
.bar-h > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #F4B73F); border-radius: 4px; }
.bar-h.over > i { background: linear-gradient(90deg, var(--naranja), var(--rosa)); }
.bar-h.verde > i { background: linear-gradient(90deg, var(--verde), var(--cian)); }
.bar-h.violeta > i { background: linear-gradient(90deg, var(--violeta), var(--brand)); }
.bar-h.naranja > i { background: linear-gradient(90deg, var(--ambar), var(--naranja)); }
.mini { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.mini .bar-h { width: 70px; min-width: 70px; }

/* ---------- Alertas ---------- */
.alert { padding: 11px 16px; border-radius: 11px; margin-bottom: 12px; border: 1px solid var(--line); border-left: 5px solid var(--muted); background: var(--panel); box-shadow: var(--shadow); }
.alert.bad { border-left-color: var(--rosa); background: color-mix(in srgb, var(--rosa) 7%, var(--panel)); }
.alert.warn { border-left-color: var(--ambar); background: color-mix(in srgb, var(--ambar) 8%, var(--panel)); }
.alert.ok { border-left-color: var(--verde); background: color-mix(in srgb, var(--verde) 7%, var(--panel)); }

/* ---------- Novedades (informativas) ---------- */
.sec-t { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 0 8px; }
.novedades { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.nov { --acento: var(--brand); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.nov .ic { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--acento) 14%, transparent); color: var(--acento); }
.nov .ic svg { width: 17px; height: 17px; }
.nov .l { font-size: 13px; color: var(--ink); line-height: 1.3; }
.nov .l b { font-size: 21px; font-weight: 800; color: var(--acento); margin-right: 3px; font-variant-numeric: tabular-nums; }
.nov .d { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.nov a.go { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; text-decoration: none; color: var(--acento); }
.nov a.go:hover { text-decoration: underline; }
.panel.vacio { text-align: center; padding: 36px 20px; }
.panel.vacio h3 { justify-content: center; }
.panel.vacio .row { justify-content: center; }

/* ---------- Usuario en el encabezado ---------- */
#usuario { margin-left: auto; display: grid; grid-template-columns: auto auto; justify-content: end; align-items: center; gap: 1px 6px; padding: 3px 0; }
.u-info { grid-column: 1 / -1; text-align: right; color: #fff; line-height: 1.1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; justify-self: end; }
.u-info small { color: #cfe8df; font-size: 11px; }
button.b.sec.hdr { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
button.b.sec.hdr:hover { background: rgba(255, 255, 255, .25); border-color: #fff; }

/* ---------- Pantallas de ingreso ---------- */
body.sin-sesion header, body.sin-sesion main { display: none; }
#acceso:empty { display: none; }
.acceso-fondo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #146B54 0%, transparent 45%), radial-gradient(circle at 85% 90%, #B7791F 0%, transparent 40%), #08392d; }
.acceso-tarjeta { width: min(430px, 100%); background: var(--panel); border-radius: 18px; padding: 28px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.acceso-tarjeta h2 { font-size: 20px; margin: 18px 0 12px; }
.acceso-logo { display: flex; align-items: center; gap: 12px; }
.acceso-logo svg { width: 42px; height: 42px; }
.acceso-logo small { display: block; color: var(--muted); font-size: 12px; }
.acceso-form { display: flex; flex-direction: column; gap: 14px; }
.acceso-form button.b { padding: 11px 16px; }
.acceso-error { color: var(--bad); font-size: 13px; min-height: 0; }
.acceso-error:empty { display: none; }
.demo-ayuda { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); font-size: 12.5px; }
.demo-ayuda > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }

/* ---------- Mi cuenta y administración ---------- */
table.matriz { width: auto; min-width: 360px; margin: 6px 0 4px; }
table.matriz td { padding: 6px 12px; }
pre.correo { white-space: pre-wrap; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 13px/1.5 ui-monospace, Consolas, monospace; margin: 8px 0; word-break: break-all; }
details summary { cursor: pointer; font-weight: 600; }

/* ---------- Calendario ---------- */
.cal { border-collapse: separate; border-spacing: 3px; }
.cal th, .cal td { padding: 0; text-align: center; border: 0; }
.cal th.d { font-size: 11px; width: 34px; position: static; background: none; color: var(--muted); border: 0; }
.cal th.d.fin { color: var(--rosa); }
.cal td.c { height: 36px; width: 34px; background: var(--line); border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--ink); transition: transform .08s; }
.cal td.c:hover { transform: scale(1.12); }
.cal td.c.libre { background: color-mix(in srgb, var(--verde) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--verde) 25%, var(--line)); }
.cal td.c.ocupado { background: var(--ocupado); }
.cal td.c.entrada { background: linear-gradient(to right, color-mix(in srgb, var(--verde) 12%, var(--panel)) 50%, var(--entrada) 50%); }
.cal td.c.salida { background: linear-gradient(to right, var(--salida) 50%, color-mix(in srgb, var(--verde) 12%, var(--panel)) 50%); }
.cal td.c.cambio { background: linear-gradient(to right, var(--salida) 50%, var(--entrada) 50%); }
.cal td.c.conflicto { background: var(--conflicto); color: #fff; }
.cal td.apto { text-align: left; padding-right: 12px; font-weight: 700; white-space: nowrap; position: sticky; left: 0; background: var(--panel); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
.legend i { display: inline-block; width: 22px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

/* ---------- Formularios, avisos ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--panel); color: var(--ink); width: min(660px, 94vw); box-shadow: 0 20px 60px rgba(15, 23, 42, .35); }
dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.form .full { grid-column: 1 / -1; }
.drop { border: 2px dashed color-mix(in srgb, var(--brand) 40%, var(--line)); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); cursor: pointer; background: color-mix(in srgb, var(--brand) 4%, var(--panel)); transition: all .15s; }
.drop:hover, .drop.over { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 11px 20px; border-radius: 11px; z-index: 20; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); border-left: 4px solid var(--verde); }
.toast.err { background: #881337; border-left-color: #fb7185; }
.toast.aviso { background: #1e293b; border-left-color: #fbbf24; }
.chart text { fill: var(--muted); font-size: 11px; }
@media (max-width: 720px) { main { padding: 12px; } .form { grid-template-columns: 1fr; } .cols { grid-template-columns: 1fr; } .bar { gap: 8px; padding: 0 12px; } }

/* Módulo de aseos */
.as-dia { margin-top: 14px; }
.as-dia.hoy .as-fecha { color: var(--acento, #0F5C47); }
.as-fecha { font-weight: 700; text-transform: capitalize; margin-bottom: 6px; }
.as-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.as-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--borde, #d9dce3); border-left-width: 4px; border-radius: 10px; background: var(--panel, #fff); color: inherit; cursor: pointer; font: inherit; }
.as-item small { color: var(--muted, #6b7280); }
.as-item.hecho { border-left-color: #16a34a; }
.as-item.en_curso { border-left-color: #d97706; }
.as-item.sin_iniciar { border-left-color: #9ca3af; }
.as-zona { margin: 12px 0; padding-bottom: 8px; border-bottom: 1px solid var(--borde, #e5e7eb); }
.as-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.as-foto { position: relative; }
.as-foto img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.as-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #dc2626; color: #fff; cursor: pointer; line-height: 22px; padding: 0; }
.as-tablero { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.as-tablero .as-item { flex: 1 1 200px; max-width: 280px; min-height: 96px; }
.as-item.pendiente { border-left-color: #d97706; }
.as-item.sin_salida { border-left-color: #cbd5e1; opacity: .65; }

/* Marca Alojo */
.marca-nombre { font-weight: 700; letter-spacing: -.5px; text-transform: none; }
.logo .marca-nombre { font-size: 29px; margin-left: 2px; line-height: 1; }

button.b.hdr { padding: 2px 9px; font-size: 12px; line-height: 1.4; }
.pill.demo-pill { }

/* ---------- Móvil y pantallas angostas: los módulos se agrupan en un menú tipo hamburguesa ---------- */
#menu-btn { display: none; margin-left: auto; width: 42px; height: 38px; align-items: center; justify-content: center; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; cursor: pointer; padding: 0; }
#menu-btn:hover { background: rgba(255, 255, 255, .25); }
@media (max-width: 1000px) {
  .bar { gap: 8px 10px; padding: 0 14px; }
  #menu-btn { display: inline-flex; }
  nav, #usuario { display: none; flex-basis: 100%; }
  header.abierto nav { display: flex; flex-direction: column; flex: 1 0 100%; gap: 2px; padding: 4px 0 6px; border-top: 1px solid rgba(255, 255, 255, .2); }
  header.abierto nav button { text-align: left; padding: 11px 12px; margin: 0; font-size: 15px; }
  header.abierto #usuario { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-left: 0; padding: 4px 0 12px; }
  header.abierto .u-info { order: -1; flex: 1 1 100%; max-width: none; text-align: left; font-size: 13px; }
  header.abierto button.b.hdr { padding: 6px 14px; font-size: 13px; flex: 1; }
  .logo .pill { display: none; }
}
@media (max-width: 720px) {
  main { padding: 12px; }
  h2 { font-size: 20px; }
  .panel { padding: 14px; }
  .as-tablero .as-item { flex: 1 1 100%; max-width: none; }
  dialog { width: calc(100vw - 20px); max-width: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}@media (max-width: 1000px) { header.abierto { max-height: 100vh; overflow-y: auto; } header.abierto nav button { padding: 9px 12px; } }
