/* ---------- Design tokens ---------- */
:root {
  --bg:          #000;
  --surface:     #1a1a1a;
  --surface-2:   #242424;
  --line:        #2e2e2e;
  --text:        #ffffff;
  --text-dim:    #b8b8b8;
  --text-mute:   #7a7a7a;

  /* Status colors - matched to JobTracker */
  --s-dropped:   #ff6a73;   /* red/pink */
  --s-progress:  #f4c430;   /* amber */
  --s-completed: #6bd36b;   /* green */
  --today-pink:  #ffb3b8;   /* coral card background */
  --today-text:  #1a1a1a;

  /* Type scale - tuned for ~10ft TV viewing */
  --fs-xxs: 14px;
  --fs-xs:  16px;
  --fs-sm:  20px;
  --fs-md:  26px;
  --fs-lg:  34px;
  --fs-xl:  56px;
  --fs-xxl: 72px;

  --radius: 6px;
  --radius-lg: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; }

.app {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: calc(100vh - 44px); /* minus footer */
  padding: 12px;
  gap: 12px;
}

/* ---------- Sidebar: TODAY'S JOBS ---------- */
.sidebar { display: flex; flex-direction: column; min-width: 0; }
.sidebar__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 4px 8px 8px;
}
.sidebar__title { margin: 0; font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.5px; }
.sidebar__count { font-size: var(--fs-xl); font-weight: 800; line-height: 1; }

.sidebar__list { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }

.tcard {
  background: var(--today-pink);
  color: var(--today-text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: var(--fs-xxs);
  line-height: 1.25;
}
.tcard__title { font-weight: 700; font-size: var(--fs-xs); margin-bottom: 4px; }
.tcard__row { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.tcard__customer { font-weight: 700; flex: 1; min-width: 0; }
.tcard__vehicle  { color: #444; font-size: 11px; margin-top: 4px; width: 100%; }
.tcard__time     { text-align: right; }
.tcard__range    { font-weight: 700; font-size: 13px; white-space: nowrap; }
.tcard__job      { font-size: 10px; color: #444; }

/* ---------- Main area ---------- */
.main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Status row */
.status-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.8fr 1.2fr;
  gap: 12px;
  min-height: 170px;
}

.status {
  background: var(--surface);
  border: 2px solid var(--s-dropped);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.status--dropped   { border-color: var(--s-dropped);   box-shadow: 0 0 18px rgba(255,106,115,.35) inset; }
.status--progress  { border-color: var(--s-progress);  box-shadow: 0 0 18px rgba(244,196, 48,.25) inset; }
.status--completed { border-color: var(--s-completed); box-shadow: 0 0 18px rgba(107,211,107,.30) inset; }

.status__head { display: flex; justify-content: space-between; align-items: flex-start; }
.status__title { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.status__count { font-size: var(--fs-xxl); font-weight: 800; line-height: .9; }

.status__tags {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 2px 14px;
  font-size: var(--fs-xs);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  max-height: 70px;
  overflow: hidden;
}

/* Weekly Jobs card */
.weekly {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.weekly__title { margin: 0 0 10px; font-size: var(--fs-md); font-weight: 700; }
.weekly__time  { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Calendar */
.calendar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.calendar__head {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid rgba(255,255,255,0.22);
}
.calendar__dow + .calendar__dow { border-left: 1px solid rgba(255,255,255,0.18); }
.calendar__dow {
  text-align: center;
  padding: 10px 6px;
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--text);
}
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  flex: 1;
  background:
    linear-gradient(to right,
      transparent calc((100%/6) * 1 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 1 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 1), transparent calc((100%/6) * 1),
      transparent calc((100%/6) * 2 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 2 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 2), transparent calc((100%/6) * 2),
      transparent calc((100%/6) * 3 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 3 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 3), transparent calc((100%/6) * 3),
      transparent calc((100%/6) * 4 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 4 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 4), transparent calc((100%/6) * 4),
      transparent calc((100%/6) * 5 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 5 - 1px), rgba(255,255,255,0.22) calc((100%/6) * 5), transparent calc((100%/6) * 5)
    ),
    var(--surface-2);
}
.cday {
  padding: 10px 14px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.cday--today {
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18);
}
.cday__num {
  align-self: flex-end;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cday--today .cday__num { color: var(--s-dropped); }
.cday__list { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cday__item {
  background: var(--today-pink);
  color: var(--today-text);
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1.25;
  overflow: hidden;
}
.cday__item-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cday__item-vehicle {
  color: #444;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cday__item--outline {
  background: transparent !important;
  color: var(--text) !important;
  border-left: 4px solid transparent;
  padding-left: 8px;
  border-radius: 0;
}
.cday__item--outline .cday__item-vehicle {
  color: var(--text-dim);
}

/* ---------- Footer ---------- */
.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 44px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: var(--fs-xs);
}
.footer__brand { font-weight: 700; margin-right: 10px; }
.footer__dim   { color: var(--text-dim); }
.footer__link  { color: var(--text); }
.footer__right { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.sep { color: var(--text-mute); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.dot--ok   { background: var(--s-completed); }
.dot--warn { background: var(--s-progress); }
.dot--err  { background: var(--s-dropped); }

/* Toast */
.toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--s-dropped);
  color: #1a0000;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: var(--fs-xs);
}

/* 4k scale-up */
@media (min-width: 2400px) {
  :root {
    --fs-xxs: 18px; --fs-xs: 22px; --fs-sm: 28px; --fs-md: 36px;
    --fs-lg: 48px;  --fs-xl: 80px; --fs-xxl: 110px;
  }
  .app { grid-template-columns: 280px 1fr; }
  .footer { height: 60px; }
  .app { height: calc(100vh - 60px); }
}
