/* Sales (plan §D7/§D11, Card 8) — the register view: the period/store tools in the
   header, the by-hour chart, the most-ordered ranking, the payment split and the
   running-low table. Reuses the shared sheet shapes from pages.css (`.tiles`, `.tbl`,
   `.pnote`, `.range-wrap/.range-pop`, `.segctl`) — nothing here duplicates them. */

/* header tools: store picker + the large period segctl */
.store-pick { position: relative; display: inline-flex; }
.store-pop { position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 4px; z-index: 30; display: grid; gap: 2px; }
.store-pop:not([hidden]) { animation: pop-in 160ms var(--ease-in) both; }
.store-pop.leaving { animation: pop-out 110ms var(--ease-out) both; }
.store-pop button { border: 0; background: none; min-height: 44px; padding: 0 10px; border-radius: var(--radius); text-align: left; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.store-pop button:hover { background: var(--paper-2); }
.store-pop button[aria-selected="true"] { font-weight: 500; }

.segctl.lg { vertical-align: middle; }
.segctl.lg button { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.segctl.lg .range-wrap { display: inline-flex; }
.segctl.lg .range-wrap .btn { border: 0; border-radius: 0; border-left: 1px solid var(--rule); min-height: 40px; }
.segctl.lg .range-pop { right: 0; left: auto; }

/* the by-hour chart: data ink only on marks, text in ink (plan's data-ink rule) */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--rule-soft); }
.chart .axis { font-family: var(--sans); font-size: 12px; fill: var(--ink-mid); }
.chart .col { fill: var(--data); }
.chart .col.lite { fill: var(--data-lite); }
.chart .val { font-family: var(--sans); font-size: 12px; font-weight: 500; fill: var(--ink); }

/* most ordered */
.rank { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.rank li { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 84px 90px; gap: 14px; align-items: center; min-height: 40px; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.rank li:last-child { border-bottom: 0; }
.rank .bar { height: 9px; background: var(--paper-3); border-radius: 1px; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--data); }
.rank .n { text-align: right; font-weight: 500; }
.rank .p { text-align: right; font-size: 12.5px; color: var(--ink-mid); }

/* the empty-state tiles (D7's own screenshot): a quieter zero/dash, no sub line */
.tile.empty .tile-val { color: var(--ink-mid); font-weight: 500; }

/* payment split */
.split { display: flex; gap: 2px; height: 14px; margin: 6px 0 10px; max-width: 560px; }
.split i { display: block; border-radius: 1px; }
.tbl .mid { color: var(--ink-mid); font-weight: 400; }

@media (max-width: 1023px) {
  .rank li { grid-template-columns: minmax(0, 1fr) 84px 74px; }
  .rank .bar { display: none; }
  /* Six periods and the date control do not fit one line at 390: each becomes its own
     chip and the row wraps (the sliding indicator only knows one row, so it steps aside). */
  .segctl.lg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; border-radius: 0; overflow: visible; max-width: 100%; }
  .segctl.lg .seg-ind { display: none; }
  .segctl.lg > button { border: 1px solid var(--rule); border-radius: var(--radius); }
  .segctl.lg > button + button { border-left: 1px solid var(--rule); }
  .segctl.lg > button[aria-pressed="true"] { background: var(--paper-2); box-shadow: inset 0 -2px 0 var(--plum); }
  .segctl.lg .range-wrap .btn { border: 1px solid var(--rule); border-radius: var(--radius); }
}
