/* ==========================================================================
   Design Tokens

   Brand colors are measured from thelongdogco.com (the visual source of
   truth for this app), not invented. Semantic status colors are the one
   deliberate, minimal extension beyond the 5 brand colors -- needed so
   booking/payment states are distinguishable without relying on color
   alone (each is always paired with a text label). They're built as a
   light tint + saturated text pairing, echoing the one badge this app
   already had (.warning-badge) before this pass, so the new set feels
   like a natural extension of something that already existed rather than
   a bolted-on palette.
   ========================================================================== */

:root {
  /* Brand */
  --color-garnet: #741012;
  --color-garnet-dark: #5c0d0f; /* hover/active state, derived from --color-garnet */
  --color-ink: #101820;
  --color-tan: #ceb888;
  --color-parchment: #f5efe3;
  --color-white: #ffffff;

  /* Neutrals -- warm-leaning (not cold blue-grays) to stay cohesive with
     the brand palette above. Used for borders, secondary text, surfaces. */
  --color-border: #e3ddd2;
  --color-border-strong: #d3c9b8;
  --color-text: var(--color-ink);
  --color-text-secondary: #5c5650;
  --color-surface: var(--color-white);
  --color-surface-alt: var(--color-parchment);

  /* Semantic status -- light tint background + saturated text + subtle
     border, each combination independently contrast-checked at 4.5:1+. */
  --color-success-bg: #eef4ef;
  --color-success-text: #2f5d3f;
  --color-success-border: #b9d3c0;

  --color-warning-bg: #faf3e2;
  --color-warning-text: #8a6a2a;
  --color-warning-border: #e3cd94;

  --color-danger-bg: #fbeceb;
  --color-danger-text: #b3261e;
  --color-danger-border: #edc0bc;
  --color-danger-dark: #8f1e18; /* hover/active state for .button-danger, derived from --color-danger-text the same way --color-garnet-dark is derived from --color-garnet */

  --color-neutral-bg: #eef1f3;
  --color-neutral-text: #3a4a55;
  --color-neutral-border: #c7d0d6;

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.375rem;   /* 22px */
  --text-2xl: 1.75rem;   /* 28px */
  --text-3xl: 2.25rem;   /* 36px */

  /* Spacing (8px base scale) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* Radius -- pill for buttons (matches the live site exactly); a modest
     radius for admin surfaces (cards/inputs/tables), deliberately smaller
     than the site's photo-frame 22px, since this is a dense operational
     UI, not a marketing page. */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;

  /* Shadow -- used sparingly by design (see design philosophy: hierarchy
     through whitespace and typography, not decoration). One elevation
     level is enough for this app. */
  --shadow-sm: 0 1px 2px rgba(16, 24, 32, 0.08);
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface-alt);
  margin: 0;
  line-height: 1.5;
}

a { color: var(--color-garnet); }

/* Visible keyboard focus everywhere -- the live site (a marketing page)
   doesn't need this the way an application does. Applied universally
   rather than per-component so nothing interactive is ever missed. */
:focus-visible {
  outline: 2px solid var(--color-garnet);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-weight: 600;
  margin-top: 0;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

legend { font-weight: 600; padding: 0 var(--space-2); font-family: var(--font-body); }

label { display: block; margin-top: var(--space-3); font-weight: 500; }

.help-text { font-size: var(--text-sm); color: var(--color-text-secondary); margin: var(--space-1) 0 0; }

/* ==========================================================================
   Layout
   ========================================================================== */

.site-header {
  background: var(--color-garnet);
  padding: var(--space-4) var(--space-8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  text-decoration: none;
}

.brand-icon { height: 28px; width: auto; display: block; }

.container {
  max-width: 900px;
  margin: var(--space-8) auto;
  padding: 0 var(--space-6);
}

/* Admin shell: wider than the public .container above -- admin screens
   (tables, multi-section dashboards) benefit from the extra width;
   deliberately denser than the public site's spacious feel (Session 10
   density decision). */
.container-admin {
  max-width: 1200px;
  margin: var(--space-6) auto;
  padding: 0 var(--space-6);
}

/* Narrower admin variant for single-record, read-top-to-bottom pages
   (booking detail/edit) -- the wide container is right for tables and
   multi-section dashboards, but forces uncomfortably long line lengths
   on a single-column form or detail view. A page opts in by overriding
   the `main_class` block with this class instead of the default above. */
.container-admin-narrow {
  max-width: 760px;
  margin: var(--space-6) auto;
  padding: 0 var(--space-6);
}

/* Pre-auth login page -- a small centered card rather than the wide/narrow
   admin containers above (there's no shell/nav yet at this point). */
.container-login {
  max-width: 420px;
  margin: var(--space-16) auto;
  padding: 0 var(--space-6);
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
}

.login-card h1 {
  text-align: center;
  font-size: var(--text-2xl);
}

.admin-topbar {
  background: var(--color-garnet);
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.admin-brand-icon { height: 28px; width: auto; display: block; }

.admin-brand-wordmark {
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.admin-nav ul {
  display: flex;
  align-items: center;
  /* Session 15: without this, .admin-nav's own flex-wrap doesn't help --
     this inner flex row still forces all links onto one line, overflowing
     the viewport on mobile now that there are six primary nav items. */
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* touch-target minimum */
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  text-decoration: none;
  padding: var(--space-2);
  border-bottom: 2px solid transparent;
}

.admin-nav a:hover { color: var(--color-white); }

.admin-nav a.is-active {
  color: var(--color-white);
  border-bottom-color: var(--color-tan);
  font-weight: 600;
}

.admin-nav-secondary a { color: rgba(255, 255, 255, 0.65); }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.filter-bar form { display: flex; align-items: center; gap: var(--space-2); }

.filter-bar label { margin-top: 0; }

.filter-bar select { width: auto; margin-top: 0; }

.table-scroll { overflow-x: auto; }

/* ==========================================================================
   Components
   ========================================================================== */

fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-6);
  /* Browsers apply an implicit `min-width: min-content` to <fieldset> --
     without overriding it, a fieldset containing a wide table refuses to
     shrink to the page width, which then defeats .table-scroll's own
     overflow-x:auto containment (the fieldset stretches instead of the
     table scrolling). Found on the Capacity page's dated-overrides table
     at mobile widths. */
  min-width: 0;
}

input, select, textarea {
  width: 100%;
  padding: var(--space-2);
  margin-top: var(--space-1);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
  margin-top: var(--space-3);
}

.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }

.button, .button-small, input[type="submit"] {
  display: inline-block;
  background: var(--color-garnet);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  margin-top: var(--space-4);
  text-decoration: none;
  text-align: center;
}

.button:hover, .button-small:hover, input[type="submit"]:hover { background: var(--color-garnet-dark); }

.button-small { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); margin-top: var(--space-2); }

/* Danger button modifier (Session 16) -- a color override only, meant to
   be combined with .button/.button-small for sizing (e.g. class="button-
   small button-danger"), not a standalone size. Reserved for genuinely
   destructive, hard-to-reverse actions (void an invoice, cancel/decline a
   booking, delete a capacity override) -- never applied to Archive
   (explicitly reversible via Restore) or any other confirm-guarded action
   that isn't actually destructive, so this stays a meaningful signal
   rather than every confirm() dialog turning red.

   The input[type="submit"].button-danger variants below are required, not
   redundant -- WTForms' SubmitField renders <input type="submit">, and
   the base rule above targets that element+attribute combination, which
   out-specifies a bare .button-danger class selector. Without the
   compound selector here, a SubmitField-rendered danger button (e.g.
   Decline) would silently stay garnet instead of red. */
.button-danger,
input[type="submit"].button-danger {
  background: var(--color-danger-text);
}

.button-danger:hover,
input[type="submit"].button-danger:hover {
  background: var(--color-danger-dark);
}

.error { color: var(--color-danger-text); font-size: var(--text-sm); margin: var(--space-1) 0 0; }

/* Session 19.5 -- Permanent Delete's own fieldset. Deliberately the
   danger palette, not the tan accent Session 19's "Returning customer?"
   prompt uses -- that one just needed to stand out; this one needs to
   read as genuinely different from every other, reversible action on the
   page, since it's the only one with no undo at all. */
.fieldset-danger-zone {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
}

.fieldset-danger-zone legend { color: var(--color-danger-text); }

/* Session 9B.5 -- for a state that's merely informative (e.g. "capacity
   hasn't been configured yet"), not an actual problem with this booking.
   Same light-tint + border language as .status-badge's neutral variant,
   deliberately NOT .error's alarm-red -- an expected, unconfigured-by-
   default state shouldn't read as something broken. */
.notice {
  background: var(--color-neutral-bg);
  color: var(--color-neutral-text);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  margin: var(--space-1) 0 0;
}

.notice a { color: inherit; text-decoration: underline; }

/* Session 19 -- the "Returning customer?" prompt at the top of the "you"
   step. Deliberately not the danger/warning palette (nothing is wrong) --
   a soft wash of the brand's own tan accent (--color-tan, already used in
   the logo and the welcome screen's trust-indicator icons) plus a left
   accent bar is enough to make it read as "look here first" without
   competing with the actual form fields below it. */
#returning-customer-lookup {
  background: #f8f4ed; /* --color-tan at ~15% over --color-surface, precomputed */
  border-color: var(--color-tan);
  border-left: 4px solid var(--color-tan);
}

#returning-customer-lookup legend {
  color: var(--color-garnet);
}

/* Session 19 -- the returning-customer "Welcome back" banner, inserted by
   wireCustomerLookup only on a successful match; reuses .notice rather
   than introducing a new tint. */
.returning-customer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.returning-customer-banner .banner-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  padding: 0 var(--space-1);
}

/* Flash messages (Session 16: category-colored, reusing the same
   success/warning/danger/neutral vocabulary as status_badge/stat_tile
   above rather than a single blanket "warning" look for every message
   regardless of whether it's a success or a failure). Coloring lives on
   each <li>, not the <ul>, since more than one flash can be queued at
   once and each needs its own category's color. */
.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.flashes li {
  padding: var(--space-3) var(--space-4);
  border: 1px solid;
  border-radius: var(--radius-md);
}

.flashes li.flash-success { background: var(--color-success-bg); color: var(--color-success-text); border-color: var(--color-success-border); }
.flashes li.flash-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: var(--color-warning-border); }
.flashes li.flash-danger { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: var(--color-danger-border); }
/* Flask's own default category ("message") when a call site specifies
   none -- treated the same as an explicit "neutral" tag, never left
   unstyled. */
.flashes li.flash-neutral, .flashes li.flash-message { background: var(--color-neutral-bg); color: var(--color-neutral-text); border-color: var(--color-neutral-border); }

table.bookings {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-4);
  background: var(--color-surface);
}

table.bookings th, table.bookings td {
  border: 1px solid var(--color-border);
  padding: var(--space-3);
  text-align: left;
  vertical-align: top;
  font-size: var(--text-sm);
}

table.bookings th { background: var(--color-surface-alt); font-family: var(--font-body); }

table.bookings form { display: flex; gap: var(--space-2); align-items: center; }

.dog-entry {
  position: relative;
  background: var(--color-surface);
  margin-bottom: var(--space-4);
}

.dog-entry .remove-dog {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  margin-top: 0;
}

.dog-detail {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}

.dog-detail:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* Semantically <h2> (Session 10 accessibility fix -- a dog's name inside
   the Dogs card is the second heading level on this page, after the
   page's own <h1>; it was previously an <h3>, silently skipping a level).
   Kept visually compact -- this is a small in-card label, not a major
   section heading -- so the font-size is overridden down from h2's
   default rather than inheriting it. */
.dog-detail .dog-name { margin-bottom: var(--space-1); font-size: var(--text-xl); }

/* Status/warning badges -- light tint + saturated text + subtle border,
   always rendered alongside a text label (never color alone). The
   warning-badge variant below is the pattern every other status color
   in the design system (see Design Tokens above) follows. */
.warning-badge {
  display: inline-block;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-left: var(--space-2);
}

/* Booking-status badge (Session 10) -- see _admin_macros.html::status_badge
   for the status-to-variant mapping. Same light-tint pattern as
   .warning-badge above, just parameterized by variant. */
.status-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-badge--success { background: var(--color-success-bg); color: var(--color-success-text); border-color: var(--color-success-border); }
.status-badge--warning { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: var(--color-warning-border); }
.status-badge--danger { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: var(--color-danger-border); }
.status-badge--neutral { background: var(--color-neutral-bg); color: var(--color-neutral-text); border-color: var(--color-neutral-border); }

/* Shared page-title(+actions) row -- see _admin_macros.html::page_header.
   Replaces the old ad hoc .admin-header title+links markup on every page. */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.admin-page-header h1 { margin-bottom: 0; }

.admin-page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.agreement-text {
  max-height: 200px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  margin-bottom: var(--space-3);
}

pre.agreement-text { font-family: inherit; }

.sort-links a { color: var(--color-garnet); }

.sort-links a.active { font-weight: 700; text-decoration: none; }

.inline-form { display: inline-block; margin-right: var(--space-3); }

.decline-details { display: inline-block; vertical-align: top; }

.decline-details summary {
  display: inline-block;
  background: var(--color-surface);
  color: var(--color-garnet);
  border: 1px solid var(--color-garnet);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
  list-style: none;
}

.decline-details summary::-webkit-details-marker { display: none; }

.decline-details form {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-width: 400px;
}

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

.booking-notes li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.booking-notes li:last-child { border-bottom: none; }

.booking-notes p { margin: var(--space-1) 0 0; }

/* ==========================================================================
   Booking Wizard (Sprint 1 UI/UX Redesign)

   The public booking form stays a single Flask-WTF form validated in one
   POST -- there is no server-side multi-step submission. Everything below
   is a purely visual/client-side layer on top of that one form: the
   fieldsets in _booking_fields.html each carry a data-step attribute, and
   booking_form.html's script just toggles which group is visible via
   [data-active-step] on .wizard-fields. Every field stays enabled at
   every step so the one real submit still carries all of it -- unlike the
   existing per-dog add/remove pattern, a hidden wizard step is never
   disabled.

   _booking_fields.html is imported by BOTH the public booking form and
   admin_booking_edit.html, so its data-step attributes reach the admin
   page's markup too. Every rule that reacts to [data-step] is therefore
   scoped under the .booking-wizard ancestor class below, which only the
   public template ever adds -- on the admin page these attributes are
   inert and every fieldset renders exactly as before.
   ========================================================================== */

.welcome-screen {
  max-width: 560px;
  margin: var(--space-8) auto;
  text-align: center;
  transition: opacity 0.2s ease;
}

.welcome-screen.is-leaving { opacity: 0; }

.booking-wizard { transition: opacity 0.3s ease; }

.booking-wizard.is-entering { opacity: 0; }

/* Full brand logo (Sprint 1.2) -- the source image already carries its own
   circular mark, so it renders directly with no wrapping badge/background.
   width:100% + max-width (rather than a fixed height) keeps the original
   aspect ratio intact at every breakpoint below. */
.welcome-logo {
  max-width: 260px;
  margin: 0 auto var(--space-4);
}

.welcome-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.welcome-screen h1 { margin-bottom: var(--space-3); }

.welcome-subtext {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
  max-width: 440px;
  margin: 0 auto var(--space-8);
}

.trust-indicators {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: 0 0 var(--space-8);
}

.trust-indicators li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.trust-indicators .check {
  color: var(--color-success-text);
  font-weight: 700;
  flex-shrink: 0;
}

.welcome-screen .button {
  font-size: var(--text-lg);
  padding: var(--space-3) var(--space-8);
}

.container-booking {
  max-width: 1100px;
  margin: var(--space-8) auto;
  padding: 0 var(--space-6);
}

.booking-wizard .wizard-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: var(--space-8);
  align-items: start;
}

.booking-wizard .wizard-main { min-width: 0; }

.booking-wizard .wizard-progress {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-8);
  gap: var(--space-2);
}

.booking-wizard .wizard-progress li {
  flex: 1;
  text-align: center;
  border-bottom: 3px solid var(--color-border);
  padding-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.booking-wizard .wizard-progress li.is-static { color: var(--color-border-strong); }

.booking-wizard .wizard-progress-step {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.booking-wizard .wizard-progress li.is-active {
  border-bottom-color: var(--color-garnet);
  color: var(--color-ink);
  font-weight: 600;
}

.booking-wizard .wizard-progress li.is-complete {
  border-bottom-color: var(--color-tan);
  color: var(--color-text);
}

.booking-wizard .wizard-fields { display: flex; flex-direction: column; }

/* Session 19 -- #booking-fields (the returning-customer-lookup fragment
   swap target, wrapping everything _booking_fields.html's
   booking_details_fields() macro renders: Your info, Stay, Transportation,
   Emergency Contact, How-heard, Dogs, Anything else) sits *between*
   .wizard-fields and those fieldsets in the DOM. display:contents removes
   its own box from layout without changing the DOM tree, which is exactly
   what promotes its children back into being true flex items of
   .wizard-fields -- required for the order rules below to have any effect
   on them at all (order is a flex-item-only property; setting it on a
   grandchild that never participates in the flex layout does nothing).
   The [data-step]/fieldet[data-step] selectors below were also widened
   from a direct-child (>) combinator to a plain descendant one so they
   still match at this one-level-deeper nesting; nothing else in
   _booking_fields.html carries a [data-step] attribute at any depth, so
   the broader selector doesn't accidentally sweep up anything new. */
#booking-fields { display: contents; }

.booking-wizard .wizard-fields [data-step] { display: none; }

.booking-wizard .wizard-fields[data-active-step="you"] [data-step="you"],
.booking-wizard .wizard-fields[data-active-step="dog"] [data-step="dog"],
.booking-wizard .wizard-fields[data-active-step="stay"] [data-step="stay"],
.booking-wizard .wizard-fields[data-active-step="review"] [data-step="review"] {
  display: block;
}

.booking-wizard .wizard-step-heading[data-step="you"] { order: 10; }
.booking-wizard .wizard-fields fieldset[data-step="you"] { order: 11; }
.booking-wizard .wizard-nav[data-step="you"] { order: 12; }

.booking-wizard .wizard-step-heading[data-step="dog"] { order: 20; }
.booking-wizard .wizard-fields fieldset[data-step="dog"] { order: 21; }
.booking-wizard .wizard-nav[data-step="dog"] { order: 22; }

.booking-wizard .wizard-step-heading[data-step="stay"] { order: 30; }
.booking-wizard .wizard-fields fieldset[data-step="stay"] { order: 31; }
.booking-wizard .wizard-nav[data-step="stay"] { order: 32; }

.booking-wizard .wizard-step-heading[data-step="review"] { order: 40; }
.booking-wizard .wizard-fields fieldset[data-step="review"] { order: 41; }
.booking-wizard .wizard-nav[data-step="review"] { order: 42; }

.booking-wizard .wizard-step-heading { margin-bottom: var(--space-2); }
.booking-wizard .wizard-step-heading h2 { margin-bottom: 0; }

/* "How did you hear about us?" is optional and asked in passing -- it
   shouldn't compete with real required sections like Your Info or
   Emergency Contact, so it drops the card border/background and gets a
   quieter, smaller legend instead of the standard fieldset treatment. */
.booking-wizard .fieldset-optional {
  border: none;
  padding: 0;
  margin-bottom: var(--space-6);
}

.booking-wizard .fieldset-optional legend {
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: 0;
}

.booking-wizard .wizard-fields[data-active-step="you"] > .wizard-nav[data-step="you"],
.booking-wizard .wizard-fields[data-active-step="dog"] > .wizard-nav[data-step="dog"],
.booking-wizard .wizard-fields[data-active-step="stay"] > .wizard-nav[data-step="stay"],
.booking-wizard .wizard-fields[data-active-step="review"] > .wizard-nav[data-step="review"] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.booking-wizard .wizard-nav .wizard-next { margin-left: auto; }

/* Pricing breakdown (Session 9B) -- a plain read-only line-item list, used
   both by the customer estimate (inside .booking-wizard's Review step) and
   the admin booking-detail page's stored-snapshot display. Unscoped
   (unlike the [data-step]-attribute rules above, which genuinely do leak
   through the shared _booking_fields.html macro into admin_booking_edit.html)
   -- .pricing-line and friends are unique class names never used anywhere
   else, so there's no equivalent leakage risk to guard against here. */
.pricing-line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

.pricing-line--divider {
  border-top: 1px solid var(--color-border);
  margin: var(--space-2) 0;
  padding: 0;
}

.pricing-line--total,
.pricing-line--deposit,
.pricing-line--balance {
  font-weight: 600;
  font-size: var(--text-base);
}

.pricing-line--deposit { color: var(--color-garnet); }
.pricing-line--balance { color: var(--color-ink); }

/* Session 9B.5 -- groups related pricing-line rows together (Boarding +
   Long Stay Discount; the three "Additional Services" surcharges) with a
   little breathing room between groups, rather than one undifferentiated
   flat list -- see the session brief's "group related information" goal. */
.pricing-group { margin-bottom: var(--space-3); }
.pricing-group:last-of-type { margin-bottom: 0; }

.pricing-group-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-1);
}

/* Indented + quieter than a top-level pricing-line, signaling "this is a
   line item within Additional Services," not its own peer category. */
.pricing-line--sub {
  padding-left: var(--space-4);
  color: var(--color-text-secondary);
}

.pricing-adjustments-heading {
  font-size: var(--text-base);
  margin: var(--space-6) 0 var(--space-3);
}

.pricing-adjustments {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Each adjustment reads as a small receipt line item -- a card, not a
   bare list row -- so "what changed, why, who, when" is scannable at a
   glance rather than run together in one paragraph. */
.pricing-adjustment {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.pricing-adjustment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* Reuses the same light-tint + saturated-text + border language as
   .status-badge -- a discount is a "good news" signal (success green), an
   additional charge is a "heads up" signal (warning amber), matching how
   every other status color in this app is never color alone (paired with
   a text label either way). */
.pricing-adjustment-type {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid transparent;
}

.pricing-adjustment-type--discount { background: var(--color-success-bg); color: var(--color-success-text); border-color: var(--color-success-border); }
.pricing-adjustment-type--charge { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: var(--color-warning-border); }

.pricing-adjustment-amount { font-size: var(--text-lg); font-weight: 600; }

.pricing-adjustment-reason { margin: var(--space-2) 0 0; }

.pricing-adjustment-meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: var(--space-1) 0 0;
}

.pricing-adjustment-note {
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-text-secondary);
  margin: var(--space-2) 0 0;
}

.pricing-adjustment .inline-form { margin: var(--space-2) 0 0; }

.booking-wizard .wizard-info-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.booking-wizard .wizard-info-panel h2 {
  font-size: var(--text-lg);
  text-align: center;
  margin-bottom: var(--space-3);
}

/* Short centered accent rule beneath the heading -- a quiet boutique-hotel
   touch rather than a full-width divider, which would compete with the
   one separating the Questions line below.

   margin-inline: auto (rather than folding centering into the shorthand
   "margin: 0 auto ..." above) is deliberately explicit and robust here --
   this rule previously referenced a --space-5 token that doesn't exist in
   this project's scale (only --space-1/2/3/4/6/8/12/16 are defined), which
   silently invalidated the whole margin shorthand and dropped the auto
   centering entirely, leaving the divider flush left. Splitting inline vs.
   block margins means a typo in one can never again take out the other. */
.booking-wizard .wizard-info-divider {
  width: 40px;
  height: 2px;
  background: var(--color-tan);
  border: none;
  margin-inline: auto;
  margin-block: 0 var(--space-4);
}

.booking-wizard .wizard-info-panel ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: var(--text-sm);
  text-align: left;
}

.booking-wizard .wizard-info-panel li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.booking-wizard .wizard-info-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-tan);
  margin-top: 2px;
}

.booking-wizard .wizard-info-icon svg { width: 18px; height: 18px; display: block; }

.booking-wizard .wizard-info-contact {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}

/* ==========================================================================
   Success Screen (Sprint 1 UI/UX Redesign)
   ========================================================================== */

.success-screen { max-width: 640px; margin: 0 auto; }

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.success-subtext { color: var(--color-text-secondary); }

.summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}

.summary-card h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); }

.next-steps {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}

.next-steps ol { margin: 0; padding-left: var(--space-6); }
.next-steps li { margin-bottom: var(--space-3); }
.next-steps li:last-child { margin-bottom: 0; }

.success-closing { font-size: var(--text-lg); font-family: var(--font-display); }

/* ==========================================================================
   Operations Center (Session 11)

   Band A (Action Strip) / Band B (calendar + rail) / Band C (situational)
   -- see the Session 11 plan for the tier rationale. Nothing here
   introduces a new color -- every tile/cell state reuses the existing
   semantic success/warning/danger/neutral tokens the status badges already
   established, so the whole admin keeps one color language.
   ========================================================================== */

/* Band A -- six compact tiles. auto-fit lets the row reflow to fewer
   columns as the viewport narrows without a dedicated breakpoint of its
   own (the 900px/640px breakpoints below are for the calendar+rail and
   Band C, which need more deliberate reflow decisions). */
.ops-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

/* The Calendar Sync card's three tiles live inside the narrow rail column,
   not the full-width Band A strip -- a smaller minmax and tighter spacing
   keep them from overflowing/wrapping awkwardly at that width. */
.ops-stat-strip--compact {
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.ops-stat-strip--compact .stat-tile { padding: var(--space-2); }
.ops-stat-strip--compact .stat-tile-value { font-size: var(--text-xl); }

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-decoration: none;
  color: inherit;
}

a.stat-tile:hover { border-color: var(--color-border-strong); }

.stat-tile-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-ink);
}

.stat-tile-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.stat-tile--warning { border-color: var(--color-warning-border); background: var(--color-warning-bg); }
.stat-tile--warning .stat-tile-value { color: var(--color-warning-text); }

.stat-tile--danger { border-color: var(--color-danger-border); background: var(--color-danger-bg); }
.stat-tile--danger .stat-tile-value { color: var(--color-danger-text); }

.stat-tile--success { border-color: var(--color-success-border); background: var(--color-success-bg); }
.stat-tile--success .stat-tile-value { color: var(--color-success-text); }

/* Band B -- calendar (dominant, ~2fr) + rail (~1fr). */
.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  align-items: start;
}

/* Session 11 review follow-up: tightened from space-6 -- the rail's own
   card borders already separate each section visually, so the extra 8px
   the wider gap added was spacing without a legibility purpose. */
.ops-layout-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ops-rail-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  /* Tightened vertical padding (space-4 -> space-3) -- same follow-up as
     the rail gap above; horizontal padding is unchanged since it affects
     line length/readability, not just density. */
  padding: var(--space-3) var(--space-6);
}

.ops-rail-section h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.ops-rail-section h3 { font-size: var(--text-base); margin-bottom: var(--space-1); }
.ops-rail-section ul { margin: 0 0 var(--space-3); padding-left: var(--space-4); }
.ops-rail-section ul:last-child { margin-bottom: 0; }

.ops-rail-capacity-line { color: var(--color-text-secondary); font-size: var(--text-sm); margin: 0 0 var(--space-3); }

/* The Selected Day panel's "no day selected" state (Session 11 review
   follow-up) -- quiet, not an error, sized to occupy roughly the same
   vertical space a populated panel would so the rail doesn't visibly jump
   when a selection is cleared by navigating to a different month. */
.ops-empty-state { color: var(--color-text-secondary); font-size: var(--text-base); margin: var(--space-4) 0 0; }
.ops-empty-state-detail { color: var(--color-text-secondary); font-size: var(--text-sm); margin: var(--space-1) 0 var(--space-4); }

/* Calendar -- a server-rendered month grid, not a JS library (see the
   Session 11 design decision: this is a nightly-occupancy heat map, not a
   generic events calendar, and every cell here is a plain link). */
.ops-calendar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.ops-calendar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-1);
}

.ops-calendar-month-label { flex: 1; text-align: center; font-size: var(--text-xl); margin: 0; }

.ops-calendar-nav-link, .ops-calendar-today-link {
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ops-calendar-caption {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-4);
}

.ops-calendar-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }

.ops-calendar-grid th {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 600;
  padding: var(--space-2);
  text-align: center;
}

.ops-calendar-cell {
  border: 1px solid var(--color-border);
  padding: var(--space-2);
  vertical-align: top;
  height: 84px;
}

/* Three mutually exclusive occupancy states (Session 11 review follow-up)
   -- empty (no rule needed, the cell's plain default), quietly occupied,
   and over capacity. `occupied`/`over_capacity` are already mutually
   exclusive at the data layer (see CalendarDay's docstring), so these two
   rules never actually compete for the same cell -- but source order still
   matters against .is-out-of-month below, which must always win for a
   leading/trailing-month cell regardless of its occupancy. */
.ops-calendar-cell.is-occupied { background: var(--color-neutral-bg); }

.ops-calendar-cell.is-over-capacity { background: var(--color-danger-bg); }
.ops-calendar-cell.is-over-capacity .ops-calendar-occupancy { color: var(--color-danger-text); font-weight: 600; }

.ops-calendar-cell.is-out-of-month { background: var(--color-surface-alt); }
.ops-calendar-cell.is-out-of-month .ops-calendar-date { color: var(--color-text-secondary); }

/* Selection state is an outline (never color alone) so it stays visible
   even on an already-tinted over-capacity cell. */
.ops-calendar-cell.is-selected { outline: 2px solid var(--color-garnet); outline-offset: -2px; }

.ops-calendar-cell-link { display: block; height: 100%; color: inherit; text-decoration: none; }

.ops-calendar-date { display: inline-block; font-weight: 600; font-size: var(--text-sm); }

.ops-calendar-cell.is-today .ops-calendar-date {
  background: var(--color-garnet);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-2);
}

.ops-calendar-occupancy {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.ops-calendar-flow {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.ops-calendar-arrivals { margin-right: var(--space-2); }

/* Band C -- deliberately quieter than Band A: smaller type, no tile
   borders, so it doesn't compete with the "do I need to act" strip above
   the fold. */
.ops-band-c { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: var(--space-6); }

.ops-band-c-financial { display: flex; gap: var(--space-6); }

.ops-mini-stat { display: flex; flex-direction: column; gap: var(--space-1); }

.ops-mini-stat-value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }

.ops-mini-stat-label { font-size: var(--text-xs); color: var(--color-text-secondary); }

.ops-band-c-upcoming h2 { font-size: var(--text-base); }

.ops-band-c-subheading { font-weight: 600; margin: var(--space-3) 0 var(--space-1); font-size: var(--text-sm); }

/* ==========================================================================
   Utilities
   ========================================================================== */

/* Screen-reader-only content -- visually hidden but still announced,
   unlike display:none. Used for the calendar's <caption> (Session 11),
   where a visible <p> already gives sighted users the same context. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link (Session 16) -- hidden the same way as
   .visually-hidden until it receives keyboard focus, then it must become
   visible (a skip link a sighted keyboard user can't see is useless), so
   this can't just reuse that class as-is. First focusable element in
   every page (see base.html) -- lets keyboard/screen-reader users bypass
   the full admin nav rather than tabbing through all six items every
   single page load. */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  width: auto;
  height: auto;
  padding: var(--space-2) var(--space-4);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--color-garnet);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  z-index: 100;
}

/* ==========================================================================
   Responsive

   Verified per-page during migration (Session 10), not deferred to a
   single end-of-implementation pass -- each rule below is tied to a
   specific issue actually observed on a specific page.
   ========================================================================== */

/* Booking list filter bar: the status-select + search-input + button row
   doesn't have room to stay on one line on a phone-width viewport. Stack
   it into full-width rows instead of letting the search input get
   squeezed illegibly thin. */
@media (max-width: 640px) {
  .filter-bar form {
    flex-wrap: wrap;
  }

  .filter-bar select,
  .filter-bar input[type="search"] {
    width: 100%;
  }

  .filter-bar form > label {
    margin-top: var(--space-2);
  }
}

/* Operations Center (Session 11) -- tablet: the rail needs the width more
   than it needs to sit beside the calendar, so it drops below rather than
   shrinking in place. */
@media (max-width: 900px) {
  .ops-layout { grid-template-columns: 1fr; }
  .ops-band-c { grid-template-columns: 1fr; }
}

/* Operations Center (Session 11) -- phone: the calendar becomes a compact
   occupancy heat map (date + occupancy figure only). Arrival/departure
   flow indicators and the caption are dropped at this width rather than
   shrunk further -- illegible text is worse than absent text, and the
   same information is always one tap away via the Selected Day panel. */
@media (max-width: 640px) {
  .ops-calendar { padding: var(--space-3) var(--space-3) var(--space-4); }
  .ops-calendar-cell { height: 52px; padding: var(--space-1); }
  .ops-calendar-flow { display: none; }
  .ops-calendar-caption { display: none; }
  .ops-calendar-occupancy { font-size: var(--text-xs); }
  .ops-calendar-nav { flex-wrap: wrap; justify-content: center; }
  .ops-calendar-month-label { order: -1; flex-basis: 100%; }

  .ops-stat-strip { grid-template-columns: repeat(2, 1fr); }

  .ops-band-c-financial { flex-direction: column; gap: var(--space-3); }
}

/* Booking Wizard (Sprint 1 UI/UX Redesign) -- the info panel needs the
   width more than it needs to sit beside the form, same reasoning as the
   Operations Center rail above; it collapses beneath the form rather than
   shrinking in place. */
@media (max-width: 900px) {
  .booking-wizard .wizard-layout { grid-template-columns: 1fr; }
  .welcome-logo { max-width: 200px; }
}

@media (max-width: 640px) {
  .welcome-screen { margin: var(--space-8) auto; }
  .welcome-logo { max-width: 160px; }
  .booking-wizard .wizard-progress { font-size: var(--text-xs); }
  .booking-wizard .wizard-progress li { padding-bottom: var(--space-1); }
  .booking-wizard .wizard-nav { flex-wrap: wrap; }
}
