/* ============================================================
   Paws Academy design system
   Palette + typography from docs/claude-design. Define tokens
   once here; components reference the custom properties only.
   ============================================================ */

/* Figtree, self-hosted (no Google Fonts CDN at runtime).
   Drop figtree-variable.woff2 into wwwroot/fonts/ and uncomment. Until then the
   stack falls back to the platform UI font, which is visually close. */
/*
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/figtree-variable.woff2') format('woff2-variations');
}
*/

:root {
  --pa-primary: #5D2349;
  --pa-primary-dark: #4A1C3A;
  --pa-primary-tint: #F6E7EF;
  --pa-surface: #F8F0EA;
  --pa-bg: #EFE1D7;
  --pa-ink: #3A1730;
  --pa-muted: #8A6E7D;
  --pa-line: #E5D3C8;
  --pa-line-soft: #EFE0D6;
  --pa-accent: #E8720C;
  --pa-accent-ink: #9A4A08;
  --pa-accent-tint: #FDEBDC;
  --pa-accent-line: #F3C79E;
  --pa-track: #F3E4EC;
  --pa-success: #2E7D4F;
  --pa-on-primary: #ffffff;

  --pa-radius-input: 12px;
  --pa-radius-card: 16px;
  --pa-radius-shell: 32px;

  --pa-font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--pa-bg);
  font-family: var(--pa-font);
  color: var(--pa-ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pa-primary); }
a:hover { color: #7A3B63; }

::placeholder { color: #B79CA9; }

/* ---- App shell: mobile-first full-bleed; a centred phone card on desktop ----
   On device the shell is pinned to the *dynamic* viewport height (100dvh tracks Safari's
   collapsing toolbar) so the bottom nav always sits on the real bottom edge, and the body pane
   scrolls internally (min-height: 0 lets flex actually constrain it — without it, long screens
   grow the shell and push the nav below the fold). safe-area padding clears the Dynamic
   Island/notch in installed-PWA mode; env() is 0 everywhere else so desktop is unaffected. */
.pa-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;      /* fallback for iOS < 15.4 */
  height: 100dvh;
  background: var(--pa-surface);
  position: relative;
  padding-top: env(safe-area-inset-top);
}

.pa-shell__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Room for the fixed bottom nav so the last content scrolls clear of it (mobile only). */
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

body { overscroll-behavior-y: none; }

/* App-like touch behaviour: taps and pans only — no double-tap-to-zoom (also removes the 300ms
   tap delay). Pinch-zoom is additionally blocked by the viewport meta in installed-PWA mode. */
html { touch-action: manipulation; }

@media (min-width: 480px) {
  body { display: grid; place-items: center; padding: 24px; }
  .pa-shell {
    width: 390px;
    height: min(820px, calc(100dvh - 48px));
    min-height: 640px;
    border-radius: var(--pa-radius-shell);
    box-shadow: 0 24px 60px rgba(52, 21, 39, 0.28), 0 2px 8px rgba(52, 21, 39, 0.12);
    overflow: hidden;
  }
}

/* ---- Bottom navigation ----
   Fixed to the visual viewport bottom on device: an in-flow bar at the base of a 100dvh box can
   render adrift on iOS when the dynamic viewport lags (notably right after the login keyboard
   closes) until a scroll recalculates it — position: fixed re-anchors immediately and rides
   Safari's collapsing toolbar. The desktop phone-frame override below puts it back in-flow.
   Bottom padding: the home-indicator inset minus most of itself — icons sit just clear of the
   indicator instead of floating high above it; max() keeps a sane floor on devices with no inset. */
.pa-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  border-top: 1px solid var(--pa-line-soft);
  background: #fff;
  padding: 4px 6px max(4px, calc(env(safe-area-inset-bottom) - 18px));
}

.pa-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--pa-muted);
}

.pa-bottom-nav__item.active,
.pa-bottom-nav__item:hover { color: var(--pa-primary); }

.pa-bottom-nav__item:focus-visible {
  outline: 2px solid var(--pa-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

.pa-bottom-nav__item:disabled { opacity: 0.45; cursor: default; }

/* Desktop phone-frame: the nav goes back in-flow at the card's base (fixed would escape the frame). */
@media (min-width: 480px) {
  .pa-bottom-nav { position: static; }
  .pa-shell__body { padding-bottom: 0; }
}

/* Icon wrapper for nav tabs that carry an unread badge (Messages) */
.pa-bottom-nav__icon-wrap { position: relative; display: inline-flex; }
.pa-bottom-nav__badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--pa-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
/* Static variant for inline use outside a nav icon (e.g. staff inbox rows) */
.pa-bottom-nav__badge--static { position: static; }

/* ---- Auth screens (login / forgot password) ---- */
.pa-auth {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px;
}

.pa-auth__logo { width: 150px; margin: 0 auto 8px; mix-blend-mode: multiply; }
.pa-auth__title { margin: 0 0 6px; font-size: 26px; font-weight: 800; text-align: center; color: var(--pa-ink); }
.pa-auth__sub { margin: 0 0 28px; font-size: 15px; text-align: center; color: var(--pa-muted); }
.pa-auth__foot { margin: 26px 0 0; text-align: center; font-size: 12px; color: #B79CA9; }

.pa-auth .pa-input { margin-bottom: 14px; }
.pa-auth .pa-label { margin-top: 2px; }

.pa-forgot {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-align: right;
  margin: 0 0 20px;
}

.pa-auth .pa-btn { margin-top: 6px; }

/* ---- Content spacing ---- */
.pa-screen { padding: 24px 20px 20px; }
.pa-h1 { margin: 0; font-size: 23px; font-weight: 800; color: var(--pa-ink); }
.pa-sub { margin: 2px 0 0; font-size: 14px; color: var(--pa-muted); }

/* ---- Forms ---- */
.pa-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--pa-primary);
  margin: 0 0 6px;
}

.pa-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--pa-line);
  border-radius: var(--pa-radius-input);
  /* 16px minimum — anything smaller makes iOS Safari force-zoom the page when a field gains focus. */
  font-size: 16px;
  background: #fff;
  color: var(--pa-ink);
}

.pa-input:focus { outline: 2px solid var(--pa-primary); outline-offset: 0; }

/* ---- Buttons ---- */
.pa-btn {
  width: 100%;
  padding: 15px;
  border-radius: var(--pa-radius-input);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.pa-btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.pa-btn:disabled { opacity: 0.5; cursor: default; }

.pa-btn--primary { background: var(--pa-primary); color: var(--pa-on-primary); border: none; }
.pa-btn--primary:hover { background: var(--pa-primary-dark); }

.pa-btn--secondary {
  background: #fff;
  color: var(--pa-primary);
  border: 1.5px solid var(--pa-primary);
}
.pa-btn--secondary:hover { background: var(--pa-primary-tint); }

/* ---- Cards / surfaces ---- */
.pa-card {
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: var(--pa-radius-card);
  padding: 16px;
}

.pa-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pa-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}

.pa-error {
  color: #B3261E;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 14px;
}

/* ---- Section headings inside cards ("VACCINATIONS", "NOTES", …) ---- */
.pa-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pa-muted);
  letter-spacing: 0.5px;
}

/* ---- Status chips (vaccinations, invoices) ---- */
.pa-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pa-chip--success { background: #E3F0E7; color: var(--pa-success); }
.pa-chip--warning { background: var(--pa-accent-tint); color: var(--pa-accent-ink); }
.pa-chip--danger { background: #F9E0E2; color: #B0505E; }
.pa-chip--neutral { background: var(--pa-line-soft); color: var(--pa-muted); }

/* ---- Dog tabs (pill selector) on Dog profiles ---- */
.pa-dog-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

.pa-dog-tab {
  padding: 9px 16px;
  background: #fff;
  color: var(--pa-ink);
  border: 1.5px solid var(--pa-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pa-dog-tab--active { background: var(--pa-primary); color: var(--pa-on-primary); border-color: var(--pa-primary); }
.pa-dog-tab:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

.pa-dog-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.pa-avatar--lg { width: 72px; height: 72px; font-size: 24px; flex: none; }

.pa-vaccination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--pa-line-soft);
}
.pa-vaccination-row:last-child { border-bottom: none; }
.pa-vaccination-row__name { font-size: 14px; font-weight: 700; color: var(--pa-ink); }
.pa-vaccination-row__due { font-size: 12px; color: #B79CA9; }

.pa-dog-notes { margin: 0; font-size: 14px; line-height: 1.5; color: var(--pa-ink); }

/* ---- Staff: page heads, list rows, detail header ---- */
.pa-screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pa-screen-head .pa-h1 { margin-bottom: 0; }

.pa-btn--inline {
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.pa-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  color: inherit;
}
.pa-list-row:hover, .pa-list-row:focus-visible { border-color: var(--pa-primary); }
.pa-list-row:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.pa-list-row__body { flex: 1; min-width: 0; }
.pa-list-row__title { font-size: 14px; font-weight: 700; color: var(--pa-ink); }
.pa-list-row__sub { font-size: 12px; color: var(--pa-muted); margin-top: 1px; }
.pa-list-row__meta { font-size: 11px; color: #B79CA9; font-weight: 600; flex: none; }

.pa-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pa-detail-head__body { flex: 1; min-width: 0; }

.pa-back-btn {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  cursor: pointer;
  font-size: 16px;
  color: var(--pa-primary);
  display: grid;
  place-items: center;
  text-decoration: none;
}
.pa-back-btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

.pa-dog-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--pa-ink); }
.pa-dog-row > span:nth-child(2) { flex: 1; font-weight: 600; }
.pa-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pa-primary); flex: none; }

.pa-link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--pa-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pa-link-btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

.pa-inline-form { background: var(--pa-primary-tint); border-radius: 12px; padding: 14px; margin: 10px 0; }
.pa-inline-form .pa-input { margin-bottom: 10px; }
.pa-inline-form__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pa-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(58, 23, 48, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  /* Breathing room top and bottom — clears the Dynamic Island / home indicator on device so the
     close button is always reachable; sides stay tight. */
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
}
.pa-modal {
  width: 100%;
  max-width: 390px;
  max-height: 100%;
  background: var(--pa-surface);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(52, 21, 39, 0.35);
}
.pa-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--pa-primary-tint);
}
.pa-modal__close {
  border: none;
  background: var(--pa-primary-tint);
  color: var(--pa-primary);
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.pa-modal__close:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.pa-modal__body {
  flex: 1;
  min-height: 0; /* lets flex actually constrain it so long content scrolls inside the sheet */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}
.pa-modal__question { margin-bottom: 18px; }
.pa-modal__question .pa-label:first-child { margin-top: 0; }
.pa-modal__foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--pa-primary-tint);
  background: var(--pa-surface);
}

.pa-success-card { text-align: center; }
.pa-temp-password {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--pa-primary);
  background: var(--pa-primary-tint);
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0;
  word-break: break-all;
}

/* ---- Buttons rendered as <a> (link styled as a full-width button) ---- */
.pa-btn--link {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.pa-btn--danger-outline {
  background: transparent;
  color: #B0505E;
  border: 1.5px solid #E8C9CD;
}
.pa-btn--danger-outline:hover { background: #FBEEEF; }

/* ---- Training: bookings list, booking detail, book-training flow, staff schedule ---- */
.pa-list-row--muted { opacity: 0.75; }

.pa-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--pa-line-soft);
  font-size: 14px;
}
.pa-summary-row:first-child { border-top: none; }
.pa-summary-row > span:first-child { color: var(--pa-muted); }
.pa-summary-row > span:last-child { font-weight: 700; color: var(--pa-ink); text-align: right; }

/* Step progress (3-dot bar) on the booking flow */
.pa-progress-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.pa-progress-dot { flex: 1; height: 4px; border-radius: 2px; background: var(--pa-line); }
.pa-progress-dot--active { background: var(--pa-primary); }

/* Service picker cards (booking flow step 1) */
.pa-service-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--pa-line-soft);
  border-radius: 14px;
  padding: 15px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
}
.pa-service-card:hover { border-color: var(--pa-primary); }
.pa-service-card--active { background: var(--pa-primary-tint); border-color: var(--pa-primary); }
.pa-service-card:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.pa-service-card__head { display: flex; justify-content: space-between; align-items: baseline; }
.pa-service-card__name { font-size: 14px; font-weight: 700; color: var(--pa-ink); }
.pa-service-card__price { font-size: 14px; font-weight: 800; color: var(--pa-primary); }
.pa-service-card__meta { font-size: 13px; color: var(--pa-muted); margin-top: 3px; }

/* Time-slot grid (booking flow step 2) */
.pa-slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pa-slot-btn {
  padding: 10px 6px;
  background: #fff;
  color: var(--pa-ink);
  border: 1.5px solid var(--pa-line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pa-slot-btn:hover { border-color: var(--pa-primary); }
.pa-slot-btn--active { background: var(--pa-primary); color: var(--pa-on-primary); border-color: var(--pa-primary); }
.pa-slot-btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

.pa-when-banner {
  background: var(--pa-primary-tint);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pa-primary);
  margin-top: 12px;
}

/* "NEXT UP" card on the customer Home screen */
.pa-nextup { background: var(--pa-primary); border-radius: 18px; padding: 20px; color: #fff; margin-bottom: 16px; }
.pa-nextup__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.pa-nextup__title { margin: 12px 0 4px; font-size: 19px; font-weight: 800; }
.pa-nextup__meta { margin: 0 0 14px; font-size: 14px; color: #E4C9D8; }
.pa-nextup__btn {
  display: inline-block;
  padding: 10px 16px;
  background: #fff;
  color: var(--pa-primary);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.pa-nextup__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Staff "This week" schedule */
.pa-week-nav { display: flex; gap: 8px; margin-bottom: 16px; }
.pa-week-nav .pa-btn--inline { flex: 1; text-align: center; justify-content: center; }
.pa-schedule-item { margin-bottom: 10px; }
.pa-schedule-item__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pa-schedule-item__actions { display: flex; gap: 8px; margin-top: 12px; }
.pa-schedule-item__actions .pa-btn--inline { flex: 1; text-align: center; justify-content: center; }

/* ---- Boarding: date-range calendar (book-boarding flow) ---- */
.pa-cal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 8px; }
.pa-cal-nav { display: flex; align-items: center; gap: 8px; }
.pa-cal-nav__btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--pa-primary);
  display: grid;
  place-items: center;
  font-family: inherit;
}
.pa-cal-nav__btn:hover { border-color: var(--pa-primary); }
.pa-cal-nav__btn:disabled { opacity: 0.4; cursor: default; }
.pa-cal-nav__btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

.pa-calendar {
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: var(--pa-radius-card);
  padding: 14px 12px;
  margin-bottom: 8px;
}
.pa-calendar__weekdays,
.pa-calendar__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pa-calendar__weekdays { margin-bottom: 6px; }
.pa-calendar__weekday { text-align: center; font-size: 11px; font-weight: 700; color: #B79CA9; }

.pa-calendar__day {
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--pa-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pa-calendar__day:hover:not(:disabled) { background: var(--pa-primary-tint); }
.pa-calendar__day:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 1px; }
.pa-calendar__day:disabled { color: #B79CA9; cursor: default; }
.pa-calendar__day--full { text-decoration: line-through; }
.pa-calendar__day--empty { visibility: hidden; }
.pa-calendar__day--in-range { background: var(--pa-primary-tint); color: var(--pa-primary); }
.pa-calendar__day--selected { background: var(--pa-primary); color: var(--pa-on-primary); }
.pa-calendar__day--selected:hover { background: var(--pa-primary); }

/* ---- Bookings list: distinguishing icon bubble for training vs. boarding rows ---- */
.pa-list-row__icon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}
.pa-list-row__icon--training { background: var(--pa-primary-tint); color: var(--pa-primary); }
.pa-list-row__icon--boarding { background: var(--pa-accent-tint); color: var(--pa-accent-ink); }

/* ---- Client-detail Activity timeline: icon bubble per activity kind ---- */
.pa-list-row__icon--message { background: var(--pa-track); color: var(--pa-primary); }
.pa-list-row__icon--invoice { background: var(--pa-accent-tint); color: var(--pa-accent-ink); }
.pa-list-row__icon--paid { background: #E3F0E7; color: var(--pa-success); }
.pa-list-row__icon--report { background: var(--pa-primary-tint); color: var(--pa-primary); }
.pa-list-row__icon--neutral { background: var(--pa-line-soft); color: var(--pa-muted); }

/* "ACTIVE NOW" boarding card at the top of the customer Bookings list */
.pa-activenow { background: var(--pa-primary); border-radius: 16px; padding: 16px; margin-bottom: 16px; color: #fff; }
.pa-activenow__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pa-activenow__badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 3px 10px;
}
.pa-activenow__title { font-size: 15px; font-weight: 700; margin-top: 6px; }
.pa-activenow__meta { font-size: 13px; color: #E4C9D8; margin-top: 2px; }

/* ---- Report cards: list rows, detail sections, skills progress bars, practise-at-home ---- */
.pa-report-row {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: var(--pa-radius-card);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  color: inherit;
}
.pa-report-row:hover, .pa-report-row:focus-visible { border-color: var(--pa-primary); }
.pa-report-row:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.pa-report-row__head { display: flex; justify-content: space-between; align-items: center; }
.pa-report-row__date { font-size: 12px; font-weight: 700; color: var(--pa-accent); letter-spacing: 0.4px; }
.pa-report-row__arrow { color: #B79CA9; }
.pa-report-row__title { font-size: 15px; font-weight: 700; color: var(--pa-ink); margin-top: 4px; }
.pa-report-row__summary { font-size: 13px; color: var(--pa-muted); margin-top: 3px; }

.pa-report-section {
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: var(--pa-radius-card);
  padding: 18px;
  margin-bottom: 14px;
}
.pa-report-section__title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--pa-muted); letter-spacing: 0.5px; }
.pa-report-notes { margin: 0; font-size: 14px; line-height: 1.55; color: var(--pa-ink); }

/* Skills progress bars (Report detail + staff authoring form) */
.pa-skill { margin-bottom: 13px; }
.pa-skill:last-child { margin-bottom: 0; }
.pa-skill__head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.pa-skill__name { font-weight: 700; color: var(--pa-ink); }
.pa-skill__pct { font-weight: 700; color: var(--pa-primary); }
.pa-skill__track { height: 8px; background: var(--pa-track); border-radius: 4px; overflow: hidden; }
.pa-skill__fill { height: 100%; background: var(--pa-primary); border-radius: 4px; transition: width .4s ease; }

/* Practise-at-home accent card */
.pa-practise-card {
  background: var(--pa-accent-tint);
  border: 1px solid var(--pa-accent-line);
  border-radius: var(--pa-radius-card);
  padding: 18px;
}
.pa-practise-card__title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--pa-accent-ink); letter-spacing: 0.5px; }
.pa-practise-item { display: flex; gap: 8px; font-size: 14px; color: var(--pa-ink); margin-bottom: 6px; }
.pa-practise-item:last-child { margin-bottom: 0; }
.pa-practise-item__bullet { color: var(--pa-accent); font-weight: 800; }

/* Repeatable rows on the staff report-card authoring form (skills, practise items) */
.pa-form-repeat-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.pa-form-repeat-row .pa-input { margin-bottom: 0; }
.pa-form-repeat-row select.pa-input { flex: 1; }
.pa-remove-row-btn {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--pa-line-soft);
  background: #fff;
  color: #B0505E;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  font-family: inherit;
}
.pa-remove-row-btn:hover { background: #FBEEEF; }
.pa-remove-row-btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

/* ---- Install banner (iOS add-to-home-screen) ---- */
.pa-install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--pa-primary-tint);
  border: 1px solid #D9B8CB;
  border-radius: var(--pa-radius-card);
  padding: 12px 14px;
  margin: 12px 16px 0;
  font-size: 13px;
  color: var(--pa-primary);
}

.pa-install-banner__close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--pa-primary);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

/* ---- Active stay: progress bar, update feed, photo grid ---- */
.pa-stay-progress { margin-bottom: 18px; }
.pa-stay-progress__row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.pa-stay-progress__row > span:first-child { font-weight: 700; color: var(--pa-ink); }
.pa-stay-progress__row > span:last-child { font-weight: 700; color: var(--pa-primary); }
.pa-stay-progress__track { height: 8px; background: var(--pa-track); border-radius: 4px; overflow: hidden; }
.pa-stay-progress__fill { height: 100%; background: var(--pa-primary); border-radius: 4px; transition: width .4s ease; }

.pa-stay-update { margin-bottom: 12px; }
.pa-stay-update__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pa-stay-update__label { font-size: 12px; font-weight: 800; color: var(--pa-accent); letter-spacing: 0.4px; }
.pa-stay-update__tag { font-size: 11px; font-weight: 700; color: #B79CA9; }
.pa-stay-update__note { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--pa-ink); }
.pa-stay-update__note:last-child { margin-bottom: 0; }

.pa-stay-update__photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pa-stay-update__photo {
  height: 120px;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: var(--pa-track);
  cursor: pointer;
}
.pa-stay-update__photo:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.pa-stay-update__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pa-stay-comingup {
  background: var(--pa-track);
  border: 1px dashed #D9B8CB;
  border-radius: var(--pa-radius-card);
  padding: 16px;
  text-align: center;
}
.pa-stay-comingup__title { font-size: 13px; font-weight: 700; color: var(--pa-primary); }
.pa-stay-comingup__sub { font-size: 12px; color: var(--pa-muted); margin-top: 3px; }

/* Full-size photo overlay, opened by tapping a thumbnail in the update feed */
.pa-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(58, 23, 48, 0.88);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}
.pa-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ---- Avatar photo variant (dog profile photo, with an initials fallback) ---- */
.pa-avatar__img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.pa-avatar--upload { position: relative; overflow: visible; }
.pa-avatar__upload {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pa-primary);
  color: #fff;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
}
.pa-avatar__upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---- Billing: invoice cards (customer Payments, staff Invoices), receipts, client-detail rows ---- */
.pa-invoice-card {
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: var(--pa-radius-card);
  padding: 16px;
  margin-bottom: 10px;
}
.pa-invoice-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.pa-invoice-card__id { font-size: 12px; font-weight: 700; color: #B79CA9; }
.pa-invoice-card__row { display: flex; justify-content: space-between; align-items: center; }
.pa-invoice-card__label { font-size: 14px; font-weight: 700; color: var(--pa-ink); }
.pa-invoice-card__amount { font-size: 16px; font-weight: 800; color: var(--pa-primary); }

.pa-invoice-card__pay-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--pa-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.pa-invoice-card__pay-btn:hover:not(:disabled) { background: #D06508; }
.pa-invoice-card__pay-btn:disabled { opacity: 0.6; cursor: default; }
.pa-invoice-card__pay-btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

/* Receipt (lines + payment) shown when a Paid invoice card is expanded */
.pa-receipt { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--pa-line-soft); }

/* "N invoice(s) due" alert on the customer Home screen */
.pa-invoice-alert {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pa-accent-tint);
  border: 1px solid var(--pa-accent-line);
  border-radius: 14px;
  padding: 13px 16px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.pa-invoice-alert__label { font-weight: 700; color: var(--pa-accent-ink); }
.pa-invoice-alert__cta { font-weight: 700; color: var(--pa-accent); }
.pa-invoice-alert:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

/* Staff client-detail INVOICES row */
.pa-client-invoice-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--pa-line-soft); }
.pa-client-invoice-row:last-child { border-bottom: none; }
.pa-client-invoice-row__label { font-size: 13px; font-weight: 700; color: var(--pa-ink); }
.pa-client-invoice-row__date { font-size: 11px; color: #B79CA9; }
.pa-client-invoice-row__amount-group { display: flex; align-items: center; gap: 8px; }
.pa-client-invoice-row__amount { font-size: 14px; font-weight: 800; color: var(--pa-primary); }

/* ---- Messaging: thread header/bubbles/input, staff inbox rows ---- */
.pa-message-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.pa-message-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--pa-line-soft);
  background: var(--pa-surface);
  flex: none;
}
.pa-message-header__title { font-size: 16px; font-weight: 800; color: var(--pa-ink); }
.pa-message-header__sub { font-size: 12px; font-weight: 700; color: var(--pa-success); margin-top: 1px; }

.pa-message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pa-message-row { display: flex; }
.pa-message-row--mine { justify-content: flex-end; }
.pa-message-row--theirs { justify-content: flex-start; }

.pa-message-bubble { max-width: 78%; padding: 10px 14px; font-size: 14px; line-height: 1.45; }
.pa-message-bubble--mine {
  background: var(--pa-primary);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.pa-message-bubble--theirs {
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  color: var(--pa-ink);
  border-radius: 16px 16px 16px 4px;
}
.pa-message-bubble__time { font-size: 10px; margin-top: 4px; opacity: 0.65; }

.pa-message-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--pa-line-soft);
  background: #fff;
  align-items: center;
  flex: none;
}
.pa-message-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--pa-line);
  border-radius: 999px;
  font-size: 14px;
  background: var(--pa-surface);
  font-family: inherit;
  color: var(--pa-ink);
}
.pa-message-input:focus { outline: 2px solid var(--pa-primary); outline-offset: 0; }
.pa-message-input:disabled { opacity: 0.7; }

.pa-message-send-btn {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--pa-primary);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.pa-message-send-btn:hover:not(:disabled) { background: var(--pa-primary-dark); }
.pa-message-send-btn:disabled { opacity: 0.5; cursor: default; }
.pa-message-send-btn:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }

/* ---- Blazor framework styles (kept from template) ---- */
.validation-message { color: #B3261E; font-size: 13px; }
.invalid { outline: 1px solid #e50000; }
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }

.blazor-error-boundary {
  background: #b32121;
  padding: 1rem 1rem 1rem 1rem;
  color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ---- Account menu (top-right avatar dropdown) ---- */
.pa-usermenu { position: relative; }
.pa-usermenu__trigger { cursor: pointer; list-style: none; user-select: none; }
.pa-usermenu__trigger::-webkit-details-marker { display: none; }
.pa-usermenu__trigger:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
.pa-usermenu[open] > .pa-usermenu__trigger { box-shadow: 0 0 0 2px var(--pa-primary-tint); }
.pa-usermenu__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  z-index: 30;
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(52, 21, 39, 0.18);
  padding: 8px;
}
.pa-usermenu__email {
  font-size: 12px;
  color: var(--pa-muted);
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--pa-line-soft);
  margin-bottom: 6px;
  word-break: break-all;
}
.pa-usermenu__item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--pa-primary);
  cursor: pointer;
}
.pa-usermenu__item:hover { background: var(--pa-primary-tint); }

/* ---- Dashboard stat widgets ---- */
.pa-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.pa-stat {
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: var(--pa-radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 84px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
a.pa-stat:hover { border-color: var(--pa-primary); box-shadow: 0 6px 16px rgba(52, 21, 39, 0.10); }
a.pa-stat:active { transform: translateY(1px); }
a.pa-stat:focus-visible { outline: 2px solid var(--pa-primary); outline-offset: 2px; }
a.pa-stat--accent:hover { box-shadow: 0 6px 18px rgba(93, 35, 73, 0.35); }
.pa-stat__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--pa-muted);
}
.pa-stat__value { font-size: 24px; font-weight: 800; color: var(--pa-ink); line-height: 1.1; }
.pa-stat__sub { font-size: 12px; color: var(--pa-muted); }
.pa-stat--accent { background: var(--pa-primary); border-color: var(--pa-primary); }
.pa-stat--accent .pa-stat__label { color: rgba(255, 255, 255, 0.72); }
.pa-stat--accent .pa-stat__value { color: #fff; }

/* ---- Quick links row ---- */
.pa-quicklinks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.pa-quicklink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: var(--pa-radius-input);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pa-ink);
  text-decoration: none;
}
.pa-quicklink::after { content: "→"; color: #B79CA9; }
.pa-quicklink:hover { border-color: var(--pa-primary); color: var(--pa-primary); }


/* ---- Circuit reconnect overlay (see App.razor #components-reconnect-modal) ----
   Hidden until blazor.web.js applies a state class; the failed/rejected states swap the
   "retrying" line for the "give us a ring" one and reveal the reload button. */
#components-reconnect-modal { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(58, 23, 48, 0.55);
}

.pa-reconnect__card {
  background: var(--pa-surface);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(52, 21, 39, 0.35);
}

.pa-reconnect__emoji { font-size: 42px; margin-bottom: 10px; }

.pa-reconnect__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--pa-ink);
}

.pa-reconnect__sub {
  margin: 0;
  font-size: 14px;
  color: var(--pa-muted);
}

.pa-reconnect__reload {
  display: none;
  margin-top: 16px;
  text-decoration: none;
}

#components-reconnect-modal .pa-reconnect__sub--failed { display: none; }

#components-reconnect-modal.components-reconnect-failed .pa-reconnect__sub--retrying,
#components-reconnect-modal.components-reconnect-rejected .pa-reconnect__sub--retrying { display: none; }

#components-reconnect-modal.components-reconnect-failed .pa-reconnect__sub--failed,
#components-reconnect-modal.components-reconnect-rejected .pa-reconnect__sub--failed { display: block; }

#components-reconnect-modal.components-reconnect-failed .pa-reconnect__reload,
#components-reconnect-modal.components-reconnect-rejected .pa-reconnect__reload { display: inline-block; }

/* ---- Collapsible detail sections (staff client view) ---- */
.pa-section { padding: 0; overflow: hidden; margin-bottom: 12px; }
.pa-section__head { margin: 0; }
.pa-section__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.pa-section__toggle:hover { background: var(--pa-primary-tint); }
.pa-section__chevron {
  color: var(--pa-muted);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.pa-section--open .pa-section__chevron { transform: rotate(90deg); }
.pa-section__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--pa-ink);
}
.pa-section__summary {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pa-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.pa-section__body { padding: 0 16px 16px; }
.pa-section__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

/* ---- Clients/Dogs segmented search toggle (staff clients screen) ---- */
.pa-mode-toggle {
  display: flex;
  background: #fff;
  border: 1px solid var(--pa-line-soft);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 12px;
}
.pa-mode-toggle__btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--pa-muted);
  cursor: pointer;
}
.pa-mode-toggle__btn.active { background: var(--pa-primary); color: #fff; }

/* Roomier collapsible-section bodies (overrides the earlier declaration). */
.pa-section__body { padding: 4px 16px 18px; }
.pa-section__body .pa-dog-row { padding: 6px 0; }

/* ---- Forms inside modal sheets ----
   The sheet itself is the container: drop the tinted inline-form card, and pin every field to the
   sheet's width — iOS date/time/select inputs have intrinsic widths that otherwise overflow it. */
.pa-modal__body .pa-inline-form { background: none; border-radius: 0; padding: 0; margin: 0; }
.pa-modal__body .pa-input,
.pa-modal__body select.pa-input,
.pa-modal__body textarea.pa-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 12px;
  display: block;
}
.pa-modal__body input[type="date"].pa-input,
.pa-modal__body input[type="time"].pa-input {
  -webkit-appearance: none;
  appearance: none;
  min-height: 50px;
}
.pa-modal__body .pa-inline-form__actions { margin-top: 4px; }

/* Yes/No answer pair on the collection survey */
.pa-yesno { display: flex; gap: 8px; margin-bottom: 12px; }
.pa-yesno__btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--pa-radius-input);
  border: 1.5px solid var(--pa-line);
  background: #fff;
  color: var(--pa-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.pa-yesno__btn.active { border-color: var(--pa-primary); background: var(--pa-primary); color: #fff; }

/* ---- New-version banner (see app-version.js) ---- */
.pa-update-banner {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: var(--pa-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(52, 21, 39, 0.35);
  cursor: pointer;
  white-space: nowrap;
}
