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

:root {
  --amber: #e8960c;
  --amber-dark: #b97308;
  --bg: #0f1117;
  --bg-card: #1a1d26;
  --bg-hover: #21242f;
  --border: #2a2d3a;
  --text: #e8eaf0;
  --text-dim: #6b7280;
  --text-muted: #9ca3af;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
nav {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 2rem; height: 56px;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
nav .brand { font-size: 1.1rem; font-weight: 700; color: var(--amber); margin-right: auto; }
nav .nav-links { display: flex; align-items: center; gap: 1.2rem; }
nav .nav-links a { color: var(--text-muted); font-size: 0.9rem; }
nav .nav-links a:hover { color: var(--text); text-decoration: none; }
.btn-nav {
  background: var(--amber); color: #000 !important; padding: 0.35rem 0.9rem;
  border-radius: var(--radius); font-weight: 600; font-size: 0.82rem;
}
.btn-nav:hover { background: var(--amber-dark); text-decoration: none !important; }

/* Main */
main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Page header */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.8rem; font-weight: 700; }
.page-header .subtitle { color: var(--text-muted); margin-top: 0.35rem; }
.back-link { font-size: 0.85rem; color: var(--text-dim); display: inline-block; margin-bottom: 0.4rem; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3-1 { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) {
  .grid-2, .grid-3-1 { grid-template-columns: 1fr; }
}

/* Buttons */
.btn-primary {
  display: inline-block; background: var(--amber); color: #000;
  padding: 0.55rem 1.2rem; border-radius: var(--radius); font-weight: 600;
  border: none; cursor: pointer; font-size: 0.9rem;
}
.btn-primary:hover { background: var(--amber-dark); text-decoration: none; }
.btn-secondary {
  display: inline-block; background: transparent; color: var(--text);
  padding: 0.5rem 1rem; border-radius: var(--radius); font-weight: 500;
  border: 1px solid var(--border); cursor: pointer; font-size: 0.9rem;
}
.btn-secondary:hover { background: var(--bg-hover); text-decoration: none; }
.btn-ghost {
  display: inline-block; background: transparent; color: var(--text-dim);
  padding: 0.5rem 1rem; border-radius: var(--radius);
  border: none; cursor: pointer; font-size: 0.9rem;
}
.btn-ghost:hover { color: var(--text); text-decoration: none; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.82rem; }
.btn-danger-sm {
  background: transparent; color: var(--text-dim); border: none;
  cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.85rem;
}
.btn-danger-sm:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.inline-form { display: inline; }

/* Forms */
.stack-form { display: flex; flex-direction: column; gap: 0.9rem; }
.stack-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--text-muted); }
.stack-form input, .stack-form select, .stack-form textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.9rem;
}
.stack-form input:focus, .stack-form select:focus {
  outline: none; border-color: var(--amber);
}

.filter-form {
  display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-form input, .filter-form select {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 0.45rem 0.75rem; border-radius: var(--radius); font-size: 0.9rem;
}
.filter-form input { min-width: 220px; }

/* Tables */
.beer-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.beer-table th {
  text-align: left; padding: 0.6rem 0.75rem;
  color: var(--text-dim); font-weight: 500; font-size: 0.8rem; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.beer-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); }
.beer-table tr:last-child td { border-bottom: none; }
.beer-table tr:hover td { background: var(--bg-hover); }
.dim { color: var(--text-dim); }

/* Check-in list */
.checkin-list { list-style: none; }
.checkin-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border); gap: 1rem;
}
.checkin-list li:last-child { border-bottom: none; }
.beer-name { font-weight: 500; }
.beer-brewery { color: var(--text-dim); font-size: 0.85rem; display: block; }
.beer-meta { display: flex; gap: 0.75rem; align-items: center; flex-shrink: 0; }
.rating { color: var(--amber); font-size: 0.85rem; }
.date { color: var(--text-dim); font-size: 0.82rem; }

/* Friends */
.friend-cards { display: flex; flex-direction: column; gap: 1rem; }
.friend-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.friend-card-info { display: flex; flex-direction: column; gap: 0.25rem; }
.friend-name { font-weight: 600; font-size: 1rem; }
.count { color: var(--text-dim); font-size: 0.85rem; }
.friend-card-actions { display: flex; gap: 0.5rem; align-items: center; }

.friend-summary { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.friend-summary:last-child { border-bottom: none; }
.friend-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; }
.recent-mini { list-style: none; font-size: 0.82rem; color: var(--text-muted); padding-left: 0.5rem; }
.recent-mini li { padding: 0.1rem 0; }

/* Discover */
.discover-filter { flex-direction: column; align-items: flex-start; gap: 1rem; }
.filter-group { display: flex; flex-direction: column; gap: 0.5rem; }
.filter-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checkbox-item {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 0.3rem 0.75rem; border-radius: 20px;
}
.checkbox-item input[type=checkbox] { accent-color: var(--amber); }
.filter-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.result-count { margin-bottom: 1rem; color: var(--text-muted); font-size: 0.9rem; }

/* Alerts */
.alert-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5; padding: 0.75rem 1rem; border-radius: var(--radius);
  font-size: 0.85rem; margin-bottom: 1rem;
}
.alert-success {
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
  color: #86efac; padding: 0.75rem 1rem; border-radius: var(--radius);
  font-size: 0.85rem; margin-bottom: 1rem;
}

/* Tap number column */
.tap-col { width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }

/* Filter select in discover */
.filter-select { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 0.45rem 0.75rem; border-radius: var(--radius); font-size: 0.9rem; }

/* Flight bar (sticky at bottom of discover) */
.flight-bar {
  position: sticky; bottom: 1.5rem; margin-top: 1.5rem;
  display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
  pointer-events: none;
}
.flight-bar button, .flight-bar a { pointer-events: all; }
.flight-count { color: var(--text-muted); font-size: 0.9rem; background: var(--bg-card); border: 1px solid var(--border); padding: 0.4rem 0.75rem; border-radius: var(--radius); }

/* Flight card page */
.flight-header { margin-bottom: 2rem; }
.flight-header h1 { font-size: 1.8rem; font-weight: 700; }
.flight-card-table .tap-col { font-size: 1.1rem; font-weight: 700; color: var(--amber); }

/* Untappd link */
.ut-link { font-size: 1rem; text-decoration: none; opacity: 0.5; transition: opacity 0.15s; }
.ut-link:hover { opacity: 1; text-decoration: none; }

/* Misc */
.empty { color: var(--text-dim); font-style: italic; }
.help-text { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 1rem; line-height: 1.5; }
.discover-cta { margin-top: 2rem; }
