/* ClearRoute Pest owner hub. Charcoal & Lime palette (the pest
   site palette): charcoal neutrals, lime accent #B5D334, amber only
   as the warning color, sunset only in the logo lockup. Dark is the
   default look; light theme ships too and follows the system
   setting until the owner picks one. */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131517;
  --bg-raise: #1e2124;
  --bg-card: #1e2124;
  --bg-inset: #17191c;
  --line: #2c3033;
  --text: #f4f6f0;
  --text-dim: #a7aea4;
  --accent: #b5d334;
  --accent-ink: #1a1d1a;
  --accent-deep: #9ac422;
  --green: #4ade80;
  --amber: #ffb02e;
  --red: #f87171;
  --red-bg: #2e1518;
  --chip-bg: #232629;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f2ec;
  --bg-raise: #ffffff;
  --bg-card: #ffffff;
  --bg-inset: #f7f8f1;
  --line: #dee1d2;
  --text: #1b1e1b;
  --text-dim: #6e7268;
  --accent: #6e8f1a;
  --accent-ink: #ffffff;
  --accent-deep: #5c7a16;
  --green: #15803d;
  --amber: #b45309;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --chip-bg: #eff1e6;
  --shadow: 0 6px 24px rgba(19, 21, 23, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 10px; }

.muted { color: var(--text-dim); }
.small { font-size: 13px; }

/* ---------- buttons, fields ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 15px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.btn-block { width: 100%; padding: 13px 16px; font-size: 16px; }
.btn-quiet { background: transparent; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.field input, .search-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 16px;
}

/* ---------- auth ---------- */
[hidden] { display: none !important; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
  width: 100%;
  max-width: 400px;
}
.auth-sub { color: var(--text-dim); margin-bottom: 20px; }
.auth-note { color: var(--text-dim); font-size: 13px; margin-top: 16px; }
.show-pw { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-dim); margin: 2px 0 6px; cursor: pointer; }
.show-pw input { width: 16px; height: 16px; margin: 0; flex: none; }
.auth-error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}

/* ---------- shell ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 0.2px; display: flex; align-items: center; gap: 9px; }
.brand-big { font-size: 26px; margin-bottom: 8px; }
.brand-mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(181, 211, 52, 0.30);
  display: inline-block;
}
.brand-icon { width: 28px; height: 28px; display: block; flex: none; }
.brand-icon-big { width: 36px; height: 36px; }
@font-face { font-family: 'Kalam'; src: url(kalam-700.woff2) format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
.lockup { display: inline-flex; flex-direction: column; line-height: 1; margin-right: .9em; }
.lockup-under { display: flex; align-items: center; gap: .22em; margin-top: .08em; width: calc(100% + .9em); }
.lockup-line { height: .085em; background: #FF8A3D; border-radius: 99px; flex: 1 1 auto; min-width: 2.2em; transform: translateY(-.08em); }
.lockup-pest { font-family: Kalam, cursive; font-weight: 700; font-size: .45em; letter-spacing: .04em; color: #FF8A3D; line-height: .9; white-space: nowrap; }
.company-name { color: var(--text-dim); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.updated-at { color: var(--text-dim); font-size: 13px; }

.mainnav {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}
.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
}
.nav-btn.active { background: var(--bg-card); color: var(--text); border-color: var(--line); }

.main { max-width: 1180px; margin: 0 auto; padding: 18px 20px 60px; width: 100%; }

/* ---------- cards, stats ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 6px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.stat-label { color: var(--text-dim); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 2px; }
.stat-sub { color: var(--text-dim); font-size: 13px; }
.stat-card.alert .stat-value { color: var(--red); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

/* ---------- alerts, issues ---------- */
.alert-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
}
.alert-card:hover { border-color: var(--accent); border-left-color: var(--red); }
.alert-title { font-weight: 700; }
.alert-problem { color: var(--red); font-weight: 600; }
.issue-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

/* ---------- routes and stops ---------- */
.route-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.route-tech { font-size: 18px; font-weight: 800; }
.ring-wrap { position: relative; width: 58px; height: 58px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-track { stroke: var(--line); }
.ring-fill { stroke: var(--green); }
.ring-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; text-align: center;
}
.stop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}
.stop-row:hover { border-color: var(--accent); }
.stop-seq {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--chip-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; flex: none;
}
.stop-main { flex: 1; min-width: 0; }
.stop-name { font-weight: 700; }
.stop-addr { color: var(--text-dim); font-size: 13px; }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.chip-done { background: var(--green); color: #06280f; }
.chip-progress { background: var(--accent); color: var(--accent-ink); }
.chip-skipped { background: var(--amber); color: #2e1f00; }
.chip-overdue, .chip-alert { background: var(--red); color: #fff; }
.chip-paid { background: var(--green); color: #06280f; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-dim); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
td.num, th.num { text-align: right; }
tr.row-bad td { background: rgba(255, 90, 78, 0.08); }
.reading-bad { color: var(--red); font-weight: 700; }

/* ---------- customers ---------- */
.pool-block { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.pool-title { font-weight: 700; }
.equip-line { color: var(--text-dim); font-size: 14px; }
.search-row { margin: 6px 0 16px; }

/* ---------- map ---------- */
#map { height: 68vh; min-height: 380px; border-radius: 14px; border: 1px solid var(--line); z-index: 0; }
.pin-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.pin-num.done { background: var(--green); color: #06280f; }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.pin-tech {
  min-width: 34px; height: 34px; border-radius: 50%;
  background: #1e2124; color: #fff;
  border: 3px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  padding: 0 4px;
}
.leaflet-popup-content { font-size: 14px; line-height: 1.4; }

/* ---------- visit detail ---------- */
.back-btn { margin-bottom: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.check-line { display: flex; gap: 9px; align-items: baseline; padding: 4px 0; }
.check-box { font-weight: 800; }
.check-done { color: var(--green); }
.check-todo { color: var(--text-dim); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.photo-grid figcaption { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 26px;
  text-align: center;
  color: var(--text-dim);
}
.loading { color: var(--text-dim); padding: 30px 0; text-align: center; }

@media (max-width: 640px) {
  .stat-value { font-size: 24px; }
  .mainnav { overflow-x: auto; }
}

/* ---------- batch 2: forms, modal, board ---------- */
.field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 14px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin: 8px 0;
  cursor: pointer;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn-small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.inline-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.notice {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  font-weight: 600;
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 28px 0 12px; }
.search-flex { display: flex; gap: 10px; }
.search-flex .search-input { flex: 1; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-dim { opacity: 0.62; }
.chip-partial { background: var(--amber); color: #2e1f00; }
.chip-voided { background: transparent; border: 1px solid var(--line); color: var(--text-dim); }

/* quick create */
.create-wrap { position: relative; }
.create-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 230px;
  padding: 6px;
  z-index: 60;
}
.create-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.create-menu button:hover:not(:disabled) { background: var(--bg-inset); }
.create-menu button:disabled { color: var(--text-dim); cursor: default; font-weight: 400; }

/* modal editors */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 16, 15, 0.66);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 28px 14px;
  z-index: 100;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px 24px 20px;
  width: 100%;
  max-width: 860px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pool-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0;
  background: var(--bg-inset);
}

/* invoice lines */
.line-table input, .line-table select { font-size: 14px; }
.mini-input, .mini-select {
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 14px;
}
.mini-input.grow { width: 100%; min-width: 130px; }
/* Native dropdown lists: paint options from the theme so the open list
   never renders light text on the OS white popup (Clint screenshot
   2026-11-23: the current day was near-invisible in dark mode). */
select option { background-color: var(--bg-raise); color: var(--text); }
select option:disabled { color: var(--text-dim); }
.mini-input.num-in { width: 96px; text-align: right; }
/* Hub batch 2026-11-21: line-item tables (invoice + quote editors).
   Fixed layout so the Description column takes the leftover width
   instead of squeezing to ~160px next to the numeric columns. */
.line-table { table-layout: fixed; width: 100%; }
.line-table th:nth-child(2), .line-table td:nth-child(2) { width: 118px; }
.line-table th:nth-child(3), .line-table td:nth-child(3) { width: 78px; }
.line-table th:nth-child(4), .line-table td:nth-child(4) { width: 104px; }
.line-table th:nth-child(5), .line-table td:nth-child(5) { width: 84px; }
.line-table th:nth-child(6), .line-table td:nth-child(6) { width: 88px; }
.line-table .mini-input.grow { min-width: 0; }
.line-table .mini-input.num-in { width: 100%; }
/* Dark map tiles without an API key: OSM tiles darkened by filter. */
.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.92); }
/* Small inline label for filter inputs (Billing month). */
.mini-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
/* Even two-column form grid (customer pool plan block). */
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.invoice-total { text-align: right; font-size: 19px; font-weight: 800; margin-top: 12px; }
.pay-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pay-row input {
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 15px;
  width: 170px;
}

/* schedule board */
/* The Schedule view breaks out of the 1180px container the other views
   use, so the week board gets the full window width. :has() scopes this
   to the schedule markup only; other views keep the narrow container. */
.main:has(> .board-wrap) { max-width: none; }
.board-wrap { position: relative; padding: 0 54px; }
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 8px;
}
.board-col {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-height: 120px;
  min-width: 0;
}
.board-today { border-color: var(--accent); }
.board-day { font-weight: 800; margin-bottom: 8px; }
.board-tech { font-weight: 700; font-size: 14px; margin: 10px 0 6px; color: var(--accent); }
.stop-chip {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  min-width: 0;
}
.stop-chip-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.stop-chip-head .stop-seq { flex: none; }
.stop-chip-head .stop-name { flex: 1; min-width: 0; overflow-wrap: break-word; }
.stop-chip-head .chip { flex: none; margin-top: 2px; }
/* Day select + Move share the first line; the tech select (long names)
   gets a full-width line of its own so nothing truncates into mush. */
.move-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.move-row .mini-select { min-width: 0; font-size: 12px; padding: 5px 4px; }
.move-row select[data-move-day] { flex: 1 1 0; }
.move-row select[data-move-tech] { flex: 1 1 100%; order: 3; }
.move-row .btn-small { flex: 0 0 auto; }

/* week navigation arrows: round buttons centered on the board edges.
   The wrap's side padding keeps the day columns clear of them. */
.board-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  padding: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}
.board-arrow:hover { border-color: var(--accent); color: var(--accent); }
.board-arrow-prev { left: 0; }
.board-arrow-next { right: 0; }

@media (max-width: 900px) {
  /* Small screens: columns keep a usable minimum and the board scrolls
     sideways inside the wrap instead of crushing the cards. */
  .board { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; }
  .board-wrap { padding: 0 48px; }
  .board-arrow { width: 38px; height: 38px; font-size: 24px; }
}

/* ---------- Part B: Charcoal & Lime reskin ----------
   Same layout as the pool hub's Glass Water pass, recolored to the
   pest palette: charcoal panels, lime accent, sunset only in the
   logo lockup. All existing class names are kept; this section
   restyles them, it does not rename anything. */

[data-theme="light"] {
  --bg: #f1f2ec;
  --bg-raise: #ffffff;
  --bg-card: #ffffff;
  --bg-inset: #f7f8f1;
  --line: #dee1d2;
  --text: #1b1e1b;
  --text-dim: #6e7268;
  --accent: #6e8f1a;
  --accent-ink: #ffffff;
  --accent-deep: #5c7a16;
  --chip-bg: #eff1e6;
  --shadow: 0 6px 24px rgba(19, 21, 23, 0.12);
}
[data-theme="dark"] {
  --bg: #131517;
  --bg-raise: #1e2124;
  --bg-card: #1e2124;
  --bg-inset: #17191c;
  --line: #2c3033;
  --text: #f4f6f0;
  --text-dim: #a7aea4;
  --accent: #b5d334;
  --accent-ink: #1a1d1a;
  --accent-deep: #9ac422;
  --chip-bg: #232629;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] body {
  background: linear-gradient(160deg, #f7f8f1, #f1f2ec 55%, #eff1e6);
  background-attachment: fixed;
  color: var(--text);
}
[data-theme="dark"] body {
  background: linear-gradient(160deg, #1e2124, #131517);
  background-attachment: fixed;
  color: var(--text);
}

/* frosted panels in both themes */
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .alert-card,
[data-theme="light"] .issue-card,
[data-theme="light"] .auth-card,
[data-theme="light"] .modal-card,
[data-theme="light"] .board-col,
[data-theme="light"] .notice {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--line);
}
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .alert-card,
[data-theme="dark"] .issue-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .board-col,
[data-theme="dark"] .notice {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--line);
}

/* ---------- sidebar layout ---------- */
.shell-layout { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #ffffff, #eff1e6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid #dee1d2;
  color: #1b1e1b;
}
[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #1e2124, #131517);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid #2c3033;
  color: #f4f6f0;
}
.sidebar .brand { padding: 2px 8px; }
.sidebar .mainnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  margin: 0;
  max-width: none;
  width: 100%;
}
.sidebar .nav-btn {
  text-align: left;
  width: 100%;
  border-radius: 10px;
  padding: 10px 14px;
}
[data-theme="light"] .sidebar .nav-btn { color: #1b1e1b; }
[data-theme="dark"] .sidebar .nav-btn { color: #a7aea4; }
.sidebar .nav-btn:hover { border-color: rgba(181, 211, 52, 0.5); }
.sidebar .nav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.sidebar-company {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--line);
}
.sidebar-company .company-name { font-weight: 800; font-size: 16px; }
[data-theme="light"] .sidebar-company .company-name { color: #1b1e1b; }
[data-theme="dark"] .sidebar-company .company-name { color: #f4f6f0; }
.company-plan-line { font-size: 13px; margin: 2px 0 10px; }
[data-theme="light"] .company-plan-line { color: #6e7268; }
[data-theme="dark"] .company-plan-line { color: #b5d334; }

/* ---------- work area, wave band, topbar ---------- */
.work-area { flex: 1; min-width: 0; position: relative; }
.wave-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 90px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.wave-band svg { width: 100%; height: 90px; display: block; }
.wave-band .wave-back { fill: #b5d334; opacity: 0.10; }
.wave-band .wave-front { fill: #b5d334; opacity: 0.16; }
.topbar {
  position: relative;
  z-index: 2;
  background: transparent;
  border-bottom: none;
  justify-content: flex-end;
  padding: 14px 20px 4px;
}
.topbar-right { margin-left: auto; }
.main { position: relative; z-index: 1; }

/* primary buttons ride the approved teal in both themes */
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent-deep); }
.pin-num { background: var(--accent); color: var(--accent-ink); }
.chip-progress { background: var(--accent); color: var(--accent-ink); }
.board-today { border-color: var(--accent); }
.board-tech { color: var(--accent-deep); }
[data-theme="dark"] .board-tech { color: #b5d334; }
[data-theme="dark"] .stat-label { color: #b5d334; }

.auth-info {
  background: var(--chip-bg);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.report-preview { max-height: 60vh; overflow-y: auto; }
.print-area { display: none; }

@media (max-width: 820px) {
  .shell-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    padding: 14px 12px 12px;
  }
  .sidebar .mainnav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
    flex: none;
    overflow: visible;
  }
  .sidebar .nav-btn { width: 100%; white-space: nowrap; text-align: center; padding: 9px 4px; font-size: 14px; }
  .sidebar-company { margin-top: 0; border-top: 1px solid var(--line); padding-top: 10px; }
  .search-flex { flex-wrap: wrap; }
  .search-flex .search-input { flex: 1 1 100%; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  table { max-width: 100%; }
}

/* ---------- Part B D3: print views ---------- */
@media print {
  body { background: #ffffff !important; }
  #appShell, #authScreen, #modalRoot { display: none !important; }
  .print-area { display: block !important; }
  .print-doc { color: #000000; font-size: 13px; padding: 10px; }
  .print-doc h1 { font-size: 22px; }
  .print-doc h2 { font-size: 17px; margin-top: 14px; }
  .print-doc table { width: 100%; border-collapse: collapse; }
  .print-doc th, .print-doc td { border-bottom: 1px solid #999999; padding: 6px 8px; text-align: left; color: #000000; }
  .print-doc td.num, .print-doc th.num { text-align: right; }
  .print-doc .inv-head { border-bottom: 3px solid #6e8f1a; padding-bottom: 8px; margin-bottom: 6px; }
  .print-doc .inv-head h1 { margin-bottom: 2px; }
  .print-doc .inv-head p { margin: 0; }
  .print-doc .inv-foot { margin-top: 20px; border-top: 1px solid #999999; padding-top: 8px; }
  .print-doc img { max-width: 100%; }
}

.trial-banner {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
  background: #fef3c7; color: #92400e; border: 1px solid #f59e0b;
  font-size: 14px; text-align: center;
}
html[data-theme="dark"] .trial-banner { background: #451a03; color: #fcd34d; border-color: #b45309; }

/* Route optimization proposal list (2026-11-23) */
.opt-list { margin: 8px 0 4px 20px; padding: 0; }
.opt-list li { padding: 2px 0; }
