/* Admin "Today" page. Colour only marks problems: red = late or urgent, amber = due soon, plain = fine. */

.sp-today { display: flex; flex-direction: column; gap: 20px; }
.sp-today .card { margin: 0; padding: 0; overflow: hidden; }
.td-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.td-card-head h3 { margin: 0; font-size: 16px; }
.td-card-head .sp-badge { margin-left: 0; }
.link-btn { background: transparent; color: var(--blue-dark); padding: 6px 0; min-height: 0; font-size: 13px; font-weight: 700; }
.link-btn:hover { text-decoration: underline; }

/* Outlet strip (also the outlet switch) */
.td-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.td-oc {
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-weight: 500; text-align: left;
}
.td-oc strong { font-weight: 800; }
.td-oc:hover { border-color: var(--navy); }
.td-oc--all { color: var(--navy); }
.td-oc--warn { background: #fff1c7; border-color: #f3dc95; color: #6b4500; }
.td-oc--bad { background: #fbe0d6; border-color: #f0bfae; color: #8a2a17; }
.td-oc[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.td-oc--all[aria-pressed="true"] { background: var(--navy); color: var(--cream); }

/* Needs attention (wide) + Coming up (quiet) */
.td-top { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.td-needs { flex: 3 1 420px; min-width: 0; }
.td-soon { flex: 2 1 300px; min-width: 0; box-sizing: border-box; padding: 14px 18px; border: 1px solid var(--border-soft); border-radius: 18px; background: #fbf9f1; }
.td-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 18px; background: var(--navy); color: var(--cream); font-size: 13px; }
.td-toast button { background: transparent; color: var(--yellow); min-height: 34px; padding: 4px 6px; font-weight: 800; }
.td-needs-list { list-style: none; margin: 0; padding: 0; }
.td-need { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border-soft); }
.td-need:last-child { border-bottom: 0; }
.td-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.td-need--urgent .td-dot { background: #c2412d; }
.td-need-text {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; min-height: 0;
  background: transparent; color: var(--navy); font-weight: 400; text-align: left; border-radius: 6px;
}
.td-need-text strong { font-weight: 750; }
.td-need-text .muted { font-size: 13px; }
.td-need-text:hover strong { text-decoration: underline; }
.td-act { flex: none; min-height: 38px; padding: 6px 14px; font-size: 14px; }
.td-act:disabled { opacity: .7; cursor: default; }
.td-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.td-chip--bad { background: #fbe0d6; color: #8a2a17; }
.td-chip--warn { background: #fff1c7; color: #6b4500; }
.td-clear { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 18px; text-align: center; }
.td-clear-tick { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e1f2e8; color: #14532d; font-weight: 800; font-size: 20px; }
.td-clear strong { font-size: 16px; margin-top: 6px; }

.td-soon-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.td-soon-head h3 { margin: 0; font-size: 15px; color: var(--muted); }
.td-soon-head .muted { font-size: 13px; }
.td-soon-list { list-style: none; margin: 0; padding: 0; }
.td-soon-item { display: flex; align-items: flex-start; gap: 12px; }
.td-rail { position: relative; flex: none; width: 12px; align-self: stretch; display: flex; justify-content: center; padding-top: 5px; }
.td-rail i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.td-rail::after { content: ""; position: absolute; top: 18px; bottom: 0; width: 2px; background: var(--border-soft); }
.td-soon-item--last .td-rail::after { display: none; }
.td-soon-item--soon .td-rail i { width: 10px; height: 10px; background: #c98a00; }
.td-soon-time { width: 62px; flex: none; font-size: 13px; color: var(--muted); padding-top: 1px; }
.td-soon-item--soon .td-soon-time { color: #6b4500; font-weight: 800; }
.td-soon-text { flex: 1; min-width: 0; padding-bottom: 14px; font-size: 14px; }
.td-soon-text strong { font-weight: 500; }
.td-soon-item--soon .td-soon-text strong { font-weight: 750; }
.td-soon-text .muted { font-size: 13px; }
.td-nudge { flex: none; min-height: 34px; padding: 4px 12px; font-size: 13px; margin-bottom: 10px; }
.td-soon-more { margin: 0 0 0 24px; font-size: 13px; }

/* Trend cards */
.td-kpis { display: flex; flex-direction: column; gap: 12px; }
.td-kpis-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.td-kpis-head h3 { margin: 0; font-size: 16px; }
.td-kpis-head p { margin: 2px 0 0; font-size: 13px; }
.td-periods { display: flex; flex-wrap: wrap; gap: 6px; }
.td-periods button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); color: var(--navy); font-weight: 600; font-size: 13px; }
.td-periods button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.td-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.td-kpi {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 15px; color: var(--navy); font-weight: 400;
}
.td-kpi:hover { border-color: var(--navy); }
.td-kpi--open { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.td-kpi-label { font-size: 13px; color: var(--muted); }
.td-kpi-value { font-size: 28px; font-weight: 850; line-height: 1.1; }
.td-kpi-meter, .td-break-bar { position: relative; display: block; height: 8px; border-radius: 999px; background: var(--border-soft); }
.td-kpi-meter i, .td-break-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--blue); }
.td-kpi-meter i.below, .td-break-bar i.below { background: #c98a00; }
.td-kpi-meter b, .td-break-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--navy); }
.td-kpi-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-size: 13px; }
.td-delta { font-weight: 700; }
.td-delta--up { color: #14532d; }
.td-delta--down { color: #8a2a17; }
.td-delta--flat { color: var(--muted); }
.td-target { color: var(--muted); }
.td-target--below { color: #6b4500; font-weight: 800; }
.td-kpi-break { padding-bottom: 6px; }
.td-break-info { margin: 10px 18px 4px; font-size: 13px; }
.td-break-row { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.td-break-row:last-child { border-bottom: 0; }
.td-break-row strong { width: 120px; flex: none; }
.td-break-bar { flex: 1; height: 10px; }
.td-break-value { width: 56px; flex: none; text-align: right; font-weight: 800; }
.td-break-row .td-delta { width: 130px; flex: none; text-align: right; font-size: 13px; }
.td-break-row--sel { background: var(--yellow-soft); }

/* Today's shift by outlet */
.td-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.td-legend span { display: inline-flex; align-items: center; gap: 6px; }
.td-ico { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.td-ico--done { background: #8a8780; }
.td-ico--late { background: #c2412d; }
.td-ico--soon { border: 3px solid #c98a00; }
.td-ico--later { border: 2px solid var(--border); }
.td-shift-grid { padding: 4px 0; }
.td-shift-row { display: grid; grid-template-columns: minmax(96px, 1.1fr) repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border-soft); }
.td-shift-head { border-top: 0; padding-top: 10px; padding-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.td-shift-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.td-step { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.td-step-main { display: inline-flex; align-items: center; gap: 6px; }
.td-svg { width: 18px; height: 18px; flex: none; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.td-step--done .td-svg { stroke: #8a8780; }
.td-step--late .td-svg circle { fill: #c2412d; stroke: #c2412d; }
.td-step--late .td-svg path { stroke: #fff; }
.td-step--late { color: #8a2a17; font-weight: 800; }
.td-step--soon .td-svg { stroke: #c98a00; }
.td-step--soon { color: #6b4500; font-weight: 800; }
.td-step--later .td-svg { stroke: var(--border); stroke-width: 2; }
.td-step--none { color: var(--border); }
.td-nudge--cell { margin: 0; min-height: 32px; padding: 2px 10px; font-size: 12px; }

/* Wins + reviews */
.td-bottom { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.td-wins { flex: 1 1 340px; min-width: 0; }
.td-wins-list { list-style: none; margin: 0; padding: 0; }
.td-wins-list li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.td-wins-list li:last-child { border-bottom: 0; }
.td-star { color: #c98a00; }
.td-reviews {
  flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px !important;
  text-align: left; color: var(--navy); font-weight: 400; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.td-reviews:hover { border-color: var(--navy); }
.td-reviews-top { display: flex; justify-content: space-between; gap: 10px; width: 100%; font-size: 15px; }
.td-bar { display: block; width: 100%; height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.td-bar i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.td-reviews-reward { font-size: 13px; }

@media (max-width: 700px) {
  .td-need { flex-wrap: wrap; padding: 10px 14px; }
  .td-need .td-act { margin-left: 20px; }
  .td-shift-row { grid-template-columns: 72px repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 12px; }
  .td-step { font-size: 12px; }
  .td-svg { width: 15px; height: 15px; }
  .td-break-row { flex-wrap: wrap; }
  .td-break-row strong { width: auto; flex: 1 1 100%; }
  .td-break-row .td-delta { width: auto; }
  .td-oc { flex: 1 1 100%; }
}
.sp-today > .refresh-status { margin: -8px 0 0; }
.sp-today > .refresh-status:empty { display: none; }
@media (max-width: 700px) {
  .td-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .td-kpi { padding: 12px; }
  .td-kpi-value { font-size: 24px; }
  .td-kpi-foot { flex-direction: column; gap: 2px; font-size: 12px; }
}
