/* Today — module styles. Layout and the few pieces only this screen has. Every colour comes from Foundations;
 * the gate fails the build on a raw colour here. */

.today { display: grid; gap: 14px; padding: 16px 14px 0; }
.today.wide { max-width: 1280px; margin: 0 auto; padding: 24px 28px 40px; gap: 16px; }
.today-head { grid-template-columns: 1fr auto; align-items: end; }
.today-head > div { display: grid; gap: 4px; }
.today-h2 { margin: 0; font: var(--t-title); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.today-h2 .du-ref { font-weight: 500; }
.today-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.today-list { display: grid; gap: 12px; }
.today-aside { display: grid; gap: 12px; position: sticky; top: 76px; }
.today-body { padding: 0 var(--pad) 12px; display: grid; gap: 10px; }
.today-entry { border-top: 1px solid var(--line); padding-top: 12px; }
.today-more { justify-content: center; }
.today-live { border-color: var(--accent-line); }
.today-live .du-head { background: var(--accent-bg); border-radius: var(--r) var(--r) 0 0; }
.today-live .du-head h2 { display: flex; align-items: center; gap: 8px; }
.today-live-body { padding: 14px 16px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.today-live-body > .du-btn { margin-left: auto; }

/* why a store is where it is — the ranking explains itself */
.du-why { display: flex; align-items: center; gap: 6px; font: var(--t-small); color: var(--muted); }
.du-why .du-icon { color: var(--accent-text); }
.du-issue .faint { color: var(--faint); }

/* a recorded verdict on an AI claim */
.du-verdict { display: flex; align-items: center; gap: 6px; font: 500 13px var(--font); color: var(--good); }
.du-verdict.override { color: var(--accent-text); }
.du-verdict .du-btn { margin-left: auto; }

.du-banner { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-s); font: var(--t-small); }
.du-banner.info { background: var(--accent-bg); color: var(--accent-text); border: 1px solid var(--accent-line); box-sizing: border-box; }
.du-banner.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); box-sizing: border-box; }

.du-evi img { display: block; width: 112px; height: 72px; object-fit: cover; }
.du-btn.on { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-bg); }

/* the map, drawn in Foundations colours */
.today-map svg .bg { fill: var(--sunk); }
.today-map svg .g { stroke: var(--line); stroke-width: 1; }
.today-map svg .route { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 6 5; stroke-linejoin: round; }
.today-map svg .me-halo { fill: var(--accent); opacity: .12; }
.today-map svg .me { fill: var(--accent); stroke: var(--surface); stroke-width: 2.2; }
.today-map svg .pin path { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.today-map svg .pin text { fill: var(--accent); font: 600 10.5px var(--font); text-anchor: middle; }
.today-map svg .pin.top path { fill: var(--accent); }
.today-map svg .pin.top text { fill: var(--accent-on); }

@media (max-width: 900px) { .today-cols { grid-template-columns: minmax(0, 1fr); } .today-aside { position: static; } }

/* the store name opens its briefing */
.today-open { font: inherit; color: var(--text); text-align: left; }
.today-open:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the priority queue ---------- */
.today .du-zone { margin-top: 8px; }
.tq-queue .du-comp-h { gap: 12px; }
.tq-rank { font-weight: 500; }
.tq-row { grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1.3fr) 112px 80px 54px 16px; gap: 10px; }
.tq-item { display: block; }
.tq-row { cursor: pointer; padding-top: 9px; padding-bottom: 9px; }
.tq-row .who { display: grid; gap: 1px; min-width: 0; }
.tq-row .who b { font: 600 14px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-row .who small { font: var(--t-small); color: var(--muted); }
.tq-why { font: var(--t-small); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tq-issue { display: grid; gap: 1px; min-width: 0; }
.tq-issue b { font: 500 13px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-issue small { font: 12px/1.3 var(--mono); color: var(--faint); }
.tq-none { font: var(--t-small); color: var(--faint); }
.tq-cad { display: grid; gap: 4px; }
.tq-bar { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.tq-bar i { display: block; height: 100%; background: var(--accent); }
.tq-bar i.warn { background: var(--warn); }
.tq-bar i.bad { background: var(--bad); }
.tq-cad small { font: 12px/1.2 var(--font); color: var(--muted); }
.tq-cad small.bad { color: var(--bad); font-weight: 500; }
.tq-ai { display: inline-flex; align-items: center; gap: 4px; font: 500 12px var(--font); color: var(--accent-text); }
.tq-ai.done { color: var(--good); }
.tq-ai .du-icon { width: 13px; height: 13px; }
.tq-row .eta { font: 500 12.5px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.tq-chev { color: var(--faint); display: grid; place-items: center; }
.du-qhead.tq-row { cursor: default; padding-top: 0; padding-bottom: 0; }
.tq-detail { padding: 14px 16px 0; }
.tq-dcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.tq-dmain { display: grid; gap: 12px; }
.tq-dside .du-side { margin: 0; }
.tq-entry { display: grid; gap: 4px; }
.tq-entry p { margin: 0; font: var(--t-body); }
.tq-detail .du-foot { margin: 14px -16px 0; padding: 10px 16px; border-top: 1px solid var(--line); }
.tq-more { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; font: var(--t-small); color: var(--faint); }
.tq-muted { margin: 0; font: var(--t-small); color: var(--muted); }

/* AI review */
.tq-rv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--machine-line); }
.tq-rv:last-child { border-bottom: 0; }
.tq-rvt { display: grid; gap: 2px; min-width: 0; }
.tq-rvt b { font: 500 13.5px var(--font); }
.tq-rvt small { font: 12px/1.3 var(--font); color: var(--muted); }
.tq-rva { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.tq-rva .du-btn.ok { color: var(--good); border-color: var(--good-line); }
.tq-review .du-comp-b.flush { background: var(--surface); }
.today-aside .du-comp + .du-comp { margin-top: 0; }

@media (max-width: 1180px) { .tq-row { grid-template-columns: 26px minmax(0, 1.3fr) minmax(0, 1.4fr) 112px 80px 54px 16px; } .tq-row .tq-issue { display: none; } .du-qhead.tq-row span:nth-child(4) { display: none; } }
@media (max-width: 760px) {
  .tq-row { grid-template-columns: 26px minmax(0, 1fr) auto 18px; row-gap: 4px; }
  .tq-row .tq-why { grid-column: 2 / 4; grid-row: 2; -webkit-line-clamp: 1; }
  .tq-row .tq-issue, .tq-row .tq-ai { display: none; }
  .tq-row .tq-cad { display: none; }
  .tq-dcols { grid-template-columns: minmax(0, 1fr); }
  .tq-queue .du-comp-h .du-comp-meta { margin-left: 0; width: 100%; }
  .tq-rank { display: none; }
}
.tq-dside .du-ai .acts { flex-wrap: wrap; }
.tq-dside .du-ai .acts .src { margin-left: 0; width: 100%; }
.tq-detail { min-width: 0; overflow: hidden; }
.tq-dmain, .tq-dside { min-width: 0; }
.tq-detail .du-foot { flex-wrap: wrap; }

/* ---------- the field manager's day ---------- */
.tf-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.tf-strip > div { display: flex; align-items: baseline; gap: 8px; padding: 14px 18px; }
.tf-strip > div + div { border-left: 1px solid var(--line); }
.tf-strip b { font: 600 22px var(--font); font-variant-numeric: tabular-nums; }
.tf-strip span { font: var(--t-small); color: var(--muted); }
.tf-row { grid-template-columns: 26px minmax(0, 1.1fr) minmax(0, 2fr) 100px 92px 64px 16px; gap: 10px; cursor: pointer; padding-top: 10px; padding-bottom: 10px; }
.du-qhead.tf-row { cursor: default; padding-top: 0; padding-bottom: 0; }
.tf-row .who { display: grid; gap: 1px; min-width: 0; }
.tf-row .who b { font: 600 14px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-row .who small { font: var(--t-small); color: var(--muted); }
.tf-work { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.tf-task { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 8px; border-radius: var(--r-s); background: var(--accent-bg); border: 1px solid var(--accent-line); max-width: 100%; }
.tf-task b { font: 600 12.5px var(--font); color: var(--accent-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-task small { font: 12px var(--font); color: var(--muted); white-space: nowrap; }
.tf-task.over { background: var(--bad-bg); border-color: var(--bad-line); }
.tf-task.over small { color: var(--bad); }
.tf-rec { font: var(--t-small); color: var(--muted); }
.tf-iss { font: var(--t-small); color: var(--muted); }
.tf-iss b { color: var(--text); font-weight: 600; }
.tf-due { font: 500 12.5px var(--font); color: var(--muted); }
.tf-due.bad { color: var(--bad); }
.tf-due.warn { color: var(--warn); }
.tf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tf-list li { display: flex; justify-content: space-between; gap: 12px; font: var(--t-small); padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tf-list li:last-child { border-bottom: 0; }
.tf-list li b { font-weight: 500; color: var(--text); }
.tf-list li span { color: var(--muted); white-space: nowrap; }
.tf-list li span.over { color: var(--bad); }
.tf-p { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.tf-p:last-child { border-bottom: 0; }
.tf-ph { display: flex; justify-content: space-between; gap: 10px; }
.tf-ph b { font: 600 14px var(--font); }
.tf-ph span { font: var(--t-small); color: var(--muted); white-space: nowrap; }
.tf-ph span.over { color: var(--bad); }
.tf-pbar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.tf-pbar i { display: block; height: 100%; background: var(--accent); }
.tf-p small { font: var(--t-small); color: var(--muted); }
@media (max-width: 1180px) { .tf-row { grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 2fr) 96px 64px 16px; } .tf-row .tf-due, .du-qhead.tf-row span:nth-child(5) { display: none; } }
@media (max-width: 760px) {
  .tf-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-strip > div:nth-child(3) { border-left: 0; }
  .tf-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tf-row { grid-template-columns: 26px minmax(0, 1fr) auto 16px; row-gap: 6px; }
  .tf-row .tf-work { grid-column: 2 / 4; grid-row: 2; }
  .tf-row .tf-iss, .tf-row .tf-due { display: none; }
}
.tf-row .eta { white-space: nowrap; }
.tq-next .du-comp-b { min-width: 0; }
.tq-next .du-btn.block { box-sizing: border-box; width: 100%; }
.tq-next .tf-list li { display: grid; gap: 2px; }
.tq-next .tf-list li span { white-space: normal; }

/* ---------- phone: the field manager's day ---------- */
.tm-head h1 { font: 600 24px/1.2 var(--font); margin: 0; }
.tm-head p { margin: 4px 0 0; font: var(--t-small); color: var(--muted); }
.tm-next { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 6px; }
.tm-next > small { font: var(--t-label); text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.tm-name { display: inline-flex; align-items: center; gap: 4px; font: 600 20px var(--font); color: var(--text); text-align: left; justify-self: start; }
.tm-next > p { margin: 0; font: var(--t-small); color: var(--muted); }
.tm-next ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; }
.tm-next li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font: var(--t-small); }
.tm-next li b { font-weight: 500; }
.tm-next li span { color: var(--muted); white-space: nowrap; }
.tm-next li span.over { color: var(--bad); }
.tm-iss { color: var(--bad) !important; font-weight: 500 !important; }
.tm-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tm-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); width: 100%; box-sizing: border-box; }
.tm-row:last-child { border-bottom: 0; }
.tm-row:active { background: var(--hover); }
.tm-n { font: 600 12px var(--mono); color: var(--faint); padding-top: 2px; }
.tm-b { display: grid; gap: 3px; min-width: 0; }
.tm-b b { font: 600 15px var(--font); }
.tm-b small { font: var(--t-small); color: var(--muted); }
.tm-b small em { font-style: normal; font-weight: 500; }
.tm-b small em.bad { color: var(--bad); }
.tm-b small em.warn { color: var(--warn); }
.tm-task { justify-self: start; font: 600 12px var(--font); color: var(--accent-text); background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: var(--r-s); padding: 2px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-i { display: grid; justify-items: end; }
.tm-i b { font: 600 16px var(--font); }
.tm-i small { font: 11px var(--font); color: var(--muted); }
.tm-more { justify-self: start; padding-left: 0; }
