/* Dashboard: phone first, two columns from 900px. */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; box-shadow: 0 6px 20px -12px rgb(0 0 0 / .6); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 12px 16px 6px; }
.demo-badge { font-size: 12px; color: #a9b8cf; border: 1px solid #2a3c5c; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.switcher { display: flex; gap: 8px; max-width: 1120px; margin: 0 auto; padding: 6px 16px 12px; overflow-x: auto; scrollbar-width: none; }
.switcher::-webkit-scrollbar { display: none; }
.switcher button {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #2a3c5c;
  background: transparent; color: #d5deea; cursor: pointer; font-weight: 500; transition: background .15s, color .15s;
}
.switcher button[aria-pressed="true"] { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }
.switcher small { color: inherit; opacity: .7; font-weight: 400; margin-inline-start: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 16px 16px 40px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h2 { margin: 0; font-size: 18px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-sub { margin: 4px 0 10px; color: var(--muted); font-size: 14px; }
.sec-title { font-size: 18px; font-weight: 600; margin: 26px 0 10px; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-wide { grid-column: 1 / -1; }
}
main[aria-busy="true"] .card, main[aria-busy="true"] .recs { opacity: .55; transition: opacity .2s; }

/* hero: today's count is the headline */
.hero { position: relative; overflow: hidden; }
.hero::after { /* a faint ticker of the day's hours behind the number */
  content: ""; position: absolute; inset: auto 0 0 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--brand-soft) 0 10px, transparent 10px 14px);
}
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 15px; }
.hero-num { margin: -6px 0 0; font: 700 104px/1 var(--display); letter-spacing: .5px; color: var(--ink); }
.chip { margin: 6px 0 0; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; background: var(--surface-2); }
.chip.up { background: var(--brand-soft); color: var(--brand-ink); }
.chip.down { background: var(--hot-soft); color: var(--hot); }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 6px; }
.hero-facts div { background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; }
.hero-facts dt { font-size: 12px; color: var(--muted); }
.hero-facts dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; }
.hero-facts dd small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
@media (max-width: 380px) { .hero-num { font-size: 88px; } .hero-facts dd { font-size: 17px; } }

/* recommendation cards */
.recs { display: grid; gap: 10px; }
@media (min-width: 900px) { .recs { grid-template-columns: 1fr 1fr; } }
.rec {
  display: grid; grid-template-columns: 36px 1fr; gap: 4px 12px; align-items: start;
  background: var(--surface); border-radius: var(--radius-s); box-shadow: var(--shadow); padding: 14px 16px;
  animation: rise .35s ease both;
}
.rec:nth-child(2) { animation-delay: .05s; } .rec:nth-child(3) { animation-delay: .1s; } .rec:nth-child(n+4) { animation-delay: .15s; }
@keyframes rise { from { transform: translateY(8px); } }  /* no opacity: a paused animation never hides a card */
.rec-icon { grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--tone-soft, var(--brand-soft)); color: var(--tone, var(--brand)); }
.more { justify-self: start; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; cursor: pointer; }
.more:hover { border-color: var(--brand); color: var(--brand-ink); }
.rec h3 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 600; }
.rec p { margin: 0; font-size: 14px; color: var(--ink-2); }
.rec .value { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--brand-ink); }
.rec[data-tone="warn"] { --tone: var(--hot); --tone-soft: var(--hot-soft); }
.rec[data-tone="save"] { --tone: var(--brand); --tone-soft: var(--brand-soft); }
.rec[data-tone="info"] { --tone: var(--info); --tone-soft: var(--info-soft); }
.rec[data-tone="ok"] { --tone: var(--brand); --tone-soft: var(--brand-soft); }

/* segmented day picker */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; color: var(--ink-2); min-height: 34px; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* charts (SVG built in dashboard.js; time runs left to right) */
.chart { direction: ltr; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 11px var(--body); fill: var(--muted); }
.chart .lbl-strong { fill: var(--ink); font-weight: 600; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .bar-actual { fill: var(--brand); }
.chart .bar-fc { fill: url(#hatch); stroke: var(--brand); stroke-width: 1.2; }
.chart .bar-hot { fill: var(--hot); }
.chart .bar-fc.bar-hot { fill: url(#hatch-hot); stroke: var(--hot); }
.chart .bar-past { fill: var(--muted); opacity: .45; }
.chart .whisker { stroke: var(--ink-2); stroke-width: 1.5; }
.chart .cap-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.chart .now-line { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .sel { fill: var(--ink); opacity: .06; }
.chart .day-today { fill: var(--brand-ink); font-weight: 700; }
.chart .holiday { fill: var(--info); font-weight: 600; }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-actual { background: var(--brand); }
.sw-fc { background: repeating-linear-gradient(135deg, var(--brand) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1.2px var(--brand); }
.sw-hot { background: var(--hot); }
.sw-cap { height: 0; border-top: 2.5px solid var(--ink); border-radius: 0; width: 18px; }
.sw-ramp { width: 44px; background: linear-gradient(90deg, var(--heat-0), var(--heat-1)); }
[dir="rtl"] .sw-ramp { background: linear-gradient(-90deg, var(--heat-0), var(--heat-1)); }
.accuracy { margin: 12px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-s); font-size: 13px; color: var(--ink-2); }
.accuracy b { color: var(--ink); }

/* heatmap: a shift roster - days are columns (Sunday on the right), hours are rows */
.heat-wrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 46px repeat(7, minmax(34px, 1fr)); gap: 3px; min-width: 300px; }
.heat .hd { text-align: center; font-size: 13px; color: var(--ink-2); font-weight: 600; padding-bottom: 4px; }
.heat .hd.today { color: var(--brand-ink); }
.heat .hr { font-size: 12px; color: var(--muted); text-align: start; align-self: center; font-variant-numeric: tabular-nums; direction: ltr; }
.heat .c {
  position: relative; height: 26px; border-radius: 6px; border: 0; padding: 0; cursor: pointer;
  background: var(--surface-2); font-size: 11px; font-variant-numeric: tabular-nums; color: transparent;
}
.heat .c.closed { background: transparent; box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.heat .c:hover, .heat .c:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; color: var(--c-ink); }
.heat .c .m {
  position: absolute; inset-block-start: -5px; inset-inline-end: -4px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font: 700 11px/1 var(--body); color: #fff; box-shadow: 0 0 0 2px var(--surface);
}
.mark { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 11px/1 var(--body); color: #fff; }
.mark-under, .heat .m-under { background: var(--hot); }
.mark-over, .heat .m-over { background: var(--info); }

/* floating tooltip */
.tip {
  position: fixed; z-index: 30; pointer-events: none; background: var(--navy); color: #fff; font-size: 13px; line-height: 1.45;
  padding: 8px 10px; border-radius: 10px; box-shadow: 0 10px 30px -10px rgb(0 0 0 / .5); max-width: 240px;
}
.tip b { font-weight: 600; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; background: var(--navy); color: #fff; }
.cta h2 { font: 700 34px/1 var(--display); letter-spacing: .3px; margin: 0 0 4px; }
.cta p { margin: 0; color: #c3cfe0; }
.foot { color: var(--muted); font-size: 12px; text-align: center; margin: 18px 0 0; }
.error { padding: 24px; text-align: center; color: var(--ink-2); }
