/* Back-office reports (Reports screen sub-tabs). Theme variables only; classes are prefixed bo-. */

/* ---------- tab bar ---------- */
.bo-tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: thin; border-bottom: 2px solid var(--sand); }
.bo-tabs button { flex: none; min-height: 48px; padding: 8px 18px; border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; background: transparent; color: var(--navy); font-size: 1rem; white-space: nowrap; border-radius: 10px 10px 0 0; }
.bo-tabs button:hover { background: var(--sand-light); }
.bo-tabs button.on { border-bottom-color: var(--teal); color: var(--teal); font-weight: 700; background: var(--white); }

/* ---------- controls ---------- */
.bo-bar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; padding: 12px 14px; margin-bottom: 12px; }
.bo-presets { flex-wrap: wrap; border-radius: 24px; }
.bo-presets button { padding: 6px 16px; }
.bo-custom, .bo-day { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.bo-day { align-items: center; }
.bo-custom .f { margin: 0; }
.bo-custom .input, .bo-datein { width: auto; }
.bo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.bo-card > .bo-actions { margin: 12px 0 0; }
.bo-banner { padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn); color: var(--navy); }
.bo-empty { padding: 28px 12px; }
.bo-nil { color: var(--muted); }
.bo-neg { color: var(--danger); }
.bo-code { color: var(--muted); font-size: .85em; letter-spacing: .03em; }
.bo-expl, .bo-foot, .bo-intro { color: var(--muted); font-size: .92rem; margin: 2px 0 8px; }
.bo-intro { color: var(--navy); font-size: 1rem; padding: 10px 12px; background: var(--sand-light); border-radius: 10px; margin-bottom: 12px; }
.bo-avg { margin: 0 0 8px; }

/* ---------- generic cards / tables ---------- */
.bo-card { padding: 14px 16px; margin-bottom: 14px; }
.bo-card h3, .bo-sec h3 { margin: 0 0 8px; }
.bo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 6px; }
.bo-head h3 { margin: 0; }
.bo-tbl { width: 100%; border-collapse: collapse; }
.bo-tbl td.n, .bo-tbl th.n, .bo-tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bo-tbl tfoot td, .bo-tbl tfoot th { font-weight: 600; border-top: 2px solid var(--sand); background: var(--sand-light); }
.bo-tbl tbody tr:hover td { background: var(--sand-light); }
.bo-scroll { overflow-x: auto; max-width: 100%; }
.bo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bo-tile { padding: 12px 14px; }
.bo-tile .sl { color: var(--muted); font-size: .88rem; }
.bo-tile .sv { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bo-tile .sc { color: var(--muted); font-size: .8rem; }
.bo-tile.bo-net { background: var(--teal); border-color: var(--teal); color: var(--cream); }
.bo-tile.bo-net .sl, .bo-tile.bo-net .sc { color: var(--cream); opacity: .85; }
.bo-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.bo-three { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.bo-two .bo-card, .bo-three .bo-card { margin-bottom: 0; }
.bo-two, .bo-three { margin-bottom: 14px; }

/* ---------- daily report sheet ---------- */
.bo-sheet { padding: 18px 22px 20px; margin-bottom: 14px; }
.bo-sheet-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 20px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--navy); }
.bo-resort { text-transform: uppercase; letter-spacing: .14em; font-size: .9rem; color: var(--muted); }
.bo-sheet-h h2 { margin: 0; font-size: 1.7rem; }
.bo-meta { text-align: right; display: grid; gap: 2px; }
.bo-meta span { color: var(--muted); font-size: .9rem; }
.bo-cols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 4px 24px; align-items: start; }
.bo-sheet .tbl th, .bo-sheet .tbl td { padding: 6px 7px; }
.bo-sheet .tbl th { font-size: .7rem; letter-spacing: .04em; }
.bo-sheet .tbl td { font-size: .95rem; }
.bo-sec { margin-bottom: 14px; }
.bo-sec h4 { margin: 8px 0 0; font-size: 1rem; }
.bo-line td { border-bottom: 1px solid var(--sand-light); }
.bo-line.bo-key td, .bo-tbl tfoot .bo-sub td { font-weight: 700; }
.bo-line.bo-key td { border-top: 2px solid var(--navy); background: transparent; }
.bo-line em { color: var(--muted); font-size: .85em; }
.bo-trial-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 6px; }
.bo-trial-h h3 { margin: 0; }
.bo-sepl { border-left: 2px solid var(--sand); }
.bo-bal { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-pill); font-weight: 700; font-size: 1.05rem; }
.bo-bal svg { width: 22px; height: 22px; flex: none; }
.bo-bal.ok { background: var(--ok-bg); color: var(--success); border: 2px solid var(--success); }
.bo-bal.bad { background: var(--danger-bg); color: var(--danger); border: 2px solid var(--danger); font-size: 1.15rem; }

/* ---------- print header (screen: hidden) ---------- */
.bo-ph { display: none; }

/* ---------- sales by hour ---------- */
.bo-bars { display: flex; align-items: stretch; gap: 4px; height: 230px; min-width: 520px; padding-top: 4px; }
.bo-barc { flex: 1 1 0; min-width: 20px; display: flex; flex-direction: column; align-items: stretch; }
.bo-bt { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--sand); min-height: 0; }
.bo-bt i { display: block; width: 100%; background: var(--teal); border-radius: 4px 4px 0 0; min-height: 0; }
.bo-barc:hover .bo-bt i { background: var(--teal-dark); }
.bo-bv { height: 18px; line-height: 18px; text-align: center; font-size: .72rem; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bo-bx { height: 20px; line-height: 20px; text-align: center; font-size: .75rem; color: var(--muted); }
.bo-mxwrap { border: 1px solid var(--sand); border-radius: 10px; }
.bo-mx td, .bo-mx th { padding: 8px 10px; }
.bo-stick { position: sticky; left: 0; z-index: 2; background: var(--white); text-align: left; min-width: 150px; max-width: 220px; box-shadow: 1px 0 0 var(--sand); }
.bo-mx tfoot th.bo-stick, .bo-perf tfoot th.bo-stick { background: var(--sand-light); }
.bo-mx .bo-heat { position: relative; z-index: 0; }
.bo-mx .bo-heat::before { content: ''; position: absolute; inset: 0; background: var(--teal); opacity: var(--h, 0); z-index: -1; }
.bo-mx tbody tr:hover td.bo-heat { background: transparent; }
.bo-totc { border-left: 2px solid var(--sand); }
.bo-inbar { height: 6px; margin-top: 4px; border-radius: 3px; background: var(--sand-light); overflow: hidden; min-width: 90px; }
.bo-inbar i { display: block; height: 100%; background: var(--teal); }
.bo-netc { min-width: 120px; }

/* ---------- reconciliation ---------- */
.bo-rec .input { min-width: 120px; }
.bo-rec .bo-note { min-width: 160px; }
.bo-rec td { vertical-align: middle; }
.bo-rec td small { display: block; color: var(--muted); }
.bo-by small { display: block; color: var(--muted); font-size: .8rem; }
.bo-var { font-weight: 700; white-space: nowrap; }
.bo-var.ok { color: var(--success); }
.bo-var.warn { color: #8a5d0c; background: var(--warn-bg); padding: 2px 10px; border-radius: var(--radius-pill); }
.bo-var.bad { color: var(--danger); background: var(--danger-bg); padding: 2px 10px; border-radius: var(--radius-pill); }
.bo-rstat { display: grid; padding: 6px 16px; border-radius: 12px; border: 2px solid var(--sand); background: var(--sand-light); }
.bo-rstat small { font-size: .8rem; color: var(--muted); }
.bo-rstat.ok { border-color: var(--success); background: var(--ok-bg); color: var(--success); }
.bo-rstat.warn { border-color: var(--warn); background: var(--warn-bg); color: #8a5d0c; }
.bo-rstat.bad { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.bo-filter, .bo-filters label { display: grid; gap: 2px; font-size: .85rem; color: var(--muted); }
.bo-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.bo-filters .input, .bo-filter .input { min-width: 180px; }
.bo-desc { min-width: 200px; max-width: 360px; }

/* ---------- set-up ---------- */
.bo-off td { opacity: .6; }
.bo-role { min-width: 170px; }
.bo-mv { min-height: 48px; min-width: 56px; }
.bo-add { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.bo-add .f { margin: 0; }
.bo-err { color: var(--danger); min-height: 1.4em; margin: 6px 0; font-weight: 600; }
.bo-err:empty { min-height: 0; margin: 0; }
.bo-setup td { vertical-align: middle; }

/* touch targets */
.bo-rec .btn.sm, .bo-setup .btn.sm { min-height: 48px; }
.bo-setup .switch { position: relative; }
.bo-setup .switch::before { content: ''; position: absolute; inset: -4px 0; }
.bo-setup .sw-wrap { min-height: 48px; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .bo-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .bo-sheet { padding: 12px; }
  .bo-sheet-h h2 { font-size: 1.4rem; }
  .bo-meta { text-align: left; }
  .bo-presets { width: 100%; }
  .bo-presets button { flex: 1 1 auto; }
  .bo-day { width: 100%; }
  .bo-day .btn { flex: 1 1 auto; }
  .bo-datein { flex: 1 1 100%; width: 100%; order: -1; }
  .bo-custom .f { flex: 1 1 130px; }
  .bo-custom .input { width: 100%; }
  .bo-actions .btn { flex: 1 1 auto; }
  .bo-filters, .bo-filters label, .bo-filters .input, .bo-filter, .bo-filter .input { width: 100%; }
  .bo-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bo-two, .bo-three { grid-template-columns: minmax(0, 1fr); }
  .bo-card { padding: 12px; }
}

/* ---------- print: one A4 page for the daily report ---------- */
@page bo-portrait { size: A4 portrait; margin: 9mm; }
@page bo-landscape { size: A4 landscape; margin: 9mm; }
@media print {
  body.print-x .bo-a4 { page: bo-portrait; }
  body.print-x .bo-land { page: bo-landscape; }
  body.print-x .bo-ph { display: block; font-size: 13pt; padding-bottom: 5px; margin-bottom: 8px; border-bottom: 1px solid #000; }
  body.print-x .bo-ph span { font-weight: 700; }
  body.print-x .bo-ph small { display: block; font-size: 8.5pt; color: #444; }
  body.print-x .bo-sheet { padding: 0; border: 0; box-shadow: none; margin: 0; font-size: 8.5pt; }
  body.print-x .bo-sheet-h { padding-bottom: 4px; margin-bottom: 6px; border-bottom: 1.5px solid #000; }
  body.print-x .bo-sheet-h h2 { font-size: 15pt; }
  body.print-x .bo-resort { font-size: 8pt; }
  body.print-x .bo-cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 14px; }
  body.print-x .bo-sec { margin-bottom: 6px; }
  body.print-x .bo-sec h3 { font-size: 10.5pt; margin-bottom: 2px; }
  body.print-x .bo-sec h4 { font-size: 8.5pt; margin-top: 3px; }
  body.print-x .bo-expl, body.print-x .bo-foot { font-size: 7.5pt; margin: 1px 0 3px; }
  body.print-x .bo-sheet .tbl th, body.print-x .bo-sheet .tbl td { padding: 1.5px 4px; font-size: 8pt; }
  body.print-x .bo-sheet .tbl th { font-size: 7pt; letter-spacing: 0; }
  body.print-x .bo-bal { padding: 2px 10px; font-size: 9pt; border-width: 1.5px; }
  body.print-x .bo-bal svg { width: 12px; height: 12px; }
  body.print-x .bo-tbl tfoot td, body.print-x .bo-tbl tfoot th { background: transparent; }
  body.print-x .bo-tbl tbody tr:hover td { background: transparent; }
  body.print-x .bo-card { padding: 6px 0; border: 0; margin-bottom: 8px; break-inside: auto; }
  body.print-x .bo-card h3 { font-size: 11pt; }
  body.print-x .bo-tbl tr { break-inside: avoid; }
  body.print-x .bo-scroll, body.print-x .bo-mxwrap, body.print-x .bo-sheet .tbl-wrap { overflow: visible; border: 0; }
  body.print-x .bo-stick { position: static; box-shadow: none; min-width: 0; }
  body.print-x .bo-bars { min-width: 0; height: 130px; }
  body.print-x .bo-tile { padding: 4px 8px; }
  body.print-x .bo-tile .sv { font-size: 12pt; }
  body.print-x .bo-tiles { gap: 6px; }
  body.print-x .bo-tile.bo-net { background: #fff; color: #000; border: 2px solid #000; }
  body.print-x .bo-tile.bo-net .sl, body.print-x .bo-tile.bo-net .sc { color: #000; }
  body.print-x .bo-mx .bo-heat::before { z-index: -1; }
  body.print-x .bo-rec .input { border: 0; padding: 0; min-height: 0; min-width: 0; background: transparent; }
  body.print-x .bo-mx td, body.print-x .bo-mx th { padding: 2px 4px; font-size: 7.5pt; }
}

.bo-bar .seg button, .bo-head .seg button { min-height: 48px; }
