/* ============================================================
   Sitter PWA stylesheet
   Phone-first, big tap targets, high contrast.
   Shares the public site's brand palette (blush + sage on cream,
   navy reserved) so the staff tool reads as the same brand.
   The key role colors (navy / brass / cream) are overridden per
   client from env in staff/base.html, mirroring the public site.
   Token NAMES are kept; their VALUES now carry the new palette
   (brass-* = the blush-pink accent).
   ============================================================ */

:root {
  --navy: #5E2A46;        /* brand dark = deep berry "dark pink" (was navy) */
  --navy-soft: #8A5470;
  --navy-deep: #371A2B;
  --cream: #FAF8F6;
  --cream-card: #ffffff;
  --brass: #E8B8C2;
  --brass-soft: #D98FA0;
  --ink: #20283A;
  --ink-soft: #3C4658;
  --muted: #6B7280;
  --rule: #EBE2DC;
  --rule-strong: #DCD0C8;
  --good: #2d8a4b;
  --warn: #c47b2a;
  --bad: #b04a3a;

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --tap-min: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 76px;  /* room for bottom nav */
  /* clip (not hidden): stops sideways scroll WITHOUT creating a scroll
     container, which on iOS Safari un-pins position:fixed and made the
     bottom nav drift/float instead of sticking to the bottom. */
  overflow-x: clip;
}
html { overflow-x: clip; }

/* Long emails/addresses/IDs must wrap, never push the page wide. */
.address, .meta, .customer, .detail-row .value, td, th { overflow-wrap: anywhere; }
table { max-width: 100%; }

a {
  color: var(--brass);
  text-decoration: none;
}
a:hover, a:active { color: var(--navy); }

img { max-width: 100%; height: auto; display: block; }

/* ----- Top bar ----- */
.topbar {
  background: var(--navy);
  color: var(--cream);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.topbar .brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.topbar .brand .sub {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brass-soft);
}
.topbar .user-info {
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.85;
}

/* ----- Account menu (top-right dropdown) ----- */
.account-menu { position: relative; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--cream);
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  min-height: 40px;
  transition: background 0.15s ease;
}
.account-trigger:hover, .account-trigger[aria-expanded="true"] { background: rgba(255,255,255,0.16); }
.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brass);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.account-name { font-weight: 600; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-caret { font-size: 0.7rem; opacity: 0.8; }

/* ----- Secret-superuser "View as" (centered between brand + account chip) ----- */
/* The topbar is justify-content: space-between, so this middle flex item sits
   centered in the gap between the brand and the right-hand account chip — no
   absolute positioning, so it never overlaps its neighbors. */
.viewas-menu {
  position: relative;
  min-width: 0;
  margin: 0 0.4rem;
  z-index: 60;
}
.viewas-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--cream);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 36px;
  max-width: 44vw;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.viewas-trigger:hover, .viewas-trigger[aria-expanded="true"] { background: rgba(255,255,255,0.18); }
.viewas-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* When actively impersonating, make it unmistakable. */
.viewas-active .viewas-trigger {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--navy);
}
.viewas-active .viewas-trigger:hover { background: var(--brass-soft); }
.viewas-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--cream-card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(19,31,66,0.18);
  z-index: 130;
  animation: account-pop 0.12s ease;
  padding: 0.3rem 0;
}
.viewas-sep { height: 1px; background: var(--rule); margin: 0.3rem 0; }
.viewas-role {
  margin-left: auto;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.viewas-current { background: rgba(217, 143, 160,0.12); font-weight: 700; }
.viewas-back { font-weight: 700; color: var(--brass); }

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--cream-card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(19,31,66,0.18);
  overflow: hidden;
  z-index: 120;
  animation: account-pop 0.12s ease;
}
@keyframes account-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.account-dropdown-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
}
.account-dropdown-name { font-weight: 700; font-size: 0.95rem; }
.account-dropdown-email { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; word-break: break-all; }
.account-dropdown-role {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--brass);
  background: rgba(217, 143, 160,0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: none;
  border: 0;
  border-top: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  min-height: var(--tap-min);
}
.account-dropdown-head + .account-dropdown-item { border-top: 0; }
.account-dropdown-item:hover { background: var(--cream); color: var(--ink); }
.account-dropdown-item .ad-ico { width: 1.2rem; text-align: center; }
.account-dropdown-item:disabled { color: var(--muted); cursor: default; }
.account-dropdown-item.is-on { color: var(--good); font-weight: 600; }
.account-dropdown-signout { color: var(--bad); font-weight: 600; }
.account-dropdown-signout:hover { background: #fbeae6; color: var(--bad); }

/* ----- Notification bell ----- */
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.bell-menu { position: relative; }
.bell-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--cream);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.bell-trigger:hover, .bell-trigger[aria-expanded="true"] { background: rgba(255,255,255,0.16); }
.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--navy);
}
.bell-dropdown {
  /* Anchored to the viewport (not the bell button) so the panel can't spill
     off the side of a phone screen. */
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  right: 8px;
  left: auto;
  width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - 120px);
  background: var(--cream-card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(19,31,66,0.18);
  overflow: hidden;
  z-index: 130;
  animation: account-pop 0.12s ease;
}
.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
  font-weight: 700;
  font-size: 0.9rem;
}
.bell-actions { display: flex; gap: 0.6rem; }
.bell-link {
  background: none; border: 0; color: var(--brass);
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; cursor: pointer; padding: 0;
}
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-item {
  display: block;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.bell-item:hover { background: var(--cream); color: var(--ink); }
.bell-unread { background: #f4f8ff; }
.bell-unread:hover { background: #eaf1fd; }
.bell-item-title { font-weight: 600; font-size: 0.9rem; }
.bell-item-body { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.1rem; }
.bell-item-time { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.bell-empty { padding: 1.5rem 0.9rem; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* ----- Toast (foreground push banner) ----- */
.toast-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(420px, 94vw);
  pointer-events: none;
}
.toast {
  display: block;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  box-shadow: 0 8px 24px rgba(19,31,66,0.28);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  border-left: 4px solid var(--brass);
}
.toast.toast-in { opacity: 1; transform: none; }
.toast strong { display: block; font-size: 0.92rem; }
.toast span { display: block; font-size: 0.82rem; color: #cfd6e6; margin-top: 0.1rem; }
.toast.toast-ok { border-left-color: var(--good, #2c7); }
.toast.toast-err { border-left-color: var(--bad, #b54); }

/* ----- Main content ----- */
main.staff-main {
  flex: 1;
  padding: 1rem 1rem 1.5rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 720px) {
  main.staff-main {
    padding: 1.5rem 2rem;
  }
}

/* ----- Headings ----- */
.staff-h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.staff-h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 1.75rem 0 0.75rem;
  color: var(--ink);
}
.staff-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.5rem;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--brass);
}

/* ----- Cards ----- */
.card {
  background: var(--cream-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(19, 31, 66, 0.04), 0 2px 8px rgba(19, 31, 66, 0.04);
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.card-link:hover {
  transform: translateY(-1px);
  border-color: var(--rule-strong);
  box-shadow: 0 2px 4px rgba(19, 31, 66, 0.06), 0 6px 16px rgba(19, 31, 66, 0.08);
}
.card-link:active {
  transform: scale(0.99);
  background: var(--cream);
}

/* ----- Job card on Today / Jobs list ----- */
.job-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: start;
}
.job-card .time {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.1;
}
.job-card .customer {
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.2rem;
}
.job-card .address {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}
.job-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.job-card .badge-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

/* ----- Status badges ----- */
.badge {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
  background: #ececec;  /* default so an unmapped status is never invisible */
  color: #5a5a5a;
}
/* Job statuses */
.badge-accepted { background: #fbe7c0; color: #6d5414; }
.badge-scheduled { background: #e0eaf8; color: var(--navy); }
.badge-in_progress { background: var(--brass); color: var(--navy); }
.badge-pending_review { background: #fff0c4; color: #6d5414; }
.badge-pending { background: #fff0c4; color: #6d5414; }
.badge-approved { background: #d5ead7; color: var(--good); }
.badge-rejected { background: #fadcd0; color: var(--bad); }
.badge-rework_requested { background: #fadcd0; color: var(--bad); }
.badge-canceled { background: #ececec; color: #5a5a5a; }
.badge-invoiced { background: #ddd0f0; color: #4a2a82; }
.badge-paid { background: #c9e5d0; color: var(--good); }
/* Quote / invoice statuses (were unstyled → transparent pills) */
.badge-draft { background: #ececec; color: #5a5a5a; }
.badge-sent { background: #e0eaf8; color: var(--navy); }
.badge-declined { background: #fadcd0; color: var(--bad); }
.badge-expired { background: #efe2c6; color: #7a5b16; }
.badge-changes_requested { background: #fff0c4; color: #6d5414; }
.badge-issued { background: #fff0c4; color: #6d5414; }
.badge-overdue { background: #fadcd0; color: var(--bad); }
.badge-refunded { background: #ddd0f0; color: #4a2a82; }
.badge-voided { background: #ececec; color: #5a5a5a; }
/* Lead statuses */
.badge-new { background: var(--brass); color: var(--navy); }
.badge-contacted { background: #e0eaf8; color: var(--navy); }
.badge-quoted { background: #ddd0f0; color: #4a2a82; }
.badge-won { background: #c9e5d0; color: var(--good); }
.badge-lost { background: #ececec; color: #5a5a5a; }

/* ----- Operations chips (dashboard hub) ----- */
.ops-chips {
  display: flex; flex-wrap: nowrap; gap: 0.4rem; margin: 0 0 1.25rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding-bottom: 2px;
}
.ops-chips::-webkit-scrollbar { display: none; }
.ops-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  background: var(--cream-card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--navy);
}
.ops-chip:hover { border-color: var(--rule-strong); background: var(--cream); color: var(--navy); }
.ops-chip-n {
  background: var(--brass); color: var(--navy);
  border-radius: 999px; padding: 0 0.4rem; font-size: 0.72rem; min-width: 18px; text-align: center;
}

/* ----- Filter tabs (one consistent control for every list page) ----- */
.filter-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  overflow-x: auto;            /* long status sets scroll instead of wrapping to 3 rows */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill {
  flex: 0 0 auto;             /* never stretch; consistent sizing */
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--cream-card);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.filter-pill:hover { background: var(--cream); color: var(--navy); }
.filter-pill.is-active { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.filter-row .filter-spacer { flex: 1 0 auto; }  /* pushes a trailing link right without margin-auto glitches */

/* ----- Job checklist ----- */
.checklist-row { display: flex; align-items: center; gap: 0.4rem; border-bottom: 1px solid var(--rule); }
.checklist-row:last-of-type { border-bottom: 0; }
.checklist-toggle {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; background: none; border: 0; cursor: pointer;
  padding: 0.7rem 0.2rem; text-align: left;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  min-height: var(--tap-min);
}
.checklist-box {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid var(--rule-strong); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.checklist-toggle.is-done .checklist-box { background: var(--good); border-color: var(--good); }
.checklist-toggle.is-done .checklist-text { color: var(--muted); text-decoration: line-through; }
.checklist-del {
  background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer;
  padding: 0.3rem 0.5rem; line-height: 1;
}
.checklist-del:hover { color: var(--bad); }

/* ----- Search bar + pager ----- */
.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-bar .staff-input { flex: 1; min-width: 160px; }
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin: 1.25rem 0 0.5rem;
}
.pager .btn { min-height: 40px; padding: 0.5rem 0.9rem; }
.pager-info { font-size: 0.82rem; color: var(--muted); text-align: center; flex: 1; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap-min);
  padding: 0.85rem 1.3rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
  box-shadow: 0 1px 2px rgba(19, 31, 66, 0.18);
}
.btn-primary:hover, .btn-primary:active {
  background: var(--navy-deep);
}
.btn-brass {
  background: var(--brass);
  color: var(--navy);
  border-color: var(--brass);
}
.btn-brass:hover, .btn-brass:active { background: var(--brass-soft); }
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover { background: var(--cream-card); }
.btn-danger {
  background: var(--bad);
  color: white;
  border-color: var(--bad);
}
.btn-block { width: 100%; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-lg {
  font-size: 1.1rem;
  min-height: 56px;
  padding: 1rem 1.5rem;
}
.btn-danger-ghost {
  background: transparent;
  color: var(--bad);
  border-color: var(--bad);
}
.btn-danger-ghost:hover { background: #fbeae6; color: var(--bad); }

/* ----- Action bar (edit/delete row on detail pages) ----- */
.action-bar {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
}
.action-bar .btn { flex: 1; min-height: 42px; }

/* ----- Danger zone / confirm-delete ----- */
.danger-card { border: 1px solid #e7c3bb; border-left: 4px solid var(--bad); }
.confirm-object {
  padding: 0.5rem 0 0.85rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.85rem;
}
.confirm-name { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.confirm-sub { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.confirm-warning { font-size: 0.92rem; color: var(--ink-soft); }
.confirm-blocked {
  background: #fdeee5;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  color: var(--bad);
}
.confirm-blocked p { margin: 0.35rem 0 0; color: var(--ink-soft); font-size: 0.9rem; }
.confirm-impact {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.confirm-impact-head { font-weight: 600; margin-bottom: 0.35rem; }
.confirm-impact ul { margin: 0; padding-left: 1.15rem; color: var(--ink-soft); }
.confirm-label { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; }
.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.confirm-check input { margin-top: 0.15rem; width: 18px; height: 18px; flex-shrink: 0; }

/* ----- Forms ----- */
.staff-input,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"],
input[type="date"], input[type="time"], textarea, select {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0.75rem 0.95rem;
  font-family: inherit;
  font-size: 1rem;
  background: white;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.staff-input:focus,
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(217, 143, 160, 0.18);
}

.field-group { margin-bottom: 1.25rem; }
/* Two-up form fields that stack on narrow phones. */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
@media (max-width: 430px) { .field-row { grid-template-columns: 1fr; } }
.field-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.field-error {
  color: var(--bad);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}
.field-help {
  color: var(--muted);
  font-size: 0.825rem;
  margin-top: 0.35rem;
}

/* ----- Login ----- */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--navy);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.login-card {
  background: white;
  color: var(--ink);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-logo img {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
}
.login-logo .name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: white;
}
.login-logo .sub {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-soft);
}

/* ----- Bottom nav ----- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(247, 227, 233, 0.97);  /* soft light pink (blush tint) */
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-top: 1px solid rgba(217, 143, 160, 0.28);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 12px rgba(19, 31, 66, 0.06);
}
.bottom-nav a {
  flex: 1;
  min-width: 0;  /* allow even shrink so 6 admin tabs fit without overflow */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: clamp(0.6rem, 2.7vw, 0.7rem);
  font-weight: 600;
  letter-spacing: 0;
  min-height: 64px;
  transition: color 0.15s ease;
}
.bottom-nav a span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-nav a.active {
  color: var(--navy);
}
/* Active tab indicator bar */
.bottom-nav a.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--brass);
}
.bottom-nav a .icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.bottom-nav a.active .icon {
  transform: translateY(-1px) scale(1.05);
}

/* ----- Photos ----- */
.photos-section {
  margin-bottom: 1.5rem;
  padding: 0.85rem 0.9rem 0.9rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--rule-strong);
  background: rgba(255, 255, 255, 0.5);
}
.photos-section.batch-before {
  border-left-color: var(--brass);
  background: #fbf3e3;
}
.photos-section.batch-after {
  border-left-color: var(--good, #2d6a4f);
  background: #e9f3ec;
}
.photos-section.batch-issue {
  border-left-color: var(--warn, #c9881f);
  background: #fdf4e0;
}
.photos-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}
.photos-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy);
}
.photos-header .batch-count {
  color: var(--muted);
  font-size: 0.825rem;
  font-weight: 500;
}
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}
.photo-tile {
  background: var(--cream-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.photo-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.photo-tile .caption {
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
}
.photo-tile .tile-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0;
}
.photo-tile:hover .tile-remove,
.photo-tile:focus-within .tile-remove {
  opacity: 1;
}
/* Touch devices have no hover — keep the delete button visible + tappable. */
@media (hover: none) {
  .photo-tile .tile-remove { opacity: 1; width: 32px; height: 32px; line-height: 30px; font-size: 16px; }
}

/* Live upload placeholder tile (shown while a photo is uploading) */
.photo-tile.uploading {
  background: var(--cream);
  position: relative;
}
.photo-tile.uploading::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.photo-tile.uploading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid var(--rule-strong);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: tile-spin 0.8s linear infinite;
}
.photo-tile.uploading .progress-text {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  font-size: 0.72rem;
  text-align: center;
  color: var(--muted);
}
@keyframes tile-spin {
  to { transform: rotate(360deg); }
}

.photo-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: var(--cream-card);
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
  transition: border-color 0.15s, background 0.15s;
}
.photo-upload-btn:hover {
  background: white;
  border-color: var(--brass);
}
.photo-upload-btn .camera-icon {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}
.photo-upload-btn .upload-hint {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 400;
}
.photo-upload-btn input[type="file"] {
  display: none;
}

.batch-empty-hint {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.25rem 0 0.5rem;
}

/* ----- Action panel (clock in/out, mark complete) ----- */
.action-panel {
  background: var(--cream-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.action-panel h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: var(--ink);
}
.action-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.action-status .label { color: var(--muted); }
.action-status .value { font-weight: 600; color: var(--ink); }

.blockers {
  background: #fdeee5;
  border-left: 3px solid var(--warn);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}
.blockers ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ----- Messages (Django) ----- */
.messages {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.messages li {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--brass);
  background: var(--cream-card);
}
.messages li.error { border-left-color: var(--bad); }
.messages li.success { border-left-color: var(--good); }

/* ----- Empty states ----- */
.empty {
  text-align: center;
  padding: 2.75rem 1.25rem;
  color: var(--muted);
  background: var(--cream-card);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
}
.empty h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 500;
}
.empty p { margin: 0 auto; max-width: 32ch; font-size: 0.9rem; }

/* ----- Detail layout ----- */
.detail-section {
  margin-bottom: 1.25rem;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label {
  color: var(--muted);
  font-size: 0.825rem;
}
.detail-row .value {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  max-width: 60%;
}


/* ----- Geofence status indicator ----- */
.geofence-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}
.geofence-status .geofence-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.geofence-status .geofence-text {
  flex: 1;
  font-weight: 500;
}
.geofence-status .geofence-distance {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  margin-left: 0.5rem;
}

.geofence-checking {
  background: var(--cream);
  border: 1px solid var(--rule);
  color: var(--muted);
}
.geofence-inside {
  background: #d5ead7;
  color: var(--good);
  border: 1px solid #b4d6b7;
}
.geofence-outside {
  background: #fadcd0;
  color: var(--bad);
  border: 1px solid #f0bba8;
}
.geofence-warning {
  background: #fff0c4;
  color: #6d5414;
  border: 1px solid #f0d878;
}
.geofence-error {
  background: #fadcd0;
  color: var(--bad);
  border: 1px solid #f0bba8;
}

/* -- Share / QR tab --------------------------------------------- */
.qr-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.qr-share-frame {
  background: #fff;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px rgba(14, 26, 58, 0.35);
  line-height: 0;
}
.qr-share-frame img {
  display: block;
  width: min(72vw, 300px);
  height: auto;
}
.qr-share-url {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.01em;
}

/* Bottom-right "up one level" back link (base.html {% block back_nav %}). */
.page-back-nav { text-align: right; margin: 1.5rem 0 0.5rem; }
.page-back-nav a { font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.page-back-nav a:active, .page-back-nav a:hover { color: var(--ink); }

/* Editable note under each job photo (crew adds descriptions on site). */
.tile-note { display: flex; gap: 4px; padding: 4px; border-top: 1px solid var(--rule); }
.tile-note input { flex: 1; min-width: 0; font-size: 0.74rem; padding: 5px 6px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }
.tile-note button { flex: 0 0 auto; background: var(--good, #2c7); color: #fff; border: 0; border-radius: 4px; width: 30px; font-size: 0.85rem; cursor: pointer; }

/* ----- Service-specific photo prompts (job_detail) ----- */
.photos-proof-title { margin: 1.25rem 0 0.15rem; font-family: var(--font-display); }
.photos-section.shot-unmet { border-left: 3px solid var(--brass); padding-left: 0.7rem; }
.photos-section.shot-done { border-left: 3px solid var(--good); padding-left: 0.7rem; }
.shot-check { color: var(--good); font-weight: 700; }
.shot-tag {
  display: inline-block; margin-left: 0.4rem; vertical-align: middle;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.1rem 0.4rem; border-radius: 999px;
}
.shot-tag-req { background: rgba(217, 143, 160, 0.22); color: var(--navy); }
.shot-tag-opt { background: var(--cream); color: var(--muted); border: 1px solid var(--rule-strong); }

/* ----- Login: Google sign-in ----- */
.login-or { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0; color: var(--muted); font-size: 0.8rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; background: #fff; }
.google-btn svg { flex: 0 0 auto; }
