/* Fonts loaded via /fonts/fonts.css in HTML — Barlow Condensed + JetBrains Mono */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #3B3020;
  --fg:       #F2E8D0;
  --fg-rgb:   242,232,208;
  --card:     #2D2518;
  --card-lt:  #F2E8D0;
  --primary:  #C0612A;
  --muted:    rgba(var(--fg-rgb),0.5);
  --green:    #2d7a3a;
  --green-lt: #d4f5d8;
  --red:      #b53535;
  --red-lt:   #fde8e8;
  --border:   #F2E8D0;
  --tag-bg:   rgba(var(--fg-rgb),0.1);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  min-height: 100vh;
}

/* ---- NAVBAR ---- */
nav {
  background: var(--bg);
  border-bottom: 3px solid var(--fg);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.nav-logo-icon {
  border: 2px solid var(--fg);
  padding: 5px;
  font-size: 1rem;
  line-height: 1;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-links { display: flex; }
.nav-link {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(var(--fg-rgb),0.6);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, border-color .15s;
}
.nav-link:hover { color: var(--fg); border-bottom-color: rgba(var(--fg-rgb),0.4); }
.nav-link.active { color: var(--fg); border-bottom-color: var(--primary); }

/* Currency select */
select.currency-select {
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--fg);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  height: 32px;
}
select.currency-select:focus { border-color: var(--primary); }

/* ---- PAGES ---- */
main { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page { display: none; }
.page.active { display: block; }

/* ---- DASHBOARD HEADER ---- */
.dashboard-header {
  border-bottom: 3px solid var(--fg);
  padding: 48px 24px;
  text-align: center;
}
.dashboard-header h1 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 1;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.dashboard-header .month-label {
  display: inline-block;
  border-top: 2px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 6px 24px;
  margin: 16px 0 40px;
  color: var(--fg);
}
.stats-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(var(--fg-rgb),0.7);
  margin-bottom: 6px;
}
.stat-value {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 3.5rem;
  color: var(--fg);
  line-height: 1;
}
.stat-value.accent { color: var(--primary); }
.stat-divider { width: 3px; height: 64px; background: var(--fg); }

/* ---- PERSON GRID ---- */
.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 40px 0;
}
.person-card {
  background: var(--card);
  border: 2px solid var(--fg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: box-shadow .15s;
}
.person-card:hover { box-shadow: 4px 4px 0 var(--fg); }
.person-emoji {
  width: 60px; height: 60px;
  border: 2px solid var(--fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin-bottom: 12px;
  background: rgba(var(--fg-rgb),0.05);
}
.person-name {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 1.8rem;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 4px;
}
.person-drinks {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(var(--fg-rgb),0.6); margin-bottom: 20px;
}
.coffee-qty {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-bottom: 8px;
  border: 2px solid var(--fg);
  background: var(--bg);
}
.coffee-qty .qty-btn {
  flex: 0 0 36px;
  background: none;
  border: none;
  color: var(--fg);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 6px 0;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.coffee-qty .qty-btn:hover:not(:disabled) { background: var(--primary, #C0612A); color: #fff; }
.coffee-qty .qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.coffee-qty .qty-val {
  flex: 1;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--fg);
  border-left: 2px solid var(--fg);
  border-right: 2px solid var(--fg);
  padding: 6px 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 640px) {
  .coffee-qty .qty-btn { min-height: 36px; flex-basis: 44px; }
}

.btn-coffee {
  position: relative;
  width: 100%;
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--fg);
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  padding: 14px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background .15s, color .15s;
  overflow: hidden;
  user-select: none;
  touch-action: manipulation;
}
.btn-coffee:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-coffee:disabled { opacity: 0.5; cursor: not-allowed; }

/* Espresso fill that pours UP from the bottom — coffee filling a cup. */
.btn-coffee-fill {
  position: absolute; inset: auto 0 0 0;
  width: 100%; height: 0%;
  background: linear-gradient(180deg, #6f4423 0%, #3b1f10 100%);
  box-shadow: inset 0 6px 10px -6px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  overflow: hidden;
  transition: height 0s linear;
}
.btn-coffee.holding .btn-coffee-fill { height: 100%; transition: height 1s linear; }
.btn-coffee.loading .btn-coffee-fill { height: 100%; transition: height 0s linear; }

/* Diagonal sheen sweeping across the liquid while it pours. */
.btn-coffee-sheen {
  position: absolute; inset: 0;
  background: linear-gradient(110deg,
    transparent 0%, transparent 42%,
    rgba(255, 240, 210, 0.22) 50%,
    transparent 58%, transparent 100%);
  background-size: 220% 100%;
  background-position: 200% 0;
  opacity: 0;
}
.btn-coffee.holding .btn-coffee-sheen,
.btn-coffee.loading .btn-coffee-sheen {
  opacity: 1;
  animation: btnCoffeeSheen 1.1s linear infinite;
}
@keyframes btnCoffeeSheen {
  from { background-position: 200% 0; }
  to   { background-position: -120% 0; }
}

.btn-coffee-label, .btn-coffee-hint { position: relative; z-index: 1; }
.btn-coffee.holding, .btn-coffee.loading { color: #fff; }
.btn-coffee-hint {
  display: block;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.55rem; opacity: 0.55;
  letter-spacing: 0.18em; margin-top: 4px;
}
.btn-coffee.loading .btn-coffee-hint { visibility: hidden; }

/* Espresso drip dots — 3 small circles that fall in sequence under the label. */
.btn-coffee-drips {
  display: none;
  align-items: flex-end;
  gap: 5px;
  margin-left: 8px;
  vertical-align: middle;
  height: 0.9em;
}
.btn-coffee.loading .btn-coffee-drips { display: inline-flex; }
.btn-coffee-drips > span {
  width: 5px; height: 5px;
  background: currentColor;
  border-radius: 50% 50% 60% 60% / 40% 40% 80% 80%;
  transform: translateY(-3px);
  opacity: 0.35;
  animation: btnCoffeeDrip 1.05s ease-in-out infinite;
}
.btn-coffee-drips > span:nth-child(2) { animation-delay: 0.18s; }
.btn-coffee-drips > span:nth-child(3) { animation-delay: 0.36s; }
@keyframes btnCoffeeDrip {
  0%, 75%, 100% { transform: translateY(-3px); opacity: 0.35; }
  35%           { transform: translateY(4px);  opacity: 1; }
  60%           { transform: translateY(4px);  opacity: 0; }
}
.person-footer {
  width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid rgba(var(--fg-rgb),0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.person-row {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.person-row .label { color: rgba(var(--fg-rgb),0.6); }
.person-row .val { color: var(--fg); font-weight: 600; }
.badge {
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; text-transform: uppercase; letter-spacing: 0.1em;
}
.badge-credit { background: var(--green); color: var(--green-lt); }
.badge-debt { background: var(--red); color: var(--red-lt); }
.btn-delete {
  position: absolute; top: 10px; right: 10px;
  background: none; border: 1px solid rgba(var(--fg-rgb),0.2);
  color: rgba(var(--fg-rgb),0.3); cursor: pointer;
  padding: 4px 6px; font-size: 0.75rem;
  display: none;
  transition: color .15s, background .15s;
}
.person-card:hover .btn-delete { display: block; }
.btn-delete:hover { background: var(--red); color: #fff; border-color: var(--red); }

.btn-credit {
  position: absolute; top: 10px; left: 10px;
  background: none; border: 1px solid rgba(var(--fg-rgb),0.2);
  color: rgba(var(--fg-rgb),0.4); cursor: pointer;
  padding: 4px 8px; font-size: 0.75rem; font-family: inherit;
  display: none;
  transition: color .15s, background .15s, border-color .15s;
}
.person-card:hover .btn-credit,
.person-card .btn-credit.is-open { display: block; }

@media (max-width: 640px) {
  .btn-delete, .btn-credit { display: block; }
  .btn-delete { top: 8px; right: 8px; }
  .btn-credit { top: 8px; left: 8px; }
  .btn-delete, .btn-credit { min-width: 36px; min-height: 32px; }
  .suggestion-item .actions button { min-height: 36px; padding: 6px 12px; }
  .btn-coffee { min-height: 48px; }
}
.btn-credit:hover,
.btn-credit.is-open { background: var(--primary, #C0612A); color: #fff; border-color: var(--primary, #C0612A); }

.btn-undo-drink {
  margin-top: 10px;
  align-self: center;
  background: none;
  color: rgba(var(--fg-rgb), 0.45);
  border: 1px dashed rgba(var(--fg-rgb), 0.25);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-undo-drink:hover:not(:disabled) { color: var(--red); border-color: var(--red); }
.btn-undo-drink:disabled { opacity: 0.3; cursor: not-allowed; }

.credit-form {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.credit-form[hidden] { display: none; }
.credit-form input {
  font-family: inherit; font-size: 0.8rem; padding: 6px 8px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--border);
}
.credit-form .credit-actions { display: flex; gap: 6px; }
.credit-form .credit-actions button { flex: 1; font-size: 0.75rem; padding: 4px 8px; }

/* Dashboard: inline rating on the active bag block */
.active-bag-rating {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.active-bag-rating .rating-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.active-bag-rating .rating { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.active-bag-rating input[type="text"] {
  font-family: inherit; font-size: 0.8rem; padding: 6px 8px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--border); max-width: 340px;
}

/* Suggestions (Next Bag Ideas) */
.suggest-form { display: flex; gap: 6px; flex-wrap: wrap; }
.suggest-form input[type="text"] {
  font-family: inherit; font-size: 0.85rem; padding: 6px 10px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--border);
}
.suggest-form #suggest-name { flex: 1 1 180px; min-width: 140px; }
.suggest-form #suggest-note { flex: 2 1 240px; min-width: 160px; }

.suggestion-item {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--border); margin-top: 6px; background: var(--bg);
}
.suggestion-item .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suggestion-item .name { font-weight: 600; }
.suggestion-item .meta { font-size: 0.75rem; color: var(--muted); }
.suggestion-item .actions { display: flex; gap: 6px; flex-shrink: 0; }
.suggestion-item .actions button { font-size: 0.75rem; padding: 4px 10px; }
.suggestion-item .vote-btn { min-width: 60px; }
.suggestion-item .vote-btn.on { background: var(--primary, #C0612A); color: #fff; border-color: var(--primary, #C0612A); }

/* Add person card */
.card-add {
  border: 2px dashed rgba(var(--fg-rgb),0.3);
  min-height: 340px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; gap: 10px;
  color: rgba(var(--fg-rgb),0.4);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em;
  background: transparent;
  transition: border-color .15s, color .15s;
}
.card-add:hover { border-color: var(--primary); color: var(--primary); }
.card-add-icon { font-size: 2rem; }

/* ---- MODAL ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 2px solid var(--fg);
  padding: 32px;
  min-width: 340px; max-width: 95vw;
  position: relative;
}
.modal h2 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 1.8rem; text-transform: uppercase;
  margin-bottom: 24px; color: var(--fg);
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--fg);
  font-size: 1.2rem; cursor: pointer; opacity: 0.6;
}
.modal-close:hover { opacity: 1; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.15em; color: rgba(var(--fg-rgb),0.6); margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 2px solid var(--fg); font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.95rem; padding: 10px 12px; outline: none;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--primary); }
.input-prefix { position: relative; }
.input-prefix .prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.9rem; color: rgba(var(--fg-rgb),0.5); pointer-events: none;
}
.input-prefix input { padding-left: 32px; }
.btn-primary {
  width: 100%; background: var(--fg); color: var(--bg);
  border: 2px solid var(--fg); font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 12px; cursor: pointer; font-weight: 600;
  transition: background .15s, color .15s;
  margin-top: 8px;
}
.btn-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- BAGS PAGE ---- */
.page-header {
  border-bottom: 3px solid var(--fg);
  padding: 32px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.page-title-wrap { display: flex; align-items: center; gap: 16px; }
.page-icon { border: 2px solid var(--fg); padding: 12px; font-size: 1.4rem; }
.page-title { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 2.4rem; text-transform: uppercase; }
.page-sub { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(var(--fg-rgb),0.55); margin-top: 2px; }
.btn-outline {
  background: var(--fg); color: var(--bg); border: 2px solid var(--fg);
  font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 10px 20px; cursor: pointer; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: background .15s, color .15s;
}
.btn-outline:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.bags-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; padding: 32px 0;
}
.bag-card {
  border: 2px solid var(--fg); padding: 20px;
  transition: box-shadow .15s;
}
.bag-card:hover { box-shadow: 4px 4px 0 var(--fg); }
.bag-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.bag-icon { border: 2px solid var(--fg); padding: 8px; font-size: 1rem; }
.bag-cost-block { text-align: right; }
.bag-cost { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 2rem; display: block; }
.bag-month { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); }
.bag-footer { border-top: 2px solid rgba(var(--fg-rgb),0.2); padding-top: 14px; }
.bag-footer .sub { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(var(--fg-rgb),0.55); margin-bottom: 4px; }
.bag-footer .name { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.3rem; text-transform: uppercase; }
.bag-footer .date { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(var(--fg-rgb),0.45); margin-top: 10px; }
.empty-state { text-align: center; padding: 64px 0; color: rgba(var(--fg-rgb),0.35); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; display: block; }

/* ---- SETTLEMENTS PAGE ---- */
.settlement-summary {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border: 2px solid var(--fg); margin-bottom: 0;
}
@media (min-width: 640px) { .settlement-summary { grid-template-columns: repeat(4, 1fr); } }
.summary-cell {
  padding: 20px; border-right: 2px solid var(--fg);
}
.summary-cell:last-child { border-right: none; }
.summary-cell.accent { background: rgba(192,97,42,0.1); }
.summary-cell .lbl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(var(--fg-rgb),0.55); margin-bottom: 6px; }
.summary-cell .val { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.6rem; }
.summary-cell.accent .val { color: var(--primary); }
table.settlement-table { width: 100%; border-collapse: collapse; border: 2px solid var(--fg); border-top: none; }
table.settlement-table th {
  background: rgba(var(--fg-rgb),0.07);
  padding: 12px 16px; font-size: 0.65rem;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: rgba(var(--fg-rgb),0.55); text-align: left;
  border-bottom: 2px solid var(--fg);
}
table.settlement-table th:last-child { text-align: right; }
table.settlement-table td { padding: 14px 16px; border-bottom: 1px solid rgba(var(--fg-rgb),0.12); font-size: 0.85rem; }
table.settlement-table td:last-child { text-align: right; }
table.settlement-table tr:last-child td { border-bottom: none; }
table.settlement-table tr:hover td { background: rgba(var(--fg-rgb),0.04); }
.td-name { display: flex; align-items: center; gap: 10px; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.1rem; text-transform: uppercase; }
.history-section { margin-top: 48px; }
.history-title { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.6rem; text-transform: uppercase; color: rgba(var(--fg-rgb),0.5); border-bottom: 2px solid rgba(var(--fg-rgb),0.2); padding-bottom: 10px; margin-bottom: 16px; }
.history-item { border: 2px solid var(--fg); padding: 20px; margin-bottom: 12px; transition: box-shadow .15s; }
.history-item:hover { box-shadow: 4px 4px 0 var(--fg); }
.history-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.history-item .month-name { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.4rem; text-transform: uppercase; }
.history-item .closed-date { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(var(--fg-rgb),0.5); }
.history-item .total-cost { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.4rem; text-align: right; }
.history-item .drinks-count { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(var(--fg-rgb),0.5); }
.history-tags { display: flex; flex-wrap: wrap; gap: 8px; border-top: 2px solid rgba(var(--fg-rgb),0.15); padding-top: 12px; }
.history-tag { border: 1px solid rgba(var(--fg-rgb),0.25); padding: 3px 10px; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 6px; }
.no-data { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(var(--fg-rgb),0.4); font-style: italic; }
.section-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--fg); padding-bottom: 16px; margin: 32px 0 24px; }
.section-title { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 2rem; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }

/* Personal user panel — bag-centric */
.pp-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.pp-stat {
  background: rgba(var(--fg-rgb), 0.04);
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
}
.pp-stat-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.pp-stat-value {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 1.6rem; line-height: 1.1; margin-top: 2px;
}
.pp-stat-unit { font-size: 0.85rem; font-family: 'JetBrains Mono', 'Courier New', monospace; color: var(--muted); }
.pp-stat-sub { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }

.pp-section { margin-top: 14px; }
.pp-section-title {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.95rem; color: var(--primary);
  margin-bottom: 8px;
}
.pp-empty { font-size: 0.82rem; color: var(--muted); font-style: italic; }

.pp-bag {
  background: rgba(var(--fg-rgb), 0.04);
  padding: 12px 14px; border-left: 3px solid var(--primary);
}
.pp-bag-name { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.2rem; }
.pp-bag-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.pp-bag-mine { font-size: 0.88rem; margin-top: 8px; line-height: 1.5; }

.pp-day-list { list-style: none; padding: 0; margin: 0; }
.pp-day {
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
  padding: 8px 0;
}
.pp-day:last-child { border-bottom: none; }
.pp-day-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.78rem;
}
.pp-day-label {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem;
}
.pp-day-count { color: var(--muted); font-size: 0.72rem; }
.pp-day-times {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.pp-time {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.72rem;
  background: rgba(var(--fg-rgb), 0.08);
  border: 1px solid rgba(var(--fg-rgb), 0.15);
  padding: 2px 6px;
  color: var(--fg);
}

.pp-hist-list { list-style: none; padding: 0; margin: 0; }
.pp-hist-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: 0.82rem;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
  flex-wrap: wrap;
}
.pp-hist-item:last-child { border-bottom: none; }
.pp-hist-name { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 0.95rem; }
.pp-hist-status { color: var(--muted); font-size: 0.7rem; margin-left: 6px; font-family: 'JetBrains Mono', 'Courier New', monospace; }
.pp-hist-amount { font-size: 0.82rem; }
.pp-hist-owed strong { color: var(--fg); }
.pp-hist-buyer { color: var(--primary); font-style: italic; }

/* Live bag settlement (inside the active-bag block) */
.bag-settle {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.bag-settle-head { margin-bottom: 8px; }
.bag-settle-title {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.95rem; color: var(--primary);
}
.bag-settle-sub {
  font-size: 0.78rem; color: var(--muted); margin-top: 2px;
}
.bag-settle-warn { color: var(--muted); font-style: italic; }
.bag-settle-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.bag-settle-table th {
  text-align: left; padding: 6px 8px;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.2);
}
.bag-settle-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
}
.bag-settle-table tr:last-child td { border-bottom: none; }
.bag-settle-num { text-align: right; white-space: nowrap; }
.bag-settle-row-buyer td { background: rgba(192, 97, 42, 0.08); }
.bag-settle-tag {
  display: inline-block;
  font-size: 0.6rem; letter-spacing: 0.1em;
  background: var(--primary); color: #fff;
  padding: 1px 6px; margin-left: 6px;
  vertical-align: 1px;
}
.bag-settle-buyer { color: var(--primary); font-weight: 600; }
.bag-settle-empty {
  text-align: center; color: var(--muted); font-style: italic; padding: 12px;
}

/* Dashboard coffee quote banner */
.dash-quote {
  background: var(--card);
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(var(--fg-rgb), 0.85);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.dash-quote-mark   { color: var(--primary); flex: 0 0 auto; }
.dash-quote-text   { font-style: italic; color: var(--fg); flex: 1 1 240px; min-width: 0; }
.dash-quote-author { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.04em; flex: 0 0 auto; }
.dash-quote-shuffle {
  background: none; border: 1px solid rgba(var(--fg-rgb), 0.2);
  color: rgba(var(--fg-rgb), 0.5); cursor: pointer;
  font-family: inherit; font-size: 0.85rem; line-height: 1;
  padding: 2px 8px; flex: 0 0 auto;
  transition: color .15s, border-color .15s;
}
.dash-quote-shuffle:hover { color: var(--primary); border-color: var(--primary); }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 48px); }
.toast {
  background: var(--fg); color: var(--bg);
  font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 12px 16px 12px 14px; border: 2px solid var(--bg);
  border-left-width: 6px;
  animation: toastIn .18s ease;
  min-width: 220px; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.toast-icon { font-size: 0.95rem; line-height: 1; flex: 0 0 auto; }
.toast-msg { flex: 1 1 auto; word-break: break-word; }
.toast-close {
  background: none; border: none; color: inherit; cursor: pointer;
  font-family: inherit; font-size: 1rem; line-height: 1;
  padding: 0 4px; opacity: 0.6; flex: 0 0 auto;
}
.toast-close:hover { opacity: 1; }
.toast-success { border-left-color: var(--green); }
.toast-error   { border-left-color: var(--red); }
.toast-info    { border-left-color: var(--primary); }
.toast-leaving { animation: toastOut .18s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(40px); } }

@media (max-width: 480px) {
  .stats-row { gap: 24px; }
  .stat-divider { display: none; }
  .stat-value { font-size: 2.5rem; }
  nav { padding: 0 12px; }
  .nav-link span { display: none; }
  main { padding: 0 12px; }
}
