/* ==========================================================================
   PoultryTrak — Carbon Design System language, custom theme
   Palette: sage #8FA28A · light sage #C7D3C0 · cream #F7F4ED · gold #C8A96B
   Type: IBM Plex Sans / IBM Plex Mono · 2x-grid spacing · sharp corners
   ========================================================================== */

:root {
  /* Brand scale derived from #8FA28A (sage) */
  --sage-10: #EEF1EA;
  --sage-20: #DFE6DA;
  --sage-30: #C7D3C0;   /* brand light sage */
  --sage-40: #ABBBA4;
  --sage-50: #8FA28A;   /* brand sage */
  --sage-60: #70816B;
  --sage-70: #55634F;
  --sage-80: #3E4939;
  --sage-90: #2B3327;
  --sage-100: #1C211A;

  /* Gold accent scale from #C8A96B */
  --gold-20: #EFE5D0;
  --gold-40: #C8A96B;   /* brand gold */
  --gold-60: #8A6F3C;
  --gold-70: #6B5527;

  /* Carbon-style semantic tokens */
  --background: #F7F4ED;            /* brand cream */
  --layer-01: #FFFFFF;
  --layer-02: #F7F4ED;
  --layer-accent-01: #EDF0E8;
  --field-01: #FFFFFF;
  --border-subtle: #E3E6DC;
  --border-strong: #8A9284;
  --border-tile: #D8DDD0;
  --border-interactive: #55634F;

  --text-primary: #20251E;
  --text-secondary: #5A6156;
  --text-placeholder: #9AA093;
  --text-on-color: #FFFFFF;
  --text-helper: #6E7568;

  --link-primary: #47543F;
  --link-primary-hover: #333D2F;

  --interactive: #4E5C48;
  --button-primary: #4E5C48;
  --button-primary-hover: #414D3C;
  --button-primary-active: #333D2F;
  --button-secondary: #3E4939;
  --button-danger: #9F3A2F;
  --button-danger-hover: #872F26;

  --support-error: #9F3A2F;
  --support-success: #55634F;
  --support-warning: #8A6F3C;
  --support-info: #5A6156;

  --error-bg: #F6E9E7;
  --success-bg: #EDF0E8;
  --warning-bg: #F3ECDD;

  --shell-bg: #262D23;
  --shell-text: #E9ECE4;
  --shell-hover: #333D2F;
  --shell-active-border: #C8A96B;

  --focus: #4E5C48;

  /* 2x-grid spacing scale */
  --sp-01: 0.125rem;
  --sp-02: 0.25rem;
  --sp-03: 0.5rem;
  --sp-04: 0.75rem;
  --sp-05: 1rem;
  --sp-06: 1.5rem;
  --sp-07: 2rem;
  --sp-08: 2.5rem;
  --sp-09: 3rem;
  --sp-10: 4rem;

  --container-max: 82rem; /* 1312px */
  --font-sans: 'IBM Plex Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
}

/* ── Reset / base ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 100%; }
/* clip (not hidden): avoids the 100vw full-bleed scrollbar overflow without
   creating a scroll container that would break the sticky header */
html, body { overflow-x: clip; }
body {
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--link-primary); text-decoration: none; }
a:hover { color: var(--link-primary-hover); text-decoration: underline; }
strong { font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* ── Type scale (Carbon productive) ───────────────────────────────── */
h1, .heading-05 { font-size: 2.375rem; line-height: 2.875rem; font-weight: 400; letter-spacing: 0; }
h2, .heading-04 { font-size: 2rem;    line-height: 2.5rem;  font-weight: 400; }
h3, .heading-03 { font-size: 1.5rem;  line-height: 2rem;    font-weight: 400; }
h4, .heading-02 { font-size: 1.125rem; line-height: 1.625rem; font-weight: 600; }
h5, .heading-01 { font-size: 1rem;    line-height: 1.5rem;  font-weight: 600; }
.body-02 { font-size: 1.125rem; line-height: 1.75rem; }
.label-01 {
  font-size: 0.875rem; line-height: 1.25rem; letter-spacing: 0.32px;
  color: var(--text-secondary);
}
.text-secondary { color: var(--text-secondary); }
.mono, code { font-family: var(--font-mono); font-size: 0.9375rem; letter-spacing: 0.32px; }

/* ── UI Shell header ──────────────────────────────────────────────── */
.shell {
  background: var(--shell-bg);
  height: 3.5rem;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #1C211A;
}
.shell-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--sp-05);
}
.shell-brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-03);
  color: var(--shell-text);
  font-size: 1rem;
  margin-right: var(--sp-07);
  white-space: nowrap;
  text-decoration: none;
}
.shell-brand:hover { color: #fff; text-decoration: none; }
.shell-brand .prefix { font-weight: 400; color: var(--sage-40); }
.shell-brand .name { font-weight: 600; letter-spacing: 0.16px; }
.shell-logo {
  width: 2.375rem;
  height: 2.375rem;
  object-fit: contain;
  background: #fff;
  border-radius: 2px;
  padding: 1px;
  align-self: center;
}
.shell-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex: 1;
}
.shell-nav a {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-05);
  color: var(--sage-20);
  font-size: 1rem;
  text-decoration: none;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
}
.shell-nav a:hover { background: var(--shell-hover); color: #fff; text-decoration: none; }
.shell-nav a.active {
  color: #fff;
  border-bottom-color: var(--shell-active-border);
  font-weight: 600;
}
.shell-right {
  display: flex;
  align-items: center;
  gap: var(--sp-05);
  margin-left: auto;
  height: 100%;
}
.shell-user {
  color: var(--sage-30);
  font-size: 0.8125rem;
  letter-spacing: 0.32px;
  text-align: right;
  line-height: 1.125rem;
  white-space: nowrap;
}
.shell-user strong { color: #fff; display: block; font-size: 0.9375rem; font-weight: 600; }
.shell-logout {
  display: flex;
  align-items: center;
  gap: var(--sp-03);
  height: 100%;
  padding: 0 var(--sp-05);
  color: var(--sage-20);
  font-size: 1rem;
  border-left: 1px solid #3E4939;
  text-decoration: none;
}
.shell-logout:hover { background: var(--button-danger); color: #fff; text-decoration: none; }

/* Hamburger + mobile panel */
.shell-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--shell-text);
  font-size: 1.375rem;
  width: 3.5rem;
  height: 3.5rem;
  cursor: pointer;
  margin-left: auto;
}
.shell-menu-btn:hover { background: var(--shell-hover); }
.shell-mobile {
  display: none;
  position: fixed;
  top: 3.5rem;
  left: 0;
  right: 0;
  background: var(--shell-bg);
  border-bottom: 1px solid #1C211A;
  z-index: 999;
  flex-direction: column;
  padding: var(--sp-03) 0;
}
.shell-mobile.open { display: flex; }
.shell-mobile a {
  color: var(--sage-20);
  padding: var(--sp-04) var(--sp-05);
  font-size: 1rem;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.shell-mobile a:hover { background: var(--shell-hover); color: #fff; text-decoration: none; }
.shell-mobile a.active { color: #fff; border-left-color: var(--shell-active-border); font-weight: 600; }
.shell-mobile .shell-mobile-user {
  color: var(--sage-40);
  font-size: 0.875rem;
  padding: var(--sp-03) var(--sp-05) var(--sp-04);
  border-bottom: 1px solid #3E4939;
  margin-bottom: var(--sp-03);
}

@media (max-width: 64rem) {
  .shell-nav, .shell-right { display: none; }
  .shell-menu-btn { display: block; }
}

/* ── Page scaffolding ─────────────────────────────────────────────── */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-07) var(--sp-05) var(--sp-10);
}
.page-header { margin-bottom: var(--sp-07); }
.page-header .breadcrumb {
  font-size: 1rem;
  margin-bottom: var(--sp-03);
}
.page-header .breadcrumb a { color: var(--link-primary); }
.page-header .breadcrumb .sep { color: var(--text-secondary); margin: 0 var(--sp-02); }
.page-header h1 {
  font-size: 2.375rem;
  line-height: 2.875rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.page-header .subtitle {
  margin-top: var(--sp-03);
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 44rem;
}
.page-header .page-actions {
  margin-top: var(--sp-05);
  display: flex;
  gap: var(--sp-03);
  flex-wrap: wrap;
}
.section-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 400;
  margin: var(--sp-08) 0 var(--sp-05);
}
.section-title:first-child { margin-top: 0; }
.rule-gold {
  width: 3rem;
  height: 3px;
  background: var(--gold-40);
  border: none;
  margin: var(--sp-04) 0 0;
}

/* ── Grids ────────────────────────────────────────────────────────── */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.grid-gap { gap: var(--sp-05); }

/* ── Tiles ────────────────────────────────────────────────────────── */
.tile {
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  padding: var(--sp-05);
}
.tile + .tile { margin-top: var(--sp-05); }
.tile-clickable {
  display: block;
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  padding: var(--sp-05);
  color: var(--text-primary);
  text-decoration: none;
  transition: background 110ms cubic-bezier(0.2, 0, 0.38, 0.9);
  min-height: 9rem;
  position: relative;
}
.tile-clickable:hover {
  background: var(--sage-10);
  text-decoration: none;
  color: var(--text-primary);
  border-color: var(--border-interactive);
}
.tile-clickable .tile-icon {
  color: var(--sage-60);
  font-size: 1.75rem;
  margin-bottom: var(--sp-05);
}
.tile-clickable .tile-title { font-size: 1.125rem; font-weight: 600; margin-bottom: var(--sp-02); }
.tile-clickable .tile-desc { color: var(--text-secondary); font-size: 1rem; }
.tile-clickable .tile-arrow {
  position: absolute;
  right: var(--sp-05);
  bottom: var(--sp-05);
  color: var(--sage-60);
}

/* KPI stat tile */
.stat-tile {
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  border-left: 3px solid var(--gold-40);
  padding: var(--sp-05);
}
.stat-tile .stat-label {
  font-size: 0.875rem;
  letter-spacing: 0.32px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-03);
}
.stat-tile .stat-value {
  font-size: 2.5rem;
  line-height: 3rem;
  font-weight: 300;
  font-feature-settings: 'tnum';
}
.stat-tile .stat-detail { font-size: 0.875rem; color: var(--text-helper); margin-top: var(--sp-02); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-07);
  min-height: 3rem;
  padding: calc(0.875rem - 3px) var(--sp-05) calc(0.875rem - 3px) var(--sp-05);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: 0.16px;
  text-align: left;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 70ms cubic-bezier(0, 0, 0.38, 0.9);
  max-width: 20rem;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn i { font-size: 1.25rem; }
.btn-primary { background: var(--button-primary); color: var(--text-on-color); }
.btn-primary:hover { background: var(--button-primary-hover); color: var(--text-on-color); }
.btn-primary:active { background: var(--button-primary-active); }
.btn-secondary {
  background: transparent;
  color: var(--button-secondary);
  border-color: var(--button-secondary);
}
.btn-secondary:hover { background: var(--button-secondary); color: var(--text-on-color); }
.btn-ghost {
  background: transparent;
  color: var(--link-primary);
  gap: var(--sp-03);
}
.btn-ghost:hover { background: var(--sage-10); color: var(--link-primary-hover); }
.btn-danger { background: var(--button-danger); color: var(--text-on-color); }
.btn-danger:hover { background: var(--button-danger-hover); color: var(--text-on-color); }
.btn-sm { min-height: 2rem; padding: 0.375rem var(--sp-05); gap: var(--sp-05); }
.btn-field { min-height: 2.75rem; padding: 0.625rem var(--sp-05); }
.btn-block { width: 100%; max-width: none; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-item { margin-bottom: var(--sp-06); }
.form-item > label, .form-label {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.25rem;
  letter-spacing: 0.32px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-03);
}
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="email"], input[type="tel"],
select, textarea {
  width: 100%;
  height: 2.75rem;
  padding: 0 var(--sp-05);
  background: var(--field-01);
  border: none;
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  border-radius: 0;
}
textarea { height: auto; min-height: 6rem; padding: var(--sp-04) var(--sp-05); resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M5 6L0 1l.7-.7L5 4.6 9.3.3l.7.7z' fill='%2320251E'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-05) center;
  padding-right: var(--sp-08);
  cursor: pointer;
}
input::placeholder, textarea::placeholder { color: var(--text-placeholder); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
input[disabled], select[disabled] { opacity: 0.5; cursor: not-allowed; }
.form-helper { font-size: 0.875rem; color: var(--text-helper); margin-top: var(--sp-02); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-05); }
@media (max-width: 42rem) { .form-row { grid-template-columns: 1fr; } }

/* Radio / checkbox groups */
.option-group { display: flex; flex-wrap: wrap; gap: var(--sp-03) var(--sp-06); padding-top: var(--sp-02); }
.option-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-03);
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
}
.option-item input[type="radio"], .option-item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--interactive);
}
fieldset { border: none; }
legend {
  font-size: 0.9375rem;
  letter-spacing: 0.32px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-03);
}

/* File input */
input[type="file"] {
  width: 100%;
  font-size: 1rem;
  color: var(--text-secondary);
}
input[type="file"]::file-selector-button {
  background: var(--button-secondary);
  color: #fff;
  border: none;
  padding: 0.625rem var(--sp-05);
  margin-right: var(--sp-04);
  font-family: var(--font-sans);
  font-size: 1rem;
  cursor: pointer;
}

/* ── Data tables ──────────────────────────────────────────────────── */
.table-container {
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  overflow-x: auto;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-05);
  padding: var(--sp-05);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.table-toolbar .table-title { font-size: 1.125rem; font-weight: 600; }
.table-toolbar .table-meta { font-size: 0.875rem; color: var(--text-secondary); margin-top: var(--sp-01); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.data-table th {
  background: var(--layer-accent-01);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  padding: 0 var(--sp-05);
  height: 3.25rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: var(--sp-04) var(--sp-05);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--sage-10); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .numeric { text-align: right; font-feature-settings: 'tnum'; }
.empty-state {
  padding: var(--sp-08) var(--sp-05);
  text-align: center;
  color: var(--text-secondary);
}
.empty-state i { font-size: 2rem; color: var(--sage-40); display: block; margin-bottom: var(--sp-04); }

/* ── Tags ─────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-02);
  padding: 0 var(--sp-04);
  height: 1.75rem;
  font-size: 0.875rem;
  letter-spacing: 0.32px;
  border-radius: 0.875rem;
  white-space: nowrap;
}
.tag-green { background: var(--sage-20); color: var(--sage-80); }
.tag-gold  { background: var(--gold-20); color: var(--gold-70); }
.tag-red   { background: var(--error-bg); color: var(--support-error); }
.tag-gray  { background: #E8E6DF; color: var(--text-secondary); }

/* ── Inline notifications ─────────────────────────────────────────── */
.notification {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-04);
  padding: var(--sp-04) var(--sp-05);
  margin-bottom: var(--sp-06);
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  background: var(--layer-01);
  font-size: 1rem;
}
.notification i { margin-top: 0.125rem; font-size: 1.25rem; }
.notification .notification-title { font-weight: 600; }
.notification-error   { border-left-color: var(--support-error);   background: var(--error-bg); }
.notification-error i { color: var(--support-error); }
.notification-success { border-left-color: var(--support-success); background: var(--success-bg); }
.notification-success i { color: var(--support-success); }
.notification-warning { border-left-color: var(--support-warning); background: var(--warning-bg); }
.notification-warning i { color: var(--support-warning); }
.notification-info    { border-left-color: var(--support-info); }
.notification-info i  { color: var(--support-info); }

/* ── Structured lists / detail pairs ──────────────────────────────── */
.detail-list { background: var(--layer-01); border: 1px solid var(--border-tile); }
.detail-row {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt {
  padding: var(--sp-04) var(--sp-05);
  font-size: 0.9375rem;
  letter-spacing: 0.32px;
  color: var(--text-secondary);
  background: var(--layer-accent-01);
}
.detail-row dd { padding: var(--sp-04) var(--sp-05); font-size: 1rem; }
@media (max-width: 42rem) {
  .detail-row { grid-template-columns: 1fr; }
  .detail-row dt { padding-bottom: var(--sp-01); background: none; }
  .detail-row dd { padding-top: 0; }
}

/* ── Login / narrow centered pages ────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 16rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-07) var(--sp-05);
}
.auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  border-top: 3px solid var(--gold-40);
  padding: var(--sp-07);
}
.auth-card .auth-eyebrow {
  font-size: 0.875rem;
  letter-spacing: 0.32px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-02);
}
.auth-card h1 { font-size: 2rem; line-height: 2.5rem; font-weight: 400; margin-bottom: var(--sp-06); }

/* ── Site footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--shell-bg);
  color: var(--sage-30);
  font-size: 0.875rem;
  letter-spacing: 0.32px;
  padding: var(--sp-06) var(--sp-05);
  margin-top: auto;
}
.site-footer .footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-05);
  flex-wrap: wrap;
}
.site-footer a { color: var(--sage-20); }

/* ── Landing page ─────────────────────────────────────────────────── */
/* Full-bleed section that escapes the .page container */
.full-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}
.hero-photo {
  position: relative;
  min-height: 34rem;
  display: flex;
  align-items: center;
  background-image:
    linear-gradient(100deg, rgba(28, 33, 26, 0.92) 0%, rgba(28, 33, 26, 0.72) 42%, rgba(28, 33, 26, 0.25) 75%, rgba(28, 33, 26, 0.35) 100%),
    var(--hero-img);
  background-size: cover;
  background-position: center 35%;
  margin-top: calc(-1 * var(--sp-07));
  margin-bottom: var(--sp-08);
}
.hero-photo-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-05);
  color: #fff;
}
.hero-photo .eyebrow {
  font-size: 0.9375rem;
  letter-spacing: 0.32px;
  color: var(--sage-30);
  margin-bottom: var(--sp-04);
  text-transform: uppercase;
}
.hero-photo h1 {
  font-size: clamp(2.5rem, 5.5vw, 3.75rem);
  line-height: 1.15;
  font-weight: 300;
  max-width: 34rem;
  letter-spacing: -0.02em;
}
.hero-photo h1 strong { font-weight: 600; }
.hero-photo .hero-sub {
  margin-top: var(--sp-05);
  max-width: 32rem;
  font-size: 1.1875rem;
  line-height: 1.875rem;
  color: #E9ECE4;
}
.hero-photo .hero-actions {
  margin-top: var(--sp-07);
  display: flex;
  gap: var(--sp-04);
  flex-wrap: wrap;
}
.hero-photo .btn-secondary {
  color: #fff;
  border-color: #fff;
}
.hero-photo .btn-secondary:hover { background: #fff; color: var(--sage-90); }

/* Stats band overlapping the hero bottom edge */
.stats-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1px;
  background: var(--border-tile);
  border: 1px solid var(--border-tile);
  margin-top: -5.5rem;
  position: relative;
  z-index: 2;
  margin-bottom: var(--sp-08);
}
.stats-band .stat-tile { border: none; margin: 0; }

/* Photo feature cards */
.photo-card {
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  display: flex;
  flex-direction: column;
}
.photo-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 3px solid var(--gold-40);
}
.photo-card .photo-card-body { padding: var(--sp-05); }
.photo-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: var(--sp-02); }
.photo-card p { color: var(--text-secondary); font-size: 1rem; }

/* Split section: image beside text */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  margin: var(--sp-08) 0;
}
.split-section .split-media {
  min-height: 20rem;
  background-size: cover;
  background-position: center;
}
.split-section .split-body {
  padding: var(--sp-08) var(--sp-07);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.split-section .split-body h2 { font-size: 2rem; line-height: 2.5rem; font-weight: 300; }
.split-section .split-body p { color: var(--text-secondary); margin-top: var(--sp-04); max-width: 30rem; }
@media (max-width: 52rem) {
  .split-section { grid-template-columns: 1fr; }
  .split-section .split-media { min-height: 14rem; }
  .split-section .split-body { padding: var(--sp-06) var(--sp-05); }
}

/* Numbered steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--sp-05); }
.step {
  background: var(--layer-01);
  border: 1px solid var(--border-tile);
  border-top: 3px solid var(--sage-50);
  padding: var(--sp-05);
}
.step .step-num {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.32px;
  color: var(--gold-60);
  margin-bottom: var(--sp-04);
}
.step h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: var(--sp-02); }
.step p { color: var(--text-secondary); font-size: 1rem; }

/* Dark call-to-action band */
.cta-band {
  background: var(--shell-bg);
  color: #fff;
  padding: var(--sp-08) var(--sp-05);
  margin-top: var(--sp-09);
  /* swallow the .page bottom padding so the band sits flush on the footer */
  margin-bottom: calc(-1 * var(--sp-10));
}
.cta-band .cta-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-06);
  flex-wrap: wrap;
}
.cta-band h2 { font-size: 2rem; line-height: 2.5rem; font-weight: 300; }
.cta-band p { color: var(--sage-30); margin-top: var(--sp-03); max-width: 34rem; }
.cta-band .btn-secondary { color: #fff; border-color: #fff; }
.cta-band .btn-secondary:hover { background: #fff; color: var(--sage-90); }

/* ── Decorative line-art doodles ──────────────────────────────────── */
.doodle {
  color: var(--sage-40);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}
.page-header { position: relative; }
.doodle-corner {
  position: absolute;
  right: 0;
  bottom: -0.5rem;
  width: 11rem;
}
@media (max-width: 48rem) { .doodle-corner { display: none; } }

/* ── Scan / capture widgets (registration form) ───────────────────── */
/* Ghana Card scanner frame: ID-1 card aspect ratio with corner brackets
   and a sweeping scan line while OCR runs. */
.card-frame {
  position: relative;
  width: 100%;
  max-width: 21rem;
  aspect-ratio: 1.586;
  background-color: var(--layer-01);
  background-image:
    linear-gradient(var(--sage-60), var(--sage-60)),
    linear-gradient(var(--sage-60), var(--sage-60)),
    linear-gradient(var(--sage-60), var(--sage-60)),
    linear-gradient(var(--sage-60), var(--sage-60)),
    linear-gradient(var(--sage-60), var(--sage-60)),
    linear-gradient(var(--sage-60), var(--sage-60)),
    linear-gradient(var(--sage-60), var(--sage-60)),
    linear-gradient(var(--sage-60), var(--sage-60));
  background-repeat: no-repeat;
  background-size: 1.5rem 2px, 2px 1.5rem, 1.5rem 2px, 2px 1.5rem,
                   1.5rem 2px, 2px 1.5rem, 1.5rem 2px, 2px 1.5rem;
  background-position: top left, top left, top right, top right,
                       bottom left, bottom left, bottom right, bottom right;
}
.card-frame .card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-03);
  color: var(--text-placeholder);
  font-size: 0.875rem;
  letter-spacing: 0.32px;
  text-align: center;
  padding: var(--sp-04);
}
.card-frame .card-placeholder i { font-size: 2rem; color: var(--sage-40); }
.card-frame .card-img {
  position: absolute;
  inset: 0.375rem;
  width: calc(100% - 0.75rem);
  height: calc(100% - 0.75rem);
  object-fit: cover;
  display: none;
}
.card-frame.has-img .card-img { display: block; }
.card-frame.has-img .card-placeholder { display: none; }
.card-frame .scan-line {
  position: absolute;
  left: 4%;
  right: 4%;
  height: 2px;
  top: 8%;
  background: var(--gold-40);
  box-shadow: 0 0 10px 2px rgba(200, 169, 107, 0.75);
  display: none;
}
.card-frame.scanning .scan-line {
  display: block;
  animation: ptscan 2s ease-in-out infinite alternate;
}
.card-frame.scanning .card-img { opacity: 0.85; }
@keyframes ptscan { from { top: 5%; } to { top: 93%; } }

.scan-drop {
  border: 1px dashed var(--border-strong);
  background: var(--layer-02);
  padding: var(--sp-05);
  display: flex;
  gap: var(--sp-05);
  align-items: flex-start;
  flex-wrap: wrap;
}
.scan-thumb {
  width: 9rem;
  min-height: 5.5rem;
  border: 1px solid var(--border-tile);
  background: var(--layer-01);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-placeholder);
  font-size: 0.75rem;
  overflow: hidden;
}
.scan-thumb img { width: 100%; height: auto; }
.scan-status {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--sp-03);
  min-height: 1.5rem;
}
.scan-status.is-error { color: var(--support-error); }
.scan-status.is-success { color: var(--support-success); }
.scan-status .spin { animation: ptspin 1s linear infinite; }
@keyframes ptspin { to { transform: rotate(360deg); } }
.ocr-filled {
  outline: 2px solid var(--gold-40) !important;
  outline-offset: -2px;
  transition: outline-color 2s ease 2s;
}
.photo-preview {
  margin-top: var(--sp-03);
  max-width: 10rem;
  border: 1px solid var(--border-tile);
  display: none;
}
.photo-preview.show { display: block; }

/* ── Utilities ────────────────────────────────────────────────────── */
.mt-05 { margin-top: var(--sp-05); }
.mt-07 { margin-top: var(--sp-07); }
.mb-05 { margin-bottom: var(--sp-05); }
.mb-07 { margin-bottom: var(--sp-07); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-05); flex-wrap: wrap; }
.max-form { max-width: 36rem; }
.hidden { display: none; }

@media print {
  .shell, .shell-mobile, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .tile, .table-container, .detail-list { border-color: #ccc; }
}
