/* Shared page-sheet layout (plan §C2/§P18/D11) — every page under web/app/pages/ reuses
   this: the page header, the ruled sheet (margin heading, spine, section body), the
   still pips where a section meets the spine (board 13, look A), the margin summary line
   (look C), and the double rule under the page header (look H) — no folio, no ribbon,
   no scroll animation (P24, "nothing else from B"). Tiles, tables, the priority list and
   the empty state are shared shapes Sales/Employees/Settings (Cards 8–10) reuse as-is;
   `.psheet`/`.pnote`/`.inp`/`.segctl` are named to avoid the chat's own classes (§C6). */

.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 80px 24px; box-sizing: border-box; }

.page-head { display: grid; grid-template-columns: 168px minmax(0, 1fr); padding: 34px 0 22px; border-bottom: 3px double var(--rule); }
.page-head .ph-t { grid-column: 2; padding-left: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-title { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
.page-state { font-family: var(--serif); font-size: 17px; line-height: 1.5; margin: 6px 0 0; color: var(--ink); max-width: 620px; }
.page-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.psheet { position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr); }
.psheet::before { content: ''; position: absolute; left: 168px; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.sec { display: contents; }
.sec > .mg { position: relative; padding: 26px 20px 0 0; text-align: right; }
.sec > .mg::after { content: ''; position: absolute; right: -5px; top: 30px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--rule); box-sizing: border-box; }
.sec > .mg h2 { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .10em; text-transform: uppercase; color: var(--ink-mid); line-height: 1.5; }
.sec > .mg p:not(.sum) { margin: 4px 0 0; font-size: 12px; color: var(--ink-mid); line-height: 1.45; }
.sec > .mg .sum { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.35; color: var(--ink); margin: 6px 0 0; }
.sec > .bd { padding: 26px 0 26px 28px; min-width: 0; border-bottom: 1px solid var(--rule-soft); }
.sec:last-child > .bd { border-bottom: 0; }

/* the honest-note line (plan §C6: .pnote, not .note — the thread's own) */
.pnote { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.55; color: var(--ink); padding: 10px 14px; border-left: 2px solid var(--plum-soft); background: var(--paper-2); max-width: 680px; margin: 0; }
.pnote .ico { margin-top: 2px; color: var(--ink-mid); flex: none; }

/* stat tiles: one ruled strip, figure in Newsreader, span always stated, change in words */
.tiles { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.tile { background: var(--paper-2); padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; }
.tile-lab { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.tile-span { font-size: 12px; color: var(--ink-mid); margin-top: 2px; }
.tile-val { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -.015em; line-height: 1.15; margin-top: 12px; }
.tile-val.empty { font-size: 15px; font-weight: 500; color: var(--ink-mid); font-family: var(--sans); }
.tile-sub { font-size: 12.5px; color: var(--ink-mid); margin-top: 4px; }
.tile-sub .fig { font-weight: 600; color: var(--ink); }
.tile-sub .fig.neg { color: var(--red); }
.tile-ask { margin-top: auto; padding-top: 12px; font-size: 12.5px; color: var(--ink-mid); background: none; border: 0; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.tile-ask:hover { color: var(--ink); }
.tile-ask .ico { width: 14px; height: 14px; color: var(--plum); }

/* tables: 48px rows, figures right-aligned (base rules in shell.css .tbl) */
.tbl-wrap { overflow-x: auto; }
.tbl tr.day td { height: auto; padding: 16px 12px 6px 12px; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mid); }

/* the entries filter row */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-wrap { position: relative; display: inline-flex; align-items: center; min-width: 200px; }
.search-wrap .ico { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--ink-mid); pointer-events: none; }
.search-wrap .inp { padding-left: 34px; }
.asof { font-size: 12.5px; color: var(--ink-mid); margin: 0; }

/* the date-range button + popover (review item 4): no native date input sits directly
   on the surface — only inside this disclosure. Reuses shell.css's pop-in/pop-out. */
.range-wrap { position: relative; display: inline-flex; }
.range-pop { position: absolute; top: calc(100% + 6px); left: 0; width: 320px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px; z-index: 30; display: grid; gap: 10px; }
.range-pop:not([hidden]) { animation: pop-in 160ms var(--ease-in) both; }
.range-pop.leaving { animation: pop-out 110ms var(--ease-out) both; }
.range-presets { display: flex; flex-direction: column; gap: 2px; }
.range-presets button { border: 0; background: none; min-height: 44px; padding: 0 8px; border-radius: var(--radius); text-align: left; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.range-presets button:hover { background: var(--paper-2); }
.range-custom { border-top: 1px solid var(--rule-soft); padding-top: 10px; }
.range-custom:first-child { border-top: 0; padding-top: 0; }
/* presets beside the calendar where there is room; stacked on a phone (below) */
.range-pop:has(.range-presets) { width: 470px; grid-template-columns: 128px minmax(0, 1fr); align-items: start; }
.range-pop:has(.range-presets) .range-custom { border-top: 0; padding-top: 0; border-left: 1px solid var(--rule-soft); padding-left: 10px; }

/* the range calendar (rangeCal.js): tap the first day, then the last */
.rcal { display: grid; gap: 6px; }
.rcal-head { display: flex; align-items: center; justify-content: space-between; }
.rcal-title { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.rcal-nav { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-mid); border-radius: var(--radius); cursor: pointer; }
.rcal-nav:hover { background: var(--paper-2); color: var(--ink); }
.rcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.rcal-wd { padding: 4px 0; text-align: center; font-size: 12px; color: var(--ink-mid); }
.rcal-day { position: relative; height: 40px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 100ms; }
.rcal-day:hover:not(:disabled) { background: var(--paper-2); }
.rcal-day.in, .rcal-day.in:hover { background: color-mix(in srgb, var(--plum) 16%, transparent); }
.rcal-day.start, .rcal-day.end, .rcal-day.start:hover, .rcal-day.end:hover { background: var(--plum); color: var(--paper); font-weight: 600; }
.rcal-day.today::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--plum); }
.rcal-day.start.today::after, .rcal-day.end.today::after { background: var(--paper); }
.rcal-day:disabled { color: var(--ink-mid); opacity: .4; cursor: default; }
.rcal-day:focus-visible, .rcal-nav:focus-visible { outline: 2px solid var(--plum-soft); outline-offset: -2px; }
.rcal-hint { margin: 0; min-height: 1.4em; font-size: 12.5px; color: var(--ink-mid); }
@media (pointer: coarse) { .rcal-day, .rcal-nav { height: 44px; } }

/* priority list — "worth a look" */
.prio { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.prio li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.prio li:first-child { padding-top: 0; }
.prio li:last-child { border-bottom: 0; }
.prio .lead { font-family: var(--serif); font-size: 18px; line-height: 1.45; margin: 0; }
.prio .lead .fig.neg { color: var(--red); }
.prio .why { font-size: 13px; color: var(--ink-mid); margin: 0; grid-column: 1; }
.prio .go { grid-row: 1 / span 2; grid-column: 2; align-self: center; display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-mid); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.prio .go:hover { color: var(--ink); }
.prio .go .ico { width: 14px; height: 14px; color: var(--plum); }

/* empty state: one heading, one explanation, one action. `.empty-state`, not `.empty`: a
   bare `.empty` also matched the modifier on `.tile.empty`, `.tile-val.empty` and the
   artifacts' `.pair-row.empty`, stripping the empty Sales tiles' side padding. */
.empty-state { max-width: 560px; padding: 6px 0; }
.empty-state h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; margin: 0 0 6px; line-height: 1.35; }
.empty-state p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; }
.empty-state .row-end { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1023px) {
  .page { padding: 0 16px 60px; }
  .page-head { grid-template-columns: minmax(0, 1fr); padding: 22px 0 14px; }
  .page-head .ph-t { grid-column: 1; padding-left: 0; }
  .page-title { font-size: 25px; }
  .psheet { grid-template-columns: minmax(0, 1fr); display: block; }
  .psheet::before { display: none; }
  .sec > .mg { text-align: left; padding: 22px 0 0; }
  .sec > .mg::after { display: none; }
  .sec > .bd { padding: 10px 0 22px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-val { font-size: 25px; }
  .search-wrap { flex: 1 1 100%; }
  .range-pop, .range-pop:has(.range-presets) { left: auto; right: 0; width: 320px; max-width: calc(100vw - 32px); grid-template-columns: minmax(0, 1fr); }
  .range-pop:has(.range-presets) .range-custom { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-soft); padding-top: 10px; }
}
