/* ════════════════════════════════════════════════════════════════
   Dashboard Ejecutivo — estilos del módulo
   Solo usa tokens de ../../css/oip.css (nada de color hardcodeado).
   ════════════════════════════════════════════════════════════════ */

/* ── Encabezado compacto: hotel seleccionado + mes ───────────── */
.db-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
}
.db-head__title { min-width: 0; }
.db-sub { margin: 6px 0 0; font-size: 14px; color: var(--oip-muted); }
.db-sub strong { color: var(--oip-ink-2); font-weight: 500; }

.db-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.db-refresh .oip-live { font-size: 12px; color: var(--oip-muted); }
.db-refresh .oip-btn { min-height: 40px; }
.db-panel { display: flex; flex-direction: column; gap: 28px; }
.db-panel[hidden] { display: none; }
.db-panel__body { display: flex; flex-direction: column; gap: 28px; }

/* ── Franja de KPIs ─────────────────────────────────────────── */
.db-kpis { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.db-kpi { border-top: 3px solid var(--oip-accent); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; background: var(--oip-surface); }
.db-kpi__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 18px; }
.db-kpi__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oip-muted);
}
.db-kpi__head .oip-status { font-size: 10px; }
.db-kpi__value { font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; line-height: 1; }
#panel-ingresos .db-kpi__value { font-size: clamp(19px, 1.6vw, 24px); white-space: nowrap; }   /* importes exactos con centavos */
.db-kpi__sub { font-size: 12px; color: var(--oip-muted); }

/* ── Bloques dentro de una pestaña ──────────────────────────── */
.db-block { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.db-block__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.db-block__title { margin: 0; font-size: 18px; font-weight: 700; }
.db-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 28px; }
.db-empty { margin: 0; padding: 20px; border: 1px dashed var(--oip-line-2); color: var(--oip-muted); font-size: 14px; }

.db-alert {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid var(--oip-warn);
  background: var(--oip-warn-bg);
  font-size: 14px;
}
.db-alert ul { margin: 0; padding-left: 18px; color: var(--oip-ink); }
.db-alert li + li { margin-top: 4px; }

/* Botones dentro de tablas (ir al detalle de un hotel / a otra pestaña) */
.db-colbtn, .db-rowbtn, .db-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--oip-accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.db-colbtn:hover, .db-rowbtn:hover, .db-linkbtn:hover { color: var(--oip-ink); }

.fin-table--list th.is-text, .fin-table--list td.is-text { text-align: left; }
.fin-table--list td { white-space: nowrap; }
.fin-table--list td.is-text { font-size: 13px; }
.fin-table tr.is-off td, .fin-table tr.is-off th { color: var(--oip-muted); }
.fin-table span.is-warn { color: var(--oip-warn); font-weight: 600; }
.fin-table span.is-crit { color: var(--oip-crit); font-weight: 600; }

.db-note { font-size: 13px; color: var(--oip-muted); margin: 0; }

/* ── Tiles de ocupación ─────────────────────────────────────── */
.occ-grid { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }

.occ-tile { min-height: 0; gap: 10px; }
.occ-tile__name { font-size: 17px; font-weight: 700; }
.occ-tile__city { font-size: 13px; color: var(--oip-muted); margin-top: -8px; }
.occ-tile .oip-figure { font-size: clamp(48px, 5vw, 64px); }
.occ-tile .oip-figure small { font-size: 0.45em; letter-spacing: 0; color: var(--oip-ink-2); }
.occ-tile__rooms { font-size: 12px; color: var(--oip-ink-2); }

/* Barra de ocupación de hoy (ocupados / bloqueados / libres) */
.occ-bar { display: flex; height: 6px; background: var(--oip-line); gap: 2px; }
.occ-bar span { display: block; height: 100%; }
.occ-bar .is-occ { background: var(--oip-ink); }
.occ-bar .is-blk { background: var(--oip-line-2); }

.occ-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin: 4px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--oip-line);
  font-size: 13px;
}
.occ-kv dt { color: var(--oip-muted); }
.occ-kv dd { margin: 0; font-weight: 600; text-align: right; }

.occ-tile.is-off { background: var(--oip-subtle); }
.occ-tile.is-off .occ-tile__name { color: var(--oip-ink-2); }
.occ-tile__msg { font-size: 13px; line-height: 1.5; color: var(--oip-muted); margin: 0; }


/* ── Gráfica diaria ─────────────────────────────────────────── */
.db-chart { border: 1px solid var(--oip-line-2); border-radius: var(--oip-radius); background: var(--oip-surface); padding: 20px 20px 12px; }
.db-chart__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.db-chart__title { margin: 0; font-size: 17px; font-weight: 700; }
.db-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--oip-ink-2); }
.db-legend span { display: inline-flex; align-items: center; gap: 6px; }
.db-legend i { width: 12px; height: 12px; display: inline-block; }
.db-legend .is-actual { background: var(--oip-chart-actual); }
.db-legend .is-otb    { background: var(--oip-chart-otb); }
.db-legend .is-today  { width: 2px; height: 14px; background: var(--oip-ink); }
.db-chart__canvas { position: relative; height: 300px; }

.db-table { margin-top: 12px; font-size: 13px; }
.db-table summary { cursor: pointer; color: var(--oip-accent); font-weight: 500; }
.db-table__wrap { max-height: 320px; overflow: auto; margin-top: 10px; border: 1px solid var(--oip-line); }
.db-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.db-table th, .db-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--oip-line); white-space: nowrap; }
.db-table th:first-child, .db-table td:first-child { text-align: left; }
.db-table thead th { position: sticky; top: 0; background: var(--oip-subtle); font-weight: 600; color: var(--oip-ink-2); }
.db-table tr.is-today td { background: var(--oip-accent-bg); font-weight: 600; }

/* ── Finanzas ───────────────────────────────────────────────── */
.db-table-scroll { overflow-x: auto; border: 1px solid var(--oip-line-2); border-radius: var(--oip-radius); background: var(--oip-surface); }
.db-table-scroll:empty { display: none; }

.fin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fin-table th, .fin-table td { padding: 10px 14px; border-bottom: 1px solid var(--oip-line); text-align: right; vertical-align: top; }
.fin-table thead th {
  background: var(--oip-subtle);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--oip-ink-2);
  white-space: nowrap;
}
.fin-table th[scope="row"], .fin-table thead th:first-child { text-align: left; font-weight: 500; min-width: 220px; }
.fin-table td { font-size: 13px; white-space: nowrap; }
.fin-table .is-group th {
  padding-top: 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oip-muted);
  border-bottom-color: var(--oip-line-2);
}
.fin-table .is-strong th, .fin-table .is-strong td { font-weight: 700; color: var(--oip-ink); }
.fin-table .is-total { background: var(--oip-subtle); font-weight: 700; }
.fin-table tr.is-today td { background: var(--oip-accent-bg); }
.fin-table .is-pending td { color: var(--oip-ink-2); }
.fin-table td.is-warn { color: var(--oip-warn); font-weight: 600; }
.fin-table td.is-crit { color: var(--oip-crit); font-weight: 600; }
.fin-table .oip-status { margin-left: 6px; font-size: 10px; }
.fin-sub { font-size: 12px; font-weight: 400; color: var(--oip-muted); white-space: normal; margin-top: 2px; }
.fin-sub-inline { font-size: 11px; color: var(--oip-muted); margin-left: 6px; }

.db-error {
  border: 1px solid var(--oip-crit);
  background: var(--oip-crit-bg);
  color: var(--oip-crit);
  padding: 14px 18px;
  font-size: 14px;
}
