/* ============================================================
   SERRANO COUNTRY CLUB — BEVERAGE MANAGEMENT PROGRAM
   Mobile-First PWA Stylesheet
   Color System: Forest Green · Rich Dark Copper · Warm Cream
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Forest Green — primary brand */
  --forest:          #1E3D2A;
  --forest-light:    #2B5038;
  --forest-dark:     #142A1C;
  --forest-subtle:   #EBF3EE;

  /* Rich Dark Copper — accent */
  --copper:          #8B4A2A;
  --copper-light:    #A35C36;
  --copper-dark:     #6B3520;
  --copper-subtle:   #F7EDEA;

  /* Warm Cream — backgrounds */
  --cream:           #FAF7F1;
  --cream-dark:      #F0EBE1;

  /* Surfaces */
  --surface:         #FFFFFF;
  --surface-2:       #FDFAF6;

  /* Borders */
  --border:          #DED8CC;
  --border-light:    #EDE8DF;

  /* Text — warm dark green tones */
  --text:            #1A2B1D;
  --text-2:          #4A5E50;
  --text-muted:      #8A9E8F;

  /* Semantic — Status colors */
  --green:           #2E7D4F;
  --green-light:     #E4F4EC;
  --amber:           #B45309;
  --amber-light:     #FEF3C7;
  --red:             #B91C1C;
  --red-light:       #FEE2E2;
  --blue:            #1D4ED8;
  --blue-light:      #EFF6FF;

  /* Shadows — warm green-tinted */
  --shadow-sm:  0 1px 3px rgba(20,42,28,.07), 0 1px 2px rgba(20,42,28,.05);
  --shadow:     0 4px 14px rgba(20,42,28,.10), 0 2px 4px rgba(20,42,28,.06);
  --shadow-lg:  0 8px 28px rgba(20,42,28,.14), 0 4px 8px rgba(20,42,28,.08);
  --shadow-copper: 0 4px 14px rgba(139,74,42,.18);

  /* Shape */
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   18px;

  /* Layout */
  --nav-h:       68px;
  --header-h:    58px;

  /* Motion */
  --transition:  .18s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Serif utility — for headings and display text ──────────── */
.serif {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* ── Layout ─────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100dvh; }

/* ── App Header ─────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--forest);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  box-shadow: 0 2px 12px rgba(20,42,28,.25);
}
.app-header .logo {
  display: flex; align-items: center; gap: 11px;
  color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .2px;
}
.app-header .logo-mark {
  width: 34px; height: 34px;
  background: var(--copper);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; font-size: 15px; color: #fff;
  box-shadow: 0 2px 6px rgba(139,74,42,.4);
}
/* Logo emblem — cream badge containing the club mark */
.logo-emblem {
  width: 38px; height: 38px;
  background: var(--cream);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.logo-emblem img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.logo-fallback {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; font-size: 18px;
  color: var(--copper);
}
.logo-text {
  display: flex; flex-direction: column; gap: 1px;
}
.logo-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px; font-weight: 700;
  color: #fff; line-height: 1;
  letter-spacing: .3px;
}
.logo-sub {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,.55);
  text-transform: uppercase; letter-spacing: .6px;
}

.header-actions { display: flex; gap: 8px; }
.header-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.65);
  transition: var(--transition);
}
.header-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.main-content {
  flex: 1;
  padding-bottom: calc(var(--nav-h) + 10px);
  overflow-y: auto;
}

/* ── Bottom Navigation ──────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: 0 -4px 18px rgba(20,42,28,.09);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  transition: var(--transition);
  padding: 6px 2px 4px;
  position: relative;
}
.nav-item.active { color: var(--forest); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 22%; right: 22%;
  height: 3px;
  background: var(--copper);
  border-radius: 0 0 3px 3px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

/* ── Pages / Views ──────────────────────────────────────────── */
.view { display: none; padding: 18px; max-width: 720px; margin: 0 auto; }
.view.active { display: block; }

/* ── Page / View Headers ────────────────────────────────────── */
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.view-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px; font-weight: 700;
  color: var(--forest);
  line-height: 1.2;
}
.page-header { margin-bottom: 20px; }
.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px; font-weight: 700;
  color: var(--forest); line-height: 1.2;
}
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px 11px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--text-muted);
}
.card-body { padding: 16px 18px; }
.card + .card { margin-top: 12px; }

/* Card with a copper top accent line */
.card-accent {
  border-top: 3px solid var(--copper);
}
.card-accent-forest {
  border-top: 3px solid var(--forest);
}

/* ── Dashboard Stat Grid ────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: var(--cream-dark);
}
.stat-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-muted);
}
.stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px; font-weight: 700;
  color: var(--forest); line-height: 1.1; margin-top: 4px;
}
.stat-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.stat-card.alert::after  { background: var(--amber); }
.stat-card.alert .stat-value { color: var(--amber); }
.stat-card.flag::after   { background: var(--red); }
.stat-card.flag .stat-value  { color: var(--red); }
.stat-card.good::after   { background: var(--green); }
.stat-card.good .stat-value  { color: var(--green); }
.stat-card.copper::after { background: var(--copper); }
.stat-card.copper .stat-value { color: var(--copper); }

/* ── Section headers inside views ──────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 10px;
}
.section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
}

/* ── List Group & Items ──────────────────────────────────────── */
.list-group {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--cream); }

.list-item-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.list-item-icon.spirits { background: var(--copper-subtle); }
.list-item-icon.wine    { background: #f9ece8; }
.list-item-icon.beer    { background: var(--forest-subtle); }
.list-item-icon.na      { background: #eff6ff; }
.list-item-icon.mixed   { background: var(--cream-dark); }

.list-item-main { flex: 1; min-width: 0; }
.list-item-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.list-item-end { text-align: right; flex-shrink: 0; }
.list-item-value { font-size: 15px; font-weight: 700; color: var(--forest); }
.list-item-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Badges / Pills ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.badge-green    { background: var(--green-light); color: var(--green); }
.badge-amber    { background: var(--amber-light); color: var(--amber); }
.badge-red      { background: var(--red-light);   color: var(--red); }
.badge-success  { background: var(--green-light); color: var(--green); }
.badge-warning  { background: var(--amber-light); color: var(--amber); }
.badge-info     { background: var(--forest-subtle); color: var(--forest-light); }
/* Legacy class names kept for JS compatibility */
.badge-navy     { background: var(--forest-subtle); color: var(--forest); }
.badge-gold     { background: var(--copper-subtle); color: var(--copper-dark); }
.badge-copper   { background: var(--copper-subtle); color: var(--copper-dark); }
.badge-forest   { background: var(--forest-subtle); color: var(--forest); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--forest); color: #fff;
  box-shadow: 0 2px 8px rgba(20,42,28,.2);
}
.btn-primary:active { background: var(--forest-dark); }

/* Copper — main accent CTA */
.btn-copper {
  background: var(--copper); color: #fff;
  box-shadow: var(--shadow-copper);
}
.btn-copper:active { background: var(--copper-dark); }

/* Keep .btn-gold as alias for .btn-copper */
.btn-gold {
  background: var(--copper); color: #fff;
  box-shadow: var(--shadow-copper);
}
.btn-gold:active { background: var(--copper-dark); }

.btn-secondary {
  background: var(--cream-dark); color: var(--forest);
  border: 1px solid var(--border);
}
.btn-secondary:active { background: var(--border); }

.btn-outline {
  background: transparent; color: var(--forest);
  border: 1.5px solid var(--forest);
}
.btn-outline:active { background: var(--forest-subtle); }

.btn-ghost {
  background: transparent; color: var(--text-2);
}
.btn-ghost:active { background: var(--cream-dark); }

.btn-danger {
  background: var(--red-light); color: var(--red);
}
.btn-danger:active { background: #fecaca; }

.btn-sm  { padding: 7px 14px; font-size: 13px; border-radius: 7px; }
.btn-lg  { padding: 15px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon  { padding: 10px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: .4; pointer-events: none; }

/* ── Action buttons — large tappable targets ────────────────── */
.action-btn {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  width: 100%; text-align: left;
  transition: box-shadow var(--transition), transform var(--transition);
}
.action-btn:active {
  background: var(--cream);
  transform: scale(.99);
  box-shadow: none;
}
.action-btn-icon {
  width: 50px; height: 50px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.action-btn-icon.navy,
.action-btn-icon.forest   { background: var(--forest); color: #fff; }
.action-btn-icon.gold,
.action-btn-icon.copper   { background: var(--copper); color: #fff; }
.action-btn-icon.green    { background: var(--green-light); color: var(--green); }
.action-btn-icon.amber    { background: var(--amber-light); color: var(--amber); }
.action-btn-body  { flex: 1; }
.action-btn-title { font-size: 16px; font-weight: 700; color: var(--text); }
.action-btn-sub   { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.action-btn-arrow { color: var(--text-muted); font-size: 18px; }
.action-btn + .action-btn { margin-top: 10px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-2); margin-bottom: 7px;
}
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(30,61,42,.1);
}
.form-control.error { border-color: var(--red); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A9E8F' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ── Detail rows (key-value pairs in modals/cards) ──────────── */
.detail-row {
  display: flex; gap: 12px; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-2); font-weight: 600; flex-shrink: 0; }

/* ── Modal / Drawer ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,42,28,.55);
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-sheet {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-height: 92dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,0,.67,0);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 32px rgba(20,42,28,.18);
}
.modal-backdrop.open .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 10px auto 6px;
}
.modal-header {
  padding: 8px 18px 13px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px; font-weight: 700; color: var(--forest);
}
.modal-body { padding: 18px; }
.modal-footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
}

/* ── Alert banners ──────────────────────────────────────────── */
.alert {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 12px;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-amber { background: var(--amber-light); color: #92400e; border: 1px solid #fde68a; }
.alert-red   { background: var(--red-light);   color: #7f1d1d; border: 1px solid #fca5a5; }
.alert-green { background: var(--green-light); color: #14532d; border: 1px solid #86efac; }
.alert-forest { background: var(--forest-subtle); color: var(--forest); border: 1px solid #c2d9c9; }

/* ── Camera / Recording UI ──────────────────────────────────── */
.camera-view {
  position: fixed; inset: 0; z-index: 300;
  background: #000; display: flex; flex-direction: column;
  user-select: none; -webkit-user-select: none;
}
#cam-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}

/* Top HUD bar */
.cam-hud-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: 52px 1fr 64px;
  align-items: center; padding: 52px 16px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,.6) 0%, transparent 100%);
}

/* Close button */
.camera-close {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.4); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; border: 1.5px solid rgba(255,255,255,.2);
  justify-self: start;
}

/* Recording timer */
.record-timer {
  font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .5px;
  text-align: center; display: none;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.record-timer.visible { display: block; }

/* Frame counter */
.cam-frame-count {
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.4); padding: 4px 10px; border-radius: 16px;
  display: none; text-align: center;
  border: 1px solid rgba(255,255,255,.15); justify-self: end;
}

/* Viewfinder corners */
.cam-focus-frame {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.cam-corner {
  position: absolute; width: 26px; height: 26px;
  border-style: solid; border-color: rgba(255,255,255,.6); border-width: 0;
  transition: border-color .15s, opacity .15s;
}
.cam-corner.cam-tl { top: 22%; left: 8%;  border-top-width: 3px; border-left-width:  3px; border-radius: 4px 0 0 0; }
.cam-corner.cam-tr { top: 22%; right: 8%; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.cam-corner.cam-bl { bottom: 22%; left: 8%;  border-bottom-width: 3px; border-left-width:  3px; border-radius: 0 0 0 4px; }
.cam-corner.cam-br { bottom: 22%; right: 8%; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }
@keyframes focusFlash { 0%{opacity:1} 40%{opacity:.15} 100%{opacity:1} }
.cam-focus-frame.flash .cam-corner { border-color: #fff; animation: focusFlash .28s ease; }

/* 3-2-1 countdown overlay */
.cam-countdown {
  position: absolute; inset: 0; z-index: 20;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.55);
}
.cam-countdown.visible { display: flex; }
@keyframes countPop { from { transform: scale(1.5); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.cam-countdown-num {
  font-size: 100px; font-weight: 900; color: #fff; line-height: 1;
  animation: countPop .35s ease;
  text-shadow: 0 4px 32px rgba(0,0,0,.5);
}
.cam-countdown-tip {
  font-size: 18px; font-weight: 600; color: rgba(255,255,255,.92);
  margin-top: 18px; text-align: center; padding: 0 36px; line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* Live motion / quality pill */
.cam-motion-pill {
  position: absolute; bottom: 158px; left: 50%; transform: translateX(-50%);
  padding: 8px 20px; border-radius: 24px; font-size: 14px; font-weight: 700;
  white-space: nowrap; z-index: 10; display: none;
  transition: background .25s, color .25s;
}
.cam-motion-pill.visible { display: block; }
.cam-motion--ready { background: rgba(255,255,255,.2);  color: rgba(255,255,255,.9); }
.cam-motion--good  { background: rgba(22,163,74,.9);    color: #fff; }
.cam-motion--warn  { background: rgba(202,138,4,.9);    color: #fff; }
.cam-motion--bad   { background: rgba(185,28,28,.9);    color: #fff; }

/* Contextual coaching tip */
.cam-tip {
  position: absolute; bottom: 140px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85);
  white-space: nowrap; z-index: 10; display: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
}

/* Bottom camera controls — 3-col grid keeps shutter always centered */
.camera-controls {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: 64px 1fr 64px;
  align-items: center; padding: 18px 24px 48px;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
}

/* Torch button */
.cam-torch-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  display: none; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,.25); transition: background .2s, color .2s;
  justify-self: start;
}
.cam-torch-btn.visible { display: flex; }
.cam-torch-btn.active  { background: #FFD600; color: #111; border-color: #FFD600; }

/* Shutter button */
.cam-shutter-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  justify-self: center;
}
.camera-shutter {
  width: 80px; height: 80px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.9); background: transparent;
  position: relative; transition: transform .1s;
  flex-shrink: 0;
}
.camera-shutter::after {
  content: '';
  position: absolute; inset: 7px; border-radius: 50%; background: rgba(255,255,255,.92);
  transition: background .2s, inset .18s, border-radius .18s;
}
.camera-shutter.recording::after {
  background: #dc2626; inset: 22px; border-radius: 5px;
}
.camera-shutter:active { transform: scale(.91); }
.cam-shutter-label {
  font-size: 10px; font-weight: 800; color: rgba(255,255,255,.75);
  letter-spacing: 1px; text-transform: uppercase; text-align: center;
}

/* Zoom button */
.cam-zoom-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  display: none; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,.25); font-size: 14px; font-weight: 700;
  transition: background .2s, color .2s; justify-self: end;
}
.cam-zoom-btn.visible { display: flex; }
.cam-zoom-btn.active  { background: rgba(255,255,255,.9); color: #111; }

/* ── Photo Upload Zone ──────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--surface);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--forest);
  background: var(--forest-subtle);
}
.upload-zone-icon { font-size: 38px; margin-bottom: 10px; }
.upload-zone-text { font-size: 15px; font-weight: 700; color: var(--forest); }
.upload-zone-sub  { font-size: 13px; color: var(--text-2); margin-top: 5px; }

/* ── Progress / Loading ─────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.loading-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(250,247,241,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  backdrop-filter: blur(4px);
}
.loading-text { font-size: 15px; font-weight: 600; color: var(--forest); }

.progress-bar-wrap { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; background: var(--copper); transition: width .3s; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: var(--cream-dark);
  padding: 10px 14px;
  text-align: left;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr.flagged td { background: #fefce8; }
tr.flagged-red td { background: var(--red-light); }
tr:hover td { background: var(--cream); }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--forest); }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  flex: 1; border: none; background: none; font-size: 15px; color: var(--text);
}
.search-bar input:focus { outline: none; }
.search-bar input::placeholder { color: var(--text-muted); }

/* ── Filter chips ───────────────────────────────────────────── */
.filter-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-2);
  white-space: nowrap; flex-shrink: 0;
  transition: var(--transition);
}
.chip.active {
  background: var(--forest); color: #fff; border-color: var(--forest);
}
.chip:active { opacity: .8; }

/* ── Par Level Indicator ────────────────────────────────────── */
.par-bar-wrap { height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 5px; }
.par-bar      { height: 100%; border-radius: 4px; }
.par-bar.ok       { background: var(--green); }
.par-bar.low      { background: var(--amber); }
.par-bar.critical { background: var(--red); }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-icon  { font-size: 48px; margin-bottom: 14px; }
.empty-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px; font-weight: 700; color: var(--forest);
}
.empty-sub { font-size: 14px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }

/* ── Toast notifications ────────────────────────────────────── */
#toast-container {
  position: fixed; top: calc(var(--header-h) + 10px); left: 50%;
  transform: translateX(-50%);
  z-index: 500; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; width: calc(100% - 32px); max-width: 400px;
}
.toast {
  background: var(--forest); color: #fff;
  padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideDown .25s ease;
  pointer-events: auto;
  display: flex; gap: 10px; align-items: center;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--amber); color: #fff; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ── Keg status colors ──────────────────────────────────────── */
.keg-full  { color: var(--green);      font-weight: 700; }
.keg-half  { color: var(--amber);      font-weight: 700; }
.keg-low   { color: var(--red);        font-weight: 700; }
.keg-empty { color: var(--text-muted); font-weight: 700; }

/* ── Invoice status ─────────────────────────────────────────── */
.status-processing { color: var(--amber); }
.status-processed  { color: var(--green); }
.status-flagged    { color: var(--red); }
.status-reconciled { color: var(--text-muted); }

/* ── Price change indicators ────────────────────────────────── */
.price-up   { color: var(--red);   font-weight: 700; }
.price-down { color: var(--green); font-weight: 700; }

/* ── Scrollable content areas ───────────────────────────────── */
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ── Step indicators (multi-step flows) ─────────────────────── */
.steps { display: flex; align-items: center; gap: 4px; margin-bottom: 22px; }
.step  { flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background .3s; }
.step.done   { background: var(--copper); }
.step.active { background: var(--forest); }

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

/* ── Floating action button ─────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px); right: 16px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--copper); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-copper);
  font-size: 26px; z-index: 90;
  transition: transform .15s, background .15s;
}
.fab:active { transform: scale(.93); background: var(--copper-dark); }

/* ── Cost % color coding ────────────────────────────────────── */
.cost-good { color: var(--green); font-weight: 800; }
.cost-ok   { color: var(--amber); font-weight: 800; }
.cost-bad  { color: var(--red);   font-weight: 800; }

/* ── Decorative section divider with club mark ──────────────── */
.club-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 16px; color: var(--text-muted);
}
.club-divider::before, .club-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.club-divider-mark {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; white-space: nowrap;
}

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (min-width: 480px) {
  .view { padding: 22px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .bottom-nav {
    max-width: 720px; left: 50%; transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .main-content { max-width: 720px; margin: 0 auto; }
  .fab { right: calc(50% - 344px); }
}
