.cashbox{display:grid;gap:18px}
.cashbox-controls{display:flex;align-items:end;gap:14px;flex-wrap:wrap}
.cashbox-presets{display:flex;gap:4px;padding:3px;border:1px solid var(--line);border-radius:7px;flex-wrap:wrap}
.cashbox-presets button{background:transparent;border:0;border-radius:5px;color:var(--muted);font-size:12px;min-height:32px;padding:5px 12px}
.cashbox-presets button[aria-pressed=true]{background:var(--surface-raised);color:var(--ink)}
.cashbox-presets button:hover:not([aria-pressed=true]){color:var(--ink)}
.cashbox-range{display:flex;align-items:end;gap:8px;margin-left:auto;flex-wrap:wrap}
.cashbox-range label{font-size:11px;font-weight:400;color:var(--muted);gap:5px}
.cashbox-range input{min-height:38px;font-size:12px;width:150px}
.cashbox-status:empty{display:none}
.cashbox-status{font-size:12px;color:var(--muted);margin:0}

/* Money first, then what it is made of. Each card carries its own comparison so
   the figure is never read without the question "better than before?". */
.cashbox-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.cashbox-metric{display:grid;gap:5px;align-content:start;padding:16px;border:1px solid var(--line);border-radius:7px;background:var(--paper)}
.cashbox-metric-label{font-size:11px;color:var(--muted);letter-spacing:.3px}
.cashbox-metric-value{font-size:24px;font-weight:500;letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.cashbox-metric-hint{font-size:11px;color:var(--subtle);line-height:1.5}
.cashbox-metric.pending .cashbox-metric-value{color:var(--pending-text)}
.cashbox-metric.cancelled .cashbox-metric-value{color:var(--muted)}
.cashbox-delta{display:inline-flex;align-items:baseline;gap:4px;font-size:12px;color:var(--muted)}
.cashbox-delta-arrow{font-style:normal;font-size:12px}
.cashbox-delta.up{color:var(--confirmed-text)}
.cashbox-delta.down{color:var(--danger)}
.cashbox-delta small{color:var(--subtle);font-size:10px}

/* One height for the plotting band: the axis, the gridlines and the bars all
   measure from it, so a bar cannot end up drawn against a different zero than
   the line it is read against. */
.cashbox-chart{--bar-band:140px;padding:18px;border:1px solid var(--line);border-radius:7px;background:var(--paper)}
.cashbox-chart h3{font-size:14px;margin:0 0 14px}
.cashbox-plot{position:relative;overflow-x:auto;padding-bottom:4px}
.cashbox-canvas{position:relative;width:max-content;min-width:100%}
/* No min-height and no bottom alignment: a taller box than the columns need
   would have floated every bar below the zero line by the height of its label. */
.cashbox-columns{display:flex;align-items:stretch;gap:6px;width:100%}
/* The bar row is pinned to the band, so the label underneath can be any height
   without moving the baseline. */
.cashbox-column{display:grid;grid-template-rows:var(--bar-band) auto;gap:6px;justify-items:center;flex:1 1 22px;min-width:22px}
/* The column is the period's whole booked value; the solid part at its foot is
   the share already worked, so committed and delivered are one shape, not two. */
.cashbox-bar{width:100%;max-width:46px;display:flex;align-items:flex-end}
.cashbox-bar-fill{width:100%;height:var(--height,0%);min-height:2px;border-radius:3px 3px 0 0;background:var(--load-2);display:flex;align-items:flex-end;overflow:hidden}
.cashbox-bar-earned{display:block;width:100%;height:var(--share,0%);background:var(--load-4)}
.cashbox-column-label{font-size:10px;color:var(--subtle);white-space:nowrap}
.cashbox-legend{display:flex;align-items:center;gap:6px;margin-top:12px;font-size:10px;color:var(--subtle);flex-wrap:wrap}
.cashbox-legend i{width:11px;height:11px;border-radius:2px;background:var(--load-2)}
.cashbox-legend .cashbox-key-earned{background:var(--load-4)}
.cashbox-legend span{margin-right:10px}

.cashbox-splits{display:grid;grid-template-columns:minmax(260px,1fr) minmax(320px,1.3fr);gap:18px;align-items:start}
.cashbox-split{padding:18px;border:1px solid var(--line);border-radius:7px;background:var(--paper);min-width:0}
.cashbox-split h3{font-size:14px;margin:0 0 14px}
.cashbox-room{display:grid;gap:6px;padding:10px 0;border-bottom:1px solid var(--line)}
.cashbox-room:last-child{border-bottom:0;padding-bottom:0}
.cashbox-room-head{display:flex;justify-content:space-between;gap:12px;font-size:13px}
.cashbox-room-head strong{font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}
.cashbox-room small{font-size:11px;color:var(--subtle)}
.cashbox-meter{height:6px;border-radius:3px;background:var(--surface-raised);overflow:hidden}
.cashbox-meter i{display:block;height:100%;width:var(--share,0%);background:var(--load-3);border-radius:3px}
.cashbox-table{width:100%;border-collapse:collapse;font-size:13px}
.cashbox-table th{text-align:left;color:var(--muted);font-size:11px;font-weight:400;padding:0 10px 8px 0;border-bottom:1px solid var(--line)}
.cashbox-table td{padding:10px 10px 10px 0;border-bottom:1px solid var(--line);vertical-align:top}
.cashbox-table tr:last-child td{border-bottom:0}
.cashbox-table th:last-child,.cashbox-table td:last-child{text-align:right;padding-right:0}
.cashbox-value{font-variant-numeric:tabular-nums;white-space:nowrap}
.cashbox-table td small{display:block;color:var(--subtle);font-size:10px;margin-top:2px}
.cashbox-note{font-size:11px;line-height:1.6;color:var(--subtle);margin:0}

@media(max-width:1000px){.cashbox-splits{grid-template-columns:1fr}}
@media(max-width:760px){
  .cashbox-range{margin-left:0;width:100%}
  .cashbox-range input{width:100%;font-size:16px;min-height:44px}
  .cashbox-range label{flex:1}
  .cashbox-presets{width:100%}
  .cashbox-presets button{flex:1;min-height:40px;padding:5px 6px;line-height:1.25}
  .cashbox-metric-value{font-size:20px}
  .cashbox-metric{padding:14px}
  .cashbox-chart,.cashbox-split{padding:14px}
  .cashbox-chart{--bar-band:110px}
  .cashbox-columns{gap:4px}
  /* Give each bar a finger's width and let the row scroll, rather than squeezing
     a month into the screen as unreadable hairlines. */
  .cashbox-column{flex:0 0 26px;min-width:26px}
  .cashbox-column-label{font-size:9px}
  /* Day labels cannot all be read at this width, so only every fifth is kept —
     hidden rather than removed, so the columns stay on their gridlines. */
  .cashbox-plot[data-dense=true] .cashbox-column-label{visibility:hidden}
  .cashbox-plot[data-dense=true] .cashbox-column:nth-child(5n+1) .cashbox-column-label{visibility:visible}
  .cashbox-plot[data-dense=true] .cashbox-column:last-child .cashbox-column-label{visibility:visible}
}
.cashbox-room-filter{font-size:11px;font-weight:400;color:var(--muted);gap:5px}
.cashbox-room-filter select{min-height:38px;font-size:12px;width:190px}
@media(max-width:760px){.cashbox-room-filter{width:100%}.cashbox-room-filter select{width:100%;font-size:16px;min-height:44px}}

/* The axis and the plot share one row so a gridline meets its label exactly. */
.cashbox-graph{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px}
.cashbox-axis{position:relative;height:var(--bar-band);width:auto;min-width:64px}
.cashbox-axis span{position:absolute;right:0;bottom:var(--offset,0%);transform:translateY(50%);font-size:10px;color:var(--subtle);white-space:nowrap;font-variant-numeric:tabular-nums}
.cashbox-grid{position:absolute;inset:0 0 auto 0;height:var(--bar-band);pointer-events:none}
.cashbox-grid i{position:absolute;left:0;right:0;bottom:var(--offset,0%);height:1px;background:var(--line)}
.cashbox-grid i{opacity:.55}
/* The baseline is the one line a reader measures from, so it stays solid. */
.cashbox-grid i:last-child{opacity:1}
@media(max-width:760px){
  .cashbox-axis{min-width:50px}
  .cashbox-axis span{font-size:9px}
  .cashbox-graph{gap:6px}
}
.cashbox-room small+small{color:var(--muted)}

/* Channels. The studio keeps its greens; WayForPay takes the panel's blue, so a
   stacked column and a legend read by colour without a key being learned. */
.cashbox{--channel-wayforpay:var(--accent)}
.cashbox-channels{display:flex;gap:4px;padding:3px;border:1px solid var(--line);border-radius:7px;flex-wrap:wrap}
.cashbox-channels[hidden]{display:none}
.cashbox-channels button{background:transparent;border:0;border-radius:5px;color:var(--muted);font-size:12px;min-height:32px;padding:5px 12px}
.cashbox-channels button[aria-pressed=true]{background:var(--ink);color:var(--paper);font-weight:600}
.cashbox-channels button:hover:not([aria-pressed=true]){color:var(--ink)}
.cashbox-room-filter[hidden]{display:none}

.cashbox-sync{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;font-size:11px;color:var(--subtle);margin-top:-6px}
.cashbox-sync:empty{display:none}
.cashbox-sync .text-button{font-size:11px;padding:0;min-height:0;color:var(--accent);background:none;border:0;text-decoration:underline;text-underline-offset:3px}
.cashbox-sync .text-button:disabled{color:var(--subtle);text-decoration:none}
.cashbox-sync-error{color:var(--danger)}

/* A stacked column draws every segment itself, top to bottom, instead of
   leaving the scheduled share to the column's own background. */
.cashbox-bar-fill.stacked{background:none;flex-direction:column;justify-content:flex-end}
.cashbox-bar-fill.stacked i{flex:none}
.cashbox-bar-scheduled{display:block;width:100%;height:var(--share,0%);background:var(--load-2)}
.cashbox-bar-wayforpay{display:block;width:100%;height:var(--share,0%);background:var(--channel-wayforpay)}
.cashbox-legend .cashbox-key-wayforpay{background:var(--channel-wayforpay)}

.cashbox-split-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:14px}
.cashbox-split-head h3{margin:0}
.cashbox-split-head .text-button{font-size:12px;color:var(--accent);background:none;border:0;padding:0;min-height:0;text-decoration:underline;text-underline-offset:3px}
.cashbox-kind .cashbox-meter i,.cashbox-channel.wayforpay .cashbox-meter i{background:var(--channel-wayforpay)}
.cashbox-kind.ungrouped small:last-child{color:var(--subtle);font-style:italic}
.cashbox-payment-status{white-space:nowrap;color:var(--muted)}
.cashbox-payment-status.approved{color:var(--confirmed-text)}
.cashbox-payment-status.refund,.cashbox-payment-status.declined{color:var(--danger)}
.cashbox-payment-status.inprocessing{color:var(--pending-text)}

/* The product list is a working form: long WayForPay names stay readable in
   full above the two short fields that rename and group them. */
.staff-page dialog.cashbox-products{max-width:720px;width:calc(100% - 30px)}
.cashbox-product-list{display:grid;gap:0;margin-top:10px}
.cashbox-product{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:8px 12px;align-items:end;padding:14px 0;border-top:1px solid var(--line)}
.cashbox-product-name{grid-column:1/-1;font-size:13px!important;line-height:1.45!important;margin:0!important;color:var(--ink)}
.cashbox-product-count{grid-column:1/-1;font-size:11px;color:var(--subtle);margin-top:-6px}
.cashbox-product label{font-size:11px;font-weight:400;color:var(--muted);gap:5px}
.cashbox-product input:not([type=checkbox]){min-height:38px;font-size:13px}
.cashbox-product-counted{grid-column:1/-1;display:flex!important;align-items:center;gap:8px!important;min-height:32px}
@media(max-width:760px){
  .cashbox-channels{width:100%}
  .cashbox-channels button{flex:1;min-height:40px}
  .cashbox-product{grid-template-columns:1fr}
  .cashbox-product input:not([type=checkbox]){font-size:16px;min-height:44px}
}
