/* Paleta de la marca (logo de Sansy Bookings): azul marino #1F3A5F, azul mar #2A8CC4, celeste de la ola #8FD0F0,
   arena #E2B86C y sol #F2C14E, en versión pastel. Los colores de las casas no están acá: cada casa tiene el suyo en
   la base y app.js lo pone en --c (una casa) o --g/--gv (degradé de varias) sobre el elemento, con CSSOM (la CSP no
   deja style=""). El modo oscuro sigue al sistema (automático) o se fuerza con data-theme en <html> (Ajustes → Sesión
   o el botón ☾/☀ de la cabecera); tema.js lo aplica antes de pintar. */
:root {
  --bg: #f6f2ea;              /* arena muy clara: fondo cálido */
  --surface: #fffdf9;
  --surface-2: #eaf2f8;       /* celeste pastel: segmentos, botones secundarios */
  --surface-3: #dde9f2;
  --text: #1f3a5f;            /* azul marino */
  --muted: #6b7f95;
  --primary: #1f3a5f;         /* botón principal, títulos */
  --primary-text: #ffffff;
  --accent: #2a8cc4;          /* enlaces, pestaña activa, foco */
  --accent-text: #ffffff;
  --accent-soft: #dceef8;     /* celeste pastel de la ola */
  --sand: #f3e6c9;            /* arena pastel */
  --sun: #fbe9b5;             /* sol pastel */
  --danger: #c9503c;
  --ok: #2f8f6a;
  --warn: #b7791f;
  --border: #e6dfd2;
  --shadow: 0 2px 12px rgb(31 58 95 / .07);
  --radius: 16px;
  color-scheme: light;
}

/* Modo oscuro: automático (sistema) salvo que se haya elegido claro, o forzado con data-theme="dark" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a28;
    --surface: #16263a;
    --surface-2: #1e3148;
    --surface-3: #294261;
    --text: #e9eff6;
    --muted: #98abc1;
    --primary: #8fd0f0;
    --primary-text: #0f1a28;
    --accent: #8fd0f0;
    --accent-text: #0f1a28;
    --accent-soft: #223c5a;
    --sand: #3a3324;
    --sun: #4a3d1c;
    --danger: #ff8d7a;
    --ok: #5fd3a0;
    --warn: #f2c14e;
    --border: #2b4059;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1a28;
  --surface: #16263a;
  --surface-2: #1e3148;
  --surface-3: #294261;
  --text: #e9eff6;
  --muted: #98abc1;
  --primary: #8fd0f0;
  --primary-text: #0f1a28;
  --accent: #8fd0f0;
  --accent-text: #0f1a28;
  --accent-soft: #223c5a;
  --sand: #3a3324;
  --sun: #4a3d1c;
  --danger: #ff8d7a;
  --ok: #5fd3a0;
  --warn: #f2c14e;
  --border: #2b4059;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
input, select, textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 0; font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); font-weight: 400; }
h1 { font-size: 30px; margin: 0 0 4px; }
h2, h3 { margin: 0; }
h3 { font-size: 16px; }
p { margin: 8px 0; }
ul { list-style: none; margin: 0; padding: 0; }

[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; font-size: 14px; }
.info { background: var(--accent-soft); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.link-btn { color: var(--accent); padding: 6px 8px; font-weight: 600; }
.link-btn.danger { color: var(--danger); }
.icon-btn { font-size: 24px; line-height: 1; padding: 6px 12px; color: var(--accent); border-radius: 10px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.sm { font-size: 16px; color: var(--muted); padding: 6px 8px; }
.chip { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip:hover { color: var(--text); }

.btn {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 600;
  flex: 1;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn.slim { flex: 0 0 auto; padding: 9px 16px; }
.btn:disabled { opacity: .5; }
.row-btns { display: flex; gap: 10px; margin-top: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.card.soft { background: transparent; box-shadow: none; border-style: dashed; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }

/* colores por casa: --c (una) o --g (varias, degradé horizontal) los pone app.js en cada elemento */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--c, var(--muted)); }
.dot.multi { background: var(--g); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}
.badge.casa { background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: color-mix(in srgb, var(--c) 85%, black); }
.badge.casa.multi { background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--text); box-shadow: inset 0 -3px 0 0 transparent; border-bottom: 3px solid; border-image: var(--g) 1; border-radius: 6px; }
.badge.airbnb { background: #fde4e1; color: #b3261e; }
.badge.booking { background: #dfe9fb; color: #1d4ed8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.casa { color: color-mix(in srgb, var(--c) 70%, white); }
  :root:not([data-theme="light"]) .badge.airbnb { background: #4a1f1c; color: #ffb4ab; }
  :root:not([data-theme="light"]) .badge.booking { background: #1c2f57; color: #a8c4ff; }
}
:root[data-theme="dark"] .badge.casa { color: color-mix(in srgb, var(--c) 70%, white); }
:root[data-theme="dark"] .badge.airbnb { background: #4a1f1c; color: #ffb4ab; }
:root[data-theme="dark"] .badge.booking { background: #1c2f57; color: #a8c4ff; }

/* --- layout general ------------------------------------------------------------ */

.view { min-height: 100dvh; display: flex; flex-direction: column; }
#v-app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 4px;
}
.brand-sm { font-weight: 800; font-size: 20px; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; }
.brand-sm img { width: 28px; height: 28px; border-radius: 7px; }
/* logo horizontal (login y barra lateral): el SVG claro en modo oscuro lo elige el <picture> */
.logo { display: block; }
.logo img { display: block; width: auto; height: 84px; max-width: 100%; margin: 0 auto 4px; }
.who { color: var(--muted); font-size: 14px; }
.content { flex: 1; min-width: 0; }
.pane { padding: 6px 16px 24px; }
.pane-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 12px; }
.pane-title { font-size: 20px; font-weight: 700; text-transform: capitalize; }
.cal-nav { display: flex; align-items: center; gap: 2px; }
.cal-nav .chip { margin-left: 6px; }
#btn-nueva, #btn-nueva-lista { margin-left: auto; }
.btn.exportar { margin-left: auto; }
.btn.exportar + .btn { margin-left: 0; }
#btn-exportar-pagos { margin-left: auto; }
/* En el celular, un segmento "ancho" ocupa su propio renglón debajo del título */
.pane-head .seg.ancho { flex: 1 0 100%; }
.solo-pc { display: none !important; }

/* barra lateral: en celular es la barra de abajo */
.side .brand, .side .side-foot { display: none; }
.tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tabs button {
  flex: 1;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 12px;
  color: var(--muted);
}
.tabs button i { font-style: normal; font-size: 20px; }
.tabs button span { font-size: 11px; font-weight: 600; }
.tabs button.on { color: var(--accent); background: var(--accent-soft); }

/* --- login ------------------------------------------------------------------ */

.login-top { flex: 1; padding: 40px 20px 10px; text-align: center; max-width: 480px; margin: 0 auto; width: 100%; }
.users { display: flex; gap: 10px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.users button {
  padding: 14px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 18px;
  border: 2px solid transparent;
}
.users button.on { border-color: var(--accent); background: var(--accent-soft); }
.pin-dots { display: flex; gap: 12px; justify-content: center; min-height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: block; }
.pin-dots i.empty { background: var(--border); }
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.numpad button { height: 60px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-size: 26px; font-weight: 500; }
.numpad button:active { background: var(--surface-2); }
.numpad button.ok { background: var(--accent); color: var(--accent-text); }

.login-top h3 { margin-top: 18px; }
.login-form { text-align: left; margin: 14px auto 0; max-width: 360px; }
.login-form .btn { width: 100%; margin-top: 16px; display: block; }
.login-form .small { margin: 6px 0 0; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; }
.login-links .link-btn { padding: 6px 2px; font-size: 14px; }
.login-registro { margin: 18px auto 0; max-width: 360px; }
.login-registro a { color: var(--accent); font-weight: 600; }
#login-pin .link-btn { margin-top: 8px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); margin-top: 14px; }
label.check input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }

/* Ajustes → Sesión: cuenta y segundo factor */
.cuenta-bloque { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.cuenta-bloque .cuenta-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cuenta-bloque .cuenta-cab b { flex: 1; }
.cuenta-bloque .cuenta-cab .link-btn { padding: 4px 6px; font-size: 13px; }
.cuenta-bloque .row-btns { margin-top: 10px; }
.cuenta-bloque .small { margin: 4px 0 0; }
.qr { display: block; width: 220px; height: 220px; margin: 12px auto 6px; background: #fff; padding: 8px; border-radius: 12px; }
.secreto { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; user-select: all; -webkit-user-select: all; background: var(--surface); padding: 8px 10px; border-radius: 8px; margin: 6px 0; }
.codigos { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; background: var(--surface); padding: 10px 14px; border-radius: 10px; margin: 8px 0; user-select: all; -webkit-user-select: all; }

/* --- calendario ---------------------------------------------------------------- */

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 16px; height: 9px; border-radius: 3px; }
.sw.casa { background: var(--c); }
.sw.bloq { background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 6px); border: 1px solid var(--muted); }
.sw.imp { background: var(--muted); box-shadow: inset 3px 0 0 var(--surface), inset 4px 0 0 var(--muted); }

.cal-layout { display: grid; gap: 14px; }
.cal-months { display: grid; gap: 14px; }
.month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
}
.month-title { display: none; font-size: 15px; margin: 0 0 6px; text-transform: capitalize; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.dow { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0 6px; font-weight: 600; }
.day {
  position: relative;
  width: 100%;            /* un <button> no se estira solo al ancho de la columna */
  min-width: 0;
  border-radius: 8px;
  padding: 3px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  line-height: 1.3;       /* el alto sale del contenido: número (+ etiqueta) + dos barras */
  background: var(--bg);
}
.day.empty { background: transparent; }
.day.past { color: var(--muted); opacity: .55; }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.day.sel { background: var(--accent-soft); }
.day:hover { background: var(--surface-2); }
/* selección de rango: llegada verde, salida roja, noches intermedias tenues */
.day.sel-a { background: var(--ok); color: #fff; }
.day.sel-b { background: var(--danger); color: #fff; }
.day.sel-rango { background: var(--accent-soft); }
.day.sel-a:hover { background: var(--ok); }
.day.sel-b:hover { background: var(--danger); }
/* la etiqueta ocupa el lugar de las barras (ocultas en ese día): ninguna celda cambia de alto */
.day.sel-a .bars, .day.sel-b .bars { visibility: hidden; }
.day.sel-a::after, .day.sel-b::after { content: 'Llegada'; position: absolute; left: 0; right: 0; top: 50%; margin-top: 2px; text-align: center; font-size: 8px; line-height: 1; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; opacity: .95; }
.day.sel-b::after { content: 'Salida'; }
.estado-sel { background: var(--ok); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.day .bars { display: flex; flex-direction: column; gap: 2px; width: 100%; min-width: 0; padding: 2px 2px 3px; }
.bar { height: 7px; border-radius: 2px; background: transparent; overflow: hidden; white-space: nowrap; --c: transparent; }
.bar.alquiler { background: var(--c); }
.bar.bloqueo { background: repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--c); }
.bar.imp { box-shadow: inset 3px 0 0 var(--surface), inset 4px 0 0 var(--c); }
.bar.bloqueo.imp { box-shadow: inset 0 0 0 1px var(--c), inset 4px 0 0 var(--surface); }
.bar.ini { border-top-left-radius: 6px; border-bottom-left-radius: 6px; margin-left: 35%; }
.bar.fin { border-top-right-radius: 6px; border-bottom-right-radius: 6px; margin-right: 35%; }
.bar.ini.fin { margin: 0 20%; }
.bar.out { margin-right: 65%; }
.bar-txt { display: none; }
.cal-hint { margin: 10px 2px 0; }
.cal-side { display: grid; gap: 12px; }
#day-vacio, #prox-panel { display: none; }

.day-list li { padding: 8px 0; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: baseline; }
.day-list li:first-child { border-top: 0; }
.day-list .casa { font-weight: 700; min-width: 64px; white-space: nowrap; }
.day-list button { text-align: left; flex: 1; padding: 2px 0; }
.day-list button:hover { color: var(--accent); }

.mini-lista li { padding: 7px 0; border-top: 1px solid var(--border); }
.mini-lista li:first-child { border-top: 0; }
.mini-lista button { width: 100%; text-align: left; padding: 0; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.mini-lista button:hover { color: var(--accent); }
.mini-lista .cuando { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* --- lista ----------------------------------------------------------------- */

.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.casas { margin-top: 8px; flex-wrap: wrap; }
.seg.casas button { flex: 1 1 auto; }
.seg.casas button.on { box-shadow: var(--shadow), inset 0 0 0 2px var(--c, var(--accent)); }
.seg.casas button.on .dot.multi { outline: 0; }
.seg.mini { padding: 3px; }
.seg.mini button { flex: 0 0 auto; padding: 4px 11px; font-size: 13px; }
#cal-meses { display: none; }
.seg button:disabled { opacity: .5; }

/* --- reservas: búsqueda, filtros y lista en filas ------------------------------------- */

.busq { margin: 0 0 10px; }
.busq-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.busq-row .seg { flex: 1 0 100%; }          /* celular: las pestañas en su propio renglón */
.busq-row input[type=search] { flex: 1; min-width: 0; padding: 9px 12px; }
.busq-row .chip { flex: 0 0 auto; padding: 8px 12px; }
.busq-row .chip.on { background: var(--accent-soft); color: var(--accent); }
.busq-filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 2px; }
.busq-filtros label { margin-top: 8px; }
.busq-filtros select, .busq-filtros input { padding: 8px 10px; }
.busq-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; min-height: 22px; }
.busq-pie .link-btn { padding: 2px 6px; font-size: 13px; }

/* Cada reserva es una fila (botón). En el celular, tres renglones por áreas; en PC, columnas alineadas (abajo). */
.res-lista { display: grid; gap: 8px; }
.res-fila {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "cod fec fec" "hue hue pre" "cas ori con" "cob cob cob";
  gap: 3px 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 9px 12px 9px 14px;
  border-left: 6px solid var(--muted);
  font-size: 14px;
}
.res-fila:hover { border-color: var(--accent); }
.res-fila.casa { border-left-color: var(--c); }
.res-fila.multi { border-left-color: transparent; border-image: var(--gv) 1; border-radius: var(--radius); }
.res-fila.cancelada { opacity: .55; }
.res-fila .c-cod { grid-area: cod; }
.res-fila .c-fec { grid-area: fec; font-weight: 600; color: var(--text); white-space: nowrap; }
.res-fila .c-fec small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.res-fila .c-hue { grid-area: hue; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-fila .c-cas { grid-area: cas; }
.res-fila .c-ori { grid-area: ori; }
.res-fila .c-pre { grid-area: pre; text-align: right; font-weight: 600; color: var(--text); }
.res-fila .c-cob { grid-area: cob; color: var(--muted); font-size: 13px; }
.res-fila .c-cob.mal { color: var(--danger); font-weight: 600; }
.res-fila .c-con { grid-area: con; color: var(--muted); font-size: 13px; }
.res-fila .c-con .badge.firmado { margin: 0; }
.res-fila .c-cob:empty, .res-fila .c-con:empty, .res-fila .c-ori:empty { display: none; }
.res-cab { display: none; }

/* --- resumen ---------------------------------------------------------------- */

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; border-top: 4px solid var(--muted); }
.kpi.casa { border-top-color: var(--c); }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 700; }
.kpi .s { font-size: 12px; color: var(--muted); }
.res-tablas { display: grid; gap: 16px; }
.res-tabla:not(.on) { display: none; }
.res-tabla .month-title { display: none; }
.tabla { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: 14px; }
.tabla th, .tabla td { padding: 7px 8px; text-align: right; border-top: 1px solid var(--border); }
.tabla th { font-size: 12px; color: var(--muted); border-top: 0; }
.tabla th:first-child, .tabla td:first-child { text-align: left; }
.tabla td.cero { color: var(--muted); opacity: .6; }
.tabla tfoot td { font-weight: 700; background: var(--surface-2); }
.res-tabla.casa .tabla thead { box-shadow: inset 0 3px 0 var(--c); }
.tabla td.neg { color: var(--danger); }
.kpi .v.neg { color: var(--danger); }
@media (max-width: 480px) {
  /* ocho columnas en el celular: letra y márgenes más chicos para que entren Gastos y Neto */
  .res-tabla .tabla { font-size: 12px; }
  .res-tabla .tabla th, .res-tabla .tabla td { padding: 6px 4px; }
}

/* --- gastos (bloque 3): lista en el Resumen y en la reserva ------------------------ */

.gastos-card { margin-top: 16px; }
.gastos-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.gastos-cats .chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.gastos-cats .chip b { color: var(--text); font-weight: 600; }
.gastos-filtro select { font-size: 14px; padding: 7px 10px; }
.gastos { list-style: none; margin: 4px 0 0; padding: 0; }
.gastos li { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.gastos li:first-child { border-top: 0; }
.gastos li .cuando { color: var(--muted); font-size: 13px; white-space: nowrap; }
.gastos li .que { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.gastos li .que .dot { flex: 0 0 auto; }
.gastos li .que .badge.codigo { font-size: 11px; padding: 1px 6px; }
.gastos li .monto { font-weight: 600; white-space: nowrap; }
.gastos li .det { grid-column: 2 / 4; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gastos li.vacio { color: var(--muted); font-size: 13px; cursor: default; }
.gastos li.error { color: var(--danger); cursor: default; }
#g-casas-wrap > .small { display: block; margin-top: 6px; }
#g-casas-wrap .seg.casas { margin-top: 4px; margin-bottom: 8px; }

/* --- pagos (por reserva, con las cuotas desplegables) ---------------------------- */

.badge.codigo { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3px; background: var(--surface-2); color: var(--muted); }
.sheet-head .badge.codigo { margin-left: 8px; }
.pago-lista { display: grid; gap: 10px; }
.pago {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--muted);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pago.casa { border-left-color: var(--c); }
.pago.multi { border-left-color: transparent; border-image: var(--gv) 1; border-radius: var(--radius); }
.pago.vencida { border-color: var(--danger); border-left-color: var(--danger); }
.pago-head {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 2px 14px;
  align-items: center;
  padding: 10px 14px;
}
.pago-head:hover { background: var(--surface-2); }
/* posiciones explícitas: los elementos con fila fija se ubican primero y desordenarían el resto */
.pago-head .p1 { grid-column: 1; grid-row: 1; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pago-head .p2 { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 13px; }
.pago-head .p2 .mal { color: var(--danger); font-weight: 600; }
.pago-head .monto { grid-column: 2; grid-row: 1 / 3; text-align: right; }
.pago-head .monto .v { font-weight: 700; font-size: 18px; }
.pago-head .monto .s { font-size: 12px; color: var(--muted); }
.pago-head .flecha { grid-column: 3; grid-row: 1 / 3; color: var(--muted); font-size: 18px; transition: transform .15s; }
.pago.abierta .pago-head .flecha { transform: rotate(90deg); }
.pago-cuotas { border-top: 1px solid var(--border); padding: 4px 14px 10px; }
.pago-cuotas li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.pago-cuotas li:first-child { border-top: 0; }
.pago-cuotas li.vencida .vence-txt { color: var(--danger); font-weight: 600; }
.pago-cuotas li.pagada { color: var(--muted); }
.pago-cuotas .num { color: var(--muted); font-size: 13px; }
.pago-cuotas .monto { font-weight: 600; text-align: right; }
.pago-cuotas .btn { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }
.pago-cuotas .pagado-el { font-size: 13px; color: var(--ok); }
.pago-acciones { display: flex; gap: 8px; padding: 8px 0 0; }
.pago-acciones .link-btn { padding: 4px 6px; font-size: 13px; }

/* --- pagos (cuotas sueltas, se conserva para la ventana del plan) --------------- */

.grupo-cuotas { margin: 14px 0 6px; }
.grupo-cuotas h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 6px 2px; }
.grupo-cuotas.vencidas h3 { color: var(--danger); }
.cuota-lista { display: grid; gap: 8px; }
.cuota {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px 9px 14px;
  border-left: 5px solid var(--muted);
}
.cuota.casa { border-left-color: var(--c); }
.cuota.vencida { border-color: var(--danger); border-left-color: var(--danger); }
.cuota .q1 { font-weight: 600; }
.cuota .q2 { color: var(--muted); font-size: 13px; }
.cuota .q2 .vence-txt.vencida { color: var(--danger); font-weight: 600; }
.cuota .monto { grid-row: 1 / 3; font-weight: 700; font-size: 17px; text-align: right; }
.cuota .acciones { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 4px; }
.cuota .acciones .btn { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }
.cuota button.quien { text-align: left; padding: 0; font: inherit; font-weight: 600; }
.cuota button.quien:hover { color: var(--accent); }

.plan { margin-top: 12px; padding: 10px 14px; }
.plan .card-head { margin-bottom: 2px; }
.plan .ok { color: var(--ok); }
.plan .mal { color: var(--danger); }
.sheet-2 { z-index: 25; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row-btns.slim { margin-top: 10px; }
.row-btns.slim .btn { flex: 0 0 auto; padding: 8px 14px; font-size: 14px; }
.tabla.cuotas { margin-top: 6px; }
.tabla.cuotas th, .tabla.cuotas td { padding: 5px 6px; text-align: left; }
.tabla.cuotas input { padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.tabla.cuotas input.monto { text-align: right; }
.tabla.cuotas td.num { color: var(--muted); font-size: 13px; width: 28px; }
.tabla.cuotas td.pago { white-space: nowrap; font-size: 13px; }
.tabla.cuotas .link-btn { padding: 4px 6px; font-size: 13px; }
.tabla.cuotas tr.pagada td { opacity: .8; }
.tabla.cuotas tr.pagada input { background: var(--surface-2); color: var(--muted); }
.suma-mal { color: var(--danger); font-weight: 600; }
.suma-ok { color: var(--ok); font-weight: 600; }

/* --- adjuntos (contrato firmado) -------------------------------------------------- */
.adjuntos li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.adjuntos li:first-child { border-top: 0; }
.adjuntos .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adjuntos .det { color: var(--muted); font-size: 12px; white-space: nowrap; }
.adjuntos .link-btn { padding: 4px 6px; font-size: 13px; }
.adjuntos .vacio { color: var(--muted); font-size: 13px; border-top: 0; }
.badge.firmado { background: var(--accent-soft); color: var(--accent); }

/* --- ajustes ------------------------------------------------------------------ */

.aj-grid { display: grid; gap: 14px; }
/* Ajustes: tarjetas plegables (<details>). Cerradas muestran título, una línea y la flecha; tocar despliega. */
details.plegable > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "titulo chev" "desc chev";
  align-items: center;
  column-gap: 10px;
  margin: -14px -16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  user-select: none;
  -webkit-user-select: none;
}
details.plegable > summary::-webkit-details-marker { display: none; }
details.plegable > summary .card-head { grid-area: titulo; margin: 0; }
details.plegable > summary small { grid-area: desc; color: var(--muted); font-size: 13px; line-height: 1.35; }
details.plegable > summary .chev { grid-area: chev; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
details.plegable[open] > summary .chev { transform: rotate(-135deg); margin-top: 6px; }
details.plegable > summary:hover { background: var(--surface-2); }
details.plegable[open] > summary { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.plegable > .card-body { padding-top: 6px; }
h4.sub { margin: 18px 0 2px; font-size: 14px; }
#imp-res { white-space: pre-line; }
#imp-res.mal { color: var(--danger); }
#imp-res.ok { color: var(--ok); }
.feed { margin: 6px 0 10px; }
.feed .st { font-size: 12px; margin: 3px 0 0; }
.feed .st.ok { color: var(--ok); }
.feed .st.err { color: var(--danger); }
.export { margin: 8px 0; }
.export .url { display: flex; gap: 6px; align-items: center; }
.export input { font-size: 12px; padding: 6px 8px; }
.export .link-btn { white-space: nowrap; }
.casas-lista { display: grid; gap: 10px; margin-top: 6px; }
.casa-ficha { background: var(--surface-2); border-radius: 12px; padding: 6px 12px 10px; border-left: 5px solid var(--c, var(--border)); }
.casa-ficha .casa-cab { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.casa-ficha .casa-cab .small { margin-left: auto; }
.casa-ficha input[type="color"] { padding: 2px 4px; height: 42px; }
.casa-ficha label.check { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.casa-ficha label.check input { width: 18px; height: 18px; margin: 0; }
.casa-ficha .ct-detalle { margin-top: 10px; }
.casa-ficha .row-btns.slim .link-btn { margin-left: auto; }
.usuarios-lista { display: grid; gap: 8px; margin-top: 6px; }
.usuario-ficha { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; }
.usuario-ficha .usuario-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usuario-ficha .usuario-cab b { flex: 1; }
.usuario-ficha .usuario-cab .link-btn { padding: 4px 6px; font-size: 13px; }
.usuario-ficha .usuario-form { margin-top: 6px; }
.usuario-ficha .usuario-form .row-btns { margin-top: 6px; }

/* --- sheet (formulario) ------------------------------------------------------- */

.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .45); }
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  margin: 0;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.title { font-weight: 700; font-size: 17px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.conflicto { background: var(--surface); border: 1px solid var(--danger); border-radius: 12px; padding: 8px 12px; margin-top: 8px; }
.conflicto li { font-size: 14px; padding: 2px 0; }

/* --- toast ---------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  z-index: 30;
  box-shadow: 0 4px 16px rgb(0 0 0 / .25);
}
.toast.err { background: var(--danger); color: #fff; }

/* --- pantalla de PC ---------------------------------------------------------------- */

@media (min-width: 900px) {
  #v-app { flex-direction: row; padding-bottom: 0; }
  .top { display: none; }

  .side {
    position: sticky;
    top: 0;
    height: 100dvh;
    width: 232px;
    flex: 0 0 232px;
    display: flex;
    flex-direction: column;
    padding: 22px 14px 18px;
    background: var(--surface);
    border-right: 1px solid var(--border);
  }
  .side .brand { display: flex; flex-direction: column; padding: 0 6px 18px; }
  .side .brand .logo img { height: 66px; margin: 0; }
  .side .brand small { color: var(--muted); font-size: 13px; }
  .tabs { position: static; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; padding: 0; background: transparent; border: 0; }
  .tabs button { flex: 0 0 auto; max-width: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; font-size: 15px; }
  .tabs button i { font-size: 18px; }
  .tabs button span { font-size: 15px; }
  .tabs button:hover { background: var(--surface-2); }
  .tabs button.on:hover { background: var(--accent-soft); }
  .side .side-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding: 12px 12px 0; border-top: 1px solid var(--border); }

  .content { padding: 22px 32px 40px; }
  .pane { padding: 0; }
  .pane-head { margin: 0 0 18px; gap: 10px 22px; }
  .pane-title { font-size: 26px; }
  .legend { font-size: 13px; }

  /* Calendario a todo el ancho; abajo, el detalle del día y las próximas en dos columnas */
  .cal-layout { gap: 20px; }
  .cal-side { grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  #day-vacio, #prox-panel { display: block; }
  .cal-hint { display: none; }
  #cal-meses { display: flex; }
  .cal-months { gap: 20px; }
  .cal-months.m1 { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
  .cal-months.m2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-months.m3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .month { padding: 12px 14px 14px; }
  .month-title { display: block; font-size: 16px; font-weight: 700; margin: 0 4px 8px; }
  .cal-grid { gap: 6px; }
  .dow { font-size: 12px; }
  /* la altura sigue al ancho: celdas más anchas que altas */
  .day { font-size: 14px; padding: 4px 0 0; border-radius: 9px; }
  .day .bars { gap: 2px; padding: 2px 4px 4px; }
  .day.sel-a::after, .day.sel-b::after { font-size: 10px; margin-top: 4px; }
  .day .bars { gap: 3px; padding: 0 3px 4px; }
  .bar { height: 16px; border-radius: 4px; font-size: 11px; line-height: 16px; color: #fff; text-align: left; padding: 0 5px; }
  .bar.bloqueo { color: var(--text); }
  .bar.bloqueo .bar-txt { background: var(--surface); padding: 0 4px; border-radius: 3px; line-height: 12px; }
  .bar-txt { display: inline; font-weight: 600; }
  .bar.ini { margin-left: 25%; }
  .bar.fin { margin-right: 25%; }
  .bar.ini.fin { margin: 0 12%; }
  .bar.out { margin-right: 75%; padding: 0; }
  .day-list li { display: block; }
  .day-list .casa { display: block; margin-bottom: 2px; }

  /* Reservas: tarjetas en columnas */
  /* Reservas en PC: búsqueda y filtros en una línea; la lista en filas compactas (como en el celular) hasta 1180 px */
  .busq { max-width: 1400px; }
  .busq-row .seg { flex: 0 0 auto; }
  .busq-row input[type=search] { max-width: 520px; }
  .solo-pc { display: inline-block !important; }
  .solo-cel { display: none !important; }
  .pane-head .seg.ancho { flex: 0 0 auto; order: -1; margin-left: 0; }
  #btn-exportar-pagos { margin-left: 0; }
  .busq-filtros { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }
  .res-lista { gap: 6px; max-width: 1400px; }
  #lista-filtro { flex: 0 0 auto; }

  /* Resumen: las dos casas lado a lado */
  #res-casa { display: none; }
  .kpis { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); max-width: 1400px; }
  .res-tablas { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 24px; max-width: 1400px; }
  .res-tabla:not(.on) { display: block; }
  .res-tabla .month-title { display: flex; align-items: center; gap: 8px; }
  .tabla { font-size: 15px; }
  .tabla th, .tabla td { padding: 9px 12px; }

  /* Pagos: tarjetas por reserva, dos columnas */
  .pago-lista { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 12px; max-width: 1400px; align-items: start; }
  #pagos-filtro { flex: 0 0 auto; }

  /* Ajustes: tarjetas en dos columnas */
  .aj-grid { grid-template-columns: 1fr 1fr; gap: 20px; max-width: 1400px; align-items: start; }

  /* Formulario centrado */
  .sheet { align-items: center; }
  .sheet-panel { max-width: 560px; border-radius: 18px; max-height: 90vh; padding: 14px 24px 22px; box-shadow: 0 12px 40px rgb(0 0 0 / .35); }
  .toast { bottom: 32px; }
}

/* --- contrato de locação ------------------------------------------------------- */
@font-face { font-family: "Tinos"; src: url("/fonts/Tinos-Regular.ttf"); font-weight: 400; font-style: normal; }
@font-face { font-family: "Tinos"; src: url("/fonts/Tinos-Bold.ttf"); font-weight: 700; font-style: normal; }
@font-face { font-family: "Tinos"; src: url("/fonts/Tinos-Italic.ttf"); font-weight: 400; font-style: italic; }
@font-face { font-family: "Tinos"; src: url("/fonts/Tinos-BoldItalic.ttf"); font-weight: 700; font-style: italic; }
.sheet-3 { z-index: 30; }
.sheet-panel.ancha { max-width: 720px; }
.sheet-panel h4.sub { margin: 14px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
label.corta { max-width: 240px; }
input.invalid { outline: 2px solid var(--danger); outline-offset: -1px; }
.row-btns.slim { margin-top: 4px; }
.ct-detalle { margin-top: 14px; }
.ct-detalle summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: 14px; }
.paper {
  margin-top: 10px; background: #fff; color: #000; border: 1px solid var(--border); border-radius: 6px; padding: 22px 24px;
  font-family: "Tinos", "Times New Roman", serif; font-size: 11pt; line-height: 1.32; text-align: justify; max-height: 60vh; overflow: auto;
}
.paper .titulo { text-align: center; font-size: 12pt; margin: 0 0 18px; }
.paper p { margin: 0 0 8px; }
.paper .inciso { display: grid; grid-template-columns: 22px 1fr; margin: 0 0 6px 10px; }
.paper .firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 50px; text-align: center; }
.paper .firmas div { border-top: 1px solid #000; padding-top: 6px; }
.paper .firmas small { display: block; font-size: 10pt; }

.toast.accion { cursor: pointer; background: var(--accent); color: var(--accent-text); }


/* --- franja de entorno (test / pre-prod): se muestra cuando /api/salud dice que no es prod --- */
.entorno { display: inline-block; background: #f97316; color: #1a0c00; font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 6px; margin-top: 6px; }
.side .brand .entorno { align-self: flex-start; }
.top .entorno { margin: 0 0 0 8px; }
#v-login .entorno { margin: 4px auto 10px; }

/* --- cotizador ------------------------------------------------------------------- */
.cotiz { margin: 6px 0 0; }
.cotiz .link-btn { padding: 0 4px; }
.cotiz .mal { color: var(--danger); }
.cotiz-res { margin-top: 12px; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.tramos { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.tramos li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.cotiz-tot .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.cotiz-tot .total { font-size: 17px; margin-top: 4px; }
.cotiz-tot .total b { color: var(--accent); }
#cz-avisos p { margin: 8px 0 0; }
#cz-avisos .mal { color: var(--danger); }
#cz-avisos .ok { color: var(--ok); }
.temporadas { display: grid; gap: 10px; margin-top: 8px; }
.temporada { background: var(--surface-2); border-radius: 12px; padding: 4px 12px 10px; }
.temporada .link-btn { margin-top: 6px; }

/* --- recorrido guiado (tour.js) ------------------------------------------------------ */

.tour-velo { position: fixed; inset: 0; z-index: 40; }
/* el foco es un recuadro transparente; la sombra enorme oscurece todo lo demás */
.tour-foco {
  position: fixed;
  z-index: 41;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgb(0 0 0 / .62), 0 0 0 3px var(--accent);
  pointer-events: none;
  transition: left .2s, top .2s, width .2s, height .2s;
}
.tour-caja {
  position: fixed;
  z-index: 42;
  width: min(380px, calc(100vw - 24px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgb(0 0 0 / .35);
  padding: 12px 16px 14px;
}
.tour-caja.centrada { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-cab { display: flex; justify-content: space-between; align-items: center; }
.tour-paso { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.tour-titulo { font-size: 17px; margin: 4px 0 6px; }
.tour-texto { margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
.tour-nav { display: flex; gap: 8px; justify-content: flex-end; }
.tour-nav .btn { flex: 0 0 auto; padding: 9px 14px; font-size: 14px; }
body.tour-activo { overflow: hidden; }

/* --- suscripción (bloque 4): franja de aviso ------------------------------------------------- */
.sus-banner { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; background: var(--sun); color: #7a5200; }
.sus-banner.mal { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }
#sus-estado b.ok { color: var(--ok); }
#sus-estado b.mal { color: var(--danger); }
#sus-estado b.warn { color: var(--warn); }

/* --- rol empleado (bloque 4): solo ocupación y reservas, sin dinero ---------------------------- */
html[data-rol="empleado"] .solo-dueno { display: none !important; }
html[data-rol="empleado"] .res-fila .c-pre, html[data-rol="empleado"] .res-fila .c-cob, html[data-rol="empleado"] .res-fila .c-con { display: none !important; }
html[data-rol="empleado"] .res-fila { grid-template-areas: "cod fec fec" "hue hue hue" "cas ori ori"; }
.usuario-cab .rol { font-size: 13px; padding: 4px 8px; border-radius: 8px; }

/* Reservas como tabla de columnas alineadas, con encabezado, cuando hay lugar (PC ancha) */
@media (min-width: 1180px) {
  .res-fila, .res-cab {
    grid-template-columns: 70px 205px minmax(0, 1.3fr) 92px 80px 92px minmax(0, 1fr) 82px;
    grid-template-areas: "cod fec hue cas ori pre cob con";
    gap: 0 10px;
    padding: 8px 14px 8px 16px;
    min-width: 0;
  }
  .res-fila .c-cob, .res-fila .c-con { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .res-fila .c-cob:empty, .res-fila .c-con:empty, .res-fila .c-ori:empty { display: block; }
  .res-cab { display: grid; background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: 0; padding-bottom: 2px; max-width: 1400px; }
  .res-cab .c-pre { text-align: right; }
  html[data-rol="empleado"] .res-fila, html[data-rol="empleado"] .res-cab {
    grid-template-columns: 70px 205px minmax(0, 1.3fr) 92px 80px;
    grid-template-areas: "cod fec hue cas ori";
  }
}

/* --- aspecto de marca (2026-10-18): más cálido y menos "panel de control" ---------------------------------- */

.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.primary:hover { filter: brightness(1.08); }
.pane-title, .card h3, .card-head h3, .login-top h3 { color: var(--primary); letter-spacing: -.2px; }
.brand-sm { color: var(--primary); }
.tabs { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tabs button { border-radius: 14px; }
.tabs button.on { color: var(--primary); background: var(--accent-soft); }
.seg button.on { color: var(--primary); }
.chip { background: var(--surface-2); color: var(--primary); }
.kpi { border-top-width: 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 55%, var(--surface)), var(--surface)); }
.kpi .v { color: var(--primary); }
.top { padding-bottom: 6px; }
.top-der { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn.tema { font-size: 18px; color: var(--muted); padding: 4px 8px; line-height: 1; }
.icon-btn.tema:hover { color: var(--primary); background: var(--surface-2); }
.side .side-foot .icon-btn.tema { margin-left: auto; margin-right: 4px; }
#tema-seg { display: inline-flex; margin: 4px 0 2px; }
.entorno { color: #1a0c00; }
.numpad button { border: 1px solid var(--border); }

/* --- pendientes (arriba del calendario) y mensajes ------------------------------------------- */
.pend { margin-bottom: 12px; border-left: 4px solid var(--warn); }
.pend > summary small { color: var(--text); }
.pend > .card-body { padding-top: 2px; }
.pend-lista li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.pend-lista li:first-child { border-top: 0; }
.pend-lista li > button:first-child { flex: 1; text-align: left; padding: 2px 0; min-width: 0; }
.pend-lista li > button:first-child:hover { color: var(--accent); }
.pend-lista .pend-sub { color: var(--muted); font-size: 13px; margin-left: 4px; }
.pend-lista .mal { color: var(--danger); font-weight: 600; }
.pend-lista .msg { flex: 0 0 auto; padding: 2px 8px; font-size: 16px; line-height: 1; border-radius: 8px; }
.pend-lista .msg:hover { background: var(--surface-2); }
.pago-cuotas .recordar { padding: 0 2px; font-size: 13px; }
#mj-texto { font-size: 15px; line-height: 1.45; }
.marcadores { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.marcadores code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; color: var(--text); }
@media (min-width: 900px) {
  .pend { max-width: 1400px; }
  .pend-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .pend-lista li:nth-child(2) { border-top: 0; }
}

/* --- reservas del mes bajo el calendario --------------------------------------------- */
.mes { margin-top: 12px; }
.mes .card-head { margin-bottom: 2px; }
.mes-lista .mes-izq { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mes-lista .mes-izq .badge { font-size: 11px; padding: 1px 6px; }
.mes-lista .badge.mal { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); color: var(--danger); }
.mes-lista .cuando { display: inline-flex; gap: 10px; align-items: baseline; }
.mes-lista .cuando b { color: var(--text); font-weight: 600; }
@media (min-width: 900px) {
  .mes { max-width: 1400px; }
  .mes-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .mes-lista li:nth-child(2) { border-top: 0; }
}

/* --- historial / actividad (auditoría) ---------------------------------------------- */
.historial li { padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.historial li:first-child { border-top: 0; }
.historial .cuando { color: var(--muted); white-space: nowrap; flex: 0 0 auto; min-width: 92px; }
.historial .quien { font-weight: 600; }
.historial .que { color: var(--muted); }
.historial .que b { color: var(--text); font-weight: 600; }
.historial button.ref { color: var(--accent); padding: 0; font-weight: 600; }
#form-historial { margin-top: 10px; }
#form-historial summary { font-size: 13px; color: var(--muted); cursor: pointer; }

/* firma digital del contrato (bloque 5) */
.badge.esperando { background: var(--sun, #fdf1d6); color: #8a5a00; }
:root[data-theme="dark"] .badge.esperando { background: #4a3a14; color: #ffd98a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.esperando { background: #4a3a14; color: #ffd98a; } }
.firma-estado { font-size: 14px; }
.firma-estado:empty { display: none; }
.firma-estado .estado { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.firma-estado .enlace { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.firma-estado .enlace input { flex: 1; min-width: 0; font-size: 13px; }
.firma-estado .acciones { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.firma-estado .aviso { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
