/* ==========================================================================
   Clae Pest Control — office.css (owned by task 06)

   The back office: the screen an office manager keeps open all day, and
   the screen a dispatcher uses to move a visit through its day. Same
   brand tokens as the customer portal, deliberately plainer and denser —
   less air, more rows on screen. Every selector here either starts with
   .office (a class this file alone defines) or is scoped under the
   .office class on <body>; nothing here reaches into base.css,
   portal.css or signup.css, and nothing outside this file reaches in.
   ========================================================================== */

/* -----------------------------------------------------------------------
   1. Density — tighter type and rhythm across every office screen
   ----------------------------------------------------------------------- */

.office { font-size: 14px; }
.office .page { padding-block: var(--clae-gap-lg) var(--clae-gap-xl); gap: var(--clae-gap-md); }
.office .wrap { max-width: 1200px; } /* wider working area than the 1080px portal wrap */
.office .card { padding: 18px; }
.office h1.page__title { font-size: clamp(24px, 3vw, 30px); }
.office h2 { font-size: 20px; }
.office h3 { font-size: 16px; }

/* Tabular numerals everywhere a figure appears, without hunting down every
   call site — office density is mostly numbers. */
.office .num,
.office-table td,
.office-timeline__value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* -----------------------------------------------------------------------
   2. Flash — the "on the way" banner carries a second, quieter line (the
   "not sent, this is a demo" disclaimer) that isn't part of shared/_flash.
   Rendered as a sibling paragraph right under the banner and pulled flush
   against it so the two read as one box; :has() only rounds the banner's
   bottom corners when a detail line actually follows.
   ----------------------------------------------------------------------- */

.office-flash:has(.office-flash-detail) .banner {
  border-radius: var(--clae-radius-sm) var(--clae-radius-sm) 0 0;
  margin-bottom: 0;
}
.office-flash-detail {
  margin: 0;
  padding: 0 18px 12px;
  background: var(--clae-periwinkle);
  border-radius: 0 0 var(--clae-radius-sm) var(--clae-radius-sm);
}

/* -----------------------------------------------------------------------
   3. Top bar — the one dark surface in the office
   ----------------------------------------------------------------------- */

.office-topbar {
  background: var(--clae-night);
  color: var(--clae-paper);
}
.office-topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--clae-gap-md);
  padding-block: 14px;
  flex-wrap: wrap;
  row-gap: 8px;
}
/* .brand__mark is ink-colored by default (base.css) — flip it to paper on
   the office's dark bar, and let a bare .chip's border follow its own
   (already paper) text instead of the invisible ink default. */
.office-topbar .brand__mark { color: var(--clae-paper); }
.office-topbar .chip { border-color: currentColor; }
/* .chip--muted's stone text (base.css) is 3.84:1 on night — under the 4.5:1
   floor now that stone is the darker, bone-legible tone. Found auditing
   this file for task 11; not one of the four .chip--lime call sites the
   task named, but the same on-dark-muted-text fix applies here. */
.office-topbar .chip--muted { color: rgb(var(--clae-paper-rgb) / 0.62); }
/* The generic rule above (border-color: currentColor) would otherwise pull
   .chip--sand's border back to ink — nearly invisible against night — so
   the "Demo build" chip needs its own, more specific override to keep the
   sand border the class name promises. */
.office-topbar .chip--sand { border-color: var(--clae-sand); }

.office-nav {
  display: flex;
  gap: var(--clae-gap-md);
  overflow-x: auto;
  scrollbar-width: none;
}
.office-nav::-webkit-scrollbar { display: none; }
.office-nav a {
  white-space: nowrap;
  padding-block: 4px;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.office-nav a.is-active { border-bottom-color: var(--clae-paper); }

.office-topbar__end {
  display: flex;
  align-items: center;
  gap: var(--clae-gap-sm);
  margin-left: auto;
  flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   4. Stat tiles — a four-up row above the customer list
   ----------------------------------------------------------------------- */

.office-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--clae-gap-md);
}

/* -----------------------------------------------------------------------
   5. Search
   ----------------------------------------------------------------------- */

.office-search {
  display: flex;
  gap: var(--clae-gap-sm);
  max-width: 480px;
}
.office-search input { flex: 1 1 auto; }
.office-search { flex-wrap: wrap; max-width: 900px; }
.office-search input { min-width: 180px; }
.office-search select { flex: 0 1 210px; }

/* -----------------------------------------------------------------------
   6. Tables — dense, hairline rules, sticky header, horizontal scroll
   ----------------------------------------------------------------------- */

.office-table-wrap {
  overflow-x: auto;
}

.office-table {
  font-size: 13px;
}
.office-table th,
.office-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--clae-sand);
  vertical-align: middle;
}
.office-table thead th {
  position: sticky;
  top: 0;
  background: var(--clae-paper);
  z-index: 1;
}
.office-table tbody tr:hover { background: var(--clae-sand); }

.office-cell--right { text-align: right; }

/* A whole row links to the record it describes. Cell padding moves onto
   the link so its own content is the click target, edge to edge for that
   content's own lines. */
.office-table td:has(> .office-row-link) { padding: 0; }
.office-row-link {
  display: block;
  padding: 8px 10px;
  color: inherit;
  text-decoration: none;
}

/* -----------------------------------------------------------------------
   7. Customer page — contacts list, findings, timeline
   ----------------------------------------------------------------------- */

.office-contact-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.office-findings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--clae-gap-md);
}
.office-finding {
  border: 1px solid var(--clae-sand);
  border-radius: var(--clae-radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.office-finding__photo img {
  border-radius: var(--clae-radius-sm);
  width: 100%;
  max-height: 140px;
  object-fit: cover;
}

.office-materials {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.office-materials li { margin-bottom: 4px; }

/* -----------------------------------------------------------------------
   8. Visit page — vertical timeline
   ----------------------------------------------------------------------- */

.office-timeline {
  margin: 0;
  padding-left: 20px;
  border-left: 2px solid var(--clae-sand);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.office-timeline__item {
  position: relative;
  color: var(--clae-stone);
}
.office-timeline__item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clae-sand);
  border: 2px solid var(--clae-paper);
}
.office-timeline__item.is-done { color: var(--clae-ink); }
.office-timeline__item.is-done::before { background: var(--clae-teal); }
.office-timeline__label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clae-stone);
}
.office-timeline__value { font-weight: 500; }

/* -----------------------------------------------------------------------
   9. Schedule — technician chip row, per-day blocks
   ----------------------------------------------------------------------- */

.office-tech-row {
  display: flex;
  gap: var(--clae-gap-sm);
  flex-wrap: wrap;
}
/* Technician colors are seeded pastels — text stays ink regardless of
   which color lands, and the border matches the fill so the chip reads
   as one solid tone rather than an outlined pill. */
.office-tech-chip { color: var(--clae-ink); }

.office-day {
  border-bottom: 1px solid var(--clae-sand);
  padding-bottom: var(--clae-gap-md);
}
.office-day:last-child { border-bottom: 0; }
.office-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--clae-gap-sm);
  margin-bottom: var(--clae-gap-sm);
}
.office-day__head h3 { margin: 0; }
.office-day__empty { margin: 0; }

/* -----------------------------------------------------------------------
   10. Actions — the three buttons that move a visit through its day
   ----------------------------------------------------------------------- */

.office-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

/* The "Completed" disclosure renders as a solid pill trigger (the one
   primary action on this page) rather than the default bordered box + "+"
   marker — it opens a small form, not a document section. Was a lime fill
   behind text; found auditing this file for task 11 — rule 3 forbids that
   on a light ground (this sits on the plain office page, not a night
   surface), so it takes the same olive/cta treatment as .btn--primary. */
.office-complete {
  border: 0;
  padding: 0;
  border-radius: var(--clae-radius-pill);
}
.office-complete .disclose__head {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--clae-radius-pill);
  background: var(--clae-cta);
  color: var(--clae-cta-fg);
  font: 500 13px / 1 var(--clae-font-sans);
  white-space: nowrap;
}
.office-complete .disclose__head::after { content: none; }
.office-complete[open] .disclose__head { border-radius: var(--clae-radius-pill) var(--clae-radius-pill) 0 0; }
.office-complete .disclose__body {
  margin-top: 0;
  padding: var(--clae-gap-sm);
  border: 1px solid var(--clae-sand);
  border-radius: 0 var(--clae-radius-sm) var(--clae-radius-sm) var(--clae-radius-sm);
  min-width: 260px;
  background: var(--clae-paper);
}

/* -----------------------------------------------------------------------
   11. Responsive — nothing overflows the page body, tables scroll instead
   ----------------------------------------------------------------------- */

@media (max-width: 900px) {
  .office-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .office .grid--2 { grid-template-columns: 1fr; }
  .office-stats { grid-template-columns: 1fr; }
  .office-topbar__inner { padding-block: 10px; }
}

@media (max-width: 375px) {
  .office-search { max-width: 100%; }
}
