/* Small additions on top of Bulma. */

/* Also defined by Bulma; repeated so filtering/tabs keep working if Bulma fails to load. */
.is-hidden { display: none !important; }

.week-tabs a { flex-direction: column; text-align: center; line-height: 1.35; padding-top: .6em; padding-bottom: .6em; }
.week-tabs .tag { margin-top: .3em; }

.product-table .group-row th,
.table .group-row th {
  background: hsl(0, 0%, 96%);
  color: hsl(0, 0%, 29%);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: .6em;
}
.product-table td { vertical-align: middle; }
.product-table .qty-input { width: 5.5em; text-align: right; }
.product-table tr.in-bag td:first-child { font-weight: 600; }
.product-table tr.in-bag { background: hsl(153, 53%, 96%); }

.bag-box { position: sticky; top: 1rem; }
.bag-list { list-style: none; margin: 0; max-height: 45vh; overflow-y: auto; }
.bag-list li { display: flex; justify-content: space-between; gap: 1em; padding: .3em 0; border-bottom: 1px solid hsl(0, 0%, 93%); font-size: .9rem; }
.bag-list li span:last-child { white-space: nowrap; font-weight: 600; }

.stat-box { height: 100%; }

.print-only { display: none; }

@media print {
  .no-print, .navbar, .notification .delete { display: none !important; }
  .print-only { display: block !important; }
  .section { padding: 0; }
  .box { box-shadow: none; border: 1px solid #ccc; }
  .location-order { break-after: page; }
  .tab-panel.is-hidden { display: none !important; }
  a[href]::after { content: none; }
}

.confirm-box { background: hsl(48, 100%, 96%); border-radius: 6px; padding: .6em .75em; font-size: .85rem; }
.confirm-box .checkbox { line-height: 1.4; }
.confirm-box input { margin-right: .4em; }

/* ---------------------------------------------------------------- charts (statistics)
   Validated categorical palette (fixed order: food, cleaning, electronics) with
   separate steps for dark mode. Text never uses series colours. */
.viz {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --viz-grid: hsl(0, 0%, 90%);
  --viz-axis: hsl(0, 0%, 40%);
  --viz-surface: var(--bulma-scheme-main, #fff);
}
@media (prefers-color-scheme: dark) {
  .viz {
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --viz-grid: hsl(0, 0%, 25%);
    --viz-axis: hsl(0, 0%, 70%);
  }
}
.viz-legend { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .85rem; }
.viz-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.viz-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.hbar-chart { display: grid; gap: 6px; }
.hbar-row { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; align-items: center; gap: .75rem;
            padding: 2px 4px; border-radius: 4px; outline: none; }
.hbar-row:hover, .hbar-row:focus-visible { background: var(--bulma-scheme-main-bis, hsl(0, 0%, 97%)); }
.hbar-label { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.hbar-bar { display: block; height: 14px; min-width: 2px; border-radius: 0 4px 4px 0; flex: none; }
.hbar-value { font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--viz-axis); }

@media (max-width: 600px) {
  .hbar-row { grid-template-columns: 1fr; gap: .1rem; }
}
.column-chart svg { width: 100%; height: auto; display: block; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-baseline { stroke: var(--viz-axis); stroke-width: 1; }
.viz-axis { fill: var(--viz-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-hit { fill: transparent; cursor: default; outline: none; }
.viz-hit:hover, .viz-hit:focus-visible { fill: hsla(0, 0%, 50%, .08); }

.viz-tooltip { position: fixed; z-index: 50; pointer-events: none; white-space: pre-line; font-size: .8rem;
               line-height: 1.45; padding: .45rem .6rem; border-radius: 6px; max-width: 18rem;
               background: var(--bulma-scheme-invert, #222); color: var(--bulma-scheme-main, #fff);
               box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }

.window-banner p + p { margin-top: .25rem; }
.ntfy-events { padding-left: .25rem; }

@media print {
  .viz-tooltip { display: none !important; }
}

/* ---------------------------------------------------------------- delivered orders */
.delivery-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.location-order.is-delivered { opacity: .55; background: var(--bulma-scheme-main-bis, hsl(0, 0%, 97%)); }
.location-order.is-delivered:hover { opacity: .85; }
.location-order.is-delivered table { text-decoration: line-through; text-decoration-color: hsla(0, 0%, 50%, .5); }
tr.is-delivered-row td { opacity: .5; }
tr.is-delivered-row:hover td { opacity: .85; }
.delivery-bar .level-right { gap: .5rem; flex-wrap: wrap; }
@media print {
  .location-order.is-delivered { opacity: 1; }
}

/* ---------------------------------------------------------------- inventory */
.stock-input { width: 6.5em; text-align: right; display: inline-block; }
.stock-input.is-changed { border-color: var(--bulma-warning, #ffb70f); background: hsl(48, 100%, 96%); }
