:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #85847e;
  --line: #e6e5df;
  --line-2: #efeee9;
  --accent: #2a78d6;
  --prev: #b3b2ab;
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --focus: #2a78d6;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --ink: #f4f3ef;
    --ink-2: #c3c2b7;
    --ink-3: #8d8c84;
    --line: #2e2e2b;
    --line-2: #242422;
    --accent: #3987e5;
    --prev: #6b6a66;
    --c1: #3987e5;
    --c2: #d95926;
    --c3: #199e70;
    --focus: #6da7ec;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface: #1a1a19;
  --ink: #f4f3ef;
  --ink-2: #c3c2b7;
  --ink-3: #8d8c84;
  --line: #2e2e2b;
  --line-2: #242422;
  --accent: #3987e5;
  --prev: #6b6a66;
  --c1: #3987e5;
  --c2: #d95926;
  --c3: #199e70;
  --focus: #6da7ec;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 72px;
}
h1, h2 { margin: 0; font-weight: 500; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.eyebrow { color: var(--ink-3); font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }

button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* Barra superior */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -0.02em; line-height: 1.05; }
.top-actions { display: flex; align-items: center; gap: 20px; font-size: 0.8125rem; }
.link { background: none; border: 0; padding: 4px 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: color .2s var(--ease), text-decoration-color .2s var(--ease); }
.link:hover { color: var(--ink); text-decoration-color: var(--ink-3); }

/* Filtros */
.filters { display: flex; align-items: flex-end; gap: 24px 32px; flex-wrap: wrap; margin: 40px 0 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.seg, .tabs { display: flex; gap: 24px; flex-wrap: wrap; }
.seg button, .tabs button {
  background: none; border: 0; padding: 6px 0; color: var(--ink-3);
  border-bottom: 2px solid transparent; transition: color .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
}
.seg button:hover, .tabs button:hover { color: var(--ink-2); }
.seg button[aria-pressed="true"], .tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.seg button:active, .tabs button:active { transform: scale(0.97); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--ink-3); }
.field select, .field input {
  min-width: 11rem; max-width: 18rem; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 4px 22px 4px 0; font-size: 0.9375rem; color: var(--ink); border-radius: 0; appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select:hover, .field input:hover { border-bottom-color: var(--ink-3); }
.field-trm input { min-width: 6rem; width: 6.5rem; padding-right: 0; }
.field option { color: #0b0b0b; background: #fff; }

/* Bloques */
main { display: block; }
.hero { padding: 48px 0 8px; }
.block { padding: 64px 0 0; }
.hero-head h2, .block-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; letter-spacing: -0.01em; }
.hero-head { margin-bottom: 28px; }
.hero-head p { margin-top: 4px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }

/* Cifras */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.figure .label { color: var(--ink-3); font-size: 0.8125rem; }
.figure .value { font-family: var(--serif); letter-spacing: -0.02em; line-height: 1; margin-top: 6px; }
.figure-main .value { font-size: clamp(4rem, 11vw, 7rem); }
.figure-main .sub { margin-top: 14px; }
.figure-side { border-left: 1px solid var(--line); padding-left: 40px; display: grid; gap: 0; }
.figure-side .figure { padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.figure-side .figure:first-child { padding-top: 4px; }
.figure-side .figure:last-child { border-bottom: 0; padding-bottom: 0; }
.figure-side .value { font-size: 2.25rem; }
.figure .sub { color: var(--ink-2); font-size: 0.8125rem; margin-top: 6px; }
.figure .sub + .sub { margin-top: 2px; color: var(--ink-3); }
.figure .value small { font-family: var(--sans); font-size: 0.875rem; letter-spacing: 0; color: var(--ink-3); margin-left: 4px; }
.fade { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Gráfico */
.chart-wrap { position: relative; }
.chart { width: 100%; min-height: 300px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 12px; font-family: var(--sans); }
.chart .axis-x.sel { fill: var(--ink); font-weight: 600; }
.chart .lbl { font-size: 12px; font-weight: 600; font-family: var(--sans); }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:focus-visible { stroke: var(--focus); stroke-width: 2; rx: 4; }
.tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 11rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.10); font-size: 0.8125rem; transform: translate(-50%, -100%);
}
.tip[hidden] { display: none; }
.tip b { font-weight: 600; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 4px; color: var(--ink-2); }
.tip .row span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.tip .row .n { color: var(--ink); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent); }
.dot.prev { background: var(--prev); }
.chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 0.8125rem; color: var(--ink-2); }
.legend { display: inline-flex; gap: 20px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.note { color: var(--ink-3); font-size: 0.8125rem; margin-top: 8px; }

/* Tablas */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 560px; }
table.data th, table.data td { padding: 12px 12px 12px 0; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { font-weight: 500; color: var(--ink-3); font-size: 0.8125rem; border-bottom-color: var(--line); padding-top: 0; }
table.data th button { background: none; border: 0; padding: 0; color: inherit; font-weight: inherit; }
table.data th button:hover { color: var(--ink); }
table.data th[aria-sort="ascending"] button::after { content: " ↑"; }
table.data th[aria-sort="descending"] button::after { content: " ↓"; }
table.data tfoot td { font-weight: 600; border-bottom: 0; padding-top: 16px; }
table.data td.name { max-width: 20rem; overflow: hidden; text-overflow: ellipsis; }
table.data td.name small { color: var(--ink-3); margin-left: 8px; }
table.data tbody tr { transition: background-color .15s var(--ease); }
table.data tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.occ { display: inline-flex; align-items: center; gap: 12px; justify-content: flex-end; }
.occ .bar { width: 72px; height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.occ .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.occ .pct { min-width: 3.5rem; text-align: right; }
td.zero { color: var(--ink-3); }

/* Canales */
.stack { display: flex; gap: 2px; height: 14px; }
.stack i { display: block; height: 100%; border-radius: 4px; min-width: 2px; transition: flex-basis .35s var(--ease); }
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 24px; }
.channels .ch .nm { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.channels .ch .nm i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.channels .ch .big { font-family: var(--serif); font-size: 1.75rem; letter-spacing: -0.01em; margin-top: 4px; }
.channels .ch .sm { color: var(--ink-3); font-size: 0.8125rem; }

.foot { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.8125rem; max-width: 60ch; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .figure-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .block { padding-top: 48px; }
  .filters { gap: 20px; }
  .field select { min-width: 9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .fade { animation: fadeonly .2s linear both; }
  @keyframes fadeonly { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-transparency: reduce) { .tip { box-shadow: none; } }
@media (prefers-contrast: more) {
  :root { --ink-3: #5c5b57; --line: #bdbcb5; --line-2: #d3d2cb; }
}
@media (forced-colors: active) {
  .occ .bar i, .stack i { forced-color-adjust: none; }
}

/* ---- v2: dos cifras protagonistas, resumen por propiedad, huéspedes ---- */
.hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; align-items: stretch; }
.hero-grid .figure-main { padding: 0 40px 0 0; }
.hero-grid .figure-main + .figure-main { padding: 0 0 0 40px; border-left: 1px solid var(--line); }
.figure-main .value { font-size: clamp(3rem, 7.5vw, 5.5rem); }
.figure-main .value small { font-size: 0.875rem; }
.hero-minor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line-2); }
.hero-minor .figure { padding-right: 40px; }
.hero-minor .figure + .figure { padding: 0 0 0 40px; border-left: 1px solid var(--line-2); }
.hero-minor .value { font-size: 2.25rem; }
.figure .sub b { color: var(--ink); font-weight: 600; }

table.data th.grp { text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
table.data thead tr + tr th { padding-top: 6px; }
table.data td.cmp { line-height: 1.25; }
table.data td.cmp .abs { display: block; color: var(--ink-3); font-size: 0.75rem; }
table.data td.sep, table.data th.sep { border-left: 1px solid var(--line-2); padding-left: 16px; }
table.data tbody td.name button.rowlink { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .15s var(--ease); }
table.data tbody td.name button.rowlink:hover { text-decoration-color: var(--ink-3); }
table.data td.name small.n { display: block; margin-left: 0; }

.btn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; color: var(--ink); transition: border-color .2s var(--ease), transform .12s var(--ease); }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.lleg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-bottom: 16px; }
.lleg-bar input[type="search"] { background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 4px 0; min-width: 14rem; font-size: 0.9375rem; color: var(--ink); border-radius: 0; }
.lleg-bar input[type="search"]:focus { outline: none; border-bottom-color: var(--accent); }
.lleg-bar label.chk { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 0.875rem; }
.lleg-bar .count { color: var(--ink-3); font-size: 0.8125rem; margin-left: auto; }
td.huesped small { display: block; color: var(--ink-3); font-size: 0.75rem; }
.tag { color: var(--ink-3); }
.estado-cancelled { color: var(--ink-3); text-decoration: line-through; }
#actualizar[disabled] { opacity: .55; cursor: default; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid .figure-main, .hero-grid .figure-main + .figure-main { padding: 0; border-left: 0; }
  .hero-grid .figure-main + .figure-main { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
  .hero-minor { grid-template-columns: 1fr; gap: 24px; }
  .hero-minor .figure, .hero-minor .figure + .figure { padding: 0; border-left: 0; }
  .lleg-bar .count { margin-left: 0; width: 100%; }
}

/* ---- v3: resumen por propiedad en barras ---- */
:root { --prev2: #c4c3bc; }
:root:not([data-theme="dark"]) { --prev: #9a998f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --prev2: #55544f; --prev: #8d8c84; } }
:root[data-theme="dark"] { --prev2: #55544f; --prev: #8d8c84; }
.res-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 20px 0 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.res-total .big { font-family: var(--serif); font-size: 1.75rem; letter-spacing: -0.01em; }
.res-total .muted { font-size: 0.8125rem; }
.rk { display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr); gap: 8px 24px; align-items: center; padding: 14px 0 14px 10px; border-bottom: 1px solid var(--line-2); border-left: 2px solid transparent; }
.rk.sel { border-left-color: var(--accent); }
.rk-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rk-name button.rowlink { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .15s var(--ease); }
.rk-name button.rowlink:hover { text-decoration-color: var(--ink-3); }
.rk.sel .rk-name button.rowlink { font-weight: 600; }
.rk-name small { color: var(--ink-3); font-size: 0.75rem; }
.rk-bars { display: grid; gap: 5px; }
.rb { display: flex; align-items: center; gap: 12px; }
.rb .t { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; height: 8px; }
.rb .t i { display: block; height: 8px; min-width: 2px; border-radius: 0 4px 4px 0; transition: width .4s var(--ease); }
.rb .v { flex: none; width: 4.75rem; font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.rb.cur .t i { background: var(--accent); }
.rb.cur .v { color: var(--ink); font-weight: 600; }
.rb.p1 .t i { background: var(--prev); }
.rb.p2 .t i { background: var(--prev2); }
.sw { display: inline-block; width: 10px; height: 8px; border-radius: 2px; margin-right: 2px; }
.sw.cur { background: var(--accent); } .sw.p1 { background: var(--prev); } .sw.p2 { background: var(--prev2); }
@media (max-width: 760px) { .rk { grid-template-columns: 1fr; } }

/* ---- selector de varias propiedades ---- */
.multi { position: relative; }
.multi-btn { min-width: 11rem; max-width: 18rem; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 4px 22px 4px 0; font-size: 0.9375rem; color: var(--ink); border-radius: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.multi-btn:hover { border-bottom-color: var(--ink-3); }
.multi-panel { position: absolute; z-index: 6; top: calc(100% + 6px); left: 0; min-width: 18rem; max-height: 20rem; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.multi-panel[hidden] { display: none; }
.multi-clear { background: none; border: 0; padding: 6px 8px; color: var(--ink-2); font-size: 0.8125rem; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.multi-clear:hover { color: var(--ink); }
.multi-panel .opt { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; color: var(--ink); font-size: 0.875rem; cursor: pointer; }
.multi-panel .opt:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.multi-panel .opt small { margin-left: auto; color: var(--ink-3); }
.multi-panel .opt input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---- la suma: ya pasó + reservado = total ---- */
.suma { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; margin: 2px 0; }
.suma div { display: flex; flex-direction: column; }
.suma span { font-size: 0.75rem; color: var(--ink-3); }
.suma b { font-weight: 600; font-size: 0.9375rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.suma i { font-style: normal; color: var(--ink-3); padding-bottom: 1px; }
.suma div:last-child b { color: var(--ink); }

/* Arreglo: las casillas del selector de propiedades heredaban el estilo de los campos de texto. */
.multi-panel input[type="checkbox"] {
  appearance: auto; -webkit-appearance: checkbox;
  min-width: 0; max-width: none; width: 16px; height: 16px; flex: none;
  padding: 0; margin: 0; border: 0; background: none;
  accent-color: var(--accent); cursor: pointer;
}
.multi-panel .opt span { flex: 1 1 auto; min-width: 0; }
.multi-panel { min-width: 21rem; }

/* Cada barra dice a qué mes corresponde; la leyenda va arriba, junto al total. */
.rb .m { flex: none; width: 2.6rem; font-size: 0.75rem; color: var(--ink-3); text-transform: capitalize; }
.rb.cur .m { color: var(--ink); font-weight: 600; }
.res-leyenda { margin: 0 0 4px; padding: 12px 0; font-size: 0.8125rem; color: var(--ink-2); flex-wrap: wrap; gap: 8px 20px; }
.rk-bars { gap: 4px; }

/* ---- barras de dos tonos: fuerte = hasta la fecha, claro = resto del mes ---- */
.rb .t { gap: 0; }
.rb .t i.fuerte { border-radius: 0; }
.rb .t i.fuerte.fin, .rb .t i.rest { border-radius: 0 4px 4px 0; }
.rb.cur .t i.rest { background: color-mix(in srgb, var(--accent) 34%, var(--surface)); }
.rb.p1 .t i.rest { background: color-mix(in srgb, var(--prev) 42%, var(--surface)); }
.rb.p2 .t i.rest { background: color-mix(in srgb, var(--prev2) 60%, var(--surface)); }
.sw.cur.soft { background: color-mix(in srgb, var(--accent) 34%, var(--surface)); margin-right: 8px; }
.res-leyenda .ley2 { display: inline-flex; align-items: center; gap: 0; color: var(--ink-3); }
.res-leyenda .ley2 .sw:first-child { margin-right: 0; border-radius: 2px 0 0 2px; }
.res-leyenda .ley2 .sw.soft { border-radius: 0 2px 2px 0; }

/* ---- fila del total del portafolio ---- */
.rk-total { border-bottom: 2px solid var(--line); padding-top: 8px; padding-bottom: 20px; }
.rk-total .rk-name b:first-child { font-size: 1.0625rem; font-weight: 600; }
.rk-name small b { color: var(--ink); font-weight: 600; }
.res-sub { margin: 24px 0 0; color: var(--ink-3); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
