/* Walking-skeleton styling — plain CSS, mobile-first for the field app. Intentionally minimal;
   the real design system lands with the surfaces in later phases. */

:root {
  --green: #1f6f43;
  --green-dark: #155035;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --amber: #b45309;
  --red: #b91c1c;
}

* { box-sizing: border-box; }

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

.wrap { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 4rem; }

.topnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 1rem;
  background: var(--green); color: #fff;
}
.topnav .brand { color: #fff; font-weight: 700; text-decoration: none; }
.topnav .links { display: flex; align-items: center; gap: 0.75rem; }
.topnav a { color: #e7f5ee; text-decoration: none; font-size: 0.95rem; }
.topnav a:hover { color: #fff; }

/* A button that reads as a link. The default is for a light surface — cards and tables, where
   most of them live. It used to be the nav's pale mint, which left the portal's Skip button
   near-invisible on a white card; the nav now carries its own colour instead of setting the
   default for everyone. */
.linkish {
  background: none; border: none; color: var(--green-dark); cursor: pointer;
  font-size: 0.95rem; padding: 0; font-family: inherit;
}
.linkish:hover { color: var(--green); }

.topnav .linkish { color: #e7f5ee; }
.topnav .linkish:hover { color: #fff; }

h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.muted { color: var(--muted); }

.flash { padding: 0.6rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.95rem; }
.flash.notice { background: #dcfce7; color: var(--green-dark); }
.flash.alert  { background: #fee2e2; color: var(--red); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem; margin-bottom: 0.75rem;
}
.card .addr { color: var(--muted); font-size: 0.9rem; }
.card .meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.35rem; }

.pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.pill.scheduled { background: #e2e8f0; color: #334155; }
.pill.completed { background: #dcfce7; color: var(--green-dark); }
.pill.skipped   { background: #fef3c7; color: var(--amber); }
.pill.unable    { background: #fee2e2; color: var(--red); }
/* Plan lifecycle (wf-2), which shares the pill but not the visit's vocabulary. */
.pill.active    { background: #dcfce7; color: var(--green-dark); }
.pill.paused    { background: #fef3c7; color: var(--amber); }
.pill.cancelled { background: #e2e8f0; color: #334155; }
/* Money owed on an abandoned signup Checkout (#17). Its own class rather than `unable`, which
   is a visit outcome — they share a red today and have no reason to move together. */
.pill.unpaid    { background: #fee2e2; color: var(--red); }

.card-head { display: flex; justify-content: space-between; align-items: baseline; }

/* A plan-level lever (pause / resume), set off from the plan's own details above it. */
.lever { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.lever summary { cursor: pointer; font-size: 0.9rem; color: var(--green-dark); font-weight: 600; }
.lever p { margin: 0.6rem 0; }
.lever form { margin-top: 0.85rem; }

.btn {
  display: inline-block; background: var(--green); color: #fff; border: none;
  padding: 0.75rem 1rem; border-radius: 10px; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--green-dark); }
.btn.wide { display: block; width: 100%; text-align: center; }
.btn.secondary { background: #fff; color: var(--green-dark); border: 1px solid var(--green); }
/* The exception ending (wf-8) — red because it closes the visit without servicing it. */
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #991b1b; }

/* The folded-away "couldn't service" flow: present on every open visit, never in the way of
   the button the tech actually taps. */
.exception summary { font-weight: 600; cursor: pointer; }
.exception[open] summary { margin-bottom: 0.85rem; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1rem 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.stat .n { font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; }

form .field { margin-bottom: 0.85rem; }
form label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
form input, form select {
  width: 100%; padding: 0.6rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit;
}
/* A form that is one lever rather than a page of data entry: a picker and the button that acts on
   what it holds. The stacked default above is right for entering a customer and wrong here, where
   two controls are a single action and a full-card-width select reads as an unfinished field.
   Wraps rather than overflowing once the line runs out. */
form.inline { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
/* Every control, not a list of the types that happened to be here. Naming `select` and `submit`
   individually meant the day-move's date picker (wf-8) fell through to the stacked default above,
   stretched the full card and pushed its own button onto the next line — a lever that looked
   unlike the identical one sitting right above it. */
form.inline input, form.inline select { width: auto; max-width: 100%; }

/* The SMS consent box (wf-9). Left to the rules above, `form input { width: 100% }` stretches a
   checkbox to the full card and `form label { display: block }` drops its text onto the next
   line — the same defect the day-move picker hit. A consent control that doesn't look like a
   checkbox is worse than ugly: the carrier reviewing the campaign is looking at this. */
.consent label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1rem; color: var(--ink); margin-bottom: 0.4rem;
}
.consent input[type="checkbox"] { width: auto; flex: none; margin: 0; }
.consent p { margin: 0 0 0.35rem; }

fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; }
legend { font-weight: 600; padding: 0 0.4rem; }

.errors { background: #fee2e2; color: var(--red); border-radius: 8px; padding: 0.75rem; margin-bottom: 1rem; }
.errors ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

.login { max-width: 360px; margin: 3rem auto; }
.row { display: flex; gap: 0.75rem; }
.row > * { flex: 1; }

form textarea {
  width: 100%; padding: 0.6rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit;
}
.small { font-size: 0.85rem; }

/* The public quote/signup funnel (wf-4). */
.publicnav { padding: 0.9rem 1rem; background: var(--green); }
.publicnav .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.wrap.narrow { max-width: 520px; }

.quote-price { text-align: center; padding: 1.5rem 1rem; }
.quote-price .headline { font-size: 2.4rem; font-weight: 700; margin: 0; line-height: 1.1; }
.quote-price .per { font-size: 1rem; font-weight: 500; color: var(--muted); }
.quote-price hr { border: none; border-top: 1px solid var(--line); margin: 1rem 0; }

/* Owner console tables (pricing, waitlist). */
.grid { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.grid th, .grid td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); }
.grid th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
/* Not `display: flex` — that drops the cell out of the table layout, so a tall row (a long
   failure reason) leaves the actions floating against the wrong baseline. */
.grid .actions { white-space: nowrap; vertical-align: middle; }
.grid .actions > * { display: inline-block; vertical-align: middle; margin-right: 0.75rem; }
.grid .actions > *:last-child { margin-right: 0; }
.grid .actions .linkish { color: var(--red); }
.grid .actions .linkish:hover { color: #7f1d1d; }
/* Non-destructive row action (retry a send) — red would read as "delete". */
.grid .actions .linkish.go { color: var(--green-dark); }
.grid .actions .linkish.go:hover { color: var(--green); }

/* The skip lever is a picker *and* a button, where every other row action on the console is one
   short word. Under `.actions`' nowrap that pair cannot break, so the table grows past the
   viewport and the button leaves the right edge — reachable only by scrolling the whole page
   sideways, which nobody does on a page that looks finished. Wrap instead: side by side when
   there is room, stacked when there is not. */
.grid .actions.skip { white-space: normal; }
.grid .actions.skip form { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; }
.grid .actions.skip > * { margin-right: 0; }
/* Undoing the stacked-form default (`form input, form select { width: 100% }`), which is right
   for a signup column and wrong in a table cell: at full width each control claims its own line
   even where both would fit, so the row is twice as tall as it needs to be on any screen. */
.grid .actions.skip select,
.grid .actions.skip input[type="submit"] { width: auto; max-width: 100%; }
