/* ============================================================
   MASTER ENGLISH — "Jalur Pendakian" Design System
   Konsep: belajar = mendaki gunung, tiap bab = pos checkpoint
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700;9..144,900&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Palette */
  --bg: #F7F3EA;
  --bg-paper: #FCFAF4;
  --ink: #20281F;
  --ink-soft: #5B6358;
  --primary: #2F6B4F;
  --primary-dark: #1E4A35;
  --primary-pale: #DCEAE0;
  --accent: #DD7A3C;
  --accent-pale: #FBE7D6;
  --gold: #C8941A;
  --gold-pale: #FAEDC9;
  --locked: #C7C0B2;
  --locked-bg: #EDE9DE;
  --danger: #C0453A;
  --line: #DAD3C2;
  --shadow: 0 4px 14px rgba(32, 40, 31, 0.08);
  --shadow-lift: 0 10px 28px rgba(32, 40, 31, 0.16);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(47,107,79,0.06) 0, transparent 45%),
    radial-gradient(circle at 85% 60%, rgba(221,122,60,0.05) 0, transparent 40%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

::selection { background: var(--accent-pale); color: var(--primary-dark); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--primary-dark); margin: 0 0 0.5em; line-height: 1.15; }
h1 { font-size: 2.1rem; font-weight: 700; font-optical-sizing: auto; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { line-height: 1.65; margin: 0 0 1em; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── App shell ──────────────────────────────────────────── */
.app-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 18px 100px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
}
.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

.stat-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill .ic { font-size: 1rem; }
.pill.xp { color: var(--primary-dark); }
.pill.streak { color: var(--accent); border-color: var(--accent-pale); background: var(--accent-pale); }
.pill.streak.zero { color: var(--ink-soft); border-color: var(--line); background: var(--bg-paper); }
.pill.level { color: var(--gold); border-color: var(--gold-pale); background: var(--gold-pale); }
.pill.account-link { color: var(--ink-soft); text-decoration: none; cursor: pointer; transition: filter 0.15s; }
.pill.account-link:hover { filter: brightness(0.94); }

/* ── Bottom nav ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--bg-paper);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 14px rgba(32,40,31,0.06);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  flex: 1;
  max-width: 92px;
}
.nav-item .ic { font-size: 1.25rem; }
.nav-item.active { color: var(--primary); background: var(--primary-pale); }

/* ── Dashboard header / hero ───────────────────────────── */
.hero {
  margin-top: 22px;
  padding: 22px 22px 26px;
  background: linear-gradient(150deg, var(--primary-dark), var(--primary) 70%);
  border-radius: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
}
.hero-row { display: flex; align-items: center; gap: 16px; }
.hero-avatar {
  width: 58px; height: 58px;
  border-radius: 16px;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.hero-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin: 0; }
.hero-level { font-size: 0.85rem; opacity: 0.85; margin-top: 2px; }
.hero-progress {
  margin-top: 16px;
}
.xp-track {
  height: 10px; border-radius: 999px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
  margin-top: 6px;
}
.xp-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #F0C84A);
  transition: width 0.7s cubic-bezier(.4,1.4,.6,1);
}
.xp-label { display: flex; justify-content: space-between; font-size: 0.74rem; opacity: 0.9; margin-top: 6px; font-family: var(--font-mono); }

/* ── Trail / climbing path ─────────────────────────────── */
.trail-section { margin-top: 30px; }
.camp-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 34px 0 18px;
  color: var(--ink-soft);
}
.camp-divider .line { flex: 1; height: 1px; background: var(--line); }
.camp-divider .label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-dark);
  background: var(--bg);
  padding: 2px 6px;
  display: flex; align-items: center; gap: 6px;
}

.trail {
  position: relative;
  padding: 6px 0;
}
.trail-node-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.trail-connector {
  position: absolute;
  left: 50%;
  top: -6px;
  width: 3px;
  height: 38px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 12px);
  transform: translateX(-50%);
}
.trail-node-wrap:first-child .trail-connector { display: none; }

.node {
  width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  position: relative;
}
.node-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  background: var(--bg-paper);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.node:hover .node-circle { transform: translateY(-3px); }
.node-circle.locked { background: var(--locked-bg); border-color: var(--locked); color: var(--locked); }
.node-circle.unlocked { border-color: var(--primary); background: var(--primary-pale); }
.node-circle.completed { border-color: var(--gold); background: var(--gold-pale); }
.node-circle.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-pale), var(--shadow-lift);
  animation: pulse-current 2.2s ease-in-out infinite;
}
@keyframes pulse-current {
  0%, 100% { box-shadow: 0 0 0 5px var(--accent-pale), var(--shadow-lift); }
  50% { box-shadow: 0 0 0 9px var(--accent-pale), var(--shadow-lift); }
}
.node-num {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.7rem;
  color: var(--ink-soft);
}
.node-label {
  font-size: 0.72rem; font-weight: 600; line-height: 1.25;
  color: var(--ink);
}
.node-circle.locked + .node-num + .node-label { color: var(--locked); }
.node-stars { display: flex; gap: 1px; font-size: 0.65rem; color: var(--gold); }

.summit-node .node-circle { width: 76px; height: 76px; font-size: 2rem; background: linear-gradient(150deg, var(--gold-pale), #fff); }

/* ── Cards / sections ───────────────────────────────────── */
.card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 26px 0 12px;
}
.section-title .ic { font-size: 1.3rem; }

.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.quick-link {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  font-size: 0.78rem; font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.quick-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-link .ic { font-size: 1.5rem; }
.quick-link .count { font-family: var(--font-mono); color: var(--ink-soft); font-weight: 500; font-size: 0.72rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-dark); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { box-shadow: 0 1px 0 var(--primary-dark); transform: translateY(3px) scale(0.99); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 4px 0 #B05A26; }
.btn-accent:active { box-shadow: 0 1px 0 #B05A26; transform: translateY(3px) scale(0.99); }
.btn-ghost { background: transparent; color: var(--primary-dark); border: 2px solid var(--line); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Chapter content page ──────────────────────────────── */
.chapter-header {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg-paper);
  border: 1px solid var(--line);
}
.chapter-eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700;
  color: var(--primary); text-transform: uppercase; letter-spacing: 0.06em;
}
.content-block { margin: 18px 0; }
.block-h2 { font-size: 1.3rem; margin-top: 28px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-pale); }
.block-h3 { font-size: 1.05rem; color: var(--accent); margin-top: 20px; }
.block-bullets { padding-left: 22px; margin: 10px 0; }
.block-bullets li { margin-bottom: 7px; line-height: 1.6; }
.block-numbered { padding-left: 0; list-style: none; margin: 10px 0; counter-reset: num; }
.block-numbered li { margin-bottom: 9px; padding-left: 30px; position: relative; }
.block-numbered li::before {
  counter-increment: num; content: counter(num);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-pale); color: var(--primary-dark);
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.example-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.example-item {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 14px;
  background: var(--primary-pale);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}
.example-item .num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--primary); font-weight: 700; }
.example-item .en { font-weight: 600; }
.example-item .id { color: var(--ink-soft); font-style: italic; font-size: 0.92rem; }

.callout {
  margin: 16px 0; padding: 14px 16px; border-radius: 12px;
  border-left: 4px solid var(--line);
}
.callout-label { font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.callout.tip { background: var(--gold-pale); border-color: var(--gold); }
.callout.fact { background: var(--primary-pale); border-color: var(--primary); }
.callout.challenge { background: var(--accent-pale); border-color: var(--accent); }
.callout.summary { background: #EFEDE6; border-color: var(--ink-soft); }
.callout.answer { background: #E8F3EC; border-color: var(--primary); }
.callout p:last-child { margin-bottom: 0; }

.story-box {
  margin: 16px 0; padding: 16px;
  background: var(--bg-paper);
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  position: relative;
}
.story-title { font-family: var(--font-display); font-weight: 700; color: var(--accent); margin-bottom: 6px; }

.dialogue-box { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.dialogue-line { display: flex; gap: 10px; }
.dialogue-speaker { font-weight: 700; color: var(--primary-dark); min-width: 86px; font-size: 0.85rem; flex-shrink: 0; }
.dialogue-bubble { background: var(--bg-paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; flex: 1; }
.dialogue-bubble .id { color: var(--ink-soft); font-size: 0.85rem; font-style: italic; margin-top: 2px; }

table.content-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.9rem; }
table.content-table th { background: var(--primary); color: #fff; text-align: left; padding: 9px 12px; }
table.content-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.content-table tr:nth-child(even) td { background: var(--primary-pale); }
.table-scroll { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
.table-scroll table.content-table { margin: 0; border: none; }

/* ── Quiz ───────────────────────────────────────────────── */
.quiz-progress { display: flex; gap: 4px; margin: 18px 0; }
.quiz-progress .seg { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.quiz-progress .seg.done { background: var(--primary); }

.quiz-question { margin-top: 20px; }
.quiz-question .qnum { font-family: var(--font-mono); color: var(--primary); font-weight: 700; font-size: 0.8rem; }
.quiz-question h3 { margin-top: 4px; }
.option-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.option-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg-paper);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option-item:hover { border-color: var(--primary); }
.option-item input { accent-color: var(--primary); width: 18px; height: 18px; }
.option-item.selected { border-color: var(--primary); background: var(--primary-pale); }
.short-answer-input {
  width: 100%; padding: 13px 16px; margin-top: 12px;
  border: 2px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: var(--font-body);
  background: var(--bg-paper);
}
.short-answer-input:focus { border-color: var(--primary); }

.result-badge { text-align: center; padding: 30px 20px; }
.result-stars { font-size: 2.5rem; margin: 10px 0; letter-spacing: 6px; }
.result-score { font-family: var(--font-mono); font-size: 3rem; font-weight: 700; color: var(--primary-dark); }
.review-item { padding: 14px; border-radius: 10px; margin-bottom: 10px; border-left: 4px solid var(--line); }
.review-item.correct { background: #E8F3EC; border-color: var(--primary); }
.review-item.wrong { background: #FBEAE8; border-color: var(--danger); }

/* ── Vocab / dialogue / sentence browsers ─────────────── */
.search-bar {
  display: flex; gap: 8px; margin: 16px 0;
}
.search-bar input {
  flex: 1; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--line);
  font-family: var(--font-body); font-size: 0.95rem; background: var(--bg-paper);
}
.search-bar input:focus { border-color: var(--primary); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px;
  background: var(--bg-paper); border: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vocab-card {
  background: var(--bg-paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; position: relative;
}
.vocab-card .en { font-weight: 700; font-size: 1rem; }
.vocab-card .id { color: var(--ink-soft); font-size: 0.85rem; }
.vocab-card .pron { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); margin-top: 4px; }
.speak-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px;
  background: var(--bg-paper); border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.95rem; cursor: pointer; color: var(--primary);
}
.speak-btn .pron { margin-top: 0; }
.speak-btn:hover { border-color: var(--primary); }
.speak-btn.sm { margin: 0 0 0 8px; padding: 2px 8px; font-size: 0.85rem; vertical-align: middle; }
.speak-btn.lg { margin: 4px 0 8px; padding: 6px 14px; font-size: 1rem; }
.speak-btn.speaking { background: var(--primary); color: #fff; border-color: var(--primary); }
.speak-btn.speaking .pron { color: #fff; }
.speak-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.vocab-card .star-btn { position: absolute; top: 8px; right: 8px; font-size: 1.1rem; background: none; border: none; opacity: 0.4; }
.vocab-card .star-btn.active { opacity: 1; }

.dialogue-card { margin-bottom: 12px; }
.dialogue-card-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.dialogue-card-head h3 { margin: 0; font-size: 1rem; }
.dialogue-card-head .badge-read { font-size: 0.7rem; color: var(--primary); font-weight: 700; }

.day-card { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.day-num-badge {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem;
  background: var(--primary); color: #fff;
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Stats / Hall of Fame ──────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.stat-box { background: var(--bg-paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-box .num { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); }
.stat-box .lbl { font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.badge-tile { text-align: center; padding: 14px 8px; border-radius: 12px; background: var(--bg-paper); border: 1px solid var(--line); }
.badge-tile .ic { font-size: 2rem; filter: grayscale(1); opacity: 0.35; }
.badge-tile.earned .ic { filter: none; opacity: 1; }
.badge-tile .nm { font-size: 0.72rem; font-weight: 700; margin-top: 6px; }

.leaderboard-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.leaderboard-row .rank { font-family: var(--font-mono); font-weight: 700; width: 24px; color: var(--ink-soft); }
.leaderboard-row .ch-title { flex: 1; font-weight: 600; font-size: 0.9rem; }
.leaderboard-row .score { font-family: var(--font-mono); font-weight: 700; color: var(--primary-dark); }

/* ── Confetti canvas ────────────────────────────────────── */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 999; }

/* ── Toast / modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(32,40,31,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-box {
  background: var(--bg-paper); border-radius: 20px; padding: 28px;
  max-width: 360px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lift);
  animation: modal-pop 0.35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modal-pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box .big-icon { font-size: 3.2rem; }

/* ── Misc ───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state .ic { font-size: 2.5rem; margin-bottom: 10px; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.badge-toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 600;
  z-index: 300; box-shadow: var(--shadow-lift);
  animation: toast-in 0.4s ease;
}
@keyframes toast-in { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  .quick-links { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); }
  .node { width: 72px; }
  .node-circle { width: 56px; height: 56px; font-size: 1.4rem; }
}

/* ── Auth pages (login) ─────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 32px 28px;
}
.auth-brand {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 6px; margin-bottom: 22px;
}
.auth-brand .mark {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; box-shadow: var(--shadow);
}
.auth-brand h1 { font-size: 1.25rem; margin: 0; }
.auth-brand p { color: var(--ink-soft); font-size: 0.85rem; margin: 0; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 5px; }
.auth-field input {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); font-size: 0.95rem; font-family: var(--font-body);
  box-sizing: border-box; background: #fff;
}
.auth-field input:focus { border-color: var(--primary); outline: none; }
.auth-error {
  background: #FBEAE8; border: 1px solid var(--danger); color: #8a2f27;
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px;
}
.auth-note { text-align: center; font-size: 0.8rem; color: var(--ink-soft); margin-top: 16px; }

/* ── Admin panel ─────────────────────────────────────────── */
.admin-shell { max-width: 920px; margin: 0 auto; padding: 18px 16px 60px; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; gap: 10px; flex-wrap: wrap;
}
.admin-topbar .brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--primary-dark); text-decoration: none; font-size: 1.05rem; }
.admin-topbar .links { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-topbar .links a { font-size: 0.82rem; }
.admin-table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: var(--bg-paper); border-radius: var(--radius-sm); overflow: hidden; }
table.admin-table th { background: var(--primary); color: #fff; text-align: left; padding: 10px 12px; white-space: nowrap; }
table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr:hover td { background: var(--primary-pale); }
.role-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.role-tag.admin { background: var(--gold-pale); color: var(--gold); }
.role-tag.user { background: var(--primary-pale); color: var(--primary-dark); }
.status-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.status-tag.active { background: var(--primary-pale); color: var(--primary-dark); }
.status-tag.inactive { background: #EFEDE6; color: var(--ink-soft); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; box-shadow: none !important; border-radius: 8px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 5px; }
.form-row input, .form-row select { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); font-size: 0.92rem; font-family: var(--font-body); box-sizing: border-box; background: #fff; }
.form-row input:focus, .form-row select:focus { border-color: var(--primary); outline: none; }
.help-text { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }

