/* ============================================================
   Wine Cellar Tracker — app.css
   Dark wine-cellar aesthetic: deep burgundy, aged gold, slate
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg-base:       #0f0604;
  --bg-surface:    #1a0c07;
  --bg-card:       #221209;
  --bg-raised:     #2d1810;
  --bg-input:      #1e0f08;
  --border:        rgba(180,100,40,0.18);
  --border-med:    rgba(180,100,40,0.32);
  --border-strong: rgba(180,100,40,0.55);
  --gold:          #c9933a;
  --gold-light:    #e8b96a;
  --gold-dim:      #8a6020;
  --wine:          #8b1a2e;
  --wine-bright:   #c0233f;
  --wine-light:    #e85070;
  --cream:         #f2e8d8;
  --text-primary:  #f0e6d2;
  --text-secondary:#b8a080;
  --text-muted:    #6e5540;
  --text-hint:     #4a3828;
  --green:         #3d8b5a;
  --green-light:   #52c47a;
  --amber:         #d4850a;
  --red:           #c0392b;
  --blue:          #2980b9;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     22px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.65);
  --nav-h:         60px;
  --header-h:      56px;
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-ui:       'Inter', system-ui, sans-serif;
  --transition:    0.18s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-ui); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Splash screen ─────────────────────────────────────────── */
#splash {
  position: fixed; inset: 0;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
#splash.fade-out { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo {
  font-size: 64px; color: var(--wine-bright);
  margin-bottom: 16px;
  animation: pulse-wine 2s ease-in-out infinite;
}
@keyframes pulse-wine {
  0%,100% { color: var(--wine-bright); }
  50% { color: var(--gold); }
}
.splash-name {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  margin-bottom: 32px;
}
.splash-spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ── Top header ─────────────────────────────────────────────── */
#top-header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.header-brand {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.03em;
  flex: 1;
}
.header-brand span { color: var(--wine-bright); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  font-size: 20px;
}
.icon-btn:hover { background: var(--bg-raised); color: var(--text-primary); }
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--wine);
  color: var(--cream);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--border-med);
  transition: border-color var(--transition);
}
.avatar-btn:hover { border-color: var(--gold); }

/* ── Main content area ─────────────────────────────────────── */
#main-content {
  flex: 1;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* ── Bottom navigation ─────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
  cursor: pointer;
  padding: 8px 4px 0;
  position: relative;
}
.nav-item i { font-size: 22px; transition: transform var(--transition); }
.nav-item.active { color: var(--gold); }
.nav-item.active i { transform: scale(1.1); }
.nav-item.nav-add {
  color: var(--wine-bright);
}
.nav-item.nav-add i {
  background: var(--wine);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border: 2px solid var(--wine-bright);
  margin-top: -10px;
  transition: background var(--transition), transform var(--transition);
}
.nav-item.nav-add:hover i { background: var(--wine-bright); transform: scale(1.05); }

/* ── Page sections ─────────────────────────────────────────── */
.page { display: none; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header {
  padding: 20px 16px 12px;
  display: flex; align-items: center; gap: 12px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 500;
  color: var(--gold-light);
  flex: 1;
}
.page-subtitle {
  font-size: 13px; color: var(--text-muted);
  margin-top: 2px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-padded { padding: 16px; }
.card + .card { margin-top: 12px; }

/* ── Stat row ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 500;
  color: var(--gold-light);
  line-height: 1;
}
.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Section headers ───────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
}
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.section-action {
  font-size: 13px;
  color: var(--gold);
  cursor: pointer;
}

/* ── Bottle list ───────────────────────────────────────────── */
.bottle-list { padding: 0 16px 8px; }
.bottle-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.bottle-item:hover, .bottle-item:active {
  border-color: var(--border-strong);
  background: var(--bg-raised);
}
.bottle-item.selected { border-color: var(--gold); }

.bottle-color-bar {
  width: 4px; height: 100%;
  border-radius: 2px;
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.wine-red    { background: #8b1a2e; }
.wine-white  { background: #d4a843; }
.wine-rose   { background: #d4607a; }
.wine-spark  { background: #b8973a; }
.wine-dessert{ background: #c07820; }
.wine-fort   { background: #6b3a8b; }
.wine-other  { background: #4a6b4a; }

.bottle-thumb {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-hint);
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
  margin-left: 8px;
}
.bottle-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bottle-info { flex: 1; min-width: 0; }
.bottle-producer {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bottle-name {
  font-size: 15px; font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.bottle-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px; flex-wrap: wrap;
}
.bottle-vintage {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 500;
  color: var(--gold);
}
.bottle-tag {
  font-size: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bottle-score {
  font-size: 12px; font-weight: 600;
  color: var(--gold);
}
.bottle-right { text-align: right; flex-shrink: 0; }
.bottle-location {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 3px;
}
.bottle-price {
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
}
.bottle-checkbox {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--border-med);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}
.bottle-item.selected .bottle-checkbox {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-base);
}

/* ── Search & filter bar ───────────────────────────────────── */
.search-bar {
  padding: 8px 16px;
  display: flex; gap: 8px;
}
.search-input-wrap {
  flex: 1;
  position: relative;
}
.search-input-wrap i {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 18px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  padding: 9px 12px 9px 36px;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--gold-dim); }
.search-input::placeholder { color: var(--text-hint); }
.filter-btn {
  width: 40px; height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 20px;
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--gold-dim); color: var(--gold);
}

/* ── Filter pills ──────────────────────────────────────────── */
.filter-pills {
  display: flex; gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.pill.active {
  background: var(--wine);
  border-color: var(--wine-bright);
  color: var(--cream);
}

/* ── Bulk action bar ───────────────────────────────────────── */
.bulk-bar {
  display: none;
  position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0; right: 0;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-med);
  padding: 10px 16px;
  z-index: 99;
  flex-direction: row; gap: 8px; align-items: center;
}
.bulk-bar.visible { display: flex; }
.bulk-count {
  font-size: 14px; font-weight: 500;
  color: var(--gold); flex: 1;
}
.bulk-actions { display: flex; gap: 8px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--wine);
  color: var(--cream);
  border: 1px solid var(--wine-bright);
}
.btn-primary:hover { background: var(--wine-bright); }
.btn-secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-med);
}
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-gold {
  background: var(--gold-dim);
  color: var(--cream);
  border: 1px solid var(--gold);
}
.btn-gold:hover { background: var(--gold); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-med); }
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn i { font-size: 18px; }
.btn-sm i { font-size: 16px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label .required { color: var(--wine-light); margin-left: 2px; }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}
.form-control:focus { border-color: var(--gold-dim); }
.form-control::placeholder { color: var(--text-hint); }
.form-control:disabled { opacity: 0.5; }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e5540' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--wine-light); margin-top: 4px; }

/* Score input */
.score-input-wrap {
  display: flex; align-items: center; gap: 12px;
}
.score-input-wrap .form-control {
  width: 80px; text-align: center; font-size: 18px; font-weight: 600;
  color: var(--gold);
}
.score-badge {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
}
.score-outstanding { background: rgba(201,147,58,0.2); color: var(--gold); border: 1px solid var(--gold-dim); }
.score-excellent   { background: rgba(61,139,90,0.2);  color: var(--green-light); border: 1px solid var(--green); }
.score-good        { background: rgba(41,128,185,0.2); color: #5dade2; border: 1px solid var(--blue); }
.score-fair        { background: rgba(212,133,10,0.2); color: #f0a500; border: 1px solid var(--amber); }
.score-poor        { background: rgba(192,57,43,0.2);  color: #e74c3c; border: 1px solid var(--red); }

/* ── Modal / sheet ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}
.modal-sheet {
  width: 100%; max-height: 92dvh;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--border-med);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.modal-header {
  padding: 16px 20px 12px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500;
  color: var(--gold-light); flex: 1;
}
.modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
  flex-shrink: 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Full modal (not bottom sheet) */
.modal-overlay.modal-center { align-items: center; padding: 16px; }
.modal-overlay.modal-center .modal-sheet {
  max-height: 85dvh;
  border-radius: var(--radius-xl);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.modal-center.open .modal-sheet { transform: scale(1); }

/* ── Drink window badge ─────────────────────────────────────── */
.drink-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.drink-peak     { background: rgba(82,196,122,0.15); color: var(--green-light); border: 1px solid var(--green); }
.drink-drinking { background: rgba(201,147,58,0.15); color: var(--gold); border: 1px solid var(--gold-dim); }
.drink-young    { background: rgba(41,128,185,0.15); color: #5dade2; border: 1px solid var(--blue); }
.drink-past     { background: rgba(192,57,43,0.15);  color: #e74c3c; border: 1px solid var(--red); }
.drink-alert    { background: rgba(212,133,10,0.2);  color: #f0a500; border: 1px solid var(--amber); }

/* ── Wine detail page ──────────────────────────────────────── */
.wine-hero {
  background: linear-gradient(180deg, var(--wine) 0%, var(--bg-surface) 100%);
  padding: 20px 16px 24px;
  position: relative;
  overflow: hidden;
}
.wine-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.wine-hero-back {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 14px; cursor: pointer;
  margin-bottom: 16px;
}
.wine-hero-inner {
  display: flex; gap: 16px; align-items: flex-start;
  position: relative;
}
.wine-label-img {
  width: 80px; height: 110px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1px solid var(--border-med);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-hint); font-size: 32px;
  flex-shrink: 0; overflow: hidden;
}
.wine-label-img img { width: 100%; height: 100%; object-fit: cover; }
.label-upload-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6);
  font-size: 10px; color: rgba(255,255,255,0.7);
  text-align: center; padding: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.wine-hero-info { flex: 1; padding-top: 4px; }
.wine-hero-producer {
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6); margin-bottom: 4px;
}
.wine-hero-name {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600;
  color: white; line-height: 1.2;
  margin-bottom: 6px;
}
.wine-hero-vintage {
  font-family: var(--font-display);
  font-size: 20px; color: var(--gold-light);
  margin-bottom: 10px;
}
.wine-hero-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.wine-hero-tag {
  padding: 3px 8px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  font-size: 11px; color: rgba(255,255,255,0.75);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Tasting note sections */
.note-section { margin-bottom: 16px; }
.note-section-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold-dim); margin-bottom: 4px;
}
.note-section-text {
  font-size: 15px; color: var(--text-primary);
  line-height: 1.6;
}

/* Score display */
.score-display {
  display: inline-flex; align-items: baseline; gap: 4px;
}
.score-number {
  font-family: var(--font-display);
  font-size: 48px; font-weight: 600;
  color: var(--gold-light); line-height: 1;
}
.score-denom {
  font-size: 16px; color: var(--text-muted);
}

/* ── Camera / scan screen ──────────────────────────────────── */
.scan-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 16px;
}
.scan-option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.scan-option:hover, .scan-option:active {
  border-color: var(--gold-dim);
  background: var(--bg-raised);
}
.scan-option i {
  font-size: 36px;
  color: var(--wine-bright);
  display: block; margin-bottom: 10px;
}
.scan-option-label {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary); margin-bottom: 4px;
}
.scan-option-hint {
  font-size: 11px; color: var(--text-muted);
}

/* Barcode scanner viewfinder */
.scanner-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.scanner-video {
  width: 100%; height: 260px;
  object-fit: cover; display: block;
}
.scanner-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.scanner-frame {
  width: 220px; height: 140px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  position: relative;
}
.scanner-frame::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 2px;
  background: var(--wine-bright);
  animation: scan-line 2s ease-in-out infinite;
}
@keyframes scan-line {
  0%,100% { transform: translateY(-30px); opacity: 0.8; }
  50% { transform: translateY(30px); opacity: 1; }
}

/* ── Add method tabs ───────────────────────────────────────── */
.method-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.method-tabs::-webkit-scrollbar { display: none; }
.method-tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.method-tab i { font-size: 17px; }
.method-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.method-panel { display: none; padding: 16px; }
.method-panel.active { display: block; }

/* ── Reports / charts ──────────────────────────────────────── */
.chart-wrap {
  padding: 0 16px 16px;
}
.bar-chart { }
.bar-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.bar-label {
  font-size: 12px; color: var(--text-secondary);
  width: 80px; flex-shrink: 0; text-align: right;
}
.bar-track {
  flex: 1; height: 22px;
  background: var(--bg-raised);
  border-radius: 4px; overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--wine);
  transition: width 0.6s ease;
  display: flex; align-items: center; padding-left: 8px;
  min-width: 24px;
}
.bar-fill-gold { background: var(--gold-dim); }
.bar-value { font-size: 11px; color: rgba(255,255,255,0.8); }
.bar-count {
  font-size: 12px; color: var(--text-muted);
  width: 30px; flex-shrink: 0; text-align: right;
}

/* ── Alert row ─────────────────────────────────────────────── */
.alert-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; }
.alert-urgency { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.alert-overdue { background: var(--red); }
.alert-urgent  { background: var(--amber); }
.alert-soon    { background: var(--gold-dim); }
.alert-info    { flex: 1; min-width: 0; }
.alert-wine    { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.alert-meta    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.alert-days    { font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }

/* ── Settings ──────────────────────────────────────────────── */
.settings-section { margin-bottom: 24px; }
.settings-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.settings-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg-raised); }
.settings-item-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--gold);
  flex-shrink: 0;
}
.settings-item-label {
  flex: 1;
  font-size: 15px; color: var(--text-primary);
}
.settings-item-value {
  font-size: 13px; color: var(--text-muted);
}
.settings-item-chevron { color: var(--text-hint); font-size: 18px; }

/* Toggle switch */
.toggle {
  position: relative; width: 46px; height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border-med);
  border-radius: 13px;
  transition: background var(--transition);
  cursor: pointer;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
  pointer-events: none;
}
.toggle input:checked ~ .toggle-track { background: var(--wine); border-color: var(--wine-bright); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); background: var(--cream); }

/* ── Auth screens ──────────────────────────────────────────── */
#auth-screen {
  min-height: 100dvh;
  background: var(--bg-base);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
}
.auth-logo {
  text-align: center; margin-bottom: 40px;
}
.auth-logo i { font-size: 56px; color: var(--wine-bright); display: block; margin-bottom: 12px; }
.auth-logo-name {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}
.auth-logo-tagline { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 500;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 24px;
}
.auth-switch {
  text-align: center; margin-top: 20px;
  font-size: 14px; color: var(--text-muted);
}
.auth-switch a { color: var(--gold); font-weight: 500; }
.auth-error {
  background: rgba(192,35,63,0.15);
  border: 1px solid var(--wine);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px; color: var(--wine-light);
  margin-bottom: 16px;
  display: none;
}
.auth-error.visible { display: block; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 18px; cursor: pointer;
}

/* ── Empty states ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 56px; margin-bottom: 16px; opacity: 0.4; display: block; }
.empty-title { font-size: 18px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.empty-hint { font-size: 14px; line-height: 1.6; }

/* ── Toast notifications ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  left: 50%; transform: translateX(-50%);
  z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 90%;
}
.toast {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.25s ease;
  box-shadow: var(--shadow-md);
  max-width: 340px;
}
.toast.success { border-color: var(--green); }
.toast.success i { color: var(--green-light); }
.toast.error   { border-color: var(--wine);  }
.toast.error   i { color: var(--wine-light); }
.toast.info    i { color: var(--gold); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Loading skeleton ──────────────────────────────────────── */
.skeleton {
  background: var(--bg-raised);
  border-radius: 4px;
  animation: shimmer 1.4s ease infinite;
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-card) 50%, var(--bg-raised) 75%);
  background-size: 200% 100%;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 16px;
}
.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn.active  { background: var(--wine); color: var(--cream); border-color: var(--wine-bright); }
.page-btn:hover:not(.active) { border-color: var(--border-med); color: var(--text-primary); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

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

/* ── Responsive: tablet & desktop ─────────────────────────── */
@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .scan-options { grid-template-columns: repeat(4, 1fr); }
  .form-row { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  #bottom-nav { display: none; }
  #app-shell { flex-direction: row; }
  #sidebar {
    width: 220px; flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    height: 100dvh; position: sticky; top: 0;
    display: flex; flex-direction: column;
    padding: 24px 0;
    overflow-y: auto;
  }
  #main-content { padding-bottom: 0; }
  .sidebar-brand {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 500;
    color: var(--gold-light);
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px;
  }
  .sidebar-brand i { color: var(--wine-bright); font-size: 24px; }
  .sidebar-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    color: var(--text-muted); font-size: 14px; font-weight: 500;
    cursor: pointer; border-radius: 0;
    transition: all var(--transition);
    position: relative;
  }
  .sidebar-nav-item i { font-size: 20px; }
  .sidebar-nav-item.active { color: var(--gold); background: rgba(201,147,58,0.08); }
  .sidebar-nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--gold); border-radius: 0 2px 2px 0;
  }
  .sidebar-nav-item:hover:not(.active) { color: var(--text-secondary); background: var(--bg-raised); }
  #top-header { display: none; }
  .sidebar-spacer { flex: 1; }
}
