/* ViglAI Hub · HitIA «Manager report» (manager.js). Tokens and base rules come from app.css. One dense grid on the page, the day
   the report is about tinted as the horizon; figures in Archivo (no Greek in it: changes and labels stay Commissioner); green / amber
   for a change the good or the bad way, red only where someone must act (overbooking, a figure that differs from the Cloud). */

/* ---- the question ------------------------------------------------------------------------------------------------------ */
.mgr-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 22px; margin-bottom: 20px; }
.mgr-bar .grp { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.mgr-bar .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mgr-bar .when { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mgr-bar input[type=date] { width: auto; margin: 0; padding: 4px 8px; font-variant-numeric: tabular-nums; }
.mgr-bar .step { padding: 3px 11px; font-size: 16px; line-height: 1.2; }
.mgr-bar .seg button { padding: 5px 11px; }
.mgr-bar .files { margin-left: auto; }
.mgr-bar .files button { padding: 5px 12px; }

/* ---- the horizon: which day, and does it agree with the Cloud ----------------------------------------------------------- */
.mgr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 14px; }
.mgr-head h2 { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; }
.mgr-head h2::first-letter { text-transform: uppercase; }
.mgr-head .sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.notice.fire { background: var(--fire-bg); border-left-color: var(--fire); }

/* ---- four figures ------------------------------------------------------------------------------------------------------ */
.mgr-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mgr-kpis .kpi .m { font-size: 12.5px; color: var(--muted); margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--rule); }
.mgr-kpis .kpi .m b { color: var(--ink); font-size: 14px; }
.mgr .delta.good { color: var(--ok); }
.mgr .delta.bad { color: var(--smoke); }
.mgr .delta.flat { color: var(--muted); font-weight: 500; }

/* ---- the grid ---------------------------------------------------------------------------------------------------------- */
.mgr-table { padding: 0; overflow: hidden; }
.mgr-table .seg.mgr-show { display: none; margin: 12px 14px 4px; }
.mgr-grid { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums lining-nums; }
.mgr-grid th, .mgr-grid td { padding: 5px 10px; white-space: nowrap; }
.mgr-grid thead th { background: var(--sunken); color: var(--muted); font-weight: 600; text-align: right; font-size: 12px; }
.mgr-grid thead th.grp { color: var(--ink); text-align: center; font-size: 13px; padding-top: 8px; }
.mgr-grid thead tr + tr th { padding-top: 2px; }
.mgr-grid .g0 { border-left: 1px solid var(--rule); }
.mgr-grid thead .g0 { border-left-color: var(--surface); }
.mgr-grid th.lab { text-align: left; font-weight: 500; color: var(--ink); position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 190px; }
.mgr-grid thead th.lab { background: var(--sunken); }
.mgr-grid tbody td { text-align: right; border-bottom: 1px solid var(--rule); }
.mgr-grid tbody th.lab { border-bottom: 1px solid var(--rule); cursor: help; }
.mgr-grid tbody tr:hover td, .mgr-grid tbody tr:hover th.lab { background: color-mix(in srgb, var(--sunken) 55%, var(--surface)); }
.mgr-grid td.ty { font-family: var(--font-figure); font-stretch: 78%; font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.mgr-grid td.ly, .mgr-grid td.bud { color: var(--muted); font-family: var(--font-figure); font-stretch: 78%; font-size: 14px; }
.mgr-grid td.d, .mgr-grid td.dBud { min-width: 78px; }
/* the day the report is about: the horizon column group */
.mgr-grid tbody td.p-day { background: color-mix(in srgb, var(--sunken) 40%, var(--surface)); }
.mgr-grid tr.sec th.lab { color: var(--muted); font-weight: 650; font-size: 12.5px; padding-top: 16px; cursor: default; border-bottom: 1px solid var(--ink); }
.mgr-grid tr.sec td { border-bottom: 1px solid var(--ink); background: none; }
.mgr-grid tr.sec:hover th.lab, .mgr-grid tr.sec:hover td { background: var(--surface); }

/* ---- the next 7 nights ------------------------------------------------------------------------------------------------ */
.mgr-out { padding-bottom: 8px; }
.mgr-grid.out th.lab { min-width: 150px; }
.mgr-grid.out thead th { text-align: right; }
.mgr-grid.out thead th.lab { text-align: left; }
.mgr-grid.out td { font-variant-numeric: tabular-nums; }
.mgr-grid.out td.occ { min-width: 130px; }
.mgr-grid.out td.occ .bar { display: inline-block; height: 7px; margin-right: 8px; vertical-align: 1px; background: var(--c-otb); }
.mgr-grid.out td.occ.over { color: var(--fire); font-weight: 650; }
.mgr-grid.out td.occ.over .bar { background: var(--fire); }

.mgr-notes { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; max-width: 110ch; }
.mgr-notes li { margin: 3px 0; }
.mgr-print { display: none; }

/* ---- phone: one block of columns at a time ------------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .mgr-bar { gap: 12px; }
  .mgr-bar .files { margin-left: 0; }
  .mgr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mgr-kpis .kpi { padding: 12px 12px 10px; }
  .mgr-kpis .kpi .v { font-size: 24px; }
  .mgr-table .seg.mgr-show { display: inline-flex; }
  .mgr-grid[data-show="day"] .p-mtd, .mgr-grid[data-show="day"] .p-ytd,
  .mgr-grid[data-show="mtd"] .p-day, .mgr-grid[data-show="mtd"] .p-ytd,
  .mgr-grid[data-show="ytd"] .p-day, .mgr-grid[data-show="ytd"] .p-mtd { display: none; }
  .mgr-grid th, .mgr-grid td { padding: 5px 5px; }
  .mgr-grid th.lab { min-width: 0; max-width: 112px; white-space: normal; font-size: 12.5px; }
  .mgr-grid td.d, .mgr-grid td.dBud { min-width: 0; font-size: 12px; }
  .mgr-grid td.ly, .mgr-grid td.bud { font-size: 13px; }
  .mgr-grid tbody td.p-day { background: none; }
  .mgr-grid td.ty { font-size: 14px; }
}

/* ---- print: the report alone, one landscape page ------------------------------------------------------------------------- */
@page manager { size: A4 landscape; margin: 9mm; }
@media print {
  body:has(#view[data-route="hitia/manager"]) { background: #fff; }
  body:has(#view[data-route="hitia/manager"]) .shell { display: block; background: none; }
  body:has(#view[data-route="hitia/manager"]) :is(.rail, .topbar, .jobbar, .hubnote, .scrim, .toast, .tip) { display: none !important; }
  #view[data-route="hitia/manager"] { page: manager; padding: 0; max-width: none; }
  #view[data-route="hitia/manager"] :is(.pagehead, .tabs, .mgr-bar, .mgr-kpis, .seg.mgr-show) { display: none !important; }
  #view[data-route="hitia/manager"] .mgr-print { display: block; font-size: 9px; color: #6B7C86; margin: 6px 0 0; }
  #view[data-route="hitia/manager"] .mgr-head { margin-bottom: 6px; }
  #view[data-route="hitia/manager"] .mgr-head h2 { font-size: 15px; }
  #view[data-route="hitia/manager"] .panel { border: 0; padding: 0; margin-bottom: 8px; background: none; }
  #view[data-route="hitia/manager"] .mgr-grid { font-size: 9px; }
  #view[data-route="hitia/manager"] .mgr-grid th, #view[data-route="hitia/manager"] .mgr-grid td { padding: 1px 5px; }
  #view[data-route="hitia/manager"] .mgr-grid td.ty, #view[data-route="hitia/manager"] .mgr-grid td.ly, #view[data-route="hitia/manager"] .mgr-grid td.bud { font-size: 9.5px; }
  #view[data-route="hitia/manager"] .mgr-grid tr.sec th.lab { padding-top: 3px; font-size: 9px; }
  #view[data-route="hitia/manager"] .mgr-grid[data-show] :is(td, th) { display: table-cell; }
  #view[data-route="hitia/manager"] .mgr-grid th.lab { position: static; min-width: 0; }
  #view[data-route="hitia/manager"] :is(.mgr-table, .scroll) { overflow: visible; }
  #view[data-route="hitia/manager"] .mgr-grid :is(td.d, td.dBud) { min-width: 0; }
  #view[data-route="hitia/manager"] .mgr .delta { font-size: 8.5px; }
  #view[data-route="hitia/manager"] .mgr-grid, #view[data-route="hitia/manager"] .mgr-grid :is(th, td) { line-height: 1.25; }
  #view[data-route="hitia/manager"] .mgr-grid.out td.occ { min-width: 0; }
  #view[data-route="hitia/manager"] .mgr-out :is(th, td, .muted) { font-size: 9px; }
  #view[data-route="hitia/manager"] .mgr-out h2 { font-size: 12px; }
  #view[data-route="hitia/manager"] .mgr-grid.out td.occ .bar { height: 5px; }
  #view[data-route="hitia/manager"] .mgr-notes { font-size: 8.5px; margin-top: 0; }
  #view[data-route="hitia/manager"] .mgr-notes li { margin: 0; }
  #view[data-route="hitia/manager"] .mgr-head .sub { font-size: 9px; }
  #view[data-route="hitia/manager"] .mgr-out .cardhead { margin-bottom: 4px; }
  #view[data-route="hitia/manager"] * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
