/* Venus Estates — hand-written stylesheet, no build step (no Tailwind, no
   bundler), no external font loads. The font rule is deliberate and worth
   keeping: this app handles PII and redacts it carefully everywhere else, so
   it stays off third-party font CDNs too, and it keeps working on a site
   office's bad connection.

   Design idea: a land register, not a dashboard. A plot is a rectangle of
   ground with a number, a frontage and an owner, and the whole product is the
   act of moving one plot from "available" to "sold" without losing the paper
   trail. So the interface is built like a working register — a quiet
   warm-neutral canvas, hairline rules instead of floating cards, deep forest
   as the single accent, and every figure that is part of a *record* (plot no.,
   ₹ amount, reference no., OTP digits, area) set in tabular figures so
   columns of them line up the way they would in a ledger.

   The one flourish is the plot tile (see `.plot-card`): a 3px status rule runs
   along its top edge like the frontage line on a layout plate. Across a grid
   of a hundred plots those rules form a single readable band of availability —
   which is the actual job of that page, so the flourish earns its place.

   Hard constraints this file honours (PRD §10.1, unchanged by the redesign):
   18px body / 20px labels, 1.6 body line-height, 48×48px minimum touch
   targets with 12px between controls, a 3px focus ring, and status always
   carried by colour *and* a text label. Every foreground colour below clears
   WCAG AA (4.5:1) against --surface, --canvas and --surface-2 alike.

   `templates/bookings/receipt.html` is untouched by this file: WeasyPrint
   never loads app.css, and that template carries its own print stylesheet
   matching the supplied Booking Form / Blocking Receipt PDFs. */

:root {
  /* ── Surfaces ─────────────────────────────────────────────────────
     Four steps, warm-neutral rather than stark white, so a section can
     recede without needing a border *and* a shadow to say so. */
  --canvas: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #efeee9;
  --surface-3: #e7e5de;

  /* ── Ink ──────────────────────────────────────────────────────────
     --ink-faint is for rules, disabled glyphs and decorative marks only.
     It does not clear AA as text and must never be used as one. */
  --ink: #1c1c1a;
  --ink-2: #575651;
  --ink-muted: #6f6d66;
  --ink-faint: #a4a29a;

  --line: #dedcd4;
  --line-strong: #c9c7bd;

  /* ── Accent — deep forest, used once per screen ───────────────────
     Reserved for the primary action, the current step, and record
     numbers. If it appears twice on a screen, one of them is wrong. */
  --accent: #2f4131;
  --accent-hover: #22301f;
  --accent-soft: rgba(47, 65, 49, 0.07);
  --accent-line: rgba(47, 65, 49, 0.22);
  --on-accent: #f7f7f3;

  /* ── Status — meaning, never decoration ───────────────────────────
     Three plot states and one warning tone. Reused by booking statuses
     so a HOLD_ACTIVE booking and a BLOCKED plot read as the same fact. */
  --status-available: #2f6b4b;
  --status-blocked: #8a5a17;
  --status-sold: #2e5578;
  --status-neutral: #605e57;
  --danger: #9d2f24;
  --danger-hover: #7d251d;

  --tint-available: rgba(47, 107, 75, 0.09);
  --tint-blocked: rgba(138, 90, 23, 0.10);
  --tint-sold: rgba(46, 85, 120, 0.09);
  --tint-neutral: rgba(111, 109, 102, 0.10);
  --tint-danger: rgba(157, 47, 36, 0.08);

  /* ── Spacing — a 4px base, so nothing lands off-grid ──────────────
     Named by use, not by number, past --space-2: it stops pages from
     inventing their own padding. */
  --space-0: 0.25rem;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;

  /* Restrained radii. A CRM row is not a pill. */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --touch-target: 48px;
  --control-height: 48px;

  /* One resting shadow and one lifted shadow. That is the whole set. */
  --shadow-xs: 0 1px 2px rgba(28, 28, 26, 0.05);
  --shadow-md: 0 8px 24px rgba(28, 28, 26, 0.10);

  --sidebar-width: 232px;
  --topbar-height: 56px;
  --content-width: 1180px;

  /* Inter and Source Sans 3 are what PRD §10.1 asks for; they are used only
     if the machine already has them, and the system UI face otherwise. No
     network request either way. */
  --font-ui: Inter, "Source Sans 3", system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --font-num: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas,
    "Liberation Mono", monospace;

  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 240ms;
  --ease: cubic-bezier(0.32, 0.08, 0.24, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* PRD §10.1: 18px body. Everything else in this file is expressed as a
   multiple of it, so raising this raises the whole product coherently. */
html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────────────
   One family, six sizes. Hierarchy comes from weight, colour and space,
   not from scale — a CRM heading that shouts steals room from the data
   underneath it. */

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.17rem;
  letter-spacing: -0.012em;
}

h3 {
  font-size: 1.05rem;
  letter-spacing: -0.008em;
}

p {
  margin: 0 0 var(--space-3);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--font-num);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}

/* PRD §10.1: 3px high-contrast ring, on everything, always visible. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ── Application shell ──────────────────────────────────────────────
   Sidebar + top bar, one grid, one scroll container. `.app--bare` is the
   signed-out case (sign-in is also the landing page — PRD §7.1). */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app--bare {
  grid-template-columns: minmax(0, 1fr);
}

.app__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* A staging booking that looks identical to a real one is a support incident,
   so this spans the full width above the shell and borrows the warning tone
   rather than the accent. */
.env-banner {
  margin: 0;
  padding: 0.3rem var(--space-3);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--surface);
  background: var(--status-blocked);
}

/* ── Sidebar ────────────────────────────────────────────────────────
   Navigation only. Identity lives in the top bar, so this column has one
   job and stays quiet: no coloured blocks, no gradients, no oversized
   icons — the active row is marked by a solid accent rule and a weight
   change, which is legible without shouting. */

/* Sticky and viewport-tall: a project can list two hundred plots, and on a
   12,000px page a sidebar that scrolls away is a sidebar you cannot use. */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  z-index: 10;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-3);
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-1);
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand__name {
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand__tagline {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar__group {
  margin: 0 0 var(--space-1);
  padding: 0 var(--space-1);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

.nav-item + .nav-item {
  margin-top: 2px;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item__icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--ink-muted);
  transition: color var(--duration-fast) var(--ease);
}

.nav-item:hover .nav-item__icon {
  color: var(--ink-2);
}

.nav-item--active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

/* A 2px rule in the gutter, not a filled block — enough to find at a
   glance, quiet enough to sit beside the content all day. */
.nav-item--active::before {
  content: "";
  position: absolute;
  left: calc(var(--space-3) * -1);
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 22px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.nav-item--active .nav-item__icon {
  color: var(--accent);
}

/* ── Top bar ────────────────────────────────────────────────────────
   Where you are on the left, who you are on the right. A hairline, not a
   shadow, separates it from the page. */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--topbar-height);
  padding: 0 var(--space-5);
  background: rgba(245, 244, 240, 0.92);
  backdrop-filter: saturate(1.4) blur(6px);
  border-bottom: 1px solid var(--line);
}

.topbar__end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

.breadcrumb a {
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb__sep {
  color: var(--ink-faint);
}

.breadcrumb__current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  line-height: 1.3;
  text-align: right;
  text-decoration: none;
}

.identity:hover .identity__name {
  text-decoration: underline;
}

.identity__name {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink);
}

.identity__role {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.topbar form {
  margin: 0;
}

/* ── Content column ─────────────────────────────────────────────────*/

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) var(--space-7);
}

.site-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.site-footer p {
  margin: 0;
}

/* ── Page header ────────────────────────────────────────────────────
   Eyebrow, title, one line of description, primary action on the right.
   Compact by design: the title is 28px, not a hero. */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.page-head__text {
  min-width: 0;
  flex: 1 1 22rem;
}

.page-head__sub {
  margin: 0.3rem 0 0;
  max-width: 62ch;
  font-size: 0.89rem;
  color: var(--ink-2);
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Small uppercase context label above a title. Names the record type the
   page is about — never a substitute for the heading itself. */
.text-eyebrow {
  display: block;
  margin: 0 0 var(--space-1);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── Sections ───────────────────────────────────────────────────────
   The default grouping device. A rule and a label, no box — used where a
   card would only be drawing a border around content that already reads
   as a group. */

.section {
  margin-bottom: var(--space-5);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.section__title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.section__note {
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

/* ── Cards ──────────────────────────────────────────────────────────
   Used where a boundary carries meaning: a form the manager is filling
   in, a record summary, a tile in a grid. Not as wallpaper. */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.card:last-child {
  margin-bottom: 0;
}

.card__title {
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  font-weight: 600;
}

/* The one card on the page that carries the primary work. A hairline top
   rule in the accent, not a heavy left bar and not a shadow. */
.card--accent {
  border-top: 2px solid var(--accent);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

/* ── Project rows ───────────────────────────────────────────────────
   A list, not a card grid: a project is one line of identity plus a
   destination, and a grid of boxes would make four fields look like ten. */

.record-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.record-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: inherit;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease);
}

.record-row + .record-row {
  border-top: 1px solid var(--line);
}

a.record-row:hover {
  background: var(--surface-2);
}

.record-row__text {
  min-width: 0;
}

.record-row__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--ink);
}

a.record-row:hover .record-row__title {
  color: var(--accent);
}

.record-row__meta {
  margin: 0.1rem 0 0;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

.record-row__code {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.record-row__go {
  margin-left: auto;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  transition: transform var(--duration-base) var(--ease),
    color var(--duration-base) var(--ease);
}

a.record-row:hover .record-row__go {
  transform: translateX(2px);
  color: var(--accent);
}

/* ── Status ─────────────────────────────────────────────────────────
   The label carries the colour, not just the mark beside it. A grey word
   with a small coloured dot asks the reader to decode a 7px square; the
   audience for this app is sales managers in their forties and up, so the
   word itself is the signal and the mark only reinforces it. Square, not a
   circle: a plot is a parcel of ground. PRD §10.1 forbids colour alone,
   which is why the text label is never optional. */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--status-neutral);
}

.status-chip::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

/* Plot states — PRD §4.3. */
.status-available { color: var(--status-available); }
.status-blocked { color: var(--status-blocked); }
.status-sold { color: var(--status-sold); }

/* Booking states — the lifecycle in `apps/bookings/models.py`. A hold and a
   blocked plot share the amber; a confirmed booking and a sold plot share the
   blue; terminal negatives go grey, because the plot is back on the market
   and nothing is pending. */
.status-draft,
.status-abandoned,
.status-expired,
.status-cancelled { color: var(--status-neutral); }
.status-otp_pending,
.status-hold_active { color: var(--status-blocked); }
.status-confirmed { color: var(--status-sold); }

/* The tinted variant, for the one place a status is the headline rather
   than a cell in a column. */
.status-chip--solid {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  background: var(--tint-neutral);
}

.status-chip--solid.status-available { background: var(--tint-available); }
.status-chip--solid.status-blocked,
.status-chip--solid.status-otp_pending,
.status-chip--solid.status-hold_active { background: var(--tint-blocked); }
.status-chip--solid.status-sold,
.status-chip--solid.status-confirmed { background: var(--tint-sold); }

/* ── Numbers ────────────────────────────────────────────────────────
   Anything that is part of a record gets tabular figures, so a column of
   amounts or plot numbers aligns digit for digit. */

.num,
.plot-number,
.amount-primary,
.amount-hero__value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.amount-primary {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.amount-hero {
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.amount-hero__label {
  margin: 0 0 0.2rem;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.amount-hero__value {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
}

/* ── Filter bar ─────────────────────────────────────────────────────
   Server-rendered GET form (PRD §5.6, AC15) — it has to look like a
   toolbar while still being a plain form. Sits on the secondary surface
   so it reads as a control strip, not as content. */

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.filter-toolbar .field {
  margin-bottom: 0;
  flex: 1 1 9rem;
  min-width: 8rem;
  max-width: 16rem;
}

.filter-toolbar label {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 0.3rem;
}

/* background-color, not the `background` shorthand: the shorthand would reset
   the drawn chevron on `select` back to none. */
.filter-toolbar input,
.filter-toolbar select {
  background-color: var(--surface);
}

/* PRD §10.1: 12px minimum between controls. */
.filter-toolbar__actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

/* ── Plot grid — the signature ──────────────────────────────────────
   Each tile is a parcel on a layout plate: a status rule along the top
   edge like a frontage line, the plot number in tabular figures as the
   loudest thing in the tile, and its metadata on one quiet line beneath.
   Read down a column of tiles and the top rules alone tell you what is
   left to sell. */

.plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-3);
}

.plot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: var(--space-3);
  border-radius: var(--radius);
  transition: border-color var(--duration-base) var(--ease),
    box-shadow var(--duration-base) var(--ease);
}

.plot-card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--status-neutral);
}

.plot-card--available::before { background: var(--status-available); }
.plot-card--blocked::before { background: var(--status-blocked); }
.plot-card--sold::before { background: var(--status-sold); }

/* Only the unavailable tiles are tinted. A manager scanning a wall of two
   hundred plots is looking for what they can still sell, so "available" stays
   clean white and the rest wash back — tinting the majority would just make
   the grid loud without making it faster to read. */
.plot-card--blocked { background: var(--tint-blocked); }
.plot-card--sold { background: var(--tint-sold); }

.plot-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.plot-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-0);
}

.plot-card .plot-number {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--ink);
}

.plot-card__meta {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: var(--space-1) 0 0;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

.plot-card__meta .num {
  color: var(--ink-2);
  font-weight: 500;
}

.plot-card__sep {
  color: var(--ink-faint);
}

/* Book / Block sit side by side on an available plot (PRD §6). gap is
   --space-2 (12px), the PRD §10.1 minimum between adjacent controls. */
.plot-card__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.plot-card__actions .button {
  flex: 1 1 6rem;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

/* ── Forms ──────────────────────────────────────────────────────────
   PRD §10.1: 20px labels against an 18px body — 1.11rem is what lands on
   20px at the 18px root. Sentence case, never shouting caps: on a wizard
   step the field labels *are* the content. */

label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1.11rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

input, select, textarea, button {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs) inset;
  transition: border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

/* The native arrow is inconsistent across platforms and looks bolted on
   next to a hairline border, so a single chevron is drawn in instead. */
select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f6d66' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5l4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 15px 15px;
}

input:hover, select:hover, textarea:hover {
  border-color: var(--ink-faint);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Keyboard users still get the ring; it just sits on the border instead
   of outside it, so a focused field does not jump the layout. */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

/* A verification code is a record to be read back over the phone, not a
   sentence to be typed. Styled apart from every other input for that. */
.auth-shell input[inputmode="numeric"] {
  font-family: var(--font-num);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.45em;
  text-align: center;
  padding-right: 0.45em;
}

.field {
  margin-bottom: var(--space-3);
}

/* background-color, not the shorthand — the shorthand would drop the drawn
   chevron off an invalid <select>. */
.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  border-color: var(--danger);
  background-color: var(--tint-danger);
}

.field--invalid input:focus,
.field--invalid select:focus,
.field--invalid textarea:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--tint-danger);
}

.field__required {
  margin-left: 0.15em;
  color: var(--danger);
  font-weight: 500;
}

/* PRD §10.1: errors inline, below the field, in plain language. */
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--danger);
}

.field-error::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 0.22em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.5h1.5v5h-1.5zM7.25 10.75h1.5v1.5h-1.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.help-text {
  margin: 0.3rem 0 0;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 736px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ── Buttons ────────────────────────────────────────────────────────
   Four weights and nothing else. Corner radius is small on purpose: a
   pill reads as marketing, a 4px corner reads as a control. */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

button:hover,
.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

button:active,
.button:active {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button:disabled,
button[disabled] {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--ink-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* One clear primary per screen; everything beside it recedes to a plain
   surface with a hairline. */
.button-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.button-secondary:hover {
  background: var(--surface-2);
  border-color: var(--ink-faint);
  color: var(--ink);
}

.button-ghost {
  min-height: 2.1rem;
  min-width: 0;
  padding: 0.25rem 0.6rem;
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: none;
}

.button-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--ink);
}

/* Cancel & refund — the one destructive action a sales manager can take,
   so it is outlined rather than filled: visible, never inviting. */
.button-danger {
  background: var(--surface);
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: var(--shadow-xs);
}

.button-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--surface);
}

/* For deliberately inert actions — a gate not yet satisfied, a feature
   flagged off. Distinct from :disabled because these are anchors. */
.button-disabled,
.button-disabled:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--ink-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.button--sm {
  min-height: 2.2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.83rem;
}

.button__icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

/* The action bar that closes a form or a page. The rule above it is what
   separates "reading" from "committing". */
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.form-actions__spacer {
  margin-left: auto;
}

.form-actions form {
  margin: 0;
}

/* ── Tables ─────────────────────────────────────────────────────────
   Two shapes, one look. `.detail-table` is key/value — one record read
   top to bottom. `.data-table` is a real column grid — many records read
   left to right. */

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  vertical-align: top;
}

/* Key/value. The label column stays narrow, small and quiet so the value —
   usually the record — carries the weight. */
.detail-table th,
.detail-table td {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
  border-bottom: none;
}

.detail-table th {
  /* A fixed label column, not a percentage: at 38% of a 1000px card the
     values started 400px from the label they belong to. */
  width: 13rem;
  padding-right: var(--space-3);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-muted);
  /* The label sits on the same baseline as a one-line value. */
  padding-top: 0.72rem;
}

.detail-table td {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
}

/* Data grid. No card wrapper, no vertical rules, no zebra — alignment and
   one hairline per row is enough, and it keeps 8 columns readable. */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow-x: auto;
}

.data-table {
  min-width: 44rem;
}

.data-table th {
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  /* Tighter than body copy: a cell is a value, not a paragraph, and 1.6
     leading on a two-line cell pushes every row to 80px. */
  line-height: 1.4;
  color: var(--ink-2);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background var(--duration-fast) var(--ease);
}

.data-table tbody tr:hover {
  background: var(--canvas);
}

/* The identifier column: what the eye lands on first when scanning. */
.data-table .cell-id {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.data-table .cell-id a {
  text-decoration: none;
}

.data-table .cell-id a:hover {
  text-decoration: underline;
}

.data-table .cell-strong {
  font-weight: 500;
  color: var(--ink);
}

.data-table .cell-num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  color: var(--ink);
}

.data-table th.cell-num {
  text-align: right;
}

.data-table .cell-meta {
  white-space: nowrap;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Wizard steps ───────────────────────────────────────────────────
   PRD §10.1 wants progress always visible. A numbered rail: a hairline
   connects the nodes and never changes colour, because the nodes already
   carry the state and doubling the signal only adds noise. */

.wizard-steps {
  display: flex;
  list-style: none;
  gap: 0;
  margin: 0 0 var(--space-5);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.wizard-steps__item {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}

.wizard-steps__item:not(:last-child)::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: var(--space-2);
  margin: 0 var(--space-2);
  background: var(--line);
}

/* Both states render the same box; only colour and weight differ, so the
   rail does not reflow as the manager moves between steps. */
a.wizard-steps__step,
span.wizard-steps__step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch-target);
  min-width: 0;
  padding: 0 0.2rem;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.wizard-steps__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-muted);
  font-family: var(--font-num);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background var(--duration-base) var(--ease),
    border-color var(--duration-base) var(--ease),
    color var(--duration-base) var(--ease);
}

.wizard-steps__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

a.wizard-steps__step:hover {
  color: var(--accent);
}

a.wizard-steps__step:hover .wizard-steps__dot {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.wizard-steps__step--done {
  color: var(--ink-2);
}

.wizard-steps__step--done .wizard-steps__dot {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.wizard-steps__step--current {
  color: var(--ink);
  font-weight: 600;
}

.wizard-steps__step--current .wizard-steps__dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* Below 46rem five labels cannot share a row without cramming, so the rail
   drops to nodes only. The label text stays in the accessibility tree — it
   just stops taking up visual space. */
@media (max-width: 736px) {
  a.wizard-steps__step,
  span.wizard-steps__step {
    padding: 0;
    gap: 0;
  }

  .wizard-steps__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .wizard-steps__item:not(:last-child)::after {
    margin: 0 0.4rem;
  }
}

/* ── Result panels — success and failure ────────────────────────────
   A confirmed booking is the end of a transaction that took twenty
   minutes and a customer's Aadhaar. It gets a panel, not a toast. The
   failure panel is the same shape in a different tone: unmistakable,
   never a full red screen. */

.result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--status-available);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-lg) var(--radius-lg);
}

.result--error {
  border-top-color: var(--danger);
}

.result--warning {
  border-top-color: var(--status-blocked);
}

.result__mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--tint-available);
  color: var(--status-available);
}

.result--error .result__mark {
  background: var(--tint-danger);
  color: var(--danger);
}

.result--warning .result__mark {
  background: var(--tint-blocked);
  color: var(--status-blocked);
}

.result__mark svg {
  width: 1.5rem;
  height: 1.5rem;
}

.result__body {
  min-width: 0;
  align-self: center;
}

.result__title {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.result__message {
  margin: 0.35rem 0 0;
  max-width: 58ch;
  font-size: 0.94rem;
  color: var(--ink-2);
}

/* The record the action produced — the reference number a manager will be
   asked for on the phone tomorrow. */
.result__facts {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  margin: var(--space-2) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.result__fact dt {
  margin: 0 0 0.15rem;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.result__fact dd {
  margin: 0;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.result__fact dd.is-text {
  font-family: var(--font-ui);
  font-weight: 500;
}

.result__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

@media (max-width: 640px) {
  .result {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-4);
  }

  .result__facts,
  .result__actions {
    grid-column: 1;
  }
}

/* The confirmation mark draws itself once — the single piece of motion in
   the product that is there for feeling rather than feedback, at the one
   moment that earns it. Inert under prefers-reduced-motion. */
.success-check {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.success-check__circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.success-check__mark {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
  .success-check__circle {
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: draw-stroke var(--duration-slow) var(--ease) forwards;
  }

  .success-check__mark {
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
    animation: draw-stroke 240ms var(--ease) 320ms forwards;
  }
}

@keyframes draw-stroke {
  to { stroke-dashoffset: 0; }
}

/* ── Messages & notices ─────────────────────────────────────────────
   Django's message framework lands here. A left rule carries the tone; the
   text carries the meaning. */

.messages {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
}

.message {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
}

.message:last-child { margin-bottom: 0; }
.message--success { border-left-color: var(--status-available); }
.message--warning { border-left-color: var(--status-blocked); }
.message--error { border-left-color: var(--danger); }

/* An explanation, not an error: something is incomplete but the page still
   works. Deliberately distinct from the danger tones. */
.notice {
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-faint);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  color: var(--ink-2);
}

.notice--warning {
  border-left-color: var(--status-blocked);
  background: var(--tint-blocked);
  color: var(--ink);
}

.notice--success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left-color: var(--status-available);
  background: var(--tint-available);
  color: var(--status-available);
  font-weight: 600;
}

.notice--success span {
  font-size: 1.1em;
  line-height: 1;
}

/* Upload progress. This is a live region *and* a visible one: a manager on a
   site office connection needs to see that a 4 MB Aadhaar scan is moving, not
   only hear it announced. Everything else with role="status" stays silent
   below. */
.upload-status {
  display: flex;
  align-items: center;
  margin: var(--space-2) 0 0;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* Live-region announcements outside the visible message list exist for
   assistive tech only and stay visually silent. */
[role="status"]:not(.env-banner):not(.messages):not(.notice):not(.result):not(.upload-status) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Empty states ───────────────────────────────────────────────────
   An empty screen is an invitation to act, so it names the reason and
   offers the one action that already exists — never an invented one. */

.empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.empty__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.empty__message {
  margin: 0.4rem auto 0;
  max-width: 44ch;
  font-size: 0.94rem;
  color: var(--ink-muted);
}

.empty__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ── Terms ──────────────────────────────────────────────────────────
   The four clauses printed on the Blocking Receipt. Set as a document
   excerpt, because that is what it is — the customer signs this. */

.terms {
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.terms ol {
  margin: 0;
  padding-left: 1.2rem;
  counter-reset: term;
  list-style: none;
}

.terms li {
  position: relative;
  margin-bottom: var(--space-2);
  font-size: 0.94rem;
  color: var(--ink-2);
}

.terms li::before {
  counter-increment: term;
  content: counter(term) ".";
  position: absolute;
  left: -1.2rem;
  font-family: var(--font-num);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.terms li:last-child { margin-bottom: 0; }

.terms strong {
  color: var(--ink);
}

/* ── Sign-in / OTP column ───────────────────────────────────────────
   Sign-in is also the landing page (PRD §7.1) — there is no public
   marketing site — so it gets a centred, self-contained column. */

.auth-shell {
  width: 100%;
  max-width: 25rem;
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-7);
}

.auth-shell .card {
  padding: var(--space-5);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  text-decoration: none;
}

.auth-shell h1 {
  text-align: center;
}

.auth-shell .text-eyebrow {
  text-align: center;
}

.auth-intro {
  margin: 0.4rem 0 var(--space-4);
  text-align: center;
  font-size: 0.89rem;
  color: var(--ink-2);
}

.auth-shell button[type="submit"] {
  width: 100%;
  margin-top: var(--space-1);
}

.auth-footnote {
  margin: var(--space-4) 0 0;
  text-align: center;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

/* ── Utility ────────────────────────────────────────────────────────*/

.text-muted {
  color: var(--ink-muted);
}

.stack > * + * {
  margin-top: var(--space-3);
}

.spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.5em;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -0.1em;
}

@media (prefers-reduced-motion: no-preference) {
  .spinner {
    animation: spin 800ms linear infinite;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────────────
   Not a shrunk desktop: below 60rem the sidebar becomes a horizontal rail
   under the top bar, which is a shape a thumb can actually use. Still no
   JavaScript — the whole shell is CSS. */

@media (max-width: 960px) {
  .app,
  .app--bare {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar__nav {
    flex-direction: row;
    align-items: center;
    gap: var(--space-1);
    margin-left: auto;
  }

  /* Group headings are a vertical-list device; in a rail they would just
     be noise between the links. */
  .sidebar__group {
    display: none;
  }

  .nav-item {
    min-height: 2.5rem;
    white-space: nowrap;
  }

  .nav-item + .nav-item {
    margin-top: 0;
  }

  .nav-item--active::before {
    left: 0;
    right: 0;
    top: auto;
    bottom: -1px;
    width: auto;
    height: 2px;
    transform: none;
    border-radius: 2px 2px 0 0;
  }

  /* Only in the rail — the sign-in page has no sidebar and keeps its
     full mark. */
  .sidebar .brand__tagline {
    display: none;
  }

  .topbar {
    padding: 0 var(--space-3);
  }

  .content {
    padding: var(--space-4) var(--space-3) var(--space-6);
  }

  .site-footer {
    padding: var(--space-4) var(--space-3);
  }
}

@media (max-width: 640px) {
  /* On a phone the rail has to hold every destination without sideways
     scrolling, so the wordmark drops to the mark alone. PRD §10.1 also
     requires the layout to survive 200% zoom without horizontal scroll,
     which is the same constraint arriving from the other direction. */
  .sidebar .brand__text {
    display: none;
  }

  /* Four destinations at a readable size do not fit one 375px row beside the
     mark, and a rail that scrolls sideways hides whatever is off the end. So
     the nav takes a row of its own and the items share it equally. Shrinking
     the labels instead would trade a real problem for a worse one — this is a
     product used all day by people who do not want to squint. */
  .sidebar {
    flex-wrap: wrap;
  }

  .sidebar__nav {
    flex: 1 0 100%;
    margin-left: 0;
    gap: var(--space-0);
  }

  .sidebar__nav > div {
    flex: 1 1 0;
    min-width: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 0 var(--space-1);
  }

  /* The label is the thing that has to survive; the icon is reinforcement. */
  .nav-item__icon {
    display: none;
  }

  .sidebar {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }

  .identity__name {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-head {
    align-items: flex-start;
  }

  .page-head__actions {
    width: 100%;
  }

  .page-head__actions .button {
    flex: 1 1 auto;
  }

  .filter-toolbar .field {
    flex: 1 1 100%;
    max-width: none;
  }

  .filter-toolbar__actions {
    width: 100%;
    margin-left: 0;
  }

  .filter-toolbar__actions .button {
    flex: 1 1 auto;
  }

  .form-actions .button,
  .form-actions button,
  .result__actions .button {
    flex: 1 1 auto;
  }

  /* A key/value table on a phone is two stacked lines, not two squeezed
     columns — 38% of a 360px screen cannot hold "Transaction / reference no." */
  .detail-table th,
  .detail-table td {
    display: block;
    width: auto;
    padding: 0;
  }

  .detail-table th {
    padding-top: var(--space-2);
    border-bottom: none;
  }

  .detail-table td {
    padding: 0.15rem 0 var(--space-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print ──────────────────────────────────────────────────────────
   The receipt PDF has its own stylesheet; this is for a manager who hits
   Ctrl-P on a review or detail screen. Drop the shell, keep the record. */

@media print {
  .sidebar,
  .topbar,
  .site-footer,
  .env-banner,
  .form-actions,
  .filter-toolbar,
  .wizard-steps {
    display: none !important;
  }

  .app {
    display: block;
  }

  body {
    background: #fff;
  }

  .card,
  .table-wrap {
    border-color: #ccc;
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ── Dashboard ──────────────────────────────────────────────────────
   The signed-in overview. Deliberately not a wall of KPI cards: four
   counts along the top, then the one time-critical list, then the audit
   trail, with inventory alongside. Every figure is counted from data the
   app already holds. */

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.metric {
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.metric__label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.89rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* The mark only — the word beside it is the real label, so the chip
   contributes its coloured square and nothing else. */
.metric__label .status-chip {
  gap: 0;
}

.metric__value {
  margin: var(--space-1) 0 0;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.metric__note {
  margin: var(--space-0) 0 0;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

/* The one number on this page that is a deadline rather than a fact. */
.metric__note--urgent {
  color: var(--status-blocked);
  font-weight: 600;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 0.75fr);
  gap: var(--space-5);
  align-items: start;
}

.dash-grid__main > .section:last-child,
.dash-grid__side > .section:last-child {
  margin-bottom: 0;
}

.data-table--compact {
  min-width: 34rem;
}

/* ── Activity trail ─────────────────────────────────────────────────
   A read of `BookingStatusHistory`, one row per transition. Time on the
   left in a fixed column so the rows scan as a timeline. */

.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.activity__row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.activity__row + .activity__row {
  border-top: 1px solid var(--line);
}

.activity__time {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 0.83rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.activity__headline {
  display: block;
  font-size: 0.94rem;
  color: var(--ink);
}

.activity__headline .status-chip {
  vertical-align: baseline;
}

.activity__meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.83rem;
  color: var(--ink-muted);
}

/* ── Inventory rail ─────────────────────────────────────────────────
   One row per active project: name, total, a proportional bar, and the
   three counts spelled out. The bar is the fast read; the counts are what
   make it true without relying on colour (PRD §10.1). */

.inv-row {
  display: block;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.inv-row + .inv-row {
  margin-top: var(--space-2);
}

.inv-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.inv-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.inv-row__name {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.inv-row:hover .inv-row__name {
  color: var(--accent);
}

.inv-row__total {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.inv-bar {
  display: flex;
  height: 8px;
  margin: var(--space-2) 0;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-3);
}

.inv-bar__seg {
  display: block;
  flex-basis: 0;
  min-width: 0;
}

.inv-bar__seg--available { background: var(--status-available); }
.inv-bar__seg--blocked { background: var(--status-blocked); }
.inv-bar__seg--sold { background: var(--status-sold); }

.inv-row__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem var(--space-3);
}

.inv-row__counts .status-chip {
  font-size: 0.8rem;
}

/* A dashboard panel that happens to be empty is not a dead end worth a
   dashed box the size of a screen. */
.empty--quiet {
  padding: var(--space-4);
  text-align: left;
  border-style: solid;
  border-color: var(--line);
}

.empty--quiet .empty__message {
  margin-left: 0;
}

@media (max-width: 960px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
}

@media (max-width: 640px) {
  .metric-row {
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: var(--space-2);
  }

  .metric {
    padding: var(--space-3);
  }

  .metric__value {
    font-size: 1.7rem;
  }

  .activity__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-0);
  }
}
