/* Review and Users screens. Builds on styles.css and uses only its color variables. */
/* Review and Users pages get a wider column on a computer screen. */
#app:has(main.wide) { max-width: 760px; }

.who { font-size: 14px; color: var(--muted); font-weight: 600; }

/* Tabs above the stop list */
.tabs { display: flex; gap: 6px; margin: 4px 0 14px; flex-wrap: wrap; }
.tabs button {
  flex: 1 1 0; min-height: 46px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: 700 16px/1 var(--display); letter-spacing: .04em; text-transform: uppercase;
}
.tabs button.on { background: var(--green); border-color: var(--green); color: var(--green-ink); }

.pill.review { background: var(--amber-soft); color: var(--amber); }
.pill.qb { background: var(--navy-soft); color: var(--navy); }
.pill.done { background: var(--tint); color: var(--green); }
.row .right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.row .total { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }

/* Facts at the top of a stop */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }

/* Editable price box on each line */
.price-in {
  width: 92px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; text-align: right;
}
.price-in.needed { border-color: var(--amber); background: var(--amber-soft); }
.price-wrap { display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }
.desc-in { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 600; }
/* "Change" sits next to the item name: swaps the item but keeps its photos */
.title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.title-row .desc-in { flex: 1 1 140px; width: auto; }
.chg {
  min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--navy-soft); color: var(--navy); font: 700 14px/1 var(--body); flex: none;
}
.changed-tag { font-size: 12px; font-weight: 700; color: var(--navy); letter-spacing: .04em; }
.line .ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Sample photo tiles have no real picture behind them */
.photo img[data-sample] { object-fit: cover; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green); flex: none; }
.check .sub { font-size: 14px; color: var(--muted); }


.note.lock { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.link { background: none; border: 0; color: var(--navy); font-weight: 600; text-decoration: underline; padding: 6px 0; }

@media (max-width: 420px) {
  .line { flex-wrap: wrap; }
  .line .name { flex-basis: 100%; }
  .line .ctrl { flex: 1; justify-content: flex-start; }
}

/* Preset buttons on a user's permissions page */
.presets button { text-transform: none; letter-spacing: .01em; font-size: 17px; }
.presets button[disabled] { opacity: .55; }
.check input[disabled] { opacity: .6; }
.check.always { background: transparent; }
.note.lock { display: flex; gap: 8px; align-items: flex-start; }
body.driver .tabs button { background: var(--surface); border-color: var(--line); color: var(--fg); }
body.driver .tabs button.on { background: var(--green); border-color: var(--green); color: var(--green-ink); }
body.driver .check { background: var(--surface); border-color: var(--line); }
body.driver .price-in, body.driver .desc-in { background: var(--surface-2); border-color: var(--line); color: var(--fg); }
body.driver .chg { background: var(--navy-soft); border-color: var(--line); color: var(--navy); }


/* Clients and Items forms */
.form .field { display: grid; gap: 6px; margin-bottom: 12px; }
.form [hidden] { display: none !important; }
.form .field > span { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.form input:not([type=radio]):not([type=checkbox]), .form textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2, var(--bg)); color: var(--fg); font-size: 17px;
}
.form input[disabled], .form textarea[disabled] { opacity: .75; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: grid; gap: 8px; margin: 4px 0 12px; }
.choice label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.choice input { width: 20px; height: 20px; accent-color: var(--green); }
.toggle-off { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: -4px 0 12px; }
.toggle-off input { width: 18px; height: 18px; accent-color: var(--green); }
.price-tag { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.form .note { margin-top: 0; }

/* ===== Main menu =====
   Phone: the Menu button slides this panel out from the left. Computer (1000px and wider): it is a permanent sidebar. */
.menu-btn { display: inline-flex; align-items: center; gap: 6px; }
.sidenav {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: 280px; max-width: 85vw;
  display: flex; flex-direction: column; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: var(--surface); border-right: 1px solid var(--line);
  transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility .2s;
}
body.menu-open .sidenav { transform: none; visibility: visible; }
.sidenav-back { position: fixed; inset: 0; z-index: 69; background: rgba(0, 0, 0, .55); display: none; }
body.menu-open .sidenav-back { display: block; }
body.menu-open { overflow: hidden; }
.sidenav-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; border-bottom: 1px solid var(--line); }
.menu-close { border: 0; background: transparent; color: var(--fg); width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sidenav-items { display: grid; gap: 4px; flex: 1; align-content: start; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px;
  border: 0; border-radius: 12px; background: transparent; color: var(--fg);
  font: 600 17px/1 var(--body); text-align: left; cursor: pointer;
}
.nav-item .ic { width: 22px; height: 22px; color: var(--muted); }
.nav-item:hover { background: var(--surface-2, var(--tint)); }
.nav-item.on { background: var(--tint); color: var(--green); }
.nav-item.on .ic { color: var(--green); }
.sidenav-foot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 4px; }
.who-block { padding: 4px 14px 6px; }
.who-name { font-weight: 700; }
.who-role { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none; } }

@media (min-width: 1000px) {
  body.has-sidenav { padding-left: 260px; }
  body.has-sidenav .sidenav { width: 260px; max-width: none; transform: none; visibility: visible; transition: none; z-index: 30; }
  body.has-sidenav .bar .menu-btn, body.has-sidenav .menu-close, body.has-sidenav .sidenav-back { display: none; }
  body.has-sidenav .submit-bar, body.has-sidenav .demo { left: 260px; }
  /* The sidebar already shows the GREENSPACE name, so a top bar with nothing else in it is hidden. */
  body.has-sidenav .bar:not(:has(.back)):not(:has(.bar-right > :not(.menu-btn))) { display: none; }
  body.has-sidenav .bar .bar-top > .brand { visibility: hidden; }
}

/* ===== Reports ===== */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.chips button {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: 600 15px/1 var(--body); cursor: pointer;
}
.chips button.on { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin: 6px 0 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.tile .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile .v { font: 700 28px/1.1 var(--display); font-variant-numeric: tabular-nums; margin-top: 4px; }
/* Wide tables scroll sideways inside their card; the first column stays put. */
.rtable-wrap { overflow-x: auto; margin: 0 -8px; }
.rtable { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.rtable th, .rtable td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rtable th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; vertical-align: bottom; }
.rtable .num { text-align: right; }
.rtable th:first-child, .rtable td:first-child { position: sticky; left: 0; background: var(--surface); white-space: normal; min-width: 130px; }
.rtable tfoot td { font-weight: 700; border-bottom: 0; }
.rtable td.zero { color: var(--muted); }
.cell-link { background: none; border: 0; padding: 0; color: var(--fg); font: inherit; font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: var(--muted); cursor: pointer; }
@media (max-width: 480px) { .tile { padding: 10px; } .tile .k { font-size: 11px; letter-spacing: .05em; } .tile .v { font-size: 22px; } }

/* Two buttons side by side (Clients page: Add client + Routes) */
.btn-row { display: flex; gap: 10px; margin-bottom: 12px; }
.btn-row .btn { flex: 1; margin: 0; }
.form select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2, var(--bg)); color: var(--fg); font-size: 17px; }
.form select[disabled] { opacity: .75; }

/* Reports: route choice and custom dates */
.route-pick { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.route-pick span, .date-range span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.route-pick select, .date-range input {
  flex: 1; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: 600 16px/1 var(--body); color-scheme: dark;
}
.date-range { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin: 0 0 12px; }
.date-range label { display: grid; gap: 4px; min-width: 0; }
.date-range input { width: 100%; }
.chip-sm { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--navy-soft); color: var(--navy); font: 700 14px/1 var(--body); cursor: pointer; }
@media (max-width: 480px) { .date-range { grid-template-columns: 1fr 1fr; } .date-range .chip-sm { grid-column: 1 / -1; min-height: 40px; } .date-range input { padding: 0 8px; font-size: 15px; } }

/* ===== Service report (service-report.js) =====
   A white "paper" sheet in every theme, laid out to print as a letter-size PDF. */
.report-tools { display: grid; gap: 10px; margin-bottom: 16px; }
.report-tools .tabs { margin: 0; }
.report-tools .btn + .btn { margin-top: 0; }
.report-sheet {
  background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 28px 26px 22px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .35); font-size: 14px; line-height: 1.4;
}
.report-sheet h2 { font: 700 26px/1.05 var(--display); margin: 0; letter-spacing: .01em; color: var(--paper-ink); }
.report-sheet h3 {
  font: 700 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--green);
  margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--green);
}
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--paper-line); }
.rp-logo { display: block; width: 210px; max-width: 55%; height: auto; margin: -8px 0 -6px -10px; }
.rp-contact { text-align: right; font-size: 12px; color: var(--paper-muted); }
.rp-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.rp-updated { background: var(--amber); color: var(--paper); font: 700 13px/1 var(--body); letter-spacing: .12em; padding: 6px 10px; border-radius: 6px; }
.rp-updnote { margin: 8px 0 0; color: var(--paper-muted); }
.rp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 16px 0 0; background: var(--paper-tint); padding: 12px 14px; border-radius: 6px; }
.rp-facts dt { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); }
.rp-facts dd { margin: 2px 0 0; font-weight: 600; }
.rp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rp-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper-muted); padding: 6px 4px; border-bottom: 1px solid var(--paper-line); }
.rp-table td { padding: 8px 4px; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.rp-table .n { text-align: right; white-space: nowrap; }
.rp-table .tbc { color: var(--amber); font-weight: 600; font-style: italic; white-space: normal; }
.rp-table tfoot td { border-bottom: 0; padding: 6px 4px; }
.rp-table tr.sum td:first-child, .rp-table tr.grand td:first-child { text-align: right; }
.rp-table tr.disc td { color: var(--green); }
.rp-table tr.grand td { font: 700 18px/1.2 var(--display); border-top: 2px solid var(--paper-ink); padding-top: 8px; }
.rp-note:first-of-type { font-weight: 600; }
.rp-note { margin: 10px 0 0; padding: 8px 10px; background: var(--paper-tint); border-radius: 6px; font-size: 13px; }
.rp-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rp-photo { margin: 0; break-inside: avoid; }
.report-sheet .rp-photo .photo { border-radius: 4px; background: var(--paper-line); }
.rp-photo figcaption { font-size: 11px; color: var(--paper-muted); margin-top: 4px; }
.rp-foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--paper-line); font-size: 11px; color: var(--paper-muted); }
@media (max-width: 420px) {
  .report-sheet { padding: 20px 16px 16px; }
  .rp-photos { grid-template-columns: repeat(2, 1fr); }
}

/* Printing / "Save as PDF": only the report sheet, on plain white paper. */
@media print {
  @page { size: letter; margin: 0.5in; }
  body, body.driver, body.has-sidenav { background: var(--paper) !important; padding: 0 !important; }
  .bar, .hero, .demo, .sidenav, .sidenav-back, .report-tools, .offline-note { display: none !important; }
  #app, main, main.wide { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .report-sheet { box-shadow: none; border-radius: 0; padding: 0; }
  .rp-head { align-items: center; }
  .report-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Job type choice on a Review estimate */
.field-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.tabs.job-type { margin: 0 0 6px; }
.tabs.job-type button { font-size: 14px; letter-spacing: .02em; text-transform: none; font-family: var(--body); padding: 6px 8px; line-height: 1.15; }
