/* ── Reset & base ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0e0e12;
  --bg-card: #17171e;
  --bg-card-hover: #1e1e28;
  --border: #2a2a36;
  --text: #e4e4ea;
  --text-muted: #8888a0;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #57f287;
  --warning: #fee75c;
  --danger: #ed4245;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ────────────────────────────────────────────────────── */
.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ── Hero / landing ────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 540px;
}

/* ── User panel ────────────────────────────────────────────────── */
.user-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.user-panel .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.user-info .tag {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  color: #fff;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: #2a2a36;
  color: var(--text);
}

.btn-secondary:hover {
  background: #35354a;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* ── Status chip ───────────────────────────────────────────────── */
.chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.chip-active {
  background: rgba(87, 242, 135, 0.15);
  color: var(--success);
}

.chip-done {
  background: rgba(136, 136, 160, 0.15);
  color: var(--text-muted);
}

/* ── Section header ────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.section-header .count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Barrel list ───────────────────────────────────────────────── */
.barrel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.barrel-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  transition: background 0.15s;
}

.barrel-card:hover {
  background: var(--bg-card-hover);
}

.barrel-name {
  font-weight: 600;
  font-size: 1rem;
}

.shared-tag {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0.85;
}

.barrel-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  grid-column: 1;
}

.barrel-meta span + span::before {
  content: '·';
  margin: 0 0.4rem;
  color: var(--border);
}

.barrel-status {
  grid-row: 1 / 3;
  grid-column: 2;
  justify-self: end;
  align-self: center;
}

/* ── Progress bar ──────────────────────────────────────────────── */
.progress-wrap {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.progress-fill.done {
  background: var(--success);
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-align: right;
}

/* ── Empty / error states ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}

.empty-state h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

.error-banner {
  background: rgba(237, 66, 69, 0.12);
  border-color: rgba(237, 66, 69, 0.3);
  color: var(--danger);
  margin-bottom: 1.5rem;
}

/* ── Spinner ───────────────────────────────────────────────────── */
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Footer ────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3rem;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.35rem;
  }

  .barrel-card {
    grid-template-columns: 1fr;
  }

  .barrel-status {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }
}
