/* ─────────────────────────────────────────────────────────────────────────
   CCMS — Coffee Consumption Management System
   Design System: Enterprise Dark Mode v2.5.0-multiuser
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg:          #0d0f14;
  --bg-card:     #141720;
  --bg-card2:    #1a1e2a;
  --border:      #242836;
  --accent:      #f5a623;
  --accent2:     #e8832a;
  --accent-glow: rgba(245, 166, 35, 0.18);
  --team-accent: #3b82f6;
  --team-glow:   rgba(59, 130, 246, 0.18);
  --green:       #22c55e;
  --yellow:      #eab308;
  --red:         #ef4444;
  --blue:        #3b82f6;
  --purple:      #a855f7;
  --text-1:      #f0f2f7;
  --text-2:      #9aa3b8;
  --text-3:      #5a6480;
  --font:        'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --radius:      12px;
  --radius-sm:   8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
.hidden { display: none !important; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Login Overlay ──────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 15, 20, 0.97);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  backdrop-filter: blur(8px);
}
.login-overlay.hidden { display: none; }

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 44px;
  width: 460px;
  max-width: 95vw;
  text-align: center;
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,166,35,0.08);
}

.login-logo {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 16px var(--accent));
  margin-bottom: 14px;
  animation: pulse-logo 3s ease-in-out infinite;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.login-existing { margin-bottom: 20px; text-align: left; }
.login-existing-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 10px;
}

.existing-users { display: flex; flex-wrap: wrap; gap: 8px; }

.existing-user-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8rem;
  color: var(--text-1);
  transition: all 0.2s;
}
.existing-user-pill:hover {
  border-color: var(--accent);
  background: rgba(245,166,35,0.08);
  transform: translateY(-1px);
}
.existing-user-pill .pill-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.existing-user-pill .pill-cups {
  font-size: 0.65rem; color: var(--text-3);
}

.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  font-size: 0.7rem; color: var(--text-3);
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

.login-input-row { display: flex; gap: 8px; }

.login-input {
  flex: 1;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.login-input::placeholder { color: var(--text-3); }
.login-input:focus { border-color: var(--accent); }

.login-btn {
  background: linear-gradient(135deg, #e8832a, #f5a623);
  color: #1a1200;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,166,35,0.4); }

.login-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 10px;
  min-height: 20px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 14px; }

.logo {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px var(--accent));
  animation: pulse-logo 3s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { filter: drop-shadow(0 0 8px var(--accent)); }
  50%       { filter: drop-shadow(0 0 18px var(--accent)); }
}

.system-name { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.02em; }
.system-sub  { font-size: 0.72rem; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; }

.header-right { display: flex; align-items: center; gap: 12px; }

/* User badge in header */
.user-badge {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}
.user-badge.hidden { display: none; }

.user-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.switch-user-btn {
  background: none; border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0 0 4px;
  transition: color 0.2s;
}
.switch-user-btn:hover { color: var(--accent); }

.sla-badge {
  font-size: 0.75rem; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: 0.06em; transition: all 0.4s;
}
.sla-green  { background: rgba(34,197,94,0.15);  color: var(--green);  border: 1px solid rgba(34,197,94,0.3); }
.sla-yellow { background: rgba(234,179,8,0.15);  color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.sla-red    { background: rgba(239,68,68,0.15);  color: var(--red);    border: 1px solid rgba(239,68,68,0.3);
              animation: blink 1s step-end infinite; }

@keyframes blink { 50% { opacity: 0.4; } }

.live-clock { font-size: 0.8rem; color: var(--text-3); letter-spacing: 0.05em; min-width: 90px; text-align: right; }

.btn-icon {
  background: none; border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 10px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 1rem; transition: all 0.2s;
}
.btn-icon:hover { background: var(--bg-card2); color: var(--text-1); }

/* ── Tab Nav ─────────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 9px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active    { color: var(--accent);      border-bottom-color: var(--accent); }
#tab-team.active   { color: var(--team-accent); border-bottom-color: var(--team-accent); }
#tab-teams.active  { color: var(--green);       border-bottom-color: var(--green); }
#tab-battles.active{ color: var(--red);         border-bottom-color: var(--red); }
#tab-intel.active  { color: var(--purple);      border-bottom-color: var(--purple); }
#tab-quiz.active   { color: var(--blue);        border-bottom-color: var(--blue); }

/* ── Views ───────────────────────────────────────────────────────────────── */
.view {
  display: none;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  padding: 20px 24px;
  flex: 1;
}
.view.active { display: grid; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: border-color 0.3s;
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(245,166,35,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.card:hover { border-color: rgba(245,166,35,0.25); }

/* Team view cards get blue tint */
#view-team .card::before {
  background: linear-gradient(135deg, rgba(59,130,246,0.03) 0%, transparent 60%);
}
#view-team .card:hover { border-color: rgba(59,130,246,0.25); }

.span-full { grid-column: span 12; }
.section-label {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Progress Section ────────────────────────────────────────────────────── */
.progress-section { grid-column: span 12; }

.progress-layout {
  display: flex; align-items: center;
  gap: 32px; flex-wrap: wrap;
}
.progress-left { flex: 1; min-width: 300px; }

.progress-numbers {
  display: flex; align-items: baseline;
  gap: 8px; margin-bottom: 20px;
}

.big-number {
  font-size: 4.5rem; font-weight: 800;
  color: var(--accent); line-height: 1;
  text-shadow: 0 0 30px var(--accent-glow);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#view-team .big-number {
  color: var(--team-accent);
  text-shadow: 0 0 30px var(--team-glow);
}

.big-slash { font-size: 3rem; color: var(--text-3); }
.big-goal  { font-size: 3rem; color: var(--text-2); font-weight: 600; }
.big-unit  { font-size: 1rem; color: var(--text-3); margin-left: 4px; }

.progress-bar-wrap { position: relative; margin-bottom: 16px; }

.progress-bar-track {
  height: 28px; background: var(--bg-card2);
  border-radius: 14px; border: 1px solid var(--border);
  overflow: hidden; position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e8832a, #f5a623, #fbbf24);
  border-radius: 14px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 10px;
  box-shadow: 0 0 20px rgba(245,166,35,0.4);
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 50%; background: rgba(255,255,255,0.12);
  border-radius: 14px 14px 0 0;
}
.progress-bar-team {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6, #60a5fa);
  box-shadow: 0 0 20px rgba(59,130,246,0.4);
}

.progress-bar-label {
  font-size: 0.75rem; font-weight: 800;
  color: #1a1200; position: relative; z-index: 1;
}
.progress-bar-team .progress-bar-label { color: #fff; }

.progress-markers {
  position: relative; height: 16px; margin-top: 6px;
}
.marker { position: absolute; transform: translateX(-50%); font-size: 0.65rem; color: var(--text-3); }

/* Daily limit bar */
.daily-limit-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.daily-limit-label { font-size: 0.65rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.daily-limit-track {
  flex: 1; height: 6px;
  background: var(--bg-card2); border-radius: 3px;
  overflow: hidden;
}
.daily-limit-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  border-radius: 3px;
  transition: width 0.6s ease, background 0.4s;
}
.daily-limit-fill.near-max { background: linear-gradient(90deg, var(--yellow), var(--red)); }
.daily-limit-fill.at-max   { background: var(--red); animation: blink 1s step-end infinite; }
.daily-limit-text { font-size: 0.72rem; color: var(--text-2); white-space: nowrap; min-width: 40px; text-align: right; }

.mood-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.mood-emoji { font-size: 1.8rem; }
.mood-label { font-size: 0.85rem; color: var(--text-2); }

.team-meta-row { display: flex; gap: 20px; margin-top: 8px; }
.team-meta { font-size: 0.78rem; color: var(--text-3); }

.radial-wrap { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
.radial-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.radial-center span:first-child { font-size: 2rem; font-weight: 800; color: var(--accent); }
#view-team .radial-center span:first-child { color: var(--team-accent); }
.radial-sub { font-size: 0.7rem; color: var(--text-3); }

/* ── KPI Grid ────────────────────────────────────────────────────────────── */
.kpi-grid {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 6px; position: relative; overflow: hidden;
  transition: all 0.3s;
}
.kpi-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.kpi-card:hover::after { opacity: 1; }
.kpi-card:hover { border-color: rgba(245,166,35,0.3); transform: translateY(-2px); }
.kpi-icon  { font-size: 1.5rem; }
.kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--accent); line-height: 1; transition: all 0.4s; }
.kpi-label { font-size: 0.8rem; color: var(--text-1); font-weight: 600; }
.kpi-sub   { font-size: 0.65rem; color: var(--text-3); }

/* ── AI Card ─────────────────────────────────────────────────────────────── */
.ai-card { grid-column: span 4; }

.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ai-stat { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.ai-val  { font-size: 1.6rem; font-weight: 800; color: var(--purple); }
.ai-lbl  { font-size: 0.65rem; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; }

.ai-note {
  font-size: 0.75rem; color: var(--text-2);
  background: var(--bg-card2); border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius-sm); padding: 10px 12px;
  margin-bottom: 12px; min-height: 36px;
}

.ai-meter-wrap { display: flex; flex-direction: column; gap: 6px; }
.ai-meter-label { font-size: 0.65rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.ai-meter-track { height: 8px; background: var(--bg-card2); border-radius: 4px; overflow: hidden; }
.ai-meter-fill  { height: 100%; background: linear-gradient(90deg, var(--purple), #c084fc); border-radius: 4px; transition: width 0.8s ease; box-shadow: 0 0 8px rgba(168,85,247,0.4); }

/* ── SLA Card ────────────────────────────────────────────────────────────── */
.sla-card { grid-column: span 4; }

.sla-status-block {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px;
}
.sla-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.sla-dot-green  { background: var(--green);  box-shadow: 0 0 10px var(--green); }
.sla-dot-yellow { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.sla-dot-red    { background: var(--red);    box-shadow: 0 0 10px var(--red); animation: blink 1s step-end infinite; }

.sla-status-text { font-size: 1rem; font-weight: 800; }
.sla-status-green  { color: var(--green); }
.sla-status-yellow { color: var(--yellow); }
.sla-status-red    { color: var(--red); }
.sla-detail { font-size: 0.72rem; color: var(--text-3); margin-top: 3px; }

.sla-metrics { display: flex; gap: 20px; margin-bottom: 10px; }
.sla-m       { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sla-m-val   { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.sla-m-lbl   { font-size: 0.65rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }

.sla-alert {
  font-size: 0.75rem; color: var(--red);
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm); padding: 8px 12px;
  animation: blink 2s step-end infinite;
}

/* ── Actions Card (kept for reference) / Intake Controls (merged into progress section) */
.actions-card { grid-column: span 4; display: flex; flex-direction: column; gap: 12px; }
.intake-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.btn-add, .btn-espresso {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-radius: var(--radius);
  border: none; cursor: pointer;
  font-family: var(--font); font-size: 0.9rem;
  font-weight: 700; letter-spacing: 0.03em;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative; overflow: hidden;
}
.btn-add {
  background: linear-gradient(135deg, #e8832a, #f5a623);
  color: #1a1200; box-shadow: 0 4px 20px rgba(245,166,35,0.3);
}
.btn-add:hover    { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 28px rgba(245,166,35,0.5); }
.btn-add:active   { transform: scale(0.97); }
.btn-add:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-espresso {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.btn-espresso:hover    { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 28px rgba(168,85,247,0.5); }
.btn-espresso:active   { transform: scale(0.97); }
.btn-espresso:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-icon-inner { font-size: 1.4rem; }
.btn-sub        { margin-left: auto; font-size: 0.68rem; opacity: 0.75; }

.action-feedback { font-size: 0.8rem; color: var(--green); min-height: 22px; padding: 4px 8px; border-radius: var(--radius-sm); }

/* ── Charts ──────────────────────────────────────────────────────────────── */
.chart-card   { grid-column: span 6; }
.chart-wrap   { height: 220px; position: relative; }
.chart-wrap-tall { height: 260px; }

/* ── Averages Section (Personal) ─────────────────────────────────────────── */
.avg-section { grid-column: span 12; }

.avg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.avg-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  position: relative; overflow: hidden;
  transition: all 0.25s;
}
.avg-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.avg-card:hover::after { opacity: 1; }
.avg-card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-1px); }

.avg-icon  { font-size: 1.3rem; }
.avg-value { font-size: 1.7rem; font-weight: 800; color: var(--blue); line-height: 1; }
.avg-label { font-size: 0.78rem; color: var(--text-1); font-weight: 600; }
.avg-sub   { font-size: 0.62rem; color: var(--text-3); }

.avg-note {
  font-size: 0.73rem; color: var(--text-3);
  border-left: 2px solid var(--blue);
  padding-left: 10px; min-height: 18px;
}

/* ── Team Highlights Row ──────────────────────────────────────────────────── */
.team-highlights {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
}

/* Today's Leader */
.today-leader-card { display: flex; flex-direction: column; }

.leader-body {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; gap: 8px; padding: 8px 0;
  text-align: center;
}

.leader-crown { font-size: 2.5rem; animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.leader-dot {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

.leader-name {
  font-size: 1.6rem; font-weight: 800;
  color: var(--text-1); line-height: 1;
}

.leader-cups {
  font-size: 2rem; font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.leader-cups span { font-size: 0.75rem; color: var(--text-3); font-weight: 400; margin-left: 4px; }

.leader-note { font-size: 0.7rem; color: var(--text-3); font-style: italic; }

/* Team Averages */
.team-avg-card { }

.team-avg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.team-avg-item {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all 0.25s;
}
.team-avg-item:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-1px); }

.team-avg-val { font-size: 1.6rem; font-weight: 800; color: var(--team-accent); line-height: 1; }
.team-avg-lbl { font-size: 0.75rem; color: var(--text-1); font-weight: 600; }
.team-avg-sub { font-size: 0.6rem; color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════════════════
   COFFEE INTEL TAB — Design Previews
   ══════════════════════════════════════════════════════════════════════════ */

.design-picker-header {
  grid-column: span 12;
  padding: 4px 0 8px;
}
.design-picker-title {
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-1); margin-bottom: 4px;
}
.design-picker-sub { font-size: 0.8rem; color: var(--text-3); }

.design-preview-block {
  grid-column: span 12;
  border-top-width: 2px;
}

.design-option-label {
  font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 6px; padding: 4px 10px;
  border-radius: 6px; display: inline-block;
}
.option-a-label { background: rgba(245,166,35,0.15);  color: var(--accent);      border: 1px solid rgba(245,166,35,0.3);  }
.option-b-label { background: rgba(34,197,94,0.12);   color: var(--green);       border: 1px solid rgba(34,197,94,0.3);   }
.option-c-label { background: rgba(59,130,246,0.12);  color: var(--blue);        border: 1px solid rgba(59,130,246,0.3);  }
.option-d-label { background: rgba(168,85,247,0.12);  color: var(--purple);      border: 1px solid rgba(168,85,247,0.3);  }
.design-preview-block:nth-child(2) { border-top-color: var(--accent); }
.design-preview-block:nth-child(3) { border-top-color: var(--green); }
.design-preview-block:nth-child(4) { border-top-color: var(--blue); }
.design-preview-block:nth-child(5) { border-top-color: var(--purple); }

.design-option-desc {
  font-size: 0.75rem; color: var(--text-3);
  margin-bottom: 20px; margin-top: 4px;
}

/* ── Option A: Tile Mosaic ──────────────────────────────────────────────── */
.option-a-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: 12px;
}

.tile {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  position: relative; overflow: hidden;
  cursor: default;
  transition: all 0.25s;
}
.tile:hover { border-color: var(--tile-color, var(--accent)); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.tile::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--tile-color, var(--accent));
}

.tile-span-2h { grid-column: span 2; }
.tile-span-2v { grid-row: span 2; }

.tile-top { display: flex; align-items: flex-start; justify-content: space-between; }
.tile-icon { font-size: 1.8rem; line-height: 1; }
.tile-cat  {
  font-size: 0.58rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 2px 7px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: var(--tile-color, var(--text-3));
  border: 1px solid var(--tile-color, var(--border)); opacity: 0.8;
}

.tile-fact {
  font-size: 0.82rem; color: var(--text-1); line-height: 1.5;
  font-weight: 500;
}
.tile-span-2h .tile-fact { font-size: 0.88rem; }
.tile-span-2v .tile-fact { font-size: 0.85rem; }

.tile-source {
  font-size: 0.6rem; color: var(--text-3);
  margin-top: 6px;
  opacity: 0; transition: opacity 0.2s;
}
.tile:hover .tile-source { opacity: 1; }

.tile-big-num {
  font-size: 2.2rem; font-weight: 900;
  color: var(--tile-color, var(--accent));
  line-height: 1; margin: 4px 0;
}
.tile-span-2h .tile-big-num { font-size: 3rem; }

/* ── Option B: Intel Dossier ────────────────────────────────────────────── */
.option-b-terminal {
  background: #060809;
  border: 1px solid #1a2a1a;
  border-radius: var(--radius);
  padding: 18px 20px;
  font-family: 'SF Mono','Fira Code','Cascadia Code',monospace;
  font-size: 0.72rem;
  color: #4ade80;
  line-height: 1.8;
}

.b-header { margin-bottom: 4px; }
.b-sys    { color: #86efac; font-weight: 700; }
.b-class  { color: #6b7280; margin-left: 20px; }
.b-divider { color: #1f2d1f; margin-bottom: 12px; }

.b-entry { margin-bottom: 14px; }
.b-case  { color: #f59e0b; font-weight: 700; margin-right: 10px; }
.b-level-u  { color: #22c55e; font-size: 0.62rem; font-weight: 700; border: 1px solid #166534; padding: 1px 6px; border-radius: 3px; margin-right: 8px; }
.b-level-c  { color: #eab308; font-size: 0.62rem; font-weight: 700; border: 1px solid #713f12; padding: 1px 6px; border-radius: 3px; margin-right: 8px; }
.b-level-ts { color: #ef4444; font-size: 0.62rem; font-weight: 700; border: 1px solid #7f1d1d; padding: 1px 6px; border-radius: 3px; margin-right: 8px; }
.b-text  { color: #bbf7d0; }
.b-redacted { background: #166534; color: #166534; border-radius: 2px; padding: 0 4px; user-select: none; }
.b-redacted:hover { background: #14532d; color: #bbf7d0; }
.b-source { color: #374151; font-size: 0.62rem; margin-top: 2px; }
.b-tag   { color: #4ade80; }

/* ── Option C: Fake Enterprise Metrics ─────────────────────────────────── */
.option-c-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.c-kpi {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative; overflow: hidden;
  transition: all 0.25s;
}
.c-kpi:hover { border-color: rgba(59,130,246,0.4); transform: translateY(-1px); }
.c-kpi::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}

.c-kpi-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.c-kpi-name   { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.c-kpi-trend  { font-size: 0.68rem; font-weight: 700; }
.c-kpi-trend.up   { color: var(--green); }
.c-kpi-trend.down { color: var(--red); }
.c-kpi-trend.flat { color: var(--text-3); }

.c-kpi-val    { font-size: 1.6rem; font-weight: 800; color: var(--blue); line-height: 1.1; margin-bottom: 4px; }
.c-kpi-label  { font-size: 0.75rem; color: var(--text-1); font-weight: 600; }
.c-kpi-sub    { font-size: 0.6rem; color: var(--text-3); margin-top: 2px; }
.c-kpi-source { font-size: 0.58rem; color: var(--text-3); margin-top: 8px; opacity: 0.6;
                border-top: 1px solid var(--border); padding-top: 6px; }

.option-c-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.c-detail {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
  transition: all 0.25s;
}
.c-detail:hover { border-color: rgba(59,130,246,0.3); }
.c-detail-icon { font-size: 1.6rem; flex-shrink: 0; }
.c-detail-val  { font-size: 1.2rem; font-weight: 800; color: var(--blue); margin-bottom: 3px; }
.c-detail-name { font-size: 0.78rem; color: var(--text-1); font-weight: 600; }
.c-detail-desc { font-size: 0.7rem; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.c-detail-badge {
  display: inline-block; font-size: 0.55rem;
  background: rgba(59,130,246,0.15); color: var(--blue);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 10px; padding: 1px 7px;
  margin-top: 5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Option D: RPG Codex ────────────────────────────────────────────────── */
.option-d-categories { display: flex; flex-direction: column; gap: 18px; }

.d-category { }
.d-cat-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.d-cat-icon  { font-size: 1.3rem; }
.d-cat-name  { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }
.d-cat-line  { flex: 1; height: 1px; background: var(--border); }

.d-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.d-card {
  background: var(--bg-card2);
  border-radius: var(--radius);
  padding: 14px;
  position: relative; overflow: hidden;
  transition: all 0.25s;
  cursor: default;
}
.d-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

/* Rarity left border + glow */
.d-card.common    { border: 1px solid #374151; }
.d-card.uncommon  { border: 1px solid #166534; box-shadow: inset 0 0 20px rgba(34,197,94,0.04); }
.d-card.rare      { border: 1px solid #1e3a5f; box-shadow: inset 0 0 20px rgba(59,130,246,0.06); }
.d-card.legendary { border: 1px solid #5b21b6; box-shadow: inset 0 0 20px rgba(168,85,247,0.08); }
.d-card.epic      { border: 1px solid #7f1d1d; box-shadow: inset 0 0 20px rgba(239,68,68,0.06); }

.d-rarity {
  font-size: 0.55rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; margin-bottom: 8px;
}
.d-card.common    .d-rarity { color: #6b7280; }
.d-card.uncommon  .d-rarity { color: var(--green); }
.d-card.rare      .d-rarity { color: var(--blue); }
.d-card.legendary .d-rarity { color: var(--purple); }
.d-card.epic      .d-rarity { color: var(--red); }

.d-card-icon { font-size: 1.5rem; margin-bottom: 6px; }
.d-card-name { font-size: 0.75rem; font-weight: 700; color: var(--text-1); margin-bottom: 6px; line-height: 1.3; }
.d-card-desc { font-size: 0.68rem; color: var(--text-2); line-height: 1.5; }
.d-card-stat {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.62rem; color: var(--text-3);
}
.d-card-stat span { font-weight: 700; color: var(--text-2); }

/* ── Leaderboard ─────────────────────────────────────────────────────────── */
.leaderboard-card { grid-column: span 12; }

.leaderboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.lb-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative; overflow: hidden;
  transition: all 0.3s;
}
.lb-card:hover { transform: translateY(-2px); }
.lb-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--lb-color, var(--accent));
}

.lb-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lb-rank   { font-size: 1.1rem; font-weight: 800; color: var(--text-3); min-width: 24px; }
.lb-rank.rank-1 { color: #fbbf24; }
.lb-rank.rank-2 { color: #94a3b8; }
.lb-rank.rank-3 { color: #cd7c42; }

.lb-dot  { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.lb-name { font-size: 0.95rem; font-weight: 700; flex: 1; }
.lb-cups { font-size: 1.5rem; font-weight: 800; }

.lb-bar-track {
  height: 6px; background: var(--bg-card);
  border-radius: 3px; overflow: hidden; margin: 8px 0;
}
.lb-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }

.lb-stats { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--text-3); }

.lb-you-badge {
  font-size: 0.6rem; background: rgba(245,166,35,0.2);
  color: var(--accent); border: 1px solid rgba(245,166,35,0.3);
  border-radius: 10px; padding: 2px 7px;
  font-weight: 700; letter-spacing: 0.05em;
}

/* ── Log Panel ───────────────────────────────────────────────────────────── */
.log-card  { grid-column: span 12; }

.log-live-dot { margin-left: auto; font-size: 0.68rem; color: var(--green); animation: blink 2s step-end infinite; }

.log-panel {
  height: 180px; overflow-y: auto;
  background: #080a0f; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.73rem; line-height: 1.7; font-family: var(--font);
}
.log-entry { display: flex; gap: 10px; align-items: baseline; animation: fadeInLog 0.3s ease; }
@keyframes fadeInLog { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
.log-ts    { color: var(--text-3); flex-shrink: 0; }
.log-lvl   { font-weight: 700; flex-shrink: 0; min-width: 62px; }
.log-msg   { color: var(--text-2); }
.lvl-INFO   { color: var(--blue); }
.lvl-WARN   { color: var(--yellow); }
.lvl-ALERT  { color: var(--red); }
.lvl-DEBUG  { color: var(--text-3); }
.lvl-SYSTEM { color: var(--green); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.68rem; color: var(--text-3); letter-spacing: 0.05em;
}
.refresh-counter { color: var(--accent); }

/* ── Celebration ─────────────────────────────────────────────────────────── */
#celebration {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; backdrop-filter: blur(6px);
}
#celebration.hidden { display: none; }

.celebration-inner {
  text-align: center; position: relative; z-index: 2;
  animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebration-emoji { font-size: 5rem; margin-bottom: 20px; animation: bounce 0.8s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-20px); } }

.celebration-inner h1 {
  font-size: 4rem; font-weight: 900;
  background: linear-gradient(90deg, #f5a623, #fbbf24, #f5a623);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: 0.05em; margin-bottom: 12px;
}
.celebration-inner p   { font-size: 1.2rem; color: var(--text-2); margin-bottom: 8px; }
.celebration-inner .sub { font-size: 0.85rem; color: var(--text-3); margin-bottom: 28px; }
.celebration-inner button {
  background: linear-gradient(135deg, #e8832a, #f5a623);
  color: #1a1200; border: none; padding: 14px 32px;
  border-radius: var(--radius); font-family: var(--font);
  font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.celebration-inner button:hover { transform: scale(1.05); }
#confetti-canvas { position: absolute; inset: 0; pointer-events: none; }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes pop-in { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.kpi-value.updated { animation: kpi-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes kpi-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); color: #fbbf24; } 100% { transform: scale(1); } }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .ai-card, .sla-card, .actions-card { grid-column: span 6; }
  .chart-card { grid-column: span 12; }
}
@media (max-width: 700px) {
  .view { padding: 12px; gap: 10px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-card, .sla-card, .actions-card, .chart-card { grid-column: span 12; }
  .big-number { font-size: 3rem; }
  header { padding: 10px 14px; }
  .tab-nav { padding: 8px 14px 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v3.0.0-teams — New Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Multi-Step Login ─────────────────────────────────────────────────────── */
.login-step { display: none; }
.login-step.active { display: block; }

.login-back-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.login-back-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-3); font-family: var(--font);
  font-size: 0.72rem; padding: 5px 10px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.login-back-btn:hover { color: var(--text-1); border-color: var(--text-3); }

.login-target-info {
  display: flex; align-items: center; gap: 8px; flex: 1;
}
.login-target-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.login-target-name { font-size: 0.9rem; font-weight: 700; color: var(--text-1); }
.login-target-team {
  font-size: 0.68rem; color: var(--text-3);
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 2px 8px;
}

.login-new-badge {
  font-size: 0.9rem; font-weight: 700; color: var(--accent);
  background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.3);
  border-radius: 10px; padding: 3px 12px;
}

.login-step-desc {
  font-size: 0.75rem; color: var(--text-3);
  margin-bottom: 14px; text-align: left;
}

.login-input-full {
  width: 100%; margin-bottom: 12px; flex: unset;
  display: block;
}

.login-btn-full {
  width: 100%; margin-top: 4px;
  display: flex; justify-content: center; align-items: center;
}

/* Team Picker */
.team-picker-label {
  font-size: 0.62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3); margin-bottom: 10px;
  margin-top: 8px;
}

.team-picker-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}

.team-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 20px; cursor: pointer;
  font-family: var(--font); font-size: 0.8rem;
  color: var(--text-1); transition: all 0.2s;
}
.team-pill:hover { transform: translateY(-1px); }
.team-pill.selected {
  border-width: 2px;
  background: rgba(255,255,255,0.06);
  font-weight: 700;
}

.team-pill-create {
  border-style: dashed;
  color: var(--text-3);
}
.team-pill-create:hover { color: var(--accent); border-color: var(--accent); }

.team-pill-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.new-team-form {
  margin-top: 6px; margin-bottom: 10px;
}
.new-team-form input { margin-bottom: 0; }

/* User badge team display */
.user-team-display {
  font-size: 0.62rem; color: var(--text-3);
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 7px;
}

/* ── Quiz Modal ───────────────────────────────────────────────────────────── */
.quiz-modal {
  position: fixed; inset: 0;
  background: rgba(13, 15, 20, 0.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; backdrop-filter: blur(10px);
}
.quiz-modal.hidden { display: none; }

.quiz-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 36px;
  width: 560px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(59,130,246,0.1);
}

.qm-header { margin-bottom: 24px; }
.qm-title-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.qm-icon  { font-size: 1.5rem; }
.qm-title { font-size: 1rem; font-weight: 800; color: var(--text-1); flex: 1; }
.qm-close-btn {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-3); font-size: 1.1rem;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.qm-close-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-1); }

.qm-progress-wrap {
  display: flex; align-items: center; gap: 10px;
}
.qm-progress-bar {
  flex: 1; height: 6px;
  background: var(--bg-card2); border-radius: 3px;
  overflow: hidden;
}
.qm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  border-radius: 3px; transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(59,130,246,0.4);
}
.qm-progress-text {
  font-size: 0.68rem; color: var(--text-3);
  white-space: nowrap; min-width: 60px; text-align: right;
}

.qm-question-text {
  font-size: 1rem; color: var(--text-1);
  line-height: 1.6; margin-bottom: 20px;
  font-weight: 600;
}

.qm-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.qm-option {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  cursor: pointer; font-family: var(--font);
  font-size: 0.85rem; color: var(--text-1);
  text-align: left; transition: all 0.18s;
  display: flex; align-items: center; gap: 10px;
}
.qm-option:hover:not(.selected):not(.correct):not(.wrong) {
  border-color: var(--blue);
  background: rgba(59,130,246,0.06);
  transform: translateX(2px);
}
.qm-option.selected {
  border-color: var(--blue);
  background: rgba(59,130,246,0.1);
  color: #93c5fd;
}
.qm-option.correct {
  border-color: var(--green);
  background: rgba(34,197,94,0.12);
  color: #86efac;
}
.qm-option.wrong {
  border-color: var(--red);
  background: rgba(239,68,68,0.08);
  color: #fca5a5; opacity: 0.7;
}

.qm-option-num {
  width: 22px; height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; flex-shrink: 0;
  opacity: 0.6;
}

.qm-footer {
  display: flex; align-items: center; gap: 10px;
}
.qm-cups-badge {
  font-size: 0.75rem; font-weight: 700;
  background: rgba(245,166,35,0.15); color: var(--accent);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 12px; padding: 4px 10px;
}
.qm-diff-badge {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-radius: 12px; padding: 3px 8px;
}
.qm-diff-easy   { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.qm-diff-medium { background: rgba(234,179,8,0.12); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
.qm-diff-hard   { background: rgba(239,68,68,0.12); color: var(--red);    border: 1px solid rgba(239,68,68,0.3); }

.qm-next-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px; font-family: var(--font);
  font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.qm-next-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qm-next-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(59,130,246,0.5); }

/* Quiz Results */
.qm-results-header {
  text-align: center; margin-bottom: 24px;
}
.qm-results-emoji { font-size: 3rem; margin-bottom: 8px; }
.qm-results-score {
  font-size: 3rem; font-weight: 900;
  color: var(--accent); line-height: 1;
  text-shadow: 0 0 24px var(--accent-glow);
}
.qm-results-title {
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-1); margin-top: 6px;
}
.qm-results-sub {
  font-size: 0.75rem; color: var(--text-3); margin-top: 4px;
}

.qm-results-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 20px; max-height: 300px; overflow-y: auto;
}

.qm-result-item {
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 0.78rem;
  border-left: 3px solid;
}
.qm-result-item.correct { border-color: var(--green); }
.qm-result-item.wrong   { border-color: var(--red); opacity: 0.75; }

.qm-result-q { color: var(--text-1); font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.qm-result-a { color: var(--text-3); font-size: 0.72rem; }
.qm-result-a.correct-a { color: var(--green); }
.qm-result-a.wrong-a   { color: var(--red); }
.qm-result-exp { color: var(--text-3); font-size: 0.7rem; margin-top: 4px; font-style: italic; line-height: 1.4; }
.qm-result-cups { float: right; font-weight: 800; color: var(--accent); font-size: 0.8rem; }

.qm-collect-btn {
  width: 100%;
  background: linear-gradient(135deg, #e8832a, #f5a623);
  color: #1a1200; border: none; border-radius: var(--radius);
  padding: 14px; font-family: var(--font);
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.02em;
}
.qm-collect-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,166,35,0.4); }

/* ── All Teams Tab ────────────────────────────────────────────────────────── */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.team-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative; overflow: hidden;
  transition: all 0.25s;
}
.team-card:hover { transform: translateY(-2px); }
.team-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--team-color, var(--team-accent));
}

.team-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.team-card-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.team-card-name { font-size: 1rem; font-weight: 800; flex: 1; }
.team-card-rank {
  font-size: 0.7rem; font-weight: 700;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 2px 8px;
  color: var(--text-3);
}

.team-card-desc { font-size: 0.72rem; color: var(--text-3); margin-bottom: 14px; line-height: 1.4; }

.team-card-stats {
  display: flex; gap: 16px; margin-bottom: 14px;
}
.team-card-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.team-card-stat-val { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.team-card-stat-lbl { font-size: 0.58rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; }

.team-card-members {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
}
.team-card-member-dot {
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 5px currentColor;
}
.team-card-member-name {
  font-size: 0.68rem; color: var(--text-2);
  display: flex; align-items: center; gap: 4px;
}

.team-card-weekly-bar {
  margin-top: 12px;
}
.team-card-weekly-label {
  display: flex; justify-content: space-between;
  font-size: 0.62rem; color: var(--text-3);
  margin-bottom: 5px;
}
.team-card-bar-track {
  height: 5px; background: var(--bg-card);
  border-radius: 3px; overflow: hidden;
}
.team-card-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.8s ease;
}

/* ── Coffee Battles Tab ───────────────────────────────────────────────────── */
.battles-header-card { grid-column: span 12; }

.battles-title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 12px; flex-wrap: wrap;
}
.battles-title {
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-1); margin-bottom: 4px;
}
.battles-sub { font-size: 0.72rem; color: var(--text-3); }

.battles-countdown-wrap { text-align: right; }
.battles-countdown-label { font-size: 0.62rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.battles-countdown {
  font-size: 2rem; font-weight: 900;
  color: var(--red); letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(239,68,68,0.4);
  font-variant-numeric: tabular-nums;
}
.battles-countdown-sub { font-size: 0.6rem; color: var(--text-3); margin-top: 2px; }

.battles-scoring-note {
  font-size: 0.7rem; color: var(--text-3);
  background: var(--bg-card2); border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm); padding: 8px 12px;
}

.battles-standings-card { grid-column: span 12; }

.battles-standings { display: flex; flex-direction: column; gap: 14px; }

.battles-team-row {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative; overflow: hidden;
  transition: all 0.25s;
}
.battles-team-row:hover { border-color: rgba(255,255,255,0.1); transform: translateX(2px); }
.battles-team-row::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--battle-color, var(--team-accent));
}

.battles-team-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.battles-rank {
  font-size: 1.5rem; font-weight: 900; min-width: 36px;
  color: var(--text-3);
}
.battles-rank.rank-1 { color: #fbbf24; }
.battles-rank.rank-2 { color: #94a3b8; }
.battles-rank.rank-3 { color: #cd7c42; }

.battles-team-name { font-size: 1rem; font-weight: 800; flex: 1; }

.battles-goal-met {
  font-size: 0.65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(34,197,94,0.15); color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 10px; padding: 3px 10px;
  animation: blink 2s step-end infinite;
}

.battles-score-row {
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px;
}
.battles-score {
  font-size: 2rem; font-weight: 900; color: var(--text-1); line-height: 1;
}
.battles-score-unit { font-size: 0.8rem; color: var(--text-3); }
.battles-score-breakdown { font-size: 0.7rem; color: var(--text-3); }

.battles-bar-track {
  height: 8px; background: var(--bg-card);
  border-radius: 4px; overflow: hidden; margin: 10px 0;
}
.battles-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px currentColor;
}
.battles-pct { font-size: 0.75rem; color: var(--text-3); margin-bottom: 8px; }

.battles-members { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.battles-member {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px 10px;
  font-size: 0.72rem; color: var(--text-2);
}
.battles-member-dot { width: 8px; height: 8px; border-radius: 50%; }
.battles-member-score { color: var(--accent); font-weight: 700; margin-left: 4px; }
.battles-member-bonus { color: var(--purple); font-size: 0.65rem; margin-left: 2px; }

/* ── Quiz Tab ─────────────────────────────────────────────────────────────── */
.quiz-intro {
  font-size: 0.8rem; color: var(--text-3);
  background: var(--bg-card2); border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 20px; line-height: 1.5;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.quiz-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: all 0.25s;
}
.quiz-card:hover { transform: translateY(-2px); }
.quiz-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.quiz-card.available::before { background: var(--blue); }
.quiz-card.completed::before { background: var(--green); }
.quiz-card.completed { opacity: 0.75; }

.quiz-card-icon { font-size: 2.2rem; }
.quiz-card-title { font-size: 0.95rem; font-weight: 800; color: var(--text-1); line-height: 1.3; }
.quiz-card-desc  { font-size: 0.72rem; color: var(--text-3); line-height: 1.5; flex: 1; }

.quiz-card-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.quiz-card-cups {
  font-size: 0.75rem; font-weight: 700;
  background: rgba(245,166,35,0.12); color: var(--accent);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 10px; padding: 3px 9px;
}
.quiz-card-questions {
  font-size: 0.68rem; color: var(--text-3);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px 9px;
}

.quiz-card-btn {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px; font-family: var(--font);
  font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.02em; text-align: center;
}
.quiz-card-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(59,130,246,0.5); }

.quiz-card-done {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--green); border-radius: var(--radius-sm);
  padding: 10px; font-family: var(--font);
  font-size: 0.82rem; font-weight: 700;
  text-align: center; letter-spacing: 0.03em;
}
.quiz-card-earned {
  font-size: 0.68rem; color: var(--text-3);
  text-align: center;
}
