/* 09-dash-home.css — home screen: shortcut tiles (js/src/73-dash-home.js) and the "due soon" cheques card (js/src/66a, chqUiDashCard). */

:root{ --dh-late:#ef4444; --dh-this:#f59e0b; --dh-next:#12c887; --dh-later:#6b8f82; --dh-mono:ui-monospace,'SFMono-Regular',Consolas,'Liberation Mono',monospace; }
html.light{ --dh-next:#0a8a5e; --dh-later:#5b7a6f; }

/* ── shortcut tiles ── */
.dh-sc{ margin:0 0 18px; }
.dh-sc-title{ font-size:12px; font-weight:800; letter-spacing:.02em; color:var(--cream2); opacity:.85; margin:0 2px 10px; display:flex; align-items:center; gap:8px; }
.dh-sc-title::after{ content:''; flex:1; height:1px; background:linear-gradient(90deg,var(--border),transparent); }
html[dir="rtl"] .dh-sc-title::after{ background:linear-gradient(270deg,var(--border),transparent); }
.dh-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); gap:10px; }
.dh-tile{ --tone:var(--gold2); position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:10px; min-height:92px; padding:14px 14px 12px;
  border-radius:14px; border:1px solid var(--border); background:var(--bg2); color:var(--cream); font-family:inherit; font-size:13px; font-weight:800; text-align:start; cursor:pointer;
  overflow:hidden; transition:transform .18s cubic-bezier(.2,.9,.3,1), border-color .18s, box-shadow .18s, background .18s; }
.dh-tile::before{ content:''; position:absolute; inset:0; background:radial-gradient(120px 80px at 100% 0%, color-mix(in srgb,var(--tone) 22%, transparent), transparent 70%); opacity:.7; pointer-events:none; transition:opacity .18s; }
html[dir="rtl"] .dh-tile::before{ background:radial-gradient(120px 80px at 0% 0%, color-mix(in srgb,var(--tone) 22%, transparent), transparent 70%); }
.dh-tile:hover{ transform:translateY(-2px); border-color:color-mix(in srgb,var(--tone) 55%, var(--border)); box-shadow:0 10px 26px rgba(0,0,0,.28), 0 0 0 1px color-mix(in srgb,var(--tone) 20%, transparent); }
.dh-tile:hover::before{ opacity:1; }
.dh-tile:active{ transform:translateY(0) scale(.98); }
.dh-tile:focus-visible{ outline:2px solid var(--tone); outline-offset:2px; }
.dh-tile-ico{ position:relative; width:36px; height:36px; border-radius:10px; display:grid; place-items:center; color:var(--tone);
  background:color-mix(in srgb,var(--tone) 14%, transparent); border:1px solid color-mix(in srgb,var(--tone) 30%, transparent); }
.dh-tile-ico svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.dh-tile-lbl{ position:relative; line-height:1.3; }
.dh-tile .sh-badge{ position:absolute; top:10px; margin:0; right:10px; left:auto; font-size:9.5px; opacity:.8; }
html[dir="rtl"] .dh-tile .sh-badge{ left:10px; right:auto; }
.dh-tile.tone-g{ --tone:var(--gold2); } .dh-tile.tone-b{ --tone:#4f9cf0; } .dh-tile.tone-v{ --tone:#a78bfa; }
.dh-tile.tone-r{ --tone:#f0716b; } .dh-tile.tone-a{ --tone:#f5b544; }
html.light .dh-tile{ background:rgba(255,255,255,.55); }
html.light .dh-tile:hover{ box-shadow:0 10px 24px rgba(10,60,40,.12); }
@media (max-width:768px){ .dh-grid{ grid-template-columns:repeat(2,1fr); } .dh-tile{ min-height:80px; padding:12px; } }

/* ── "due soon" cheques card ── */
.card.dh-chq{ position:relative; overflow:hidden; padding:18px 18px 8px;
  background-image:linear-gradient(var(--bg3),var(--bg3)), repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb,var(--gold2) 5%, transparent) 23px 24px), repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb,var(--gold2) 5%, transparent) 23px 24px);
  background-blend-mode:normal; }
.card.dh-chq::after{ content:''; position:absolute; top:0; inset-inline:0; height:2px; background:linear-gradient(90deg,transparent,var(--gold2),transparent); opacity:.6; }
.dh-chq-head{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.dh-chq-ico{ width:38px; height:38px; flex-shrink:0; border-radius:11px; display:grid; place-items:center; color:var(--gold2);
  background:color-mix(in srgb,var(--gold2) 13%, transparent); border:1px solid color-mix(in srgb,var(--gold2) 30%, transparent); box-shadow:0 0 18px color-mix(in srgb,var(--gold2) 18%, transparent); }
.dh-chq-ico svg{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.dh-chq-title{ flex:1; font-size:15px; font-weight:800; display:flex; align-items:center; gap:8px; }
.dh-chq-count{ font-family:var(--dh-mono); font-size:11.5px; font-weight:700; padding:2px 8px; border-radius:999px; color:var(--gold2);
  background:color-mix(in srgb,var(--gold2) 12%, transparent); border:1px solid color-mix(in srgb,var(--gold2) 30%, transparent); }

.dh-chq-tiles{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.dh-chq-tile{ --c:var(--dh-later); position:relative; padding:10px 12px 11px; border-radius:11px; background:color-mix(in srgb,var(--c) 7%, var(--bg2)); border:1px solid color-mix(in srgb,var(--c) 26%, var(--border)); }
.dh-chq-tile.late{ --c:var(--dh-late); } .dh-chq-tile.this{ --c:var(--dh-this); } .dh-chq-tile.next{ --c:var(--dh-next); } .dh-chq-tile.later{ --c:var(--dh-later); }
.dh-chq-tile.zero{ opacity:.55; }
.dh-chq-tl{ display:flex; align-items:center; gap:6px; font-size:11px; color:var(--cream2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dh-chq-tl::before{ content:''; width:7px; height:7px; border-radius:50%; flex-shrink:0; background:var(--c); box-shadow:0 0 8px var(--c); }
.dh-chq-tn{ display:block; font-family:var(--dh-mono); font-size:24px; font-weight:800; line-height:1.15; margin:4px 0 7px; color:var(--cream); font-variant-numeric:tabular-nums; }
.dh-chq-tile.late:not(.zero) .dh-chq-tn{ color:var(--dh-late); }
.dh-chq-meter{ display:block; height:3px; border-radius:3px; background:color-mix(in srgb,var(--c) 15%, transparent); overflow:hidden; }
.dh-chq-meter i{ display:block; height:100%; border-radius:3px; background:var(--c); transition:width .5s cubic-bezier(.2,.9,.3,1); }

.dh-chq-strip{ display:flex; gap:3px; height:6px; margin:12px 0 6px; border-radius:6px; overflow:hidden; }
.dh-chq-strip i{ display:block; min-width:6px; border-radius:2px; }
.dh-chq-strip i.late{ background:var(--dh-late); } .dh-chq-strip i.this{ background:var(--dh-this); } .dh-chq-strip i.next{ background:var(--dh-next); } .dh-chq-strip i.later{ background:var(--dh-later); }

.dh-chq-list{ margin-top:6px; }
.dh-chq-row{ --c:var(--dh-later); display:grid; grid-template-columns:auto 1fr auto auto; align-items:center; gap:14px; padding:11px 12px; margin:0 -6px;
  border-radius:10px; border-bottom:1px solid color-mix(in srgb,var(--border) 70%, transparent); cursor:pointer; position:relative; transition:background .15s; }
.dh-chq-row:last-child{ border-bottom:none; }
.dh-chq-row::before{ content:''; position:absolute; inset-inline-start:0; top:10px; bottom:10px; width:3px; border-radius:3px; background:var(--c); box-shadow:0 0 10px var(--c); }
.dh-chq-row.late{ --c:var(--dh-late); } .dh-chq-row.this{ --c:var(--dh-this); } .dh-chq-row.next{ --c:var(--dh-next); }
.dh-chq-row:hover,.dh-chq-row:focus-visible{ background:color-mix(in srgb,var(--gold2) 7%, transparent); outline:none; }
.dh-chq-kind{ margin-inline-start:8px; font-size:11px; font-weight:800; padding:3px 9px; border-radius:7px; white-space:nowrap; color:var(--gold2);
  background:color-mix(in srgb,var(--gold2) 12%, transparent); border:1px solid color-mix(in srgb,var(--gold2) 28%, transparent); }
.dh-chq-kind.issued{ color:#6fb0f5; background:rgba(79,156,240,.12); border-color:rgba(79,156,240,.3); }
.dh-chq-id{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.dh-chq-id b{ font-family:var(--dh-mono); font-size:14px; letter-spacing:.03em; }
.dh-chq-id small{ font-size:11.5px; color:var(--cream2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dh-chq-due{ font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:999px; white-space:nowrap; color:var(--c); background:color-mix(in srgb,var(--c) 12%, transparent); }
.dh-chq-amt{ font-family:var(--dh-mono); font-size:15px; font-weight:800; white-space:nowrap; font-variant-numeric:tabular-nums; min-width:84px; text-align:end; }
.dh-chq-amt small{ font-size:11px; color:var(--cream2); font-weight:700; }

@media (max-width:768px){
  .dh-chq-tiles{ grid-template-columns:repeat(2,1fr); }
  .dh-chq-row{ grid-template-columns:1fr auto; gap:6px 10px; }
  .dh-chq-kind{ grid-row:1; justify-self:start; }
  .dh-chq-id{ grid-column:1; grid-row:2; }
  .dh-chq-due{ grid-column:2; grid-row:1; justify-self:end; }
  .dh-chq-amt{ grid-column:2; grid-row:2; }
}
@media (prefers-reduced-motion:reduce){ .dh-tile,.dh-tile::before,.dh-chq-meter i{ transition:none; } }
@media (prefers-reduced-motion:no-preference){
  #pg-dashboard .dh-sc{ animation:arvRise .6s cubic-bezier(.22,.9,.28,1) .2s backwards; }
  #pg-dashboard .dh-tile{ animation:arvRise .5s cubic-bezier(.22,.9,.28,1) backwards; }
  #pg-dashboard .dh-tile:nth-child(2){ animation-delay:.04s; } #pg-dashboard .dh-tile:nth-child(3){ animation-delay:.08s; }
  #pg-dashboard .dh-tile:nth-child(4){ animation-delay:.12s; } #pg-dashboard .dh-tile:nth-child(5){ animation-delay:.16s; }
  #pg-dashboard .dh-tile:nth-child(6){ animation-delay:.2s; }  #pg-dashboard .dh-tile:nth-child(n+7){ animation-delay:.24s; }
}

/* v1.19.196: supplier / customer log (js/src/74): one-line description, view button */
.pl-desc{ max-width:320px; }
.pl-desc > div{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pl-act{ white-space:nowrap; text-align:end; }
.pl-view{ font-size:11.5px; color:var(--gold2); border-color:color-mix(in srgb,var(--gold2) 45%, var(--border)); }
.pl-rate-note{ font-size:11.5px; color:var(--cream2); background:var(--bg2); border:1px dashed var(--border); border-radius:8px; padding:7px 10px; margin:-6px 0 12px; }

/* v1.19.196: mixture cards: same height, buttons never move */
#pg-mixtures .mix-card-top{ flex-wrap:nowrap; }
#pg-mixtures .mix-card-info{ flex:1; min-width:0; }
.mix-ings{ display:flex; flex-wrap:nowrap; gap:4px; margin-bottom:9px; overflow:hidden; height:24px; align-items:center; }
.mix-ings .badge{ flex-shrink:0; white-space:nowrap; max-width:170px; overflow:hidden; text-overflow:ellipsis; }
.mix-more{ border:1px solid var(--border); background:var(--bg2); color:var(--gold2); cursor:pointer; font-family:inherit; font-weight:800; }
.mix-stats{ display:grid; grid-template-columns:minmax(170px,auto) minmax(140px,auto) minmax(140px,auto); justify-content:start; gap:6px 18px; font-size:12.5px; }
#pg-mixtures .mix-card-actions{ flex-wrap:nowrap; }
@media (max-width:768px){
  #pg-mixtures .mix-card-top{ flex-wrap:wrap; }
  .mix-ings{ flex-wrap:wrap; height:auto; }
  .mix-stats{ grid-template-columns:1fr; }
  #pg-mixtures .mix-card-actions{ width:100%; flex-wrap:wrap; }
}

/* v1.19.196: waste window (js/src/75) and mixture repair bar (js/src/76) */
.ws-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ws-qty-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
tr.ws-off td{ opacity:.5; text-decoration:line-through; }
tr.ws-off td.pl-act{ text-decoration:none; }
.mr-bar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
@media (max-width:768px){ .ws-grid{ grid-template-columns:1fr; } }
