@import url('brand.css?v=3'); /* Field Book signature tokens + components (fb-*) */

:root {
  /* ── Raw palette (tsfgeo tenant primitives — do not reference directly in
     new work; go through the semantic layer below so a future tenant's
     brand can override it) ── */
  /* sky aliased to ink action — converts ~60 legacy accent call sites
     (incl. all six pages' inline styles) to field-book ink in one line. */
  --sky: var(--color-action);
  --sky-dark: var(--color-action-hover);
  --earth1: #C4956A;
  --earth2: #8B6347;
  --earth3: #5C3D2E;
  --white: #FFFFFF;
  /* FIELD BOOK RESKIN pass 2 (2026-07-19): ~42 rules still referenced these
     raw primitives directly (incl. body), so the paper never showed. Re-point
     the primitives themselves — the whole app re-skins wholesale. Old values
     retained in comments for rollback. */
  /* Raw primitives now ALIAS the semantic layer — one override point for
     tenant theming (theme.js overrides --color-*; these follow). Semantic
     widening: a tenant text override also recolors sheet borders (intended). */
  --off-white: var(--color-bg);
  --text-dark: var(--color-text);
  --text-mid: var(--color-text-muted);
  --text-light: var(--color-text-subtle);
  --border: var(--color-border);
  --success: #2ECC71;
  --danger: #E74C3C;
  --warning: #F39C12;
  --shadow: 0 3px 16px rgba(23,24,26,0.07);   /* ink-tinted (was sky) */
  --shadow-md: 0 8px 32px rgba(23,24,26,0.11);
  --nav-height: 64px;
  --earth: var(--fb-yellow);            /* index week-widget 'today' references this (was UNDEFINED — bar invisible); now the one yellow highlight */
  --app-grid: rgba(23,24,26,0.035);     /* in-app grid, quieter than login's .055 */

  /* ── Semantic color layer — this is what theme.js overrides per tenant.
     Everything here resolves to today's tsfgeo look; nothing changes until
     a rule is migrated to reference these instead of the raw tokens above. ── */
  /* FIELD BOOK RESKIN (2026-07-19): semantic layer re-pointed from the sky/
     earth tsfgeo palette to the platform signature — paper, ink, field-book
     yellow (see brand.css). Functional colors (success/danger/warning) keep
     their meanings. Raw tsfgeo primitives above stay for any rule still
     referencing them directly. */
  --color-bg: #FBFAF6;            /* all-weather paper */
  --color-surface: #FFFFFF;       /* the clean sheet */
  --color-text: #17181A;          /* ink */
  --color-text-muted: #4A4D52;    /* pencil */
  --color-text-subtle: #6A6D73;   /* graphite (AA on paper) */
  --color-border: #E3E1DA;        /* faint paper divider */
  --color-chrome: #17181A;        /* nav bar: ink */
  /* --color-action is a deeper shade of the same sky hue (194.5°, same
     saturation) — not a hue-shift — chosen so white text on it clears WCAG
     AA (5.5:1) with margin. The original --sky/--sky-dark stay available
     for borders, focus rings, and text-on-dark-navy uses where they were
     already compliant (e.g. .nav-link.active on the navy nav bar is ~8:1
     and doesn't need to change). See feedback_wcag_contrast_fix memory. */
  /* Primary action IN-APP = ink block with WHITE type (16.9:1 — better sun
     contrast than yellow's 8.2:1, and honors brand rule 2: yellow is the
     highlighter, not the default button text; only marketing/emails use the
     ink/yellow fb-btn). Per Fable design review 2026-07-19. */
  --color-action: #17181A;
  --color-action-hover: #000000;
  --color-action-active: #000000;
  --color-action-contrast: #FFFFFF;
  --color-focus-ring: rgba(23,24,26,0.30);
  --color-accent-soft: rgba(232,163,61,0.10);
  --color-success: var(--success);
  --color-success-bg: #eafaf1;
  --color-success-fg: #27ae60;
  --color-danger: var(--danger);
  --color-danger-bg: #fdecea;
  --color-danger-fg: var(--danger);
  --color-warning: var(--warning);
  --color-warning-bg: #fef9e7;
  --color-warning-fg: #d68910;
  --color-info-bg: #F2EFE6; /* paper-warm info tint (was sky #e8f6fd — off-palette after reskin) */
  --color-info-fg: var(--color-action);
  --color-gray-bg: #f0f0f5;
  --color-gray-fg: var(--text-light);

  /* ── Spacing scale — values chosen to contain the magic numbers already
     in use, so migrating a rule is a rename, not a re-value. ── */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 6px;
  --space-sm: 8px;
  --space-md: 10px;
  --space-lg: 12px;
  --space-xl: 14px;
  --space-2xl: 16px;
  --space-3xl: 18px;
  --space-4xl: 20px;
  --space-5xl: 24px;
  --space-6xl: 28px;
  --space-7xl: 32px;
  --space-8xl: 40px;
  --space-9xl: 48px;
  --space-10xl: 64px;

  /* ── Radius scale ── */
  --radius-xs: 6px;
  --radius-sm: 7px;
  --radius-md: 8px;
  --radius-lg: 9px;
  --radius-xl: 10px;
  --radius-2xl: 12px;
  --radius-3xl: 14px;
  --radius-4xl: 16px;
  --radius-5xl: 20px;
  --radius-pill: 9999px;

  /* ── Type scale ── */
  --text-2xs: 0.72rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8rem;
  --text-base: 0.85rem;
  --text-md: 0.9rem;
  --text-lg: 1rem;    /* inputs stay exactly here — see iOS-zoom comment below */
  --text-xl: 1.1rem;
  --text-2xl: 1.3rem;
  --text-3xl: 1.4rem;
  --text-4xl: 1.6rem;
  --text-5xl: 1.8rem;
  --text-6xl: 2.2rem;

  /* ── Weight scale ── */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* ── Font families ── */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Barlow', sans-serif;
  background-color: var(--off-white);
  /* Field Book ground — content sits on sheets (rule 1); NO background-attachment:
     fixed (the one config that costs scroll repaints on low-end Android). */
  background-image:
    linear-gradient(var(--app-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--app-grid) 1px, transparent 1px);
  background-size: var(--fb-grid-size) var(--fb-grid-size);
  min-height: 100vh;
  color: var(--text-dark);
}

/* ─── ACCESSIBILITY ─── */
/* Inputs already get their own focus ring (box-shadow, below); this covers
   everything else that's clickable but previously had no visible focus
   state at all — buttons, links, and custom tab/card controls. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-action);
  outline-offset: 2px;
}

/* Skip-to-content link — invisible until keyboard-focused, lets a
   keyboard/screen-reader user bypass the header/nav on every page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--color-action);
  color: var(--color-action-contrast);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

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

/* ─── AUTH SCREEN ─── */
/* Login = a doorway, not a workspace: the one in-app surface that wears the
   full Field Book signature (grid ground + ink-ruled sheet). Working screens
   past this point stay calm per brand rule 4. */
.auth-screen {
  display: none;
  min-height: 100vh;
  background-color: var(--color-bg);
  background-image:
    linear-gradient(rgba(23,24,26,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,24,26,.055) 1px, transparent 1px);
  background-size: 22px 22px;
  border-top: 10px solid #E8A33D;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
}
.auth-screen.active { display: flex; }

.auth-card {
  background: var(--white);
  border: 2px solid #17181A;
  border-radius: 14px; /* keeps the current friendliness; rounded + hard shadow is the merged (Gumroad-style) construction */
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 6px 6px 0 rgba(23,24,26,.85);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo img { height: 60px; }
.auth-logo h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 12px;
  letter-spacing: 0.5px;
}
.auth-logo p {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-mid);
  transition: all 0.2s;
  background: var(--off-white);
}
.auth-tab.active {
  background: var(--color-action);
  color: var(--color-action-contrast);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: 'Barlow', sans-serif;
  /* 16px, not 0.95rem/15.2px — iOS Safari auto-zooms the viewport on focus
     for any input under 16px, which felt like a jump-cut on every field. */
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--off-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--sky);
  background: white;
  box-shadow: 0 0 0 3px rgba(23,24,26,0.12);
}

.auth-btn {
  width: 100%;
  padding: 13px;
  background: var(--color-action);
  color: var(--color-action-contrast);
  border: none;
  border-radius: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}
.auth-btn:hover { background: var(--color-action-hover); }
.auth-btn:active { transform: scale(0.98); }

.auth-msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  display: none;
}
.auth-msg.error { background: #fdecea; color: var(--danger); display: block; }
.auth-msg.success { background: #eafaf1; color: #27ae60; display: block; }
.auth-msg.warning { background: #fef9e7; color: var(--warning); display: block; }

/* ─── PENDING / DENIED SCREENS ───
   Field Book: a sheet on the paper ground — 2px ink rule, square-ish corners,
   the app's calm 3px offset shadow (matches the #appScreen sheet treatment). */
.status-screen {
  display: none;
  min-height: 100vh;
  background-color: var(--color-bg);
  background-image:
    linear-gradient(var(--app-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--app-grid) 1px, transparent 1px);
  background-size: var(--fb-grid-size) var(--fb-grid-size);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.status-screen.active { display: flex; }
.status-card {
  background: var(--color-surface);
  border: 2px solid var(--color-text);
  border-radius: var(--fb-radius);
  padding: 48px 40px;
  text-align: center;
  max-width: 440px;
  box-shadow: 3px 3px 0 rgba(23,24,26,.85);
}
.status-icon { font-size: 3rem; margin-bottom: 16px; }
.status-card h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.status-card p { color: var(--text-mid); line-height: 1.6; }
.status-card .signout-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--color-action);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── MAIN APP ─── */
.app-screen { display: none; }
.app-screen.active { display: block; }

/* ─── HEADER ─── */
.header {
  background: var(--color-chrome);
  position: sticky;
  top: 0;
  z-index: 100;
}
/* Leaflet's internal panes run z-index 400-1000, which beats the sticky
   header while scrolling. isolation traps that whole stack inside the map
   box so the header always paints above it. */
.leaflet-container { isolation: isolate; z-index: 0; }
/* Header band = TENANT identity (logo + name + slogan + office line).
   GridTally moved to the .powered-by tail of the nav bar below.
   Chrome height math (hard constraint: no taller than before):
     BEFORE: header 64 (fixed) + soil 6 + nav ~44 + tenant strip ~52
             (10+30+10 pad/logo + 1px border) = ~166px total chrome
     AFTER:  header 64 (fixed, unchanged — 3 text lines ~44px stack inside
             it) + soil 6 + nav ~44 = ~114px. Strip removed entirely.
             Net -52px. Band height is FIXED, so the office line appearing
             async (after the user doc resolves) causes zero layout shift. */
.header-sky {
  background: var(--color-action);
  padding: 0 20px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-mark img { width: 100%; height: 100%; object-fit: contain; }
.logo-monogram {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-action);
  color: var(--color-action-contrast);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
}
.header-tenant { flex: 1; min-width: 0; } /* min-width:0 lets the three lines ellipsize instead of pushing .header-user */
.tenant-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: white;
  letter-spacing: 0.4px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tenant-slogan,
.tenant-office {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.78);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0; /* long tenant names ellipsize; the user block never compresses or wraps */
}
.user-name {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  white-space: nowrap;
  display: none;
}
@media (min-width: 480px) { .user-name { display: block; } }
.signout-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.signout-btn:hover { background: rgba(255,255,255,0.35); }

.header-soil { display: flex; height: 6px; }
.soil-layer { flex: 1; background: var(--fb-yellow); } /* the field-book strip (was the 3-earth soil gradient) */

/* ─── NAV ─── */
.nav-bar {
  background: var(--color-chrome);
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.4px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover { color: rgba(255,255,255,0.9); }
.nav-link.active { color: var(--fb-yellow); border-bottom-color: var(--fb-yellow); } /* yellow-on-ink; lands WITH the sky alias or active goes ink-on-ink */
.nav-link .nav-icon { font-size: 1rem; }

/* ─── POWERED-BY (nav bar tail) ─── */
/* GridTally's whole footprint in the app chrome: a quiet mono line at the
   right end of the ink nav bar, with the bare-five tally glyph (paper
   strokes via currentColor, yellow accent diagonal in the SVG itself).
   margin-left:auto right-aligns it when the links leave room; on narrow
   screens it just becomes the scrollable trough's last item — it never
   wraps and never adds chrome height. */
.powered-by {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 16px;
  color: rgba(251, 250, 246, 0.72); /* paper at ~.75 — baked into the color so the yellow diagonal stays full-strength */
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.powered-by svg { display: block; flex-shrink: 0; }

/* ─── PAGE CONTENT ─── */
.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: 0.3px;
}
.page-header p {
  color: var(--text-mid);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ─── CARDS ─── */
.card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-header {
  background: var(--color-action);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header.earth {
  background: var(--color-action);
}
.card-header.dark {
  background: var(--color-text); /* solid ink — navy gradient retired in Field Book reskin */
}
.card-icon {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.25);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.card-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.card-body { padding: 18px; }

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
label .req { color: var(--color-action); margin-left: 2px; }

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="email"],
select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: 'Barlow', sans-serif;
  /* 16px, not 0.95rem/15.2px — iOS Safari auto-zooms the viewport on focus
     for any input under 16px, which felt like a jump-cut on every field. */
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--off-white);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sky);
  background: white;
  box-shadow: 0 0 0 3px rgba(23,24,26,0.12);
}
input[readonly] { opacity: 0.7; cursor: not-allowed; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2317181A' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 500px) {
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 9px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--color-action); color: var(--color-action-contrast); }
.btn-primary:hover { background: var(--color-action-hover); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost {
  background: var(--off-white);
  color: var(--text-mid);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Add User — role radio group */
.cu-role-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cu-role-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cu-role-option:has(input:checked) {
  border-color: var(--sky);
  background: rgba(79, 195, 232, 0.07);
}
.cu-role-option input[type="radio"] { display: none; }
.cu-role-label { font-weight: 700; font-size: 0.88rem; color: var(--text-dark); }
.cu-role-desc  { font-size: 0.75rem; color: var(--text-mid); line-height: 1.4; }
@media (max-width: 600px) { .cu-role-group { grid-template-columns: 1fr; } }

.submit-btn {
  width: 100%;
  padding: 15px;
  background: var(--color-action);
  color: var(--color-action-contrast);
  border: none;
  border-radius: 12px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(19,114,144,0.35);
  transition: all 0.2s;
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(19,114,144,0.45); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
/* Badge foregrounds darkened one step for AA contrast on their tint at 0.72rem */
.badge-success { background: #eafaf1; color: #1e8449; }
.badge-danger { background: #fdecea; color: #b03a2e; }
.badge-warning { background: #fef9e7; color: #9c6508; }
.badge-info { background: var(--color-info-bg); color: var(--color-info-fg); }
.badge-gray { background: #f0f0f5; color: var(--text-light); }

/* ─── TABLE ─── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  background: var(--off-white);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-dark);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(23,24,26,0.03); }

/* ─── GPS ALERT ─── */
.gps-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 14px;
}
.gps-status.acquiring { background: #fef9e7; color: #d68910; }
.gps-status.success { background: #eafaf1; color: #27ae60; }
.gps-status.error { background: #fdecea; color: var(--danger); }

/* ─── LATE FLAG ─── */
.late-banner {
  background: #fdecea;
  border: 1.5px solid var(--danger);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: var(--danger);
  font-weight: 600;
}

/* ─── BREADCRUMB STATUS INDICATOR ─── */
/* Quiet, shift-framed. No battery %, no live timestamp. Binary reassurance only. */
.bc-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 500;
  flex-wrap: wrap;
  margin-top: 10px;
  line-height: 1.4;
}
.bc-recording {
  background: #eaf6fd;
  color: #1a6b8a;
  border: 1px solid rgba(23,24,26,0.25);
}
.bc-searching {
  background: #fef9e7;
  color: #7d6608;
}
/* Denied: amber-toned, NOT --danger red. GPS failure ≠ shift failure. */
.bc-denied {
  background: #fef6e7;
  color: #7d4e00;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.bc-stopped {
  background: var(--off-white);
  color: var(--text-light);
}
.bc-icon { flex-shrink: 0; }
.bc-text { flex: 1; }
.bc-help-btn {
  background: none;
  border: none;
  padding: 4px 0;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #7d4e00;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 44px; /* accessible tap target */
  display: inline-flex;
  align-items: center;
}
.bc-help {
  display: none;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.5;
  width: 100%;
}
.bc-help.bc-open { display: block; }

/* ─── SUCCESS OVERLAY ─── */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(23,24,26,0.7); /* ink scrim */
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.success-overlay.show { display: flex; }
.success-card {
  background: white;
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.success-icon {
  width: 64px; height: 64px;
  background: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  color: white;
  margin: 0 auto 16px;
}
.success-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.success-card p { color: var(--text-mid); font-size: 0.9rem; line-height: 1.5; }

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ─── FORM NOTE ─── */
.form-note {
  background: var(--color-bg); /* rule 1: reading text never bare on the grid */
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 16px;
  line-height: 1.6;
}

/* ─── ERROR STYLES ─── */
.field-error {
  display: none;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 4px;
  font-weight: 500;
}
.field-error.show { display: block; }
input.error, select.error, textarea.error { border-color: var(--danger); }

/* ─── LOADING ─── */
.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── STAT CARDS ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card-link {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-number {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-action);
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}
.stat-card.danger .stat-number { color: var(--danger); }
.stat-card.success .stat-number { color: var(--success); }
.stat-card.warning .stat-number { color: var(--warning); }

/* ─── RECEIPT UPLOAD ─── */
.receipt-upload {
  border: 2px dashed var(--border);
  border-radius: 9px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.receipt-upload:hover { border-color: var(--color-action); background: rgba(23,24,26,0.03); }
.receipt-upload input { display: none; }
.receipt-upload .upload-icon { font-size: 1.5rem; margin-bottom: 6px; }
.receipt-upload p { font-size: 0.82rem; color: var(--text-mid); }
.receipt-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.receipt-thumb {
  width: 64px; height: 64px;
  border-radius: 6px;
  object-fit: cover;
  border: 1.5px solid var(--border);
}

/* ─── TOTAL BAR ─── */
.total-bar {
  background: var(--color-action);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-action-contrast);
  margin-top: 4px;
}
.total-bar .total-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.9;
}
.total-bar .total-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
}

/* ─── LINK-STYLE BUTTON (e.g. "Forgot password?") ─── */
.btn-link {
  background: none;
  border: none;
  color: var(--color-action);
  font-size: var(--text-sm);
  cursor: pointer;
  padding: 4px 0;
  width: 100%;
  text-align: center;
  margin-top: 4px;
}

/* ─── OFFLINE BANNER ─── */
.offline-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--warning);
  color: var(--white);
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  letter-spacing: 0.3px;
}
.offline-banner.visible {
  transform: translateY(0);
}
/* Reserve space so the fixed banner doesn't sit on top of a page's Submit
   button — most likely to happen at the exact moment this app's offline-first
   design is actually being used. */
body:has(.offline-banner.visible) .page-content {
  padding-bottom: 76px;
}

/* ── Skeleton paint ──────────────────────────────────────────────────────
   Instant card frames on the home screen while Firestore streams the real
   data (repeat visits only — index.js gates on a localStorage hint). Text
   inside a .skel is transparent; the sweep is decorative and disabled for
   reduced-motion users, who just get the static placeholder block. */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--border, #e3e8ee);
  border-radius: 6px;
  color: transparent !important;
}
.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: skelSweep 1.2s infinite;
}
@keyframes skelSweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.skel-line { height: 12px; margin: 8px 0; }
@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; }
}

/* ── Field Book reskin: link visibility (Fable review MUST #3) ────────────────
   --color-action is now ink == body text, so text links need a persistent
   signifier beyond color/weight. A 2px offset underline is the on-brand cue. */
.btn-link,
.shift-submit-link,
.status-card .signout-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}


/* ── Field Book: working-pages sheet treatment (lean plan step 3) ────────────
   #appScreen id-specificity beats the six pages' inline class rules without
   touching them. Radii deliberately retained (merged rounded+hard construction,
   like .auth-card). Overlays (modals, dropdowns, bottom sheets) stay soft. */
#appScreen .card, #appScreen .stat-card, #appScreen .week-widget,
#appScreen .quick-link, #appScreen .shift-card, #appScreen .admin-sidebar,
#appScreen .user-card {
  /* toolbars/controls (.filter-bar, .sidebar-toggle) deliberately NOT sheets —
     the history filter is a bare flex wrapper; a border+shadow on it reads broken */
  border: 2px solid var(--color-text);
  box-shadow: 3px 3px 0 rgba(23,24,26,.85);
}
#appScreen .quick-link:hover, #appScreen .stat-card-link:hover {
  transform: translate(-1px,-1px);
  box-shadow: 4px 4px 0 rgba(23,24,26,.85);
}
