/* Route Scheduling Assistant — styling, carried over from the validated
   prototype's palette so it sits visually alongside the rest of the app. */
:root {
  --ink: #10161a;
  --paper: #f4f7f7;
  --panel: #ffffff;
  --line: #e2e7ec;
  /* Brand: teal fills/headings, gold accents. --moss kept as the var name to
     avoid touching every rule; its value is now brand teal. */
  --moss: #00a79d;
  --moss-dark: #00776e;
  --ochre: #c1882d;
  --ochre-soft: #f4e3c5;
  --clay: #a5432f;
  --clay-soft: #f6dcd4;
  --sky: #33627a;
  --sky-soft: #dbe9ee;
  --muted: #5f676e;
  --route-1: #00a79d;
  --route-2: #33627a;
  --route-3: #8a5a2b;
  --route-4: #6b4c8a;
  --route-5: #a5432f;
  --route-6: #b5326b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.45;
  padding: 0 20px 80px;
}
.wrap { max-width: 1180px; margin: 0 auto; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; margin: 0 0 4px; }
h1 { font-size: 1.9rem; letter-spacing: -0.01em; }
a { color: var(--sky); }
.hidden { display: none !important; }

.tag {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--moss);
  background: var(--ochre-soft);
  border: 1px solid var(--ochre);
  border-radius: 3px;
  padding: 2px 8px;
  margin-bottom: 14px;
}

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 24px;
}
.topbar h1 { margin: 0; }
.topbar .spacer { flex: 1; }
.navlink { font-size: 0.9rem; text-decoration: none; font-weight: 600; }
#authBox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#authBox form { display: flex; gap: 6px; flex-wrap: wrap; }
#userEmail { font-size: 0.85rem; color: var(--muted); font-family: "IBM Plex Mono", monospace; }

header.intro { margin-bottom: 24px; }
header.intro p { color: var(--muted); max-width: 640px; margin: 6px 0 0; font-size: 0.95rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card > h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.card .sub { color: var(--muted); font-size: 0.88rem; margin: 4px 0 14px; }
.step-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--moss);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

/* forms */
label.field { display: block; margin-bottom: 10px; }
label.field > span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=search], select {
  font-family: "Inter", sans-serif;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  background: #fff;
  width: 100%;
}
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

button {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 9px 16px;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.85; }
button.secondary { background: transparent; color: var(--ink); }
button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
button:disabled { opacity: 0.35; cursor: not-allowed; }
button.small { padding: 5px 10px; font-size: 0.78rem; border-radius: 5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

.drop {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fbfaf5;
}
.drop:hover { border-color: var(--ochre); background: var(--ochre-soft); }
.drop input { display: none; }
.drop .status { font-family: "IBM Plex Mono", monospace; font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.drop .status.ok { color: var(--moss); font-weight: 600; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th {
  text-align: left;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  position: sticky; top: 0; background: var(--panel);
}
td { padding: 7px 8px; border-bottom: 1px solid #ece9dd; vertical-align: top; }
tr:last-child td { border-bottom: none; }
.scroll-y { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
}
.badge.ok { background: var(--moss); color: #fff; }
.badge.warn { background: var(--ochre-soft); color: #8a5a12; border: 1px solid var(--ochre); }
.badge.bad { background: var(--clay-soft); color: var(--clay); border: 1px solid var(--clay); }
.badge.info { background: var(--sky-soft); color: var(--sky); border: 1px solid var(--sky); }

.hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.status { font-size: 0.85rem; }
.status.error { color: var(--clay); }
.error { color: var(--clay); font-size: 0.9rem; }

/* day planning */
.day-list { display: flex; flex-direction: column; gap: 14px; }
.day-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.day-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; background: #fbfaf5; border-bottom: 1px solid var(--line);
}
.day-head .day-name { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.05rem; }
.day-head .count { font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; color: var(--muted); }
.day-staff { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.day-staff label.field { margin: 0; }
.day-staff input[type=text] { min-width: 240px; }
.day-body { padding: 12px 16px; }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--moss); transition: width 0.2s; width: 0; }

/* results */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 12px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-family: "IBM Plex Mono", monospace; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.route-card { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
.route-head {
  padding: 10px 16px; color: #fff;
  font-family: "Fraunces", serif; font-weight: 600; font-size: 1.02rem;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.route-head .meta { font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; font-weight: 400; }
.route-body { padding: 4px 16px 12px; }
.stop { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.stop:last-child { border-bottom: none; }
.stop.cancelled { opacity: 0.5; }
.blaze {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 0.85rem; margin-top: 2px;
}
.stop-main { flex: 1; }
.stop-title { font-weight: 600; font-size: 0.94rem; }
.stop-meta { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.stop-note { background: var(--ochre-soft); border-left: 3px solid var(--ochre); padding: 4px 8px; font-size: 0.8rem; margin-top: 5px; border-radius: 0 4px 4px 0; }
.stop-actions { margin-top: 4px; }
.shift { font-family: "IBM Plex Mono", monospace; font-size: 0.76rem; }
.shift.later { color: var(--clay); }
.shift.earlier { color: var(--sky); }
.shift.none { color: var(--muted); }

.flag-panel { border: 1px solid var(--clay); background: var(--clay-soft); border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; }
.flag-panel h3 { color: var(--clay); font-size: 1rem; }
.flag-panel.note { border-color: var(--ochre); background: var(--ochre-soft); }
.flag-panel.note h3 { color: #8a5a12; }
.flag-panel ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.85rem; }
.flag-panel li { margin-bottom: 4px; }

/* segmented list/calendar toggle */
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 6px; overflow: hidden; }
.seg-btn { border: none; border-radius: 0; background: transparent; color: var(--ink); padding: 8px 14px; }
.seg-btn:hover { opacity: 1; background: #efeada; }
.seg-btn.active { background: var(--ink); color: #fff; }

/* calendar / timeline view */
.cal { margin-bottom: 14px; }
.cal-header { display: flex; }
.cal-corner { width: 56px; flex: none; }
.cal-heads { flex: 1; display: flex; }
.cal-colhead {
  flex: 1; min-width: 0; text-align: center; color: #fff; font-weight: 600;
  font-family: "Fraunces", serif; font-size: 0.9rem; padding: 7px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 6px 6px 0 0;
}
.cal-colhead:last-child { border-right: none; }
.cal-body { display: flex; border: 1px solid var(--line); border-top: none; border-radius: 0 0 8px 8px; overflow: hidden; background: #fff; }
.cal-gutter { width: 56px; flex: none; position: relative; border-right: 1px solid var(--line); background: #fbfaf5; }
.cal-gutter .h {
  position: absolute; right: 6px; transform: translateY(-50%);
  font-size: 0.68rem; color: var(--muted); font-family: "IBM Plex Mono", monospace;
}
.cal-canvas { flex: 1; position: relative; min-width: 0; }
.cal-band { position: absolute; left: 0; right: 0; }
.cal-band.alt { background: rgba(47, 74, 61, 0.045); }
.cal-band-label {
  position: absolute; top: 3px; left: 8px;
  font-size: 0.66rem; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--muted); font-family: "IBM Plex Mono", monospace;
}
.cal-hourline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.cal-cols { position: absolute; inset: 0; display: flex; }
.cal-col { flex: 1; min-width: 0; position: relative; border-right: 1px dashed var(--line); }
.cal-col:last-child { border-right: none; }
.cal-bar {
  position: absolute; left: 3px; right: 3px; border-radius: 5px; color: #fff;
  padding: 3px 6px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.cal-bar-time { font-family: "IBM Plex Mono", monospace; font-size: 0.68rem; font-weight: 600; }
.cal-bar-title { font-size: 0.74rem; font-weight: 600; line-height: 1.15; }
.cal-bar-sub { font-size: 0.68rem; opacity: 0.9; line-height: 1.1; }
.cal-bar .badge { margin-top: 2px; }
.cal-empty { color: var(--muted); font-size: 0.85rem; padding: 14px; }

/* top-level tabs */
.tabbar {
  display: flex; gap: 4px; border-bottom: 2px solid var(--ink);
  margin-bottom: 20px; flex-wrap: wrap;
}
.tab {
  border: 1px solid var(--line); border-bottom: none; background: #fbfaf5;
  color: var(--muted); border-radius: 8px 8px 0 0; padding: 10px 18px;
  font-weight: 600; font-family: "Fraunces", serif; font-size: 1rem;
  position: relative; top: 2px;
}
.tab:hover { opacity: 1; color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab:disabled { opacity: 0.4; cursor: not-allowed; }
.tab-badge {
  display: inline-block; min-width: 18px; text-align: center; margin-left: 6px;
  font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; padding: 0 5px;
  border-radius: 9px; background: var(--ochre-soft); color: #8a5a12;
}
.tab.active .tab-badge { background: rgba(255,255,255,0.25); color: #fff; }

/* schedule workspace toolbar */
.sched-toolbar {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 14px; position: sticky; top: 0; z-index: 5;
}
.sched-staff { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sched-staff label.field { margin: 0; flex: 1; min-width: 260px; }
.sched-controls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sched-controls label.field { margin: 0; }
.sched-controls .spacer { flex: 1; }

/* day navigator */
.day-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.nav-arrow {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 6px 10px; font-weight: 700; line-height: 1;
}
.day-pills { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding-bottom: 2px; }
.day-pill {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 7px 14px; white-space: nowrap; font-weight: 600;
  font-size: 0.85rem; display: flex; align-items: center; gap: 7px;
}
.day-pill:hover { opacity: 1; background: #f3efe2; }
.day-pill.active { background: var(--moss); color: #fff; border-color: var(--moss); }
.day-pill .pcount {
  font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; opacity: 0.8;
}
.day-pill .pflag { color: var(--clay); font-weight: 700; }
.day-pill.active .pflag { color: #ffd9cf; }
.week-label { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.05rem; padding: 0 6px; }
.nav-cal {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 6px 10px; font-size: 1rem; line-height: 1;
}
.nav-cal.active { background: var(--moss); color: #fff; border-color: var(--moss); }

/* month date-picker popover */
.datepicker {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 14px; max-width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-family: "Fraunces", serif; font-weight: 600; font-size: 1rem; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-wd {
  text-align: center; font-size: 0.64rem; color: var(--muted);
  font-family: "IBM Plex Mono", monospace; padding: 2px 0;
}
.dp-cell {
  min-height: 34px; border: 1px solid transparent; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.82rem; color: var(--muted); gap: 2px;
}
.dp-cell.has {
  background: #f0efe4; color: var(--ink); font-weight: 600;
  cursor: pointer; border-color: var(--line);
}
.dp-cell.has:hover { opacity: 1; background: var(--ochre-soft); }
.dp-cell.selected { background: var(--moss); color: #fff; border-color: var(--moss); }
.dp-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--moss); }
.dp-cell.selected .dp-dot { background: #fff; }
.dp-dot.flag { background: var(--clay); }

/* week grid: reuses the calendar canvas, columns = days */
.wk-colhead {
  flex: 1; min-width: 0; text-align: center; padding: 7px 6px; cursor: pointer;
  border-right: 1px solid var(--line); background: #fbfaf5;
}
.wk-colhead:last-child { border-right: none; }
.wk-colhead:hover { background: var(--ochre-soft); }
.wk-colhead .wk-day { font-family: "Fraunces", serif; font-weight: 600; font-size: 0.9rem; }
.wk-colhead .wk-sub { font-family: "IBM Plex Mono", monospace; font-size: 0.68rem; color: var(--muted); }
.wk-colhead .wk-sub .pflag { color: var(--clay); }
.wk-bar {
  position: absolute; border-radius: 4px; color: #fff; padding: 2px 4px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18); border: 1px solid rgba(0,0,0,0.12); font-size: 0.66rem;
}
.wk-bar-time { font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.wk-bar-title { font-weight: 600; line-height: 1.1; }

/* per-stop walker reassignment picker */
.reassign-lbl {
  font-size: 0.72rem; color: var(--muted); font-family: "IBM Plex Mono", monospace;
  display: inline-flex; align-items: center; gap: 4px;
}
.reassignSelect { width: auto; padding: 3px 6px; font-size: 0.78rem; }
.cal-bar .reassignSelect {
  width: 100%; margin-top: 3px; padding: 1px 3px; font-size: 0.66rem;
  border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.92); color: var(--ink);
}
