/* =============================================================================
   WineIQ – Site Stylesheet  (2026 Design System)
   Design tokens → Component overrides → Page layouts → Utilities
   ============================================================================= */


/* --- 1. Design Tokens -------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg:              #F4EFE8;   /* warm off-white "paper" */
  --surface:         #FFFFFF;   /* cards, panels */
  --surface-alt:     #FAF7F3;   /* slightly-off-white surface */

  /* Borders */
  --border:          #E0D6CC;
  --border-subtle:   #EDE8E2;
  --border-strong:   #C4B5A8;

  /* Wine palette */
  --wine:            #6D2535;   /* primary wine red */
  --wine-deep:       #3D1118;   /* very deep burgundy */
  --wine-mid:        #8A3545;   /* lighter shade for hover */
  --wine-muted:      #BC8090;   /* faded wine */
  --wine-faint:      #F7EFF1;   /* barely-there wine tint */

  /* Gold accent */
  --gold:            #B89050;   /* muted sophisticated gold */
  --gold-light:      #D4AE6A;   /* lighter gold for hover */
  --gold-faint:      #F8F2E6;   /* gold-tinted background */
  --gold-star:       #D4A848;   /* star ratings */

  /* Text */
  --text:            #1C1410;   /* near-black, warm */
  --text-secondary:  #6A5C54;   /* warm medium-brown */
  --text-muted:      #9A8B83;   /* muted warm gray */
  --text-on-dark:    #FFFFFF;
  --text-on-dark-dim: rgba(255,255,255,0.65);

  /* Semantic */
  --success:         #2A6049;
  --success-bg:      #EBF5EF;
  --warning:         #7A5E1A;
  --warning-bg:      #FDF4DC;
  --danger:          #8B2535;
  --danger-bg:       #FDEAED;
  --info:            #1E5479;
  --info-bg:         #E5EFF7;

  /* Typography */
  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing (4 px base) */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;

  /* Radius */
  --r-xs:  4px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-pill: 100px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 3px 10px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg:    0 6px 24px rgba(0,0,0,0.09), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-focus: 0 0 0 3px rgba(109, 37, 53, 0.18);

  /* Legacy aliases so any old references still resolve */
  --primary-burgundy:   var(--wine-deep);
  --secondary-garnet:   var(--wine);
  --warm-beige:         var(--surface-alt);
  --light-parchment:    var(--bg);
  --accent-gold:        var(--gold);
  --soft-slate-gray:    var(--text-secondary);
  --text-dark:          var(--text);
  --text-light:         var(--text-on-dark);
  --border-light:       var(--border);
}


/* --- 1b. Safe-area environment ----------------------------------------------- */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-left:  env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}


/* --- 2. Base reset & body ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  padding-top: 60px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* --- 3. Typography ----------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4 {
  font-family: var(--font-serif);
  color: var(--wine-deep);
  line-height: 1.25;
  margin-bottom: 0.5em;
  font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }

p { margin-bottom: 1em; }

a {
  color: var(--wine);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--wine-mid); text-decoration: underline; }

.text-small { font-size: 0.875rem; }
.text-muted  { color: var(--text-muted) !important; }


/* --- 4. Container ------------------------------------------------------------ */
.container {
  max-width: 1200px;
  padding-top: 2rem;
  padding-bottom: 3rem;
}


/* --- 5. Navbar --------------------------------------------------------------- */
.navbar {
  background-color: var(--wine-deep) !important;
  height: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 1px 10px rgba(0,0,0,0.18);
}

.navbar-brand {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFFFFF !important;
  letter-spacing: 0.02em;
}
.navbar-brand:hover { color: var(--gold-light) !important; text-decoration: none; }

.navbar-nav .nav-link {
  color: rgba(255,255,255,0.80) !important;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.85rem !important;
  border-radius: var(--r-sm);
  transition: color 0.15s, background-color 0.15s;
}
.navbar-nav .nav-link:hover {
  color: #FFFFFF !important;
  background-color: rgba(255,255,255,0.10);
}
.navbar-nav .nav-link.active {
  color: var(--gold-light) !important;
  background-color: rgba(255,255,255,0.08);
}

.navbar-toggler { border-color: rgba(255,255,255,0.30); }

.navbar .dropdown-menu {
  background-color: var(--wine-deep);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
}
.navbar .dropdown-item {
  color: rgba(255,255,255,0.80);
  font-size: 0.875rem;
  border-radius: var(--r-sm);
  padding: 8px 12px;
  transition: background-color 0.15s;
  background: transparent;
}
.navbar .dropdown-item:hover {
  background-color: rgba(255,255,255,0.10);
  color: #FFFFFF;
}
.navbar .dropdown-divider { border-color: rgba(255,255,255,0.12); }


/* --- 6. Cards ---------------------------------------------------------------- */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.card-header {
  background-color: var(--surface-alt) !important;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0 !important;
  padding: 1rem 1.5rem;
  font-family: var(--font-serif);
  color: var(--wine-deep);
}
.card-body { padding: 1.5rem; }


/* --- 7. Buttons -------------------------------------------------------------- */
.btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r-md);
  padding: 0.5rem 1.1rem;
  transition: all 0.15s ease;
  border-width: 1.5px;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Primary */
.btn-primary {
  background-color: var(--wine);
  border-color: var(--wine);
  color: #FFFFFF;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--wine-deep);
  border-color: var(--wine-deep);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-primary:active { transform: none; box-shadow: none; }

/* Success → gold accent */
.btn-success {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--text);
}
.btn-success:hover, .btn-success:focus {
  background-color: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Secondary */
.btn-secondary {
  background-color: var(--text-secondary);
  border-color: var(--text-secondary);
  color: #FFFFFF;
}
.btn-secondary:hover, .btn-secondary:focus {
  background-color: var(--text);
  border-color: var(--text);
  color: #FFFFFF;
}

/* Info */
.btn-info {
  background-color: var(--info);
  border-color: var(--info);
  color: #FFFFFF;
}
.btn-info:hover { background-color: #174463; border-color: #174463; color: #FFFFFF; }

/* Outlines */
.btn-outline-primary {
  color: var(--wine);
  border-color: var(--wine);
  background: transparent;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--wine);
  border-color: var(--wine);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border-strong);
  background: transparent;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
  background-color: var(--surface-alt);
  border-color: var(--text-secondary);
  color: var(--text);
}

.btn-outline-danger {
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-outline-success {
  color: var(--success);
  border-color: var(--success);
  background: transparent;
}
.btn-outline-success:hover {
  background-color: var(--success);
  border-color: var(--success);
  color: #FFFFFF;
}

/* Sizes */
.btn-sm  { font-size: 0.8125rem; padding: 0.3rem 0.75rem; border-radius: var(--r-sm); }
.btn-lg  { font-size: 1rem;      padding: 0.65rem 1.5rem; }


/* --- 8. Forms ---------------------------------------------------------------- */
label, .form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
  display: block;
}

.form-control,
.form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--text);
  background-color: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--wine-muted);
  box-shadow: var(--shadow-focus);
  outline: none;
  background-color: var(--surface);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control-sm, .form-select-sm { font-size: 0.875rem; border-radius: var(--r-sm); }

.form-text { color: var(--text-muted); font-size: 0.8125rem; margin-top: 4px; }

.form-group,
.mb-3 { margin-bottom: 1.25rem; }

.form-check-input:checked {
  background-color: var(--wine);
  border-color: var(--wine);
}

/* Switch */
.form-check-input[type="checkbox"]:checked { background-color: var(--wine); border-color: var(--wine); }


/* --- 9. Table ---------------------------------------------------------------- */
.table {
  color: var(--text);
  border-color: var(--border-subtle);
  font-size: 0.9rem;
}
.table thead th {
  background-color: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  border-bottom: 2px solid var(--border);
  padding: 0.7rem 0.75rem;
  white-space: nowrap;
}
.table thead th a {
  color: var(--text-secondary);
  text-decoration: none;
}
.table thead th a:hover { color: var(--wine); text-decoration: none; }

.table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.1s;
}
.table tbody tr:nth-of-type(even) { background-color: var(--surface-alt); }
.table tbody tr:hover             { background-color: var(--wine-faint); }
.table tbody tr.table-light       { background-color: var(--surface-alt); opacity: 0.7; }

.table td {
  padding: 0.7rem 0.75rem;
  vertical-align: middle;
}
.table a            { color: var(--wine); font-weight: 500; }
.table a:hover      { color: var(--wine-mid); text-decoration: none; }

/* Column-width helpers (preserved from original) */
.table .th-actions,  .table .td-actions  { width: 110px; min-width: 110px; text-align: center; vertical-align: middle; }
.table .td-actions  { white-space: nowrap; }
.table .td-actions .btn + form,
.table .td-actions form + .btn,
.table .td-actions .btn + .btn { margin-left: 0.25rem; }

.table td.col-data-wine-name .td-truncate-content,
.table td.col-data-producer  .td-truncate-content,
.table td.col-data-varietal  .td-truncate-content,
.table td.col-data-region    .td-truncate-content,
.table td.col-data-country   .td-truncate-content {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.table td.col-data-wine-name .td-truncate-content { max-width: 220px; }
.table td.col-data-producer  .td-truncate-content { max-width: 160px; }
.table td.col-data-varietal  .td-truncate-content { max-width: 130px; }
.table td.col-data-region    .td-truncate-content { max-width: 110px; }
.table td.col-data-country   .td-truncate-content { max-width: 110px; }

.table .th-qty,      .table .td.col-data-qty     { width: 60px;  text-align: center; }
.table .th-vintage,  .table td.col-data-vintage  { width: 80px;  text-align: center; }
.table .th-begin,    .table td.col-data-begin     { width: 70px;  text-align: center; }
.table .th-end,      .table td.col-data-end       { width: 70px;  text-align: center; }
.table .th-status,   .table td.col-data-status    { width: 120px; text-align: center; }
.table .th-size,     .table td.col-data-size      { width: 80px; }
.table .th-color,    .table td.col-data-color     { width: 90px; }
.table .th-category, .table td.col-data-category  { width: 100px; }

.table th.col-hdr-qty      { width: 60px; }
.table th.col-hdr-vintage  { width: 80px; }
.table th.col-hdr-begin    { width: 70px; }
.table th.col-hdr-end      { width: 70px; }
.table th.col-hdr-status   { width: 120px; }
.table th.col-hdr-size     { width: 80px; }
.table th.col-hdr-color    { width: 90px; }
.table th.col-hdr-category { width: 100px; }
.table th.col-hdr-wine-name { min-width: 200px; }
.table th.col-hdr-producer  { min-width: 150px; }
.table th.col-hdr-varietal  { min-width: 120px; }
.table th.col-hdr-country   { min-width: 100px; }
.table th.col-hdr-region    { min-width: 100px; }


/* --- 10. Badges -------------------------------------------------------------- */
.badge {
  padding: 0.32em 0.65em;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  letter-spacing: 0.01em;
  vertical-align: middle;
  line-height: 1;
}
.badge.bg-success   { background-color: var(--success) !important; color: #fff !important; }
.badge.bg-danger    { background-color: var(--danger)  !important; color: #fff !important; }
.badge.bg-warning   { background-color: var(--warning) !important; color: #fff !important; }
.badge.bg-info      { background-color: var(--info)    !important; color: #fff !important; }
.badge.bg-secondary { background-color: var(--text-muted) !important; color: #fff !important; }
.badge.bg-info.text-dark { background-color: var(--gold) !important; color: var(--text) !important; }

/* Drinking-status pill badges */
.badge.rounded-pill.text-success { background-color: var(--success-bg); color: var(--success) !important; border: 1px solid rgba(42,96,73,0.25); }
.badge.rounded-pill.text-danger  { background-color: var(--danger-bg);  color: var(--danger)  !important; border: 1px solid rgba(139,37,53,0.25); }
.badge.rounded-pill.text-primary { background-color: var(--info-bg);    color: var(--info)    !important; border: 1px solid rgba(30,84,121,0.25); }
.badge.rounded-pill.text-muted,
.badge.rounded-pill.text-secondary { background-color: var(--surface-alt); color: var(--text-muted) !important; border: 1px solid var(--border); }


/* --- 11. Alerts -------------------------------------------------------------- */
.alert {
  border-left-width: 4px;
  border-radius: var(--r-md);
  padding: 0.85rem 1rem 0.85rem 3rem;
  position: relative;
  font-size: 0.9375rem;
}
.alert::before {
  font-family: "bootstrap-icons";
  content: "";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  line-height: 1;
}
.alert-success {
  background-color: var(--success-bg);
  border-left-color: var(--success);
  border-color: rgba(42,96,73,0.2);
  color: var(--success);
}
.alert-success::before { content: "\f135"; }

.alert-info {
  background-color: var(--info-bg);
  border-left-color: var(--info);
  border-color: rgba(30,84,121,0.2);
  color: var(--info);
}
.alert-info::before { content: "\f33b"; }

.alert-warning {
  background-color: var(--warning-bg);
  border-left-color: var(--warning);
  border-color: rgba(122,94,26,0.2);
  color: var(--warning);
}
.alert-warning::before { content: "\f34a"; }

.alert-danger {
  background-color: var(--danger-bg);
  border-left-color: var(--danger);
  border-color: rgba(139,37,53,0.2);
  color: var(--danger);
}
.alert-danger::before { content: "\f33e"; }


/* --- 12. Footer -------------------------------------------------------------- */
footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background-color: var(--surface-alt);
  font-size: 0.875rem;
  color: var(--text-muted);
}


/* --- 13. Images -------------------------------------------------------------- */
.img-fluid { max-width: 100%; height: auto; }

.wine-label-image {
  max-height: 420px;
  width: 100%;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background-color: var(--surface-alt);
}


/* --- 14. Semantic colour utilities ------------------------------------------ */
.text-success   { color: var(--success)        !important; }
.text-danger    { color: var(--danger)          !important; }
.text-warning   { color: var(--warning)         !important; }
.text-info      { color: var(--info)            !important; }
.text-muted     { color: var(--text-muted)      !important; }
.text-primary   { color: var(--wine)            !important; }
.text-secondary { color: var(--text-secondary)  !important; }


/* --- 15. Wine Detail – hero card -------------------------------------------- */
.wine-detail-page { max-width: 980px; margin: 0 auto; }

.wine-hero-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
}
/* Gradient accent bar at top */
.wine-hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--wine-deep) 0%, var(--wine) 55%, var(--gold) 100%);
}

.wine-vintage-tag {
  display: inline-block;
  background: var(--wine-faint);
  color: var(--wine);
  border: 1px solid var(--wine-muted);
  border-radius: var(--r-pill);
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.8rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
}

.wine-main-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--wine-deep);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.wine-producer-name {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 1rem;
}

.wine-origin-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.wine-origin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* No-image placeholder */
.label-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--surface-alt);
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted);
  padding: 2rem;
}
.label-image-placeholder i { font-size: 2.5rem; margin-bottom: 0.6rem; opacity: 0.45; }


/* --- 16. Wine Detail – info sections ---------------------------------------- */
.info-section {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.info-section-header {
  padding: 0.6rem 1.25rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.info-section-body { padding: 0.25rem 1.25rem 0.75rem; }

/* Definition rows */
.detail-row {
  display: flex;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
  align-items: baseline;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  width: 130px;
  min-width: 130px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}
.detail-value {
  flex: 1;
  color: var(--text);
  font-size: 0.9375rem;
}
.detail-value--placeholder {
  color: var(--text-muted);
}

/* Detail divider (replaces inline-styled <hr>) */
.detail-divider { border: none; border-top: 1px solid var(--border-subtle); margin: 0.6rem 0; }

/* Form label small variant */
.form-label-sm { font-size: 0.8125rem; font-weight: 600; }

/* Cellar meta date */
.cellar-meta-date { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Wine profile 2-col grid (full-width section) */
@media (min-width: 769px) {
  .wine-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
  }
}

/* Equal-height paired cards on wine detail page */
.wine-detail-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin-top: 1rem;
}
.wine-detail-cards > [class*="col-"] {
  display: flex;
}
.wine-detail-cards .info-section {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.wine-detail-cards .info-section-body {
  flex: 1;
}

/* Cellar quantity display */
.cellar-qty-display { text-align: center; padding: 1rem 0 0.5rem; }
.cellar-qty-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--wine-deep);
  line-height: 1;
  background: var(--surface-alt);
  border-radius: 50%;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.cellar-qty-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}


/* --- 17. Drinking status pills ---------------------------------------------- */
.drinking-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 600;
}
.drinking-status-pill.status-ready {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(42,96,73,0.22);
}
.drinking-status-pill.status-early {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(30,84,121,0.22);
}
.drinking-status-pill.status-late {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(139,37,53,0.22);
}
.drinking-status-pill.status-na {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.drinking-status-pill.status-consumed {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.drinking-status-pill i { font-size: 0.8rem; }


/* --- 17b. Star rating -------------------------------------------------------- */
.star-rating { display: inline-flex; gap: 0.25rem; }
.star-rating .star { cursor: pointer; font-size: 1.5rem; color: #ccc; transition: color 0.15s, transform 0.15s; }
.star-rating .star.active, .star-rating .star:hover { color: var(--gold-star); }
.star-rating .star:hover { transform: scale(1.15); }


/* --- 17c. Info-section header icons ------------------------------------------ */
.info-section-header i { color: var(--wine-muted); margin-right: 0.35rem; font-size: 0.85em; }


/* --- 17d. Wine hero facts strip ---------------------------------------------- */
.wine-facts-strip {
  display: flex;
  gap: 2rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.wine-fact {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.wine-fact-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.wine-fact-value {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}


/* --- 17e. Rating section – collapsible -------------------------------------- */
.rating-toggle-btn {
  display: none; /* hidden without JS — form stays open as fallback */
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--wine);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rating-toggle-btn:hover {
  background: var(--wine-faint);
  border-color: var(--wine-muted);
}
.rating-summary {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}
/* JS adds .rating-collapsed on load */
.rating-collapsed .rating-detail-fields { display: none; }
.rating-collapsed .rating-toggle-btn { display: block; }


/* --- 18. Enrichment section ------------------------------------------------- */
.enrichment-section {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 1.25rem;
  overflow: hidden;
}
.enrichment-header {
  padding: 0.85rem 1.5rem;
  background: var(--gold-faint);
  border-bottom: 1px solid #E6D8B0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.enrichment-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--warning);
}
.enrichment-body { padding: 1.25rem 1.5rem; }

/* Enrichment field rows */
.enrich-field {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.enrich-field:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.enrich-field-label {
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.enrich-field-value {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.65;
}
.enrich-field-cta {
  margin-top: 0.75rem;
}

/* Food pairing tags */
.food-pairings-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.food-pairing-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.25rem 0.7rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}


/* --- 19. Wine detail – action bar ------------------------------------------ */
.wine-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.back-link:hover { color: var(--wine); text-decoration: none; }
.back-link-text-short { display: none; }
.back-link-text-long  { display: inline; }

/* About/summary italic */
.about-wine-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
  margin-top: 0.75rem;
}

/* Inline status text */
.status-text-success { color: var(--success); }
.status-text-danger  { color: var(--danger);  }
.status-text-warning { color: var(--warning); }
.status-text-muted   { color: var(--text-muted); }


/* --- 20. Home page ---------------------------------------------------------- */
.inventory-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.inventory-page-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--wine-deep);
  margin: 0;
}
.inventory-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

/* Active filter chips */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.active-filters-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
  border-radius: 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.filter-chip:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  text-decoration: none;
}
.filter-chip-clear {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}


/* --- 21. Form pages (add/edit wine) ----------------------------------------- */
.form-page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.form-page-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--wine-deep);
  margin: 0;
}

.form-section {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.form-section-header {
  padding: 0.65rem 1.25rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-section-body {
  padding: 1.25rem 1.5rem 0.75rem;
}
.form-section-header i {
  font-size: 0.85rem;
  color: var(--wine-muted);
}

/* Form page container */
.form-page-container {
  max-width: 780px;
  margin: 0 auto;
}

/* Upload zone */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  text-align: center;
  transition: border-color 0.15s, background-color 0.15s;
}
.upload-zone:hover {
  border-color: var(--wine-muted);
  background: var(--wine-faint);
}
.upload-zone-icon {
  font-size: 2.25rem;
  color: var(--wine-muted);
  margin-bottom: 0.6rem;
  opacity: 0.7;
}
.upload-zone-text {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.upload-zone-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.upload-zone .form-control {
  max-width: 320px;
}


/* --- 22. Misc / dividers ----------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}
.spinner-border-sm { width: 0.9rem; height: 0.9rem; }


/* --- 22a. Quantity cell colours -------------------------------------------- */
.qty-cell { font-weight: 600; }
.qty-zero { color: var(--text-muted); }
.qty-low  { color: var(--warning); }
.qty-ok   { color: var(--text); }


/* --- 22b. Wine color dot ---------------------------------------------------- */
.color-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.color-dot--red      { background: #8B2535; }
.color-dot--white    { background: #D4AE6A; border: 1px solid var(--border); }
.color-dot--rose     { background: #E08080; }
.color-dot--sparkling{ background: #A0C8E0; }
.color-dot--other    { background: var(--text-muted); }


/* --- 23. Dashboard ----------------------------------------------------------- */

/* Welcome header */
.dash-welcome {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.dash-welcome-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--wine-deep);
  margin: 0 0 0.15rem;
}
.dash-welcome-sub {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Stats row */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1rem;
  text-align: center;
}
.dash-stat-card::before {
  content: '';
  display: block;
  height: 3px;
  border-radius: 3px 3px 0 0;
  margin: -1.25rem -1rem 1rem;
  background: var(--wine);
}
.dash-stat-card.dash-stat--success::before { background: var(--success); }
.dash-stat-card.dash-stat--info::before    { background: var(--info); }
.dash-stat-card.dash-stat--danger::before  { background: var(--danger); }
.dash-stat-card.dash-stat--warning::before { background: var(--warning); }
a.dash-stat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
}

.dash-stat-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--wine-deep);
  line-height: 1.1;
}
.dash-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* Section wrapper */
.dash-section {
  margin-bottom: 1.75rem;
}

/* Quick actions */
.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.dash-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s ease;
  text-decoration: none;
}
.dash-action-btn:hover {
  border-color: var(--wine);
  color: var(--wine);
  background: var(--wine-faint);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.dash-action-btn i {
  font-size: 1rem;
  color: var(--wine);
}
.dash-action-btn--primary {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff;
}
.dash-action-btn--primary:hover {
  background: var(--wine-deep);
  border-color: var(--wine-deep);
  color: #fff;
}
.dash-action-btn--primary i { color: #fff; }
.dash-action-btn--secondary {
  border-color: var(--wine);
  color: var(--wine);
}
.dash-action-btn--secondary:hover {
  background: var(--wine-faint);
}
.dash-action-btn--subtle {
  border-color: var(--border-subtle);
  color: var(--text-muted);
  font-weight: 400;
}
.dash-action-btn--subtle i { color: var(--text-muted); }
.dash-action-btn--subtle:hover {
  border-color: var(--border);
  color: var(--text);
}
.dash-action-btn--subtle:hover i { color: var(--wine); }

/* Two-column grid */
.dash-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.dash-grid-2col--inner {
  margin-bottom: 0;
}

/* Dashboard card */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dash-card--full {
  margin-bottom: 1.75rem;
}
.dash-card--insights {
  border-left: 3px solid var(--gold);
}
.dash-card-header {
  padding: 0.7rem 1.25rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dash-card-header i {
  font-size: 0.9rem;
  color: var(--wine-muted);
}
.dash-card-body {
  padding: 1rem 1.25rem;
}

/* Breakdown lists (color, region) */
.dash-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}
.dash-breakdown-item:last-child { border-bottom: none; }
.dash-breakdown-label {
  flex: 1;
  color: var(--text);
}
.dash-breakdown-count {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
}
a.dash-breakdown-item {
  text-decoration: none;
  color: inherit;
  padding: 0.45rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: var(--r-xs);
  transition: background 0.15s ease;
}
a.dash-breakdown-item:hover {
  background: var(--wine-faint);
  text-decoration: none;
  color: inherit;
}

/* Color dots for dashboard */
.dash-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dash-color-dot--red       { background: #8B2535; }
.dash-color-dot--white     { background: #D4AE6A; border: 1px solid var(--border); }
.dash-color-dot--rosé,
.dash-color-dot--rose      { background: #E08080; }
.dash-color-dot--sparkling { background: #A0C8E0; }
.dash-color-dot--dessert   { background: #C89040; }
.dash-color-dot--fortified { background: #7A4A2A; }
.dash-color-dot--orange    { background: #D4864A; }

/* World map */
.dash-map-container {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.dash-map-svg {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
}

/* Drinking window groups */
.dash-window-group {
  margin-bottom: 0.5rem;
}
.dash-window-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--border-subtle);
}
.dash-window-title--success { color: var(--success); border-bottom-color: var(--success); }
.dash-window-title--warning { color: var(--warning); border-bottom-color: var(--warning); }
.dash-window-title--info    { color: var(--info);    border-bottom-color: var(--info); }
.dash-window-title--danger  { color: var(--danger);  border-bottom-color: var(--danger); }

.dash-wine-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-wine-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}
.dash-wine-list li:last-child { border-bottom: none; }
.dash-wine-list a {
  color: var(--wine);
  font-weight: 500;
}
.dash-wine-list a:hover { color: var(--wine-mid); text-decoration: none; }
.dash-vintage {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.dash-dw-hint {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Recently added grid */
.dash-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.dash-recent-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dash-recent-item:hover {
  border-color: var(--wine-muted);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
}
.dash-recent-thumb {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.dash-recent-thumb-placeholder {
  width: 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.dash-recent-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.dash-recent-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--wine-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-recent-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.dash-recent-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Insights */
.dash-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-insights-list li {
  padding: 0.45rem 0 0.45rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: relative;
}
.dash-insights-list li:last-child { border-bottom: none; }
.dash-insights-list li::before {
  content: "\f474";
  font-family: "bootstrap-icons";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.85rem;
}

/* Empty state note */
.dash-empty-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0.25rem 0;
}


/* --- 23b. Pagination theme --------------------------------------------------- */
.pagination { gap: 0.25rem; }
.page-link {
  border: 1px solid var(--border);
  color: var(--wine);
  border-radius: var(--r-sm) !important;
  background: var(--surface);
  font-size: 0.875rem;
}
.page-link:hover {
  background: var(--wine-faint);
  border-color: var(--wine-muted);
  color: var(--wine-deep);
}
.page-item.active .page-link {
  background: var(--wine);
  border-color: var(--wine);
  color: var(--text-on-dark);
}
.page-item.disabled .page-link {
  background: var(--surface-alt);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}


/* --- 23c. Empty state component ---------------------------------------------- */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; opacity: 0.3; margin-bottom: 1rem; }
.empty-state h4 { font-family: var(--font-serif); color: var(--wine-deep); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; max-width: 380px; margin: 0 auto; line-height: 1.6; }
.empty-state .btn { margin-top: 1rem; }


/* --- 23d. Taste bar component ------------------------------------------------ */
.taste-bar { display: flex; align-items: center; margin-bottom: 0.35rem; }
.taste-bar-label { width: 5.5rem; font-size: 0.8125rem; flex-shrink: 0; }
.taste-bar-label--wide { width: 7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.taste-bar-track { flex: 1; background: var(--border-subtle); border-radius: 4px; height: 0.5rem; overflow: hidden; }
.taste-bar-fill { height: 100%; border-radius: 4px; min-width: 4px; }
.taste-bar-fill--wine { background: var(--wine); }
.taste-bar-fill--gold { background: var(--gold); }
.taste-bar-fill--muted { background: var(--wine-muted); }
.taste-bar-value { width: 2.5rem; text-align: right; font-size: 0.75rem; color: var(--text-muted); }
.taste-section-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.5rem; }


/* --- 23e. Profile header classes --------------------------------------------- */
.profile-avatar-icon { font-size: 3rem; color: var(--wine-muted); margin-bottom: 0.5rem; }
.profile-username { font-size: 1.25rem; font-weight: 600; }


/* --- 23f. Desktop table wine name emphasis ----------------------------------- */
td.col-data-wine-name a { font-weight: 600; color: var(--wine-deep); }


/* --- 23g. Taste tag badges --------------------------------------------------- */
.taste-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  background: var(--wine-faint);
  color: var(--wine);
  border: 1px solid var(--wine-muted);
  margin: 0.15rem 0;
}


/* --- 24a. Desktop/mobile toggle utilities ------------------------------------ */
.tab-bar      { display: none; }
.bottom-sheet { display: none; }
.sheet-backdrop { display: none; }
.desktop-only { display: block !important; }
.mobile-only  { display: none  !important; }

/* --- 24. Responsive ---------------------------------------------------------- */
@media (max-width: 768px) {
  body { padding-top: 56px; }

  /* Mobile nav: let navbar grow when collapse is open */
  .navbar { height: auto; min-height: 60px; }
  .navbar-collapse {
    background-color: var(--wine-deep);
    padding: 0.5rem 0;
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .wine-hero-card { padding: 1.25rem; }
  .wine-facts-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; }
  .wine-main-title { font-size: 1.45rem; }
  .cellar-qty-number { font-size: 2.25rem; }

  .wine-actions-bar {
    /* Keep the desktop flex row + space-between; just tune for mobile */
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 44px;
  }
  .back-link-text-long  { display: none; }
  .back-link-text-short { display: inline; }
  .back-link {
    font-size: 0.9375rem;
    padding: 6px 4px 6px 0;
  }
  .back-link i { font-size: 1.05rem; line-height: 1; }

  .detail-label { width: 110px; min-width: 110px; }
  .inventory-page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

  /* Dashboard responsive */
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-map-svg { max-height: 250px; }
  .dash-grid-2col { grid-template-columns: 1fr; }
  .dash-recent-grid { grid-template-columns: 1fr; }
  .dash-quick-actions { flex-direction: column; }
  .dash-action-btn { justify-content: center; }

  /* --- Phase 1: iOS-native foundation ------------------------------------ */

  /* 1a. System font on mobile (replaces Inter + Playfair Display) */
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  }
  h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  }

  /* 1b. 44px minimum touch targets (Apple HIG) */
  .btn                    { min-height: 44px; }
  .btn-sm                 { min-height: 44px; padding: 0.5rem 0.875rem; }
  .filter-chip            { min-height: 36px; padding: 0.45rem 0.75rem; }
  .form-control,
  .form-select            { min-height: 44px; }
  .form-control-sm,
  .form-select-sm         { min-height: 44px; font-size: 0.9375rem; }
  .page-link              { min-height: 44px; min-width: 44px;
                            display: flex; align-items: center; justify-content: center; }
  .form-check-input       { width: 1.25rem; height: 1.25rem; }

  /* 1c. Shadow removal – iOS flat design with 0.5px hairline borders */
  .card,
  .info-section,
  .form-section,
  .filter-bar,
  .dash-card,
  .dash-stat-card,
  .enrichment-section,
  .wine-hero-card         { box-shadow: none !important;
                            border: 0.5px solid var(--border) !important; }
  .table-responsive       { box-shadow: none !important;
                            border: 0.5px solid var(--border) !important; }

  /* 1d. Hide footer on mobile (tab bar replaces it in Phase 2) */
  footer                  { display: none; }

  /* 1e. Remove hover lift effects (meaningless on touch devices) */
  .btn:hover,
  .btn-primary:hover,
  .btn-success:hover,
  .btn-outline-primary:hover,
  .btn-outline-secondary:hover,
  .btn-outline-danger:hover,
  a.dash-stat-card:hover,
  .dash-action-btn:hover,
  .dash-recent-item:hover { transform: none !important; }

  /* --- Phase 2: Bottom Tab Bar --------------------------------------------- */

  .navbar { display: none !important; }

  .tab-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1050;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--border);
    height: calc(49px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tab-bar-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 6px 0 2px;
    text-decoration: none; color: var(--text-muted);
    font-size: 0.625rem; font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    min-height: 49px;
  }
  .tab-bar-item i { font-size: 1.375rem; }
  .tab-bar-item.active { color: var(--wine); }

  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(49px + env(safe-area-inset-bottom, 0px));
  }
  .container { padding-top: 1rem; }

  /* --- Phase 2: Toggle utilities ------------------------------------------- */

  .desktop-only { display: none !important; }
  .mobile-only  { display: block !important; }

  /* --- Phase 3: Mobile wine list rows -------------------------------------- */

  .wine-list-mobile {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
  }
  .wine-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--border-subtle);
    text-decoration: none; color: var(--text);
    min-height: 60px;
    -webkit-tap-highlight-color: transparent;
  }
  .wine-row:last-child { border-bottom: none; }
  .wine-row:active { background: var(--surface-alt); }

  .wine-row-qty {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm);
    background: var(--surface-alt);
    font-weight: 700; font-size: 0.875rem;
    flex-shrink: 0;
  }
  .wine-row-center { flex: 1; min-width: 0; }
  .wine-row-name {
    font-weight: 600; font-size: 0.9375rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .wine-row-meta {
    display: flex; gap: 6px; flex-wrap: wrap;
    font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px;
  }
  .wine-row-meta span + span::before {
    content: '\00B7'; margin-right: 6px; color: var(--text-muted);
  }
  .wine-row-right {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  }

  /* --- Phase 7: Profile header + links ------------------------------------- */

  .profile-header {
    text-align: center;
    padding: 1.5rem 0 1rem;
  }
  .profile-links {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 1rem 1.25rem;
    margin-top: 1rem;
  }
  .profile-links a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    text-decoration: none; color: var(--wine);
    font-size: 0.75rem; font-weight: 500;
    min-width: 56px;
  }
  .profile-links a i { font-size: 1.5rem; }

  /* --- Phase 4: Bottom sheet component ------------------------------------- */

  .bottom-sheet {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 1060;
    background: var(--surface);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 85vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-sheet.sheet-open { transform: translateY(0); }

  .sheet-backdrop {
    position: fixed; inset: 0; z-index: 1055;
    background: rgba(0,0,0,0.3);
    opacity: 0; transition: opacity 0.3s;
    pointer-events: none; display: none;
  }
  .sheet-backdrop.active { opacity: 1; pointer-events: auto; }

  .sheet-handle {
    display: flex; justify-content: center; padding: 8px 0 4px; cursor: grab;
  }
  .sheet-handle span {
    width: 36px; height: 5px;
    background: var(--border-strong, var(--border)); border-radius: 3px;
  }
  .sheet-content { padding: 0 16px 16px; }
  .sheet-title {
    font-size: 1.0625rem; font-weight: 600;
    text-align: center; padding: 8px 0 16px;
  }

  /* Sheet option list (sort, actions) */
  .sheet-option-list { padding: 0; }
  .sheet-option {
    display: flex; align-items: center;
    padding: 14px 0; border-bottom: 0.5px solid var(--border-subtle);
    text-decoration: none; color: var(--text); font-size: 1rem;
    background: none; border-left: none; border-right: none; border-top: none;
    width: 100%; text-align: left; cursor: pointer;
  }
  .sheet-option:last-child { border-bottom: none; }
  .sheet-option--danger { color: var(--danger); }
  .sheet-option--active { color: var(--wine); font-weight: 600; }

  /* Mobile search bar */
  .filter-trigger-bar { margin-bottom: 1rem; }
  .search-bar-mobile {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-alt);
    border: 0.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 0 12px; height: 44px;
  }
  .search-bar-mobile > i { color: var(--text-muted); font-size: 0.875rem; flex-shrink: 0; }
  .search-input-mobile {
    flex: 1; border: none; background: transparent;
    font-size: 0.9375rem; outline: none;
    color: var(--text);
  }
  .filter-trigger-btn {
    border: none; background: transparent;
    color: var(--wine); font-size: 1.25rem;
    padding: 8px; min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }

  /* Mobile filter form inside sheet */
  .mobile-filter-form .form-select {
    margin-bottom: 1rem;
  }
  .mobile-filter-label {
    display: block;
    font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
  }
  .mobile-filter-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 0;
    border-top: 0.5px solid var(--border-subtle);
    margin-top: 0.25rem;
  }
  .mobile-filter-toggle .form-check-label {
    font-size: 0.9375rem; font-weight: 500; color: var(--text);
  }
  .mobile-filter-actions {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding-top: 1rem;
    border-top: 0.5px solid var(--border-subtle);
  }
  .mobile-filter-apply {
    min-height: 48px; font-size: 1rem; font-weight: 600;
  }
  .mobile-filter-clear {
    min-height: 44px; font-size: 0.9375rem;
  }

  /* --- Phase 6: Wine detail mobile refinements ----------------------------- */

  .overflow-btn {
    border: none;
    background: var(--surface-alt);
    border-radius: 50%;
    width: 44px; height: 44px;
    min-width: 44px; min-height: 44px;
    padding: 0;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
  }
  .overflow-btn i { font-size: 1.05rem; line-height: 1; }
  .overflow-btn:active { background: var(--border-subtle); }

  .info-section {
    margin-bottom: 0.75rem;
  }
  .info-section-header {
    font-size: 0.8125rem; text-transform: uppercase;
    color: var(--text-secondary); font-weight: 600;
    letter-spacing: 0.06em; padding: 0.5rem 0 0.25rem;
  }

  .wine-hero-card {
    margin-left: -12px; margin-right: -12px;
    border-radius: 0; border-left: none; border-right: none;
  }
  .wine-detail-cards { flex-direction: column; }
  .wine-detail-cards > [class*="col-"] { width: 100%; }
}

/* ============================================================
 * REPORTS & INSIGHTS PAGE
 * ============================================================ */

.reports-header {
  margin: 1.25rem 0 1rem;
  padding: 0 0.25rem;
}
.reports-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.reports-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  max-width: 62ch;
}

/* Segmented tab control */
.reports-tabs {
  display: inline-flex;
  gap: 0;
  background: var(--surface-raised, #F4EFE8);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  max-width: 100%;
}
.reports-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  min-height: 40px;
  white-space: nowrap;
}
.reports-tab i { font-size: 1rem; }
.reports-tab:hover { color: var(--text-primary); }
.reports-tab.active {
  background: #fff;
  color: var(--wine, #6D2535);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.reports-tab:focus-visible {
  outline: 2px solid var(--wine, #6D2535);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .reports-tabs {
    display: flex;
    width: 100%;
  }
  .reports-tab {
    flex: 1 1 0;
    padding: 0.55rem 0.5rem;
    font-size: 0.85rem;
  }
}

.reports-pane { display: none; }
.reports-pane.active { display: grid; gap: 1.25rem; }

/* Report card */
.report-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.report-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.5rem;
  flex-wrap: wrap;
}
.report-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.report-card-title i { color: var(--wine, #6D2535); font-size: 1.05rem; }
.report-card-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}
.report-card-action {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wine, #6D2535);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  transition: background 0.15s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.report-card-action:hover { background: rgba(109, 37, 53, 0.08); }
.report-card-body { padding: 0.75rem 1.25rem 1.25rem; }
.report-card-body--split {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .report-card-body--split { grid-template-columns: 1fr; gap: 1rem; }
}
.report-card-footnote {
  padding: 0.65rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-raised, #F9F5EF);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  line-height: 1.4;
}
.report-card-footnote i { color: var(--wine, #6D2535); }
.report-card-footnote-link {
  margin-left: auto;
  color: var(--wine, #6D2535);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.report-card-footnote-link:hover { text-decoration: underline; }

/* Section titles inside report bodies */
.report-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.report-section-title--small { margin-top: 0.85rem; }

/* Donut chart */
.report-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
}
.report-donut {
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 1 / 1;
}
.report-donut-segments path { transition: opacity 0.15s, transform 0.15s; transform-origin: center; }
.report-donut-segments a:hover path { opacity: 0.85; }
.report-donut-total {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  fill: var(--text-primary);
}
.report-donut-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  fill: var(--text-secondary);
}

/* Donut legend */
.report-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.report-legend-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 44px;
  transition: background 0.15s;
}
.report-legend-row:hover { background: var(--surface-raised, #F9F5EF); }
.report-legend-swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08) inset;
}
.report-legend-label { font-size: 0.9rem; font-weight: 500; }
.report-legend-count { font-weight: 700; color: var(--text-primary); font-size: 0.9rem; }
.report-legend-pct { color: var(--text-secondary); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* Horizontal bar list (Composition by Origin, top regions, etc.) */
.report-bar-list { display: grid; gap: 0.4rem; min-width: 0; }
.report-bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 110px) 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 40px;
  transition: background 0.15s;
}
.report-bar-row:hover { background: var(--surface-raised, #F9F5EF); }
.report-bar-label {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-bar-track {
  background: var(--border-subtle, #E5DFD6);
  border-radius: 999px;
  height: 8px;
  position: relative;
  overflow: hidden;
}
.report-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--wine, #6D2535);
  transition: width 0.25s ease-out;
}
.report-bar-fill--wine { background: var(--wine, #6D2535); }
.report-bar-fill--gold { background: var(--gold, #B89050); }
.report-bar-count {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}

/* Stacked horizontal bar (Drink Window Timeline) */
.report-stacked-bar {
  display: flex;
  width: 100%;
  height: 28px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border-subtle, #E5DFD6);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) inset;
}
.report-stacked-segment {
  display: block;
  min-width: 6px;
  transition: opacity 0.15s;
}
.report-stacked-segment:hover { opacity: 0.88; }
.report-stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.report-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #fff;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  min-height: 36px;
  transition: background 0.15s, border-color 0.15s;
}
.report-pill:hover { background: var(--surface-raised, #F9F5EF); border-color: var(--pill-color, var(--border)); }
.report-pill-dot { width: 10px; height: 10px; border-radius: 50%; }
.report-pill-label { font-weight: 600; }
.report-pill-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.report-pill-pct { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Data-quality / sparse warning banner */
.report-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  margin-top: 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
}
.report-banner--warning {
  background: #FFF6E5;
  border: 1px solid #F5D58A;
  color: #6B4A11;
}
.report-banner > i {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.report-banner-body {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  min-width: 0;
}
.report-banner-action {
  color: #6B4A11;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
}
.report-banner-action:hover { text-decoration: underline; }

/* Wine list rows (Drink Soon) */
.report-wine-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.report-wine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 60px;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.report-wine-row:hover {
  background: var(--surface-raised, #F9F5EF);
  border-color: var(--border-subtle);
}
.report-wine-meta { min-width: 0; flex: 1; }
.report-wine-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-wine-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.report-wine-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}
.report-end-year-badge {
  background: var(--wine, #6D2535);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Empty states */
.report-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  display: grid;
  gap: 0.6rem;
  justify-items: center;
}
.report-empty-icon {
  font-size: 2rem;
  color: var(--text-tertiary, #B5A99A);
}
.report-empty p { margin: 0; font-size: 0.92rem; max-width: 38ch; }
.report-empty-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.5rem 0;
  margin: 0;
}

/* Taste profile grid (R5) */
.report-taste-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}
@media (max-width: 768px) {
  .report-taste-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}
.report-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.report-tag {
  background: rgba(109, 37, 53, 0.08);
  color: var(--wine, #6D2535);
  border: 1px solid rgba(109, 37, 53, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.report-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.6rem 0;
  margin: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.report-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.report-stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}
.report-stat-unit { font-size: 0.85rem; color: var(--text-secondary); font-weight: 400; }

.report-season-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.report-season-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  background: var(--surface-raised, #F9F5EF);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  min-width: 46px;
}
.report-season-pill strong {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}
.report-season-pill span {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Taste bar component (reused inside R5) */
.taste-bar {
  display: grid;
  grid-template-columns: minmax(90px, 120px) 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 36px;
  transition: background 0.15s;
}
.taste-bar:hover { background: var(--surface-raised, #F9F5EF); }
.taste-bar-label {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taste-bar-label--wide { max-width: 180px; }
.taste-bar-track {
  background: var(--border-subtle, #E5DFD6);
  border-radius: 999px;
  height: 8px;
  position: relative;
  overflow: hidden;
}
.taste-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--wine, #6D2535);
  transition: width 0.25s ease-out;
}
.taste-bar-value {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  text-align: right;
}

/* Data Completeness / Improve Your Cellar (R6) */
.report-completeness-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.report-completeness-ring {
  --score: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--wine, #6D2535) calc(var(--score) * 1%), var(--border-subtle, #E5DFD6) 0);
  position: relative;
}
.report-completeness-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}
.report-completeness-ring span {
  position: relative;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.report-completeness-caption {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.completeness-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.completeness-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  background: var(--surface-raised, #F9F5EF);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.completeness-item--done {
  background: #F1F8F4;
  border-color: #CDE7D6;
  opacity: 0.85;
}
.completeness-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--wine, #6D2535);
  font-size: 1.15rem;
  border: 1px solid var(--border-subtle);
}
.completeness-item--done .completeness-item-icon {
  color: #2A6B3D;
  border-color: #CDE7D6;
}
.completeness-item-body { min-width: 0; }
.completeness-item-headline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.completeness-item-label {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.completeness-item-missing {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8B4A00;
  background: #FFF1D6;
  border: 1px solid #F5D58A;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.completeness-item-done {
  font-size: 0.78rem;
  font-weight: 700;
  color: #2A6B3D;
}
.completeness-item-why {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin: 0.3rem 0 0;
}
.completeness-item-action {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin: 0.2rem 0 0;
  font-style: italic;
}
.completeness-item-cta {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.9rem;
  background: var(--wine, #6D2535);
  color: #fff;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 40px;
  transition: background 0.15s, transform 0.15s;
}
.completeness-item-cta:hover { background: #5A1D2B; color: #fff; }
.completeness-item-cta:active { transform: scale(0.97); }
@media (max-width: 600px) {
  .completeness-item { grid-template-columns: 36px 1fr; }
  .completeness-item-cta { grid-column: 1 / -1; justify-self: start; margin-top: 0.35rem; }
}

/* ============================================================
 * DASHBOARD HERO CARDS (slim redesign)
 * ============================================================ */
.dash-hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-hero-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 140px;
}
.dash-hero-card--span-12 { grid-column: span 12; }
.dash-hero-card--span-8 { grid-column: span 8; }
.dash-hero-card--span-6 { grid-column: span 6; }
.dash-hero-card--span-4 { grid-column: span 4; }
.dash-hero-card--accent { background: linear-gradient(135deg, #fff 0%, #FBF6EE 100%); border-color: #E5D9C4; }
.dash-hero-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 700;
}
.dash-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.dash-hero-big {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.1rem 0 0.25rem;
}
.dash-hero-caption {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}
.dash-hero-split {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.6rem;
}
.dash-hero-stat {
  border-left: 3px solid var(--border-subtle);
  padding: 0.25rem 0 0.25rem 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
  min-height: 50px;
  border-radius: 2px;
  transition: background 0.15s;
}
.dash-hero-stat:hover { background: rgba(109, 37, 53, 0.04); color: var(--text-primary); }
.dash-hero-stat--ready { border-left-color: #2A6049; }
.dash-hero-stat--aging { border-left-color: #1E5479; }
.dash-hero-stat--past { border-left-color: #8B2535; }
.dash-hero-stat--unknown { border-left-color: #9A8B83; }
.dash-hero-stat-value {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-primary);
  line-height: 1.1;
  display: block;
}
.dash-hero-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 600;
}
.dash-hero-footer {
  margin-top: auto;
  padding-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.dash-hero-link {
  color: var(--wine, #6D2535);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.dash-hero-link:hover { text-decoration: underline; color: var(--wine, #6D2535); }

@media (max-width: 900px) {
  .dash-hero-card--span-8,
  .dash-hero-card--span-6,
  .dash-hero-card--span-4 { grid-column: span 12; }
  .dash-hero-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

