/* ==========================================================================
   Food Tracker — unified design system (mobile-first)
   Navy shell #0f1923 · orange accent #F26B21 · green success · Inter
   Shared across the admin, congregation and crew portals.
   ========================================================================== */
:root {
  /* Shell / dark surfaces */
  --brand:            #0f1923;   /* navy — nav, buttons, headings */
  --brand-hover:      #1c2f40;
  --surface:          #16212e;   /* darker panel (auth right side) */
  --shell-divider:    rgba(255,255,255,0.06);
  --shell-text:       #e8edf2;
  --shell-text-2:     #7a8fa6;
  --shell-label:      #465a72;

  /* Orange accent (from the Food Tracker logo) */
  --accent:           #F26B21;
  --accent-hover:     #d95a17;
  --accent-soft:      rgba(242,107,33,0.10);
  --accent-border:    rgba(242,107,33,0.28);

  /* Green — secondary highlight + success */
  --green:            #71BF45;
  --green-dark:       #2d5e14;
  --green-soft:       #eef7e8;
  --green-border:     rgba(113,191,69,0.28);

  /* Text on light surfaces */
  --ink:              #111827;
  --ink-2:            #374151;
  --muted:            #6b7280;
  --hint:             #9aa4b2;
  --line:             #d1d8e0;
  --line-2:           #eef0f4;

  /* App background + cards */
  --bg:               #f4f6f9;
  --card:             #ffffff;

  /* Status */
  --ok: #2d7a1f;      --ok-bg: #eef7e8;   --ok-border: #bfe0aa;
  --err: #b3261e;     --err-bg: #fdecea;  --err-border: #f2b8b5;

  /* Radii + shadow + motion */
  --r-lg: 14px; --r: 12px; --r-sm: 10px;
  --sh-1: 0 1px 2px rgba(15,25,35,.08);
  --sh-2: 0 1px 3px rgba(15,25,35,.10), 0 10px 30px rgba(15,25,35,.10);
  --sh-card: 0 24px 56px rgba(0,0,0,0.28);
  --ease: cubic-bezier(.2,.7,.3,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 6%, rgba(242,107,33,.05), transparent 30%),
    radial-gradient(circle at 94% 10%, rgba(113,191,69,.05), transparent 30%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1,h2,h3 { color: var(--ink); letter-spacing: -0.02em; }

/* Layout */
.container { max-width: 980px; margin: 0 auto; padding: 26px 18px 72px; }
.container-narrow { max-width: 460px; }

/* Nav — clean light bar, navy brand, orange accents */
.nav { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 30; }
.nav-inner { max-width: 980px; margin: 0 auto; padding: 11px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--brand);
  font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { height: 40px; width: auto; display: block; }
.nav-brand span { color: var(--accent); }
.nav-chip { font-size: 10px; font-weight: 800; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-border); padding: 3px 9px; border-radius: 999px;
  letter-spacing: .08em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-links a { padding: 7px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.nav-links a:hover { background: var(--accent-soft); color: var(--accent-hover); text-decoration: none; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); padding: 22px; margin-bottom: 16px; }
.card h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

/* Simple centered auth (admin/crew login, crew role pages) — sits on the navy shell */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 18px; background: var(--brand);
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 6px; line-height: 1.1; color: var(--shell-text);
  font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.auth-logo img { height: 58px; width: auto; }
.auth-logo span { color: var(--accent); }
.auth-sub { text-align: center; color: var(--shell-text-2); margin: 0 0 18px; font-size: 14px; }
.auth-card .card { box-shadow: var(--sh-card); padding: 28px 24px; border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,0.06); }

/* Forms */
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 16px; font-family: inherit; background: #f9fafb; color: var(--ink);
  transition: border-color .18s, box-shadow .18s, background .18s; }
.field input::placeholder, .field textarea::placeholder { color: var(--hint); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b8c0cc; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: #fff; border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-soft); }
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 40px #fff inset; box-shadow: 0 0 0 40px #fff inset;
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
.row { display: flex; gap: 12px; }
.row .field { flex: 1; }

/* Buttons — navy primary */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700; padding: 12px 18px; border-radius: var(--r-sm);
  background: var(--brand); color: var(--shell-text); box-shadow: 0 4px 14px rgba(15,25,35,.22);
  transition: background .18s, box-shadow .18s, transform .1s var(--ease); }
.btn:hover { background: var(--brand-hover); color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgba(15,25,35,.30); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-block { width: 100%; min-height: 50px; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; box-shadow: none; }
/* Orange call-to-action variant */
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(242,107,33,.28); }
.btn-accent:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 6px 18px rgba(242,107,33,.34); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: #f1f3f5; color: var(--ink); box-shadow: none; transform: none; }
.btn-danger { background: #fff; color: var(--err); border-color: #f2b8b5; box-shadow: none; }
.btn-danger:hover { background: var(--err-bg); color: var(--err); box-shadow: none; transform: none; }

/* Alerts */
.alert { padding: 12px 15px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 15px; display: none; border: 1px solid transparent; }
.alert.show { display: block; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.alert-err { background: var(--err-bg); color: var(--err); border-color: var(--err-border); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--sh-1);
  position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.stat .num { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.stat .label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-active { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green-border); }
.badge-role { background: var(--accent-soft); color: var(--accent-hover); border: 1px solid var(--accent-border); }
.badge-muted { background: var(--line-2); color: var(--muted); }

.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.025em; margin: 2px 0; color: var(--brand); }
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.mt { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Progress bars */
.pbar { background: #e9edf1; border-radius: 999px; height: 8px; overflow: hidden; }
.pbar > div { height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s var(--ease); }

/* Modal */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(15,25,35,.55); backdrop-filter: blur(2px);
  z-index: 70; align-items: center; justify-content: center; padding: 16px; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: var(--r-lg); padding: 22px; width: 100%; max-width: 440px;
  box-shadow: var(--sh-card); max-height: 92vh; overflow-y: auto; }
.modal h3 { margin: 0 0 16px; }

/* Collapsibles */
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '⌄'; float: right; color: var(--muted); font-size: 18px; line-height: 1; transition: transform .2s; }
details.card[open] > summary::after { transform: rotate(180deg); }

/* ==========================================================================
   Dark two-panel auth (login / signup / forgot / reset / 2FA)
   Navy left panel with grid texture · surface right panel · white card
   ========================================================================== */
.ft-auth-page { min-height: 100vh; display: grid; background: var(--brand);
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr); position: relative; overflow: hidden; }

/* Left branding panel */
.ft-auth-branding { padding: clamp(36px, 5vw, 56px); display: flex; flex-direction: column;
  justify-content: center; gap: 34px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(242,107,33,0.05) 0%, transparent 55%);
  border-right: 1px solid var(--shell-divider); }
.ft-auth-branding::before { content:""; position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px; }
.ft-auth-branding::after { content:""; position:absolute; width:360px; height:360px; right:-120px; top:8%;
  border-radius:50%; background: radial-gradient(circle, rgba(113,191,69,.10), transparent 70%); pointer-events:none; }
.ft-brand-content { width:100%; max-width:560px; position:relative; z-index:1; }
.ft-brand-logo { display:inline-flex; align-items:center; gap:14px; margin-bottom:40px; }
.ft-brand-logo img { display:block; max-width:210px; max-height:56px; object-fit:contain; }
.ft-brand-eyebrow { display:inline-flex; align-items:center; gap:9px; margin-bottom:22px;
  font-size:10px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color: var(--shell-label); }
.ft-brand-eyebrow::before { content:""; width:22px; height:2px; border-radius:2px; background: var(--accent); }
.ft-brand-title { max-width:560px; margin:0 0 18px; color: var(--shell-text); font-size:clamp(34px,4.4vw,50px);
  line-height:1.05; letter-spacing:-.03em; font-weight:800; }
.ft-brand-title span { color: var(--accent); }
.ft-brand-description { max-width:500px; margin:0; color: var(--shell-text-2); font-size:15px; line-height:1.75; }
.ft-feature-list { display:grid; gap:8px; margin-top:34px; max-width:500px; }
.ft-feature { display:flex; align-items:center; gap:13px; padding:14px 16px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07);
  color: var(--shell-text); font-size:14px; font-weight:600; }
.ft-feature-icon { width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center; border-radius:9px;
  background: var(--accent-soft); border:1px solid var(--accent-border); color: var(--accent); }
.ft-feature-icon svg { width:18px; height:18px; }

/* Right panel + card */
.ft-auth-panel { display:flex; align-items:center; justify-content:center; padding:40px 36px;
  position:relative; z-index:2; background: var(--surface); }
.ft-login-card { width:100%; max-width:460px; padding:34px 30px; border:1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-card); color: var(--ink); }
.ft-mobile-logo { display:none; justify-content:center; margin-bottom:26px; }
.ft-mobile-logo img { max-width:190px; max-height:56px; object-fit:contain; }
.ft-login-header { margin-bottom:24px; }
.ft-login-header h1 { margin:0 0 8px; color: var(--brand); font-size:27px; line-height:1.15; letter-spacing:-.02em; font-weight:800; }
.ft-login-header p { margin:0; color: var(--muted); font-size:14px; line-height:1.6; }
.ft-portal-badge { display:inline-flex; align-items:center; gap:7px; margin-bottom:18px; padding:5px 11px;
  border-radius:999px; background: var(--accent-soft); border:1px solid var(--accent-border);
  color: var(--accent-hover); font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.ft-portal-badge svg { width:15px; height:15px; }
.ft-login-card .field { margin-bottom:18px; }
.ft-login-card .field label { display:block; margin-bottom:7px; color: var(--ink-2); font-size:13px; font-weight:700; }
.ft-input-wrap { position:relative; }
.ft-input-icon { position:absolute; left:14px; top:50%; width:19px; height:19px; color: var(--hint); transform:translateY(-50%); pointer-events:none; transition:color .2s; }
.ft-login-card input[type="email"], .ft-login-card input[type="password"], .ft-login-card input[type="text"] {
  width:100%; height:52px; padding:0 44px; border:1px solid var(--line); border-radius: var(--r-sm); outline:none; background:#f9fafb;
  color: var(--ink); font-family:inherit; font-size:16px; transition:border-color .18s, box-shadow .18s, background .18s; }
.ft-login-card input:hover { border-color:#b8c0cc; }
.ft-login-card input:focus { background:#fff; border-color: var(--accent-border); box-shadow:0 0 0 3px var(--accent-soft); }
.ft-login-card input.plain, .ft-login-card select, .ft-login-card textarea { padding:0 15px; }
.ft-login-card select, .ft-login-card textarea { width:100%; min-height:52px; border:1px solid var(--line); border-radius: var(--r-sm); background:#f9fafb; color:var(--ink); font-family:inherit; font-size:16px; }
.ft-login-card textarea { padding:12px 15px; min-height:auto; }
.ft-input-wrap:focus-within .ft-input-icon { color: var(--accent); }
.ft-password-toggle { position:absolute; right:10px; top:50%; width:36px; height:36px; display:grid; place-items:center;
  border:0; border-radius:50%; background:transparent; color: var(--muted); cursor:pointer; transform:translateY(-50%); transition:background .2s; }
.ft-password-toggle:hover { background:#f1f3f5; }
.ft-password-toggle svg { width:19px; height:19px; }
.ft-login-card .btn { width:100%; min-height:52px; display:inline-flex; align-items:center; justify-content:center; gap:9px;
  border:0; border-radius: var(--r-sm); background: var(--brand); color: var(--shell-text); font-family:inherit; font-size:15px; font-weight:700;
  cursor:pointer; box-shadow:0 4px 14px rgba(15,25,35,.24); transition:background .18s, box-shadow .18s, transform .18s; }
.ft-login-card .btn:hover:not(:disabled) { background: var(--brand-hover); color:#fff; box-shadow:0 7px 18px rgba(15,25,35,.30); transform:translateY(-1px); }
.ft-login-card .btn:active:not(:disabled) { transform:translateY(0); }
.ft-login-card .btn:disabled { cursor:not-allowed; opacity:.7; }
.ft-login-card .btn svg { width:18px; height:18px; }
.ft-login-card .alert { display:none; align-items:flex-start; gap:10px; margin-bottom:20px; padding:12px 14px; border:1px solid transparent; border-radius: var(--r-sm); font-size:14px; line-height:1.5; }
.ft-login-card .alert.show { display:flex; }
.ft-login-card .alert-ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }
.ft-login-card .alert-err { border-color: var(--err-border); background: var(--err-bg); color: var(--err); }
.ft-login-links { margin:22px 0 0; text-align:center; color: var(--muted); font-size:14px; line-height:1.9; }
.ft-login-links a { color: var(--accent); font-weight:700; text-decoration:none; }
.ft-login-links a:hover { text-decoration:underline; }
.ft-security-note { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:24px; color: var(--hint); font-size:12px; }
.ft-security-note svg { width:15px; height:15px; }
.ft-code-message { margin:0 0 20px; color: var(--muted); font-size:14px; line-height:1.65; }
.ft-code-input { text-align:center; font-size:25px !important; font-weight:700; letter-spacing:.35em; padding-left:52px !important; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1020px) {
  .ft-auth-page { grid-template-columns: 1fr; }
  .ft-auth-branding { display:none; }
  .ft-auth-panel { min-height:100vh; padding:32px 20px; }
  .ft-mobile-logo { display:flex; }
}
@media (max-width: 560px) {
  .container { padding: 18px 14px 56px; }
  .card { padding: 18px; }
  .row { flex-direction: column; gap: 0; }
  .page-title { font-size: 22px; }
  .nav-links a { padding: 7px 9px; font-size: 13.5px; }
  .nav-brand { font-size: 16px; }
  /* Center the login card vertically — no dead space below on tall phones */
  .ft-auth-panel { align-items:center; justify-content:center; padding:22px 14px;
    min-height:100vh; min-height:100dvh; }
  .ft-login-card { max-width:100%; padding:28px 20px; box-shadow:0 10px 30px rgba(0,0,0,.18); }
  .ft-login-header h1 { font-size:24px; }
  .auth-card .card { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================================
   Mobile app layer (2026-07) — hamburger drawer, card-tables, zoom lock,
   decrowded spacing. Desktop is unchanged; everything below is additive.
   ========================================================================== */

/* Kill double-tap zoom + tap flash on touch devices (pairs with the
   maximum-scale=1 viewport for a full zoom lock). */
a, button, input, select, textarea, label, summary { touch-action: manipulation; }
body { -webkit-tap-highlight-color: transparent; }

/* Hamburger button — hidden on desktop */
.nav-toggle { display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent;
  color: var(--brand); cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle:active { background: var(--accent-soft); color: var(--accent); }

/* Slide-in drawer (mobile menu) */
.drawer-bg { position: fixed; inset: 0; background: rgba(15,25,35,.55); backdrop-filter: blur(2px);
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.drawer-bg.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: min(300px, 84vw); background: var(--brand); color: var(--shell-text);
  display: flex; flex-direction: column; box-shadow: -18px 0 48px rgba(0,0,0,.35);
  transform: translateX(105%); transition: transform .28s var(--ease);
  padding-bottom: env(safe-area-inset-bottom); }
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px 20px;
  border-bottom: 1px solid var(--shell-divider); }
.drawer-head img { height: 34px; width: auto; }
.drawer-close { width: 44px; height: 44px; display: grid; place-items: center; border: 0;
  border-radius: 12px; background: rgba(255,255,255,.06); color: var(--shell-text); cursor: pointer; }
.drawer-close svg { width: 22px; height: 22px; }
.drawer-links { flex: 1; overflow-y: auto; padding: 12px 12px 18px; display: flex; flex-direction: column; gap: 4px; }
.drawer-links a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px;
  border-radius: 12px; color: var(--shell-text); font-size: 16px; font-weight: 600; }
.drawer-links a:hover { text-decoration: none; background: rgba(255,255,255,.06); color: #fff; }
.drawer-links a.is-current { background: var(--accent-soft); color: var(--accent); }
.drawer-links a.drawer-logout { margin-top: auto; color: #ff9d7a; border-top: 1px solid var(--shell-divider);
  border-radius: 0 0 12px 12px; }
.drawer-icon { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; }
.drawer-icon svg { width: 21px; height: 21px; }
body.drawer-open { overflow: hidden; }

/* Desktop current-page highlight */
.nav-links a.is-current { background: var(--accent-soft); color: var(--accent-hover); }

@media (max-width: 760px) {
  .nav .nav-links { display: none; }   /* top-bar links live in the drawer on phones */
  .nav-toggle { display: inline-flex; }
  .nav-inner { padding: 8px 12px 8px 16px; }
  .nav-brand img { height: 36px; }
}

/* ── Card-style tables on phones (tables tagged .rt) ─────────────────────
   Each row becomes a rounded card; cells stack with their heading on the
   left (from data-label). Action cells (.rt-actions) become a button row. */
@media (max-width: 700px) {
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt thead { display: none; }
  table.rt tr { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r);
    box-shadow: var(--sh-1); margin-bottom: 10px; padding: 6px 14px; }
  table.rt tr:last-child { margin-bottom: 0; }
  table.rt td { border: 0; padding: 8px 0; display: flex; align-items: center; gap: 12px;
    justify-content: space-between; text-align: right; border-bottom: 1px solid var(--line-2); }
  table.rt td:last-child { border-bottom: 0; }
  table.rt td[data-label]::before { content: attr(data-label); flex: 0 0 auto;
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 800; text-align: left; }
  table.rt td:not([data-label]) { justify-content: flex-end; }
  table.rt td.rt-primary { justify-content: flex-start; text-align: left;
    font-weight: 700; font-size: 16px; padding-top: 12px; }
  table.rt td.rt-primary::before { display: none; }
  table.rt td.rt-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
    padding-top: 10px; padding-bottom: 12px; }
  table.rt td.rt-actions::before { display: none; }
  table.rt tbody tr:hover td { background: transparent; }
  /* the wrapper no longer needs to scroll sideways */
  .table-wrap:has(> table.rt) { overflow-x: visible; }
}

/* ── General mobile decrowding / app feel ───────────────────────────────── */
@media (max-width: 700px) {
  .container { padding: 16px 14px calc(40px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 22px; }
  .breadcrumb { margin-bottom: 12px; }
  .card { padding: 16px; border-radius: var(--r-lg); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .num { font-size: 21px; }
  /* Page headers stack; their action button becomes full-width and thumb-sized */
  .container > .flex-between { flex-direction: column; align-items: stretch; gap: 8px; }
  .container > .flex-between .btn { width: 100%; min-height: 48px; }
  /* Card headers keep title + button on one line but give the button room */
  .btn-sm { min-height: 40px; padding: 8px 14px; }
  .btn { min-height: 48px; }
  .modal { border-radius: var(--r-lg); padding: 18px; max-height: 88vh; }
  input, select, textarea { font-size: 16px !important; } /* prevents iOS focus zoom */
}

/* In-page action button rows (event header, dashboard quick actions) */
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; min-height: 44px; }
  /* stacked .row leaves loose buttons flush — give them room + full width */
  .row { flex-direction: column; gap: 0; }
  .row > .btn, .row > a.btn { width: 100%; margin-top: 8px; }
}

/* ==========================================================================
   Mobile density pass (2026-07-28) — native-app feel: section tabs on the
   event page, tighter cards, less scrolling. Desktop unchanged.
   ========================================================================== */

/* Segmented tab bar — hidden on desktop */
.seg { display: none; }

@media (max-width: 700px) {
  .seg { display: flex; gap: 4px; position: sticky; top: 54px; z-index: 25;
    background: rgba(244,246,249,.96); backdrop-filter: blur(8px);
    padding: 5px; margin: 2px 0 12px; border-radius: 12px;
    border: 1px solid var(--line-2); box-shadow: var(--sh-1); }
  .seg-btn { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent;
    font-family: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
  .seg-btn.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(15,25,35,.25); }

  /* Show only the active section's cards */
  .container.tabbed[data-tab="overview"] .sec:not(.sec-overview),
  .container.tabbed[data-tab="menu"]     .sec:not(.sec-menu),
  .container.tabbed[data-tab="people"]   .sec:not(.sec-people),
  .container.tabbed[data-tab="money"]    .sec:not(.sec-money) { display: none; }

  /* ── Denser everything ─────────────────────────────── */
  .container { padding-top: 10px; }
  .container > .breadcrumb:first-child { display: none; }  /* path duplicates the title */
  .breadcrumb { font-size: 12.5px; margin-bottom: 8px; }
  .page-title { font-size: 20px; }
  .card { padding: 13px 14px; margin-bottom: 10px; border-radius: 12px; }
  .card h2 { font-size: 15px; }
  .card .sub { font-size: 13px; margin-bottom: 10px; }
  .stats { gap: 8px; }
  .stat { padding: 9px 12px; border-radius: 10px; }
  .stat .num { font-size: 17px; }
  .stat .label { font-size: 11px; margin-top: 0; }
  .field { margin-bottom: 11px; }
  .field > label { font-size: 12px; margin-bottom: 4px; }
  .field input, .field select, .field textarea { padding: 10px 12px; }

  /* Header action buttons: one compact row instead of a stack */
  .container > .flex-between { gap: 6px; }
  .page-actions { flex-wrap: nowrap; gap: 6px; }
  .page-actions .btn { flex: 1; min-height: 40px; padding: 6px 4px; font-size: 12.5px; white-space: nowrap; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; padding: 6px 12px; font-size: 12.5px; }

  /* Row-cards: tighter */
  table.rt tr { padding: 2px 12px; margin-bottom: 8px; border-radius: 10px; }
  table.rt td { padding: 6px 0; font-size: 13.5px; }
  table.rt td[data-label]::before { font-size: 10px; }
  table.rt td.rt-primary { font-size: 14.5px; padding-top: 10px; padding-bottom: 6px; }
  table.rt td.rt-actions { gap: 6px; padding-top: 6px; padding-bottom: 10px; }
}
