/* stockroom -- Home (#/home) and the settings sheet (.sh-settings).
   Everything is scoped under .view-home or the sheet's own body class. */

.view-home .home-date { margin: -4px 2px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }

/* quick actions: hero Receive + three quiet-hued tiles */
.view-home .home-quick button { min-height: 84px; }
.view-home .home-quick .q-order .glyph { background: var(--h6-bg); color: var(--h6-fg); }
.view-home .home-quick .q-buy   .glyph { background: var(--h4-bg); color: var(--h4-fg); }
.view-home .home-quick .q-count .glyph { background: var(--h5-bg); color: var(--h5-fg); }

/* needs attention: compact tinted cards, only when something's there */
.view-home .attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.view-home .attn-card { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 68px;
                        padding: 10px 12px 11px; border-radius: var(--r); background: var(--tt); color: var(--t);
                        transition: transform .12s var(--ease); }
.view-home .attn-card:active { transform: scale(.97); }
.view-home .attn-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.view-home .attn-top .i { width: 18px; height: 18px; opacity: .85; }
.view-home .attn-n { font: 700 26px/1 var(--f-num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.view-home .attn-l { font-size: 12.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* column spacing: on the phone the second column simply continues */
.view-home .home-col + .home-col > .section:first-child { margin-top: 24px; }
@media (min-width: 900px) {
  .view-home .home-cols { margin-top: 4px; }
  .view-home .home-col + .home-col > .section:first-child { margin-top: 6px; }
  .view-home .home-col > .section:first-child { margin-top: 6px; }
  .view-home .home-quick button { flex-direction: row; justify-content: center; gap: 12px; min-height: 66px; font-size: 15px; }
  .view-home .attn { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .view-home .attn-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; }
  .view-home .attn-top { display: contents; }
  .view-home .attn-n { order: 1; }
  .view-home .attn-l { order: 2; font-size: 14.5px; }
  .view-home .attn-top .i { order: 3; }
}
.view-home > .cols { margin-top: 0; }

.view-home .home-meta { font: 600 13.5px/1 var(--f-num); color: var(--muted); font-variant-numeric: tabular-nums; }

/* this month */
.view-home .month-card { display: block; color: inherit; transition: transform .12s var(--ease); }
.view-home .month-card:active { transform: scale(.99); }
.view-home .mc-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.view-home .mc-hero { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-top: 8px; }
.view-home .mc-hero .big-num { font-size: 42px; }
.view-home .mc-vs { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.view-home .mc-vs .delta { font-size: 13.5px; }
.view-home .mc-spark { margin-top: 14px; }
.view-home .mc-spark .bar-legend { margin-top: 4px; font-size: 11.5px; color: var(--faint); }
.view-home .mc-foot { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center;
                      margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.view-home .mc-stat { min-width: 0; }
.view-home .mc-stat .l { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.view-home .mc-stat .v { font: 700 23px/1.1 var(--f-num); letter-spacing: -.02em; margin-top: 5px;
                         font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-home .mc-stat .d { margin-top: 5px; min-height: 13px; }

/* rows: tags under the sub line, arriving due states */
.view-home .home-tags { display: flex; gap: 6px; margin-top: 6px; }
.view-home .row .trail .home-late { color: var(--bad); font-weight: 650; }
.view-home .row .trail .home-delay { color: var(--warn); font-weight: 650; }
.view-home .row .gauge { max-width: 260px; }

/* one-line empty states inside a card */
.view-home .home-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px;
                         padding: 10px 10px 10px 16px; min-height: 56px; color: var(--muted); font-size: 14.5px; }
.view-home .home-empty.ok { justify-content: flex-start; color: var(--ok); font-weight: 600; }
.view-home .home-empty.ok .i { width: 20px; height: 20px; }

/* running low: one card per supplier, Reorder in its head */
.view-home .low-groups { display: grid; gap: 12px; }
.view-home .low-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; min-height: 56px;
                       background: var(--paper); border-bottom: 1px solid var(--line); }
.view-home .low-head .av.sm .i { width: 15px; height: 15px; }
.view-home .low-head .main { flex: 1; min-width: 0; }
.view-home .low-head .t { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-home .low-head .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.view-home .low-head .btn { flex: none; }

/* stock value */
.view-home .stock-card { display: block; color: inherit; transition: transform .12s var(--ease); }
.view-home .stock-card:active { transform: scale(.99); }
.view-home .sv-top { display: flex; align-items: flex-start; gap: 12px; }
.view-home .sv-top .l { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.view-home .sv-top .v { font: 700 30px/1.05 var(--f-num); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.view-home .sv-flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.view-home .stack { display: flex; gap: 3px; height: 10px; margin-top: 14px; border-radius: 99px; overflow: hidden; background: var(--paper-2); }
.view-home .stack > span { display: block; width: 0; min-width: 0; background: var(--hf); transition: width .6s var(--ease); }
.view-home .sv-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.view-home .sv-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.view-home .sv-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--hf); }
.view-home .sv-legend b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------- settings sheet -- */
.sh-settings .set-head { margin: 22px 4px 8px; font: 650 12.5px/1.2 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sh-settings .set-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sh-settings .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; min-height: 58px; }
.sh-settings .set-row + .set-row { border-top: 1px solid var(--line); }
.sh-settings .set-l { font-size: 15.5px; font-weight: 600; }
.sh-settings .set-row .input-group { width: 132px; flex: none; height: 44px; }
.sh-settings .set-row .input { text-align: right; padding-right: 4px; }
.sh-settings .set-row .affix { padding-left: 4px; font-size: 14px; }
.sh-settings .set-out { margin-top: 22px; }
