/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }
.btn-ghost:hover:not(:disabled) { background: var(--color-alt-row); }
.btn-danger { background: #fff; color: var(--color-alert); border: 1px solid var(--color-alert); }
.btn-danger:hover:not(:disabled) { background: var(--color-alert); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.card h3 { font-size: 16px; margin-bottom: 14px; }
.divider { border: none; border-top: 1px solid var(--color-border); margin: 28px 0; }

/* ============================================================
   Forms
   ============================================================ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--color-muted); margin-top: 6px; }
input[type=text], input[type=password], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  background: #fff;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
}
input:disabled, select:disabled { background: var(--color-alt-row); color: var(--color-muted); }

/* ============================================================
   Badges — 20px pill, Inter Bold 10px, participant status
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}
.badge-registered { background: var(--color-border); color: var(--color-muted); }
.badge-checked_in { background: var(--color-teal-light-tint); color: var(--color-primary); }
.badge-pin_activated { background: var(--color-gold); color: var(--color-navy); }
.badge-completed { background: var(--color-primary); color: #fff; }

/* ============================================================
   Feedback / alerts
   ============================================================ */
.feedback { font-family: var(--font-body); font-weight: 600; font-size: 13px; margin-top: 4px; min-height: 18px; }
.feedback.good { color: var(--color-primary); }
.feedback.bad { color: var(--color-alert); }
.alert-banner {
  background: var(--color-alert-tint);
  border: 1px solid var(--color-alert);
  color: var(--color-alert);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.loading-note, .empty-note { color: var(--color-muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* ============================================================
   Metric cards (dashboards)
   ============================================================ */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.metric-card .metric-label {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.metric-card .metric-value { font-family: var(--font-heading); font-weight: 700; font-size: 30px; color: var(--color-text); line-height: 1; }
.metric-card .metric-value.accent { color: var(--color-primary); }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.data-table th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-alt-row);
  white-space: nowrap;
}
.data-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: var(--color-alt-row); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-cell { font-family: var(--font-heading); font-weight: 700; color: var(--color-muted); width: 32px; }

/* ============================================================
   Empty state — centered illustration, Poppins heading, teal CTA
   ============================================================ */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .empty-illustration { width: 88px; height: 88px; margin: 0 auto 18px; }
.empty-state h3 { font-family: var(--font-heading); font-weight: 600; font-size: 17px; margin-bottom: 8px; }
.empty-state p { font-family: var(--font-body); font-weight: 400; color: var(--color-muted); font-size: 13px; margin: 0 auto 20px; max-width: 340px; }

/* ============================================================
   Pills / chips (general purpose, not status badges)
   ============================================================ */
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--color-primary-tint); color: var(--color-primary); font-size: 12px; font-weight: 600; }

/* ============================================================
   App shell — Dark Navy sidebar, for staff/dashboard/admin pages
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--color-navy);
  color: #fff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar .brand { font-family: var(--font-heading); font-weight: 700; font-size: 15px; color: #fff; margin-bottom: 2px; line-height: 1.3; }
.sidebar .brand-sub { font-size: 11px; color: rgba(255,255,255,0.55); margin-bottom: 28px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a, .sidebar nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav button:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; }
.sidebar nav a.active, .sidebar nav button.active { background: var(--color-teal-light); color: var(--color-navy); font-weight: 700; }
.sidebar .sidebar-foot { margin-top: auto; font-size: 11px; color: rgba(255,255,255,0.4); padding: 10px 14px; }
.main-content { flex: 1; padding: 32px 40px; max-width: 1280px; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 22px; }
.page-header p { color: var(--color-muted); font-size: 13px; margin: 0; }

/* Tabs, used within dashboard.html */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.tab-btn {
  background: none; border: none; padding: 10px 16px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  color: var(--color-muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ============================================================
   Public shell — unauthenticated registration/login/quiz screens
   ============================================================ */
.public-shell { max-width: 540px; margin: 0 auto; padding: 32px 20px 60px; }
.public-header {
  background: var(--color-navy);
  color: #fff;
  padding: 28px 26px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  text-align: center;
}
.public-header .eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--color-teal-light);
  font-weight: 700;
  margin-bottom: 8px;
}
.public-header h1 { color: #fff; font-size: 21px; margin-bottom: 6px; }
.public-header p { color: rgba(255,255,255,0.75); font-size: 13px; margin: 0; }
.link-row { text-align: center; margin: 14px 0; font-size: 13px; }
.link-row a { cursor: pointer; font-weight: 600; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.demo-ribbon {
  background: var(--color-gold);
  color: var(--color-navy);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  text-align: center;
  padding: 8px;
}

/* ============================================================
   Quiz-taking screen (not in the brand kit — extends the same
   tokens/components: card, btn, feedback, Poppins for the prompt
   and score, Inter for everything else)
   ============================================================ */
.quiz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.qcount { font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--color-muted); }
.ring-wrap { position: relative; width: 54px; height: 54px; }
.ring-bg { fill: none; stroke: var(--color-border); stroke-width: 4; }
.ring-fg {
  fill: none; stroke: var(--color-teal-light); stroke-width: 4; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 1s linear, stroke .2s ease;
}
.ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
}
.qtext { font-family: var(--font-heading); font-weight: 600; font-size: 18px; margin-bottom: 20px; line-height: 1.4; }
.opt {
  display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: #fff;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--color-text);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.opt:hover:not(:disabled) { border-color: var(--color-teal-light); }
.opt.selected { border-color: var(--color-teal-light); background: var(--color-teal-light-tint); }
.opt.dim { opacity: .5; }
.opt:disabled { cursor: default; }

.score-hero { text-align: center; padding: 8px 0 22px; }
.score-hero .cap { font-family: var(--font-body); font-size: 12px; color: var(--color-muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; margin-bottom: 6px; }
.score-hero .big { font-family: var(--font-heading); font-weight: 700; font-size: 46px; color: var(--color-primary); line-height: 1; }
.stat-row { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.stat { text-align: center; min-width: 88px; }
.stat .n { font-family: var(--font-heading); font-weight: 700; font-size: 20px; }
.stat .l { font-size: 11px; color: var(--color-muted); text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }

.answer-strip { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.answer-dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 12px; color: #fff;
}
.answer-dot.correct { background: var(--color-primary); }
.answer-dot.wrong { background: var(--color-alert); }

/* Initials avatar — replaces the old photo picker/upload */
.avatar-placeholder {
  width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 14px;
}

.chart-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow-card); }
.chart-card canvas { max-height: 280px; }

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 14px 16px; overflow-x: auto; }
  .sidebar .brand-sub { display: none; }
  .sidebar .brand { margin-right: 16px; white-space: nowrap; }
  .sidebar nav { flex-direction: row; gap: 4px; }
  .sidebar .sidebar-foot { display: none; }
  .main-content { padding: 20px; }
}
