/* BVD of Ascend Leaderboard
   Primary: #FFFFFF (surfaces)   Secondary / brand: #CF2030
   Category accents: Weekly blue · BVD green · Conversion purple · Induction orange */
:root {
  --primary: #ffffff;
  --brand: #cf2030;
  --brand-dark: #a8172a;
  --brand-soft: #fdecee;
  --bg: #f5f6f8;
  --surface: var(--primary);
  --border: #e6e8ec;
  --text: #1c2230;
  --muted: #6b7280;
  --weekly: #2563eb;
  --bvd: #16a34a;
  --conversion: #7c3aed;
  --conversion_bonus: #c026d3;
  --induction: #ea580c;
  --adjustment: #64748b;
  --gold: #d4a017;
  --silver: #9ca3af;
  --bronze: #b87333;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --sidebar: 264px;
  font-size: 15px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Tamil", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; margin-top: 1rem; }
small { font-size: .82em; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: .5rem; border-radius: 8px; font-size: .8rem; max-width: 420px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; min-width: 0; }
.lead { font-size: 1.02rem; color: var(--muted); margin: 0 0 1rem; }
.note { font-size: .85rem; color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.brand {
  display: flex; gap: .75rem; align-items: center; padding: 1.1rem 1.1rem; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); text-decoration: none !important;
}
.brand img { border-radius: 12px; background: #fff; padding: 3px; }
.brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.brand small { opacity: .85; }
.nav { padding: .75rem .6rem 2rem; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .9rem .75rem .3rem; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px;
  color: var(--text); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a.active .icon { color: var(--brand); }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .8rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 1.2rem; margin: 0; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: .5rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta small { color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }
.content { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; width: 100%; max-width: 1500px; }
.footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .8rem; margin-top: auto; }
.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* ---------------------------------------------------------------- Cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h3 { margin: 0; font-weight: 650; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); gap: 1.25rem; align-items: start; }
.empty-state { text-align: center; padding: 2.5rem 1rem; }

.hero { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center;
  background: linear-gradient(120deg, #fff 55%, var(--brand-soft)); }
.eyebrow { text-transform: uppercase; font-size: .72rem; letter-spacing: .1em; color: var(--brand); font-weight: 700; }
.meeting-strip { display: flex; gap: .6rem; flex-wrap: wrap; }
.meeting-pill { border: 1px solid var(--border); border-radius: 12px; padding: .5rem .8rem; min-width: 104px; background: #fff; display: flex; flex-direction: column; }
.meeting-pill strong { font-size: 1.1rem; }
.meeting-pill span { font-size: .72rem; color: var(--weekly); font-weight: 600; }
.meeting-pill.is-bvd span { color: var(--bvd); }
.meeting-pill.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------------------------------------------------------------- KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); }
.kpi span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.kpi strong { font-size: 1.65rem; line-height: 1.15; letter-spacing: -.01em; }
.kpi small { color: var(--muted); }
.kpi .icon { position: absolute; right: 1rem; top: 1rem; width: 26px; height: 26px; color: var(--brand); opacity: .9; }
.kpi-brand::before { background: var(--brand); }
.kpi-brand strong { color: var(--brand); }
.kpi-weekly::before { background: var(--weekly); } .kpi-weekly strong { color: var(--weekly); }
.kpi-bvd::before { background: var(--bvd); } .kpi-bvd strong { color: var(--bvd); }
.kpi-conversion::before { background: var(--conversion); } .kpi-conversion strong { color: var(--conversion); }
.kpi-conversion_bonus::before { background: var(--conversion_bonus); } .kpi-conversion_bonus strong { color: var(--conversion_bonus); }
.kpi-induction_bonus::before { background: var(--induction); } .kpi-induction_bonus strong { color: var(--induction); }
.kpi-adjustment::before { background: var(--adjustment); }
.kpi-total::before { display: none; }
.kpi-total { border-color: var(--brand); background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; }
.kpi-total span, .kpi-total small { color: rgba(255, 255, 255, .85); }

/* ---------------------------------------------------------------- Badges, ranks */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--muted); }
.cat-weekly { background: #e8f0fe; color: var(--weekly); }
.cat-bvd { background: #e7f6ec; color: var(--bvd); }
.cat-conversion { background: #f1eafe; color: var(--conversion); }
.cat-conversion_bonus { background: #fbe9fd; color: var(--conversion_bonus); }
.cat-induction_bonus { background: #fff0e6; color: var(--induction); }
.cat-adjustment { background: #eef1f5; color: var(--adjustment); }
.st-ok { background: #e7f6ec; color: var(--ok); }
.st-warn { background: #fff4e0; color: var(--warn); }
.st-muted { background: #eef1f5; color: var(--muted); }
.c-weekly { color: var(--weekly); } .c-bvd { color: var(--bvd); } .c-conversion { color: var(--conversion); }
.c-conversion_bonus { color: var(--conversion_bonus); } .c-induction_bonus { color: var(--induction); }
.chip { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: .2rem .7rem; margin: .15rem; }

.rank {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 .4rem; border-radius: 999px;
  background: var(--bg); font-weight: 700; font-size: .85rem; color: var(--text);
}
.rank sup { font-size: .65rem; margin-left: 1px; }
.rank.gold { background: var(--gold); color: #fff; }
.rank.silver { background: var(--silver); color: #fff; }
.rank.bronze { background: var(--bronze); color: #fff; }
.row-gold td { background: #fdf8e6; }
.row-silver td { background: #f6f7f9; }
.row-bronze td { background: #fbf2ea; }
.row-me td { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-soft); }
.row-void td { opacity: .5; text-decoration: line-through; }

.podium-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.podium-list li { display: flex; align-items: center; gap: .7rem; padding: .45rem .3rem; border-bottom: 1px dashed var(--border); }
.podium-list li:last-child { border-bottom: 0; }
.podium-list .grow { display: flex; flex-direction: column; }
.podium-list b { font-size: 1.05rem; }

.podiums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; min-height: 210px; padding-top: .5rem; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; min-width: 0; }
.step strong { font-size: .88rem; overflow-wrap: anywhere; }
.step small { color: var(--muted); }
.step .block { width: 100%; border-radius: 10px 10px 0 0; margin-top: .3rem; }
.step-1 .block { height: 110px; background: linear-gradient(180deg, var(--gold), #b8860b); }
.step-2 .block { height: 80px; background: linear-gradient(180deg, #c7ccd3, var(--silver)); }
.step-3 .block { height: 58px; background: linear-gradient(180deg, #d4935a, var(--bronze)); }
.medal { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.step-1 .medal { background: var(--gold); } .step-2 .medal { background: var(--silver); } .step-3 .medal { background: var(--bronze); }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll { max-height: 460px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .55rem .65rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table tbody tr:hover td { background: #fcfcfd; }
.table-compact th, .table-compact td { padding: .4rem .5rem; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .total { font-weight: 800; color: var(--brand); font-size: 1rem; }
.table .empty { text-align: center; color: var(--muted); padding: 2rem; }
.table .actions { white-space: nowrap; }
.board td { white-space: nowrap; }
.board details small { white-space: normal; display: block; max-width: 280px; }
details summary { cursor: pointer; color: var(--brand); }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.activity li:last-child { border-bottom: 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.plain li { padding: .2rem 0; }

/* ---------------------------------------------------------------- Forms & buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { border-color: #cfd3da; background: #fafafa; }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(207, 32, 48, .35); outline-offset: 2px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: #fff; border-color: var(--brand); color: var(--brand); }
.btn-danger:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: .32rem .65rem; font-size: .84rem; }
.btn-block { width: 100%; justify-content: center; }
.btn .icon { width: 16px; height: 16px; }
.icon-btn { background: none; border: 0; padding: .45rem; border-radius: 10px; cursor: pointer; color: var(--text); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--bg); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--brand-dark); }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #d5d9e0; border-radius: 10px; padding: .5rem .7rem; min-height: 40px; max-width: 100%;
}
input:focus, select:focus { border-color: var(--brand); }
select[multiple] { min-height: 140px; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: #374151; display: flex; flex-direction: column; }
.field em { color: var(--brand); font-style: normal; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; grid-column: 1 / -1; }
.check input { min-height: auto; margin-top: .25rem; accent-color: var(--brand); }
.form-card { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; grid-column: 1 / -1; }
.form-actions .field { flex: 1 1 260px; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-end; }
.filters .field { flex: 1 1 180px; }
.filter-actions { display: flex; gap: .5rem; }
.filters-inline, .row-form, .inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; }
.inline-form input { min-height: 34px; padding: .3rem .55rem; }
.row-form input, .row-form select { min-height: 36px; }
.w-xs { width: 80px; } .w-sm { width: 110px; }
input.num { text-align: right; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.table-search { min-width: 200px; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; padding: .75rem 0 .25rem; border-top: 1px solid var(--border); }
.assign-form { margin-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.danger-zone { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; border-color: #f3c4ca; }
.danger-zone input { flex: 1 1 220px; }

.tabs { display: flex; gap: .25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .25rem; flex-wrap: wrap; }
.tabs a { padding: .45rem 1rem; border-radius: 9px; color: var(--text); font-weight: 600; text-decoration: none; }
.tabs a.active { background: var(--brand); color: #fff; }

/* Segmented attendance control */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .32rem .65rem; font-size: .82rem; font-weight: 600; border-right: 1px solid var(--border); color: var(--muted); }
.seg label:last-child span { border-right: 0; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.seg-present input:checked + span { background: var(--ok); color: #fff; }
.seg-substitute input:checked + span { background: var(--warn); color: #fff; }
.seg-absent input:checked + span { background: var(--brand); color: #fff; }
.seg-none input:checked + span { background: #e5e7eb; color: var(--text); }

/* Alerts */
.alert { padding: .75rem 2.5rem .75rem 1rem; border-radius: 10px; border: 1px solid; position: relative; font-weight: 500; }
.alert-success { background: #ecfdf3; border-color: #a6e9c0; color: #14532d; }
.alert-error { background: #fdecee; border-color: #f4b4bc; color: #7f1020; }
.alert-info { background: #eef4ff; border-color: #c3d6fb; color: #1e3a8a; }
.alert-close { position: absolute; right: .5rem; top: .35rem; background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: inherit; }

/* Misc blocks */
.profile-head, .team-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.profile-head h2, .team-head h2 { margin: 0; }
.profile-rank { display: flex; flex-direction: column; align-items: center; padding: .5rem 1.25rem; border-left: 1px solid var(--border); margin-left: auto; }
.profile-rank strong { font-size: 2rem; color: var(--brand); line-height: 1.1; }
.team-roles { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: .5rem 0 0; }
.team-roles span { display: inline-flex; gap: .4rem; align-items: center; }
.team-roles .icon { color: var(--brand); }
.leader-card .big-num { display: flex; align-items: center; gap: .5rem; font-size: 1.5rem; margin: .5rem 0; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }
.calc { margin-top: 1rem; padding: .85rem 1rem; border-radius: 10px; background: #f6f0ff; border: 1px solid #e2d4fd; }
.calc ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.rules-strip { display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; }
.rule-card { border-top: 4px solid var(--weekly); }
.rule-bvd { border-top-color: var(--bvd); }
.rule-induction_bonus { border-top-color: var(--induction); }
.rule-field { flex-direction: row; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.rule-field small { font-weight: 400; }
.chart-box { position: relative; height: 300px; }
.chart-tall { height: 380px; }
.report-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.report-layout > div { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.report-nav { display: flex; flex-direction: column; gap: 2px; padding: .5rem; position: sticky; top: 80px; }
.report-nav a { padding: .55rem .75rem; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 500; }
.report-nav a.active { background: var(--brand-soft); color: var(--brand); }
.print-only-title { display: none; }

/* ---------------------------------------------------------------- Auth */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(140deg, #fff 40%, var(--brand-soft)); }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 920px; width: 100%; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(17, 24, 39, .12); border: 1px solid var(--border); }
.auth-hero { background: linear-gradient(150deg, var(--brand), var(--brand-dark)); color: #fff; padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; gap: .5rem; }
.auth-hero img { background: #fff; border-radius: 18px; padding: 6px; margin-bottom: .5rem; }
.auth-hero h1 { font-size: 1.7rem; }
.auth-hero p { opacity: .9; margin: 0 0 1rem; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.hero-points li { display: flex; align-items: center; gap: .6rem; background: rgba(255, 255, 255, .12); padding: .5rem .75rem; border-radius: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.dot.cat-weekly { background: var(--weekly); } .dot.cat-bvd { background: var(--bvd); }
.dot.cat-conversion { background: var(--conversion); } .dot.cat-induction_bonus { background: var(--induction); }
.auth-card { padding: 2.5rem; display: flex; flex-direction: column; gap: .5rem; background: #fff; }
body.auth-body > .auth-card { max-width: 440px; border-radius: 16px; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- Print */
.print-body { background: #fff; padding: 1.5rem; }
.print-head { display: flex; align-items: center; gap: 1rem; border-bottom: 3px solid var(--brand); padding-bottom: 1rem; margin-bottom: 1rem; }
.print-head h1 { color: var(--brand); font-size: 1.4rem; margin: 0; }
.print-head p { margin: .2rem 0 0; }
.print-head .btn { margin-left: auto; }
.print-table { margin-bottom: 1.5rem; font-size: .82rem; }
.print-body h2 { margin-top: 1.25rem; }

@media print {
  .sidebar, .topbar, .footer, .toolbar, .filters, .no-print, .alert, .table-search, .report-nav, .pager, [data-print] { display: none !important; }
  .app, .main { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; break-inside: avoid; }
  .print-only-title { display: block; }
  .table th { position: static; }
  .row-gold td, .row-silver td, .row-bronze td, .rank, .kpi-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .board td { white-space: normal; }
  details { display: block; } details > summary { display: none; }
  body { font-size: 11pt; }
}

/* ---------------------------------------------------------------- Pager */
.pager { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.pager-info { color: var(--muted); font-size: .84rem; margin-right: auto; margin-top: .6rem; }
.pager .pager-info { margin-top: 0; }

/* ---------------------------------------------------------------- Team structure */
.structure-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.structure-summary .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .1rem; }
.structure-summary span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.structure-summary strong { font-size: 1.65rem; color: var(--brand); line-height: 1.2; }
.structure-summary strong small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.structure-summary strong.split { font-size: 1.05rem; color: var(--text); padding: .3rem 0; }
.structure-summary em { font-style: normal; font-size: .8rem; color: var(--muted); }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.checklist li { display: flex; gap: .75rem; align-items: flex-start; font-size: .9rem; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.checklist .ok .tick { background: #e7f6ec; color: var(--ok); }
.checklist .todo .tick { background: #fff4e0; color: var(--warn); }

.assign-box { display: flex; flex-direction: column; gap: .75rem; }
.check-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: .4rem .6rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .1rem .75rem; }
.check-list label { display: flex; gap: .45rem; align-items: center; padding: .3rem 0; font-size: .88rem; cursor: pointer; }
.check-list input { min-height: auto; accent-color: var(--brand); }

.structure { display: flex; flex-direction: column; gap: 1.5rem; }
.leader-block { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.leader-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, var(--brand-soft), #fff 60%); }
.leader-head h3 { margin: 0; font-size: 1.15rem; }
.leader-head .avatar { width: 42px; height: 42px; font-size: 1.1rem; }
.leader-none .leader-head { background: #fff8eb; }
.pill { display: inline-flex; align-items: center; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.pill-ok { background: #e7f6ec; color: var(--ok); border-color: #c4ebd1; }
.pill-warn { background: #fff4e0; color: var(--warn); border-color: #f6dfb4; }
.pill-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding: 1.1rem 1.25rem 1.25rem; }
.team-card { border: 1px solid var(--border); border-radius: 14px; padding: .95rem 1rem; display: flex; flex-direction: column; gap: .75rem; background: #fff; transition: box-shadow .15s, border-color .15s; }
.team-card:hover { border-color: #f1b9c0; box-shadow: 0 6px 18px rgba(207, 32, 48, .08); }
.team-card header { display: flex; gap: .5rem; align-items: flex-start; }
.team-card h4 { margin: 0; font-size: 1rem; }
.team-card h4 a { color: var(--text); }
.team-pts { font-weight: 800; color: var(--brand); font-size: 1.15rem; text-align: right; line-height: 1.1; }
.team-pts small { display: block; font-size: .68rem; color: var(--muted); font-weight: 600; }
.roles { display: grid; grid-template-columns: 1fr; gap: .4rem; }
.structure-legend { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.structure-legend .member-chips li { font-size: .72rem; }
.toolbar .table-search[data-filter-cards] { min-width: 300px; }
.role { display: flex; gap: .45rem; align-items: center; background: var(--bg); border-radius: 10px; padding: .45rem .55rem; min-width: 0; }
.role > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.role small { font-size: .68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.role b { font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.role-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.role-ic .icon { width: 15px; height: 15px; }
.seats { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); }
.seats strong { color: var(--text); }
.seats progress { width: 100%; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: #eef0f3; appearance: none; -webkit-appearance: none; }
.seats progress::-webkit-progress-bar { background: #eef0f3; border-radius: 99px; }
.seats progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
.seats progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }
.seats.full progress::-webkit-progress-value { background: var(--ok); }
.seats.full progress::-moz-progress-bar { background: var(--ok); }
.member-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.member-chips li { font-size: .76rem; padding: .18rem .55rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }
.member-chips li.is-captain { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.member-chips li.is-voice { background: var(--brand-soft); border-color: #f1b9c0; color: var(--brand-dark); font-weight: 600; }
.member-chips li.empty-chip { color: var(--muted); border-style: dashed; background: #fff; }
.team-card footer { display: flex; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .5rem; border-top: 1px dashed var(--border); font-size: .84rem; font-weight: 600; }

/* ---------------------------------------------------------------- Setup wizard */
.setup-hero { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; background: linear-gradient(120deg, #fff 55%, var(--brand-soft)); }
.setup-hero h2 { margin: .2rem 0; }
.setup-progress { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; min-width: 160px; }
.setup-progress strong { font-size: 1.8rem; color: var(--brand); line-height: 1; }
.setup-progress progress { width: 160px; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: #eef0f3; appearance: none; -webkit-appearance: none; }
.setup-progress progress::-webkit-progress-bar { background: #eef0f3; }
.setup-progress progress::-webkit-progress-value { background: var(--brand); }
.setup-progress progress::-moz-progress-bar { background: var(--brand); }
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.stepper a { display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); }
.stepper .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); font-weight: 800; flex: none; }
.stepper a.done .num { background: #e7f6ec; color: var(--ok); }
.stepper a.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stepper a.current .num { background: var(--brand); color: #fff; }
.quick-add { background: var(--bg); padding: .8rem; border-radius: 12px; margin-bottom: 1rem; }
.quick-add input, .quick-add select { flex: 1 1 200px; }
.setup-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.setup-list li { display: flex; align-items: center; gap: .75rem; padding: .6rem .2rem; border-bottom: 1px solid var(--border); }
.setup-list .avatar { width: 32px; height: 32px; font-size: .9rem; }
.mini-card { border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; background: #fff; }
.mini-card .card-head { margin-bottom: .5rem; }
.setup-leaders { margin-top: .5rem; }
.wizard-nav { display: flex; gap: .75rem; align-items: center; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
textarea { font: inherit; color: var(--text); border: 1px solid #d5d9e0; border-radius: 10px; padding: .6rem .7rem; width: 100%; resize: vertical; }
textarea:focus { border-color: var(--brand); outline: none; }
.login-sheet { border: 2px dashed #f1b9c0; border-radius: 12px; padding: 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
.login-sheet table { width: 100%; }
@media print {
  body:has(.login-sheet) .content > *:not(.card), body:has(.login-sheet) .stepper, body:has(.login-sheet) .setup-hero { display: none !important; }
}
@media (max-width: 960px) {
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- Installer */
.install-card { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 1rem; padding: 2rem; }
.install-head { display: flex; gap: 1rem; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.install-head h1 { font-size: 1.35rem; margin: 0; color: var(--brand); }
.install-head p { margin: 0; }
.install-card h3 small { font-weight: 400; font-size: .8rem; }
.config-box { max-width: none; max-height: 360px; overflow: auto; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1400px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .structure-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-3, .podiums { grid-template-columns: 1fr 1fr; }
  .grid-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(17, 24, 39, .4); z-index: 40; }
  .nav-toggle { display: inline-grid; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-layout { grid-template-columns: 1fr; }
  .report-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 1.75rem; }
}
@media (max-width: 640px) {
  :root { font-size: 14px; }
  .content { padding: 1rem; gap: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .user-meta { display: none; }
  .grid-3, .podiums, .form-grid, .team-grid { grid-template-columns: 1fr; }
  .team-grid { padding: .9rem; }
  .kpis, .kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi strong { font-size: 1.35rem; }
  .card { padding: 1rem; }
  .profile-rank { border-left: 0; margin-left: 0; padding: 0; align-items: flex-start; }
  .dl { grid-template-columns: 1fr; }
  .filters .field { flex-basis: 100%; }
  .table-search { min-width: 0; width: 100%; }
  .auth-card { padding: 1.5rem; }
}

/* =====================================================================
   Design layer v2 – typography, polish, toasts, animated leaderboard,
   clean dashboard, presentation mode. Appended last so it refines the
   rules above.
   ===================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/inter-800.woff2") format("woff2"); }

:root {
  --bg: #f4f5f8;
  --border: #e7e9ee;
  --text: #161b26;
  --muted: #667085;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
body { font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Tamil", Arial, sans-serif; letter-spacing: -.005em; }
h1, h2, h3 { letter-spacing: -.02em; }
.num, .kpi strong, .lb-total, .team-pts { font-variant-numeric: tabular-nums; }

/* Sidebar */
.brand { padding: 1.15rem 1.2rem; gap: .8rem; }
.brand strong { font-size: .98rem; }
.nav { padding: .9rem .75rem 1.5rem; gap: 1px; flex: 1; }
.nav a { position: relative; color: #344054; font-weight: 500; padding: .58rem .8rem; transition: background .15s, color .15s; }
.nav a .icon { color: #98a2b3; transition: color .15s; }
.nav a:hover { background: #f6f7f9; color: var(--text); text-decoration: none; }
.nav a:hover .icon { color: var(--brand); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav-section { font-size: .68rem; letter-spacing: .09em; color: #98a2b3; padding: 1.1rem .8rem .35rem; }
.sidebar-foot { display: flex; align-items: center; gap: .65rem; padding: .9rem 1rem; border-top: 1px solid var(--border); }
.sidebar-foot .avatar { width: 34px; height: 34px; font-size: .9rem; }
.sidebar-foot .user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidebar-foot strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot small { color: var(--muted); font-size: .75rem; }

/* Top bar */
.topbar { background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(10px); padding: .75rem 1.75rem; }
.page-heading { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.page-heading small { color: var(--muted); font-size: .74rem; font-weight: 500; }
.page-title { font-size: 1.2rem; font-weight: 700; flex: none; }
.user-chip { padding: .25rem .6rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.user-chip:hover { border-color: #d0d5dd; box-shadow: var(--shadow); }
.user-chip .avatar { width: 32px; height: 32px; font-size: .85rem; }
.avatar { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.content { padding: 1.75rem; gap: 1.4rem; max-width: 1480px; animation: page-in .45s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Cards, KPIs, buttons, inputs */
.card { border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.card-head { margin-bottom: 1rem; }
.card-head h3 { font-size: 1rem; }
.card-head a { font-size: .85rem; font-weight: 600; }
.kpi { border-radius: var(--radius); padding: 1.05rem 1.2rem; transition: transform .2s var(--ease), box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi span { font-weight: 500; }
.kpi strong { font-weight: 800; }
.btn { border-radius: 11px; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 1px 2px rgba(207, 32, 48, .25), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-primary:hover { box-shadow: 0 6px 16px -4px rgba(207, 32, 48, .45); }
.btn-light { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn-light:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .6); }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; margin-left: .3rem; }
@keyframes spin { to { transform: rotate(360deg); } }
input, select, textarea { border-color: #d0d5dd; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(207, 32, 48, .12); outline: none; }
.table thead th { background: #f9fafb; color: #667085; font-weight: 600; }

/* Toast notifications */
.toasts { position: fixed; top: 1rem; right: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .6rem; width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: .7rem; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: .85rem .9rem;
  box-shadow: 0 16px 40px -12px rgba(16, 24, 40, .25); animation: toast-in .35s var(--ease) both; font-weight: 500; font-size: .92rem; }
.toast.leaving { animation: toast-out .3s ease forwards; }
.toast-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; font-size: .85rem; }
.toast-success .toast-icon { background: #dcfae6; color: #067647; }
.toast-error .toast-icon { background: #fee4e2; color: #b42318; }
.toast-info .toast-icon { background: #e0eaff; color: #3538cd; }
.toast-error { border-color: #fecdca; }
.toast-msg { flex: 1; padding-top: .15rem; overflow-wrap: anywhere; }
.toast-close { background: none; border: 0; font-size: 1.2rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .1rem .2rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ---------------------------------------------------------------- Clean dashboard */
.dash-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; }
.dash-hero h2 { font-size: 1.35rem; margin: .15rem 0 .35rem; }
.dash-facts { display: flex; flex-wrap: wrap; gap: .4rem; }
.fact { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .7rem; border-radius: 999px; background: var(--bg); font-size: .8rem; color: #475467; font-weight: 500; }
.fact b { color: var(--text); }
.dash-weeks { display: flex; gap: .4rem; flex-wrap: wrap; }
.week { display: flex; flex-direction: column; padding: .45rem .8rem; border-radius: 12px; border: 1px solid var(--border); min-width: 92px; background: #fff; }
.week small { color: var(--muted); font-size: .72rem; font-weight: 600; }
.week strong { font-size: .98rem; }
.week em { font-style: normal; font-size: .68rem; font-weight: 700; color: var(--weekly); }
.week.is-bvd em { color: var(--bvd); }
.week.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.week.current small::after { content: " · next"; color: var(--brand); }

.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.pill-tabs { display: flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: 10px; flex-wrap: wrap; }
.pill-tabs a { padding: .38rem .8rem; border-radius: 8px; font-size: .85rem; font-weight: 600; color: #475467; text-decoration: none; white-space: nowrap; }
.pill-tabs a:hover { color: var(--text); }
.pill-tabs a.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.filterbar select { min-height: 36px; padding: .35rem .6rem; font-size: .86rem; border-radius: 10px; max-width: 220px; }
.filterbar .spacer { flex: 1; }
.filterbar .reset { font-size: .85rem; font-weight: 600; }
.filter-note { font-size: .82rem; color: var(--muted); }
.filter-note b { color: var(--brand); }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .9rem; }
.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: .95rem 1.05rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.stat-tile .label { display: flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600; color: #475467; }
.stat-tile .label i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.stat-tile strong { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.stat-tile small { color: var(--muted); font-size: .76rem; }
.stat-tile.total { background: linear-gradient(135deg, #cf2030, #a8172a); border-color: transparent; color: #fff; }
.stat-tile.total .label, .stat-tile.total small { color: rgba(255, 255, 255, .85); }
.dot-weekly { background: var(--weekly); } .dot-bvd { background: var(--bvd); } .dot-conversion { background: var(--conversion); }
.dot-conversion_bonus { background: var(--conversion_bonus); } .dot-induction_bonus { background: var(--induction); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.dash-grid > .card { min-width: 0; }
.chart-box { height: 280px; }
.mini-list { display: flex; flex-direction: column; }
.mini-list .row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid #f0f1f4; }
.mini-list .row:last-child { border-bottom: 0; }
.mini-list .who { display: flex; flex-direction: column; min-width: 0; }
.mini-list .who strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .who small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .pts { font-weight: 800; color: var(--text); font-size: .98rem; }
.mini-bar { grid-column: 2 / -1; height: 5px; border-radius: 99px; background: #f2f4f7; overflow: hidden; margin-top: -.15rem; }
.mini-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e2394a, #cf2030); border-radius: 99px; transition: width 1.1s var(--ease); }
.leader-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.leader-tile { border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.leader-tile header { display: flex; align-items: center; gap: .6rem; }
.leader-tile strong { font-size: .95rem; }
.leader-tile .big { font-size: 1.45rem; font-weight: 800; color: var(--brand); }
.leader-tile small { color: var(--muted); font-size: .76rem; }
.activity li { padding: .6rem 0; gap: .6rem; font-size: .9rem; }
.activity .when { color: var(--muted); font-size: .75rem; white-space: nowrap; }
details.panel > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 700; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "Show ▾"; font-size: .82rem; color: var(--brand); font-weight: 600; }
details.panel[open] > summary::after { content: "Hide ▴"; }
details.panel[open] > summary { margin-bottom: 1rem; }

/* ---------------------------------------------------------------- Leaderboard */
.lb-hero { position: relative; overflow: hidden; border-radius: 20px; padding: 1.6rem 1.75rem 1.1rem; color: #fff;
  background: radial-gradient(1200px 300px at 85% -40%, rgba(255, 255, 255, .22), transparent 60%), linear-gradient(120deg, #a8172a 0%, #cf2030 55%, #e2394a 100%);
  box-shadow: 0 18px 40px -18px rgba(207, 32, 48, .6); }
.lb-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .12) 50%, transparent 65%);
  transform: translateX(-100%); animation: shine 3.5s ease-in-out .6s infinite; pointer-events: none; }
@keyframes shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
.lb-hero .eyebrow { color: rgba(255, 255, 255, .8); }
.lb-hero h2 { font-size: 1.9rem; margin: .2rem 0 .15rem; font-weight: 800; }
.lb-hero p { margin: 0; opacity: .85; }
.lb-hero-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; position: relative; z-index: 1; }
.lb-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.lb-tabs, .lb-meetings { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: 1rem; position: relative; z-index: 1; }
.lb-tabs a { padding: .5rem 1.05rem; border-radius: 999px; color: #fff; font-weight: 600; text-decoration: none; background: rgba(255, 255, 255, .12); transition: background .15s; }
.lb-tabs a:hover { background: rgba(255, 255, 255, .22); }
.lb-tabs a.active { background: #fff; color: var(--brand); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .3); }
.lb-meetings { margin-top: .6rem; }
.lb-meetings a { padding: .3rem .75rem; border-radius: 999px; color: rgba(255, 255, 255, .9); font-size: .82rem; font-weight: 600; text-decoration: none; border: 1px solid rgba(255, 255, 255, .3); }
.lb-meetings a small { opacity: .75; font-weight: 500; }
.lb-meetings a.active { background: rgba(0, 0, 0, .18); border-color: rgba(255, 255, 255, .7); color: #fff; }
.lb-meetings a.is-bvd::before { content: "★ "; }

.podiums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.podiums-single { grid-template-columns: minmax(0, 720px); justify-content: center; }
.podium-card { background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 1.2rem 1.25rem 0; overflow: hidden; }
.podium-card h3 { text-align: center; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 1.6rem; }
.podium { min-height: 230px; gap: .6rem; padding-top: 0; }
.step { gap: .25rem; animation: rise-in .7s var(--ease) both; }
.step-2 { animation-delay: .15s; } .step-1 { animation-delay: .35s; } .step-3 { animation-delay: .05s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.podium-avatar { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem;
  color: #fff; background: linear-gradient(135deg, #475467, #1d2939); box-shadow: 0 0 0 3px #fff, 0 6px 14px -4px rgba(0, 0, 0, .3); margin-bottom: .3rem; }
.step-1 .podium-avatar { width: 66px; height: 66px; font-size: 1.6rem; background: linear-gradient(135deg, #f5c542, #b8860b); box-shadow: 0 0 0 3px #fff, 0 0 0 7px rgba(212, 160, 23, .25), 0 10px 22px -6px rgba(184, 134, 11, .6); }
.step-2 .podium-avatar { background: linear-gradient(135deg, #d0d5dd, #8a94a6); }
.step-3 .podium-avatar { background: linear-gradient(135deg, #e0a06a, #a0612b); }
.podium-avatar .medal { position: absolute; right: -6px; bottom: -4px; width: 24px; height: 24px; font-size: .75rem; box-shadow: 0 0 0 2px #fff; }
.step-1 .podium-avatar::before { content: "👑"; position: absolute; top: -26px; font-size: 1.25rem; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.step strong { font-size: .88rem; line-height: 1.25; }
.step small { font-weight: 700; color: var(--text); }
.step .block { position: relative; display: grid; place-items: center; color: rgba(255, 255, 255, .92); font-weight: 800; font-size: 1.05rem; transform-origin: bottom;
  animation: grow 1s var(--ease) both; border-radius: 12px 12px 0 0; }
.step-1 .block { height: 110px; animation-delay: .45s; } .step-2 .block { height: 80px; animation-delay: .25s; } .step-3 .block { height: 58px; animation-delay: .1s; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.lb-grid { align-items: start; }
.lb-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .78rem; color: var(--muted); margin: -.25rem 0 .85rem; }
.lb-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.lb-legend .bseg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lb-list { display: flex; flex-direction: column; gap: .5rem; }
.lb-row { border: 1px solid var(--border); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.lb-row:hover, .lb-row[open] { border-color: #f1b9c0; box-shadow: 0 10px 24px -14px rgba(207, 32, 48, .45); }
.lb-row:hover { transform: translateY(-1px); }
.lb-row > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto auto minmax(0, 1.6fr) auto minmax(90px, 1fr) auto; align-items: center; gap: .85rem; padding: .7rem .95rem; }
.lb-row > summary::-webkit-details-marker { display: none; }
.lb-row.top1 { background: linear-gradient(90deg, #fff8e1, #fff 55%); border-color: #f3dd9b; }
.lb-row.top2 { background: linear-gradient(90deg, #f3f4f6, #fff 55%); }
.lb-row.top3 { background: linear-gradient(90deg, #fbeee3, #fff 55%); border-color: #efd3bc; }
.lb-row.mine { box-shadow: inset 4px 0 0 var(--brand); }
.lb-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: var(--brand); background: var(--brand-soft); }
.lb-name { display: flex; flex-direction: column; min-width: 0; }
.lb-name strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name small { color: var(--muted); font-size: .77rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you { font-style: normal; font-size: .66rem; background: var(--brand); color: #fff; padding: .05rem .4rem; border-radius: 6px; vertical-align: 2px; margin-left: .25rem; }
.move { font-size: .74rem; font-weight: 800; padding: .15rem .45rem; border-radius: 7px; white-space: nowrap; }
.move.up { color: #067647; background: #dcfae6; animation: nudge-up .9s ease 1s 2; }
.move.down { color: #b42318; background: #fee4e2; }
.move.same { color: #98a2b3; background: #f2f4f7; }
@keyframes nudge-up { 50% { transform: translateY(-3px); } }
.lb-bar { height: 10px; background: #f2f4f7; border-radius: 99px; overflow: hidden; }
.lb-fill { display: flex; height: 100%; width: 0; border-radius: 99px; overflow: hidden; transition: width 1.1s var(--ease); }
.bseg { display: block; height: 100%; width: 0; transition: width 1.1s var(--ease); }
.bseg-weekly { background: var(--weekly); } .bseg-bvd { background: var(--bvd); } .bseg-conversion { background: var(--conversion); }
.bseg-conversion_bonus { background: var(--conversion_bonus); } .bseg-induction_bonus { background: var(--induction); }
.lb-total { font-size: 1.25rem; font-weight: 800; color: var(--brand); text-align: right; min-width: 80px; line-height: 1.1; }
.lb-total small { display: block; font-size: .66rem; font-weight: 600; color: var(--muted); }
.lb-detail { padding: .85rem .95rem 1rem; display: flex; flex-direction: column; gap: .75rem; border-top: 1px dashed var(--border); }
.lb-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip-stat { display: inline-flex; gap: .35rem; align-items: baseline; padding: .3rem .65rem; border-radius: 10px; background: #f2f4f7; font-size: .78rem; color: #475467; }
.chip-stat b { font-size: .92rem; }
.reveal { animation: row-in .55s var(--ease) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Presentation (TV) mode */
body.tv { background: radial-gradient(1400px 600px at 50% -20%, #fde7ea, #f4f5f8 60%); }
.tv-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.tv-brand { display: flex; align-items: center; gap: .8rem; padding: 1.1rem 2rem 0; }
.tv-brand img { border-radius: 12px; }
.tv-brand strong { display: block; font-size: 1.1rem; }
.tv-brand small { color: var(--muted); }
body.tv .content { max-width: none; padding: 1rem 2rem 2rem; }
body.tv .lb-hero h2 { font-size: 2.4rem; }
body.tv .lb-row > summary { padding: .85rem 1.2rem; }
body.tv .lb-name strong { font-size: 1.15rem; }
body.tv .lb-total { font-size: 1.6rem; }
body.tv .lb-meetings, body.tv .table-search { display: none; }
.tv-timer { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .88rem; background: rgba(0, 0, 0, .18); padding: .4rem .8rem; border-radius: 999px; }
.tv-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); } 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }

@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .podiums, .dash-grid { grid-template-columns: 1fr; }
  .lb-row > summary { grid-template-columns: auto auto minmax(0, 1fr) auto auto; }
  .lb-row .lb-bar { grid-column: 3 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
  .content { padding: 1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leader-tiles { grid-template-columns: 1fr; }
  .filterbar select { max-width: none; flex: 1 1 140px; }
  .lb-hero { padding: 1.2rem; border-radius: 16px; }
  .lb-hero h2 { font-size: 1.45rem; }
  .lb-avatar { display: none; }
  .lb-row > summary { gap: .55rem; padding: .6rem .7rem; grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .lb-row .lb-bar { grid-column: 2 / -1; }
  .lb-total { font-size: 1.05rem; min-width: 0; }
  .page-heading small { display: none; }
  .toasts { left: 1rem; right: 1rem; width: auto; }
}
@media print {
  .toasts, .lb-hero::after, .lb-actions, .lb-meetings, .lb-tabs, .filterbar { display: none !important; }
  .lb-hero { box-shadow: none; }
  .reveal, .step, .step .block, .content { animation: none !important; }
  .lb-fill, .bseg, .mini-bar span { transition: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Password show/hide */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 2.9rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; border-radius: 8px;
  display: grid; place-items: center; color: #98a2b3; cursor: pointer; transition: color .15s, background .15s; }
.pw-toggle:hover { color: var(--brand); background: var(--brand-soft); }
.pw-toggle svg { width: 19px; height: 19px; }
.caps-hint { display: none; font-size: .76rem; color: var(--warn); margin-top: .3rem; font-weight: 600; }
.caps-hint.show { display: block; }

/* Sign-in page */
.auth-card input { width: 100%; min-height: 44px; }
.auth-card .btn-primary { min-height: 46px; font-size: 1rem; }
.auth-card h2 { font-size: 1.6rem; }
.dash-grid { align-items: stretch; }
.activity li.act { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; }
.act-text { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; min-width: 0; }
.act-text strong { font-size: .9rem; }
.act-text .badge { font-size: .68rem; padding: .08rem .45rem; }
.act-text small { flex-basis: 100%; color: var(--muted); font-size: .78rem; }
.act-pts { font-weight: 800; color: var(--ok); white-space: nowrap; }
.field > .pw-wrap { display: block; font-size: 1rem; font-weight: 400; color: var(--text); }
.field > .caps-hint { display: none; font-size: .76rem; color: var(--warn); font-weight: 600; }
.field > .caps-hint.show { display: block; }

/* =====================================================================
   Mobile layer – grids that can never overflow, tables that become
   cards, comfortable touch targets.
   ===================================================================== */
@media (max-width: 1100px) {
  .grid-main-side, .dash-grid, .podiums { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .grid-2, .report-layout, .structure-summary { grid-template-columns: minmax(0, 1fr); }
  .content { max-width: 100%; }
  .topbar { padding: .6rem 1rem; gap: .6rem; }
  .user-chip .user-meta { display: none; }
  .user-chip { padding: .2rem; }
  .report-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .report-nav a { white-space: nowrap; }
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-3, .podiums, .form-grid, .team-grid, .leader-tiles, .structure-summary, .kpis, .stats { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis, .kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-tile.total { grid-column: 1 / -1; }
  .content { padding: .9rem; gap: 1rem; }
  .card { padding: 1rem; border-radius: 14px; }
  .card-head { flex-wrap: wrap; }
  h2 { font-size: 1.2rem; }

  /* Touch-friendly controls (16px inputs stop iOS from zooming) */
  input, select, textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .toolbar, .toolbar-actions, .filters-inline, .row-form { width: 100%; }
  .toolbar-actions .btn, .filters-inline .btn { flex: 1 1 auto; justify-content: center; }
  .filters-inline input, .filters-inline select, .row-form input, .row-form select { flex: 1 1 100%; min-width: 0; }
  .filters .field, .quick-add input, .quick-add select { flex-basis: 100%; }
  .inline-form { flex-wrap: wrap; }
  .table-search, .toolbar .table-search[data-filter-cards] { min-width: 0; width: 100%; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { justify-content: center; }
  .wizard-nav { flex-wrap: wrap; }
  .wizard-nav .btn { flex: 1 1 auto; justify-content: center; }
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
  .stepper a { flex-direction: column; gap: .25rem; padding: .5rem .3rem; text-align: center; font-size: .72rem; }
  .setup-hero { flex-direction: column; align-items: flex-start; }
  .setup-progress { align-items: flex-start; }

  /* Dashboard */
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-weeks { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filterbar { padding: .5rem; }
  .filterbar .pill-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .filterbar select { flex: 1 1 100%; max-width: none; }
  .chart-box { height: 240px; }
  .chart-tall { height: 340px; }

  /* Leaderboard */
  .lb-hero-top { flex-direction: column; }
  .lb-actions { width: 100%; }
  .lb-actions .btn { flex: 1 1 auto; justify-content: center; }
  .lb-tabs, .lb-meetings { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .lb-tabs a, .lb-meetings a { white-space: nowrap; }
  .podium { min-height: 200px; }
  .step strong { font-size: .78rem; }
  .podium-avatar { width: 44px; height: 44px; font-size: 1.05rem; }
  .step-1 .podium-avatar { width: 54px; height: 54px; }

  /* Profile / team headers */
  .profile-head, .team-head { flex-direction: column; align-items: flex-start; }
  .profile-rank { flex-direction: row; gap: .5rem; align-items: baseline; }
  .team-roles { flex-direction: column; gap: .4rem; }
  .danger-zone { flex-direction: column; align-items: stretch; }

  /* Tables become cards: each cell shows its column heading (data-label set by app.js) */
  .table.stacked thead { display: none; }
  .table.stacked, .table.stacked tbody, .table.stacked tr, .table.stacked td { display: block; width: 100%; }
  .table.stacked tr { border: 1px solid var(--border); border-radius: 12px; padding: .35rem .8rem; margin-bottom: .6rem; background: #fff; }
  .table.stacked tbody tr:hover td { background: transparent; }
  .table.stacked td { display: flex; justify-content: space-between; align-items: center; gap: .75rem; text-align: right; padding: .45rem 0;
    border-bottom: 1px dashed #eef0f3; white-space: normal; min-height: 0; }
  .table.stacked td:last-child { border-bottom: 0; }
  .table.stacked td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .table.stacked td[data-label=""]::before, .table.stacked td:not([data-label])::before { display: none; }
  .table.stacked td[data-label=""] { justify-content: flex-start; }
  .table.stacked td.num { justify-content: space-between; }
  .table.stacked td.empty { display: block; text-align: center; }
  .table.stacked td.empty::before { display: none; }
  .table.stacked td > * { max-width: 100%; }
  .table.stacked td input:not([type="radio"]):not([type="checkbox"]), .table.stacked td select { width: 60%; min-width: 0; }
  .table.stacked tr.row-gold, .table.stacked tr.row-silver, .table.stacked tr.row-bronze { background: inherit; }
  .table.stacked .row-gold td, .table.stacked .row-silver td, .table.stacked .row-bronze td { background: transparent; }
  .table-wrap { overflow-x: visible; }
  .seg span { padding: .45rem .6rem; }
  .table.stacked td .row-form { width: 100%; }
  .table.stacked td .row-form input, .table.stacked td .row-form select { flex: 1 1 100%; width: 100%; }
  .print-table.stacked td { justify-content: space-between; }
}
@media (max-width: 640px) {
  .stats .stat-tile:nth-child(5) { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .lb-tabs, .lb-meetings, .filterbar .pill-tabs, .report-nav { scrollbar-width: none; }
  .lb-tabs::-webkit-scrollbar, .lb-meetings::-webkit-scrollbar, .filterbar .pill-tabs::-webkit-scrollbar, .report-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .table.stacked td { display: block; text-align: right; overflow-wrap: anywhere; }
  .table.stacked td::before { float: left; margin-right: .75rem; padding-top: .15rem; }
  .table.stacked td::after { content: ""; display: block; clear: both; }
  .table.stacked td[data-label=""], .table.stacked td.empty { text-align: left; }
  .table.stacked td .seg { display: inline-flex; }
  .table.stacked td input:not([type="radio"]):not([type="checkbox"]), .table.stacked td select { width: 62%; display: inline-block; }
  .table.stacked td .inline-form { display: inline-flex; justify-content: flex-end; }
  .form-actions .field { flex: none; width: 100%; }
  .sticky-actions { padding-top: .6rem; box-shadow: 0 -8px 16px -12px rgba(16, 24, 40, .25); }
}
@media (max-width: 640px) {
  .table.stacked td.actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: stretch; padding-top: .6rem; }
  .table.stacked td.actions > a, .table.stacked td.actions .link-btn { flex: 1 1 auto; text-align: center; padding: .55rem .8rem; border: 1px solid var(--border);
    border-radius: 10px; font-weight: 600; background: #fff; text-decoration: none; }
  .table.stacked td.actions .inline-form { flex: 1 1 auto; }
  .table.stacked td.actions .inline-form .link-btn { width: 100%; }
}
@media (max-width: 640px) {
  .auth-body { padding: .75rem; place-items: start center; }
  .auth-hero { flex-direction: row; align-items: center; gap: .8rem; padding: 1.1rem 1.25rem; }
  .auth-hero img { width: 48px; height: 48px; margin: 0; border-radius: 12px; padding: 3px; }
  .auth-hero h1 { font-size: 1.1rem; margin: 0; }
  .auth-hero p { font-size: .8rem; margin: 0; }
  .auth-hero .hero-points { display: none; }
  .auth-card { padding: 1.4rem 1.25rem; }
  .install-card { padding: 1.25rem; }
}
@media (max-width: 640px) {
  .auth-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .8rem; row-gap: .1rem; align-items: center; }
  .auth-hero img { grid-row: span 2; }
  select { min-width: 0; max-width: 100%; }
  .filterbar select { width: 100%; }
}

/* Dashboard setup card (shown to admins until Chapter Setup is complete) */
.setup-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; padding: 1.25rem 1.4rem;
  border-radius: 18px; color: var(--text); text-decoration: none !important; background: linear-gradient(120deg, #fff 40%, var(--brand-soft));
  border: 1.5px solid #f1b9c0; box-shadow: 0 14px 30px -18px rgba(207, 32, 48, .55); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.setup-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 20px 36px -18px rgba(207, 32, 48, .65); }
.setup-card:focus-visible { outline: 3px solid rgba(207, 32, 48, .35); outline-offset: 3px; }
.setup-card-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 8px 18px -8px rgba(207, 32, 48, .8); animation: bob 2.6s ease-in-out infinite; }
.setup-card-icon .icon { width: 26px; height: 26px; }
.setup-card-body { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.setup-card-body > strong { font-size: 1.15rem; letter-spacing: -.01em; }
.setup-card-body > small { color: #475467; font-size: .87rem; }
.setup-card-steps { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.setup-card-steps span { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem .22rem .25rem; border-radius: 999px; background: #fff;
  border: 1px solid var(--border); font-size: .78rem; font-weight: 600; color: #475467; }
.setup-card-steps i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 800;
  background: var(--bg); color: var(--muted); }
.setup-card-steps .done { border-color: #c4ebd1; color: #067647; }
.setup-card-steps .done i { background: #dcfae6; color: #067647; }
.setup-card-steps .next { border-color: var(--brand); color: var(--brand); }
.setup-card-steps .next i { background: var(--brand); color: #fff; }
.setup-card-bar { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
.setup-card-bar progress { flex: 0 1 220px; height: 7px; border: 0; border-radius: 99px; overflow: hidden; background: #f2d0d5; appearance: none; -webkit-appearance: none; }
.setup-card-bar progress::-webkit-progress-bar { background: #f2d0d5; }
.setup-card-bar progress::-webkit-progress-value { background: var(--brand); }
.setup-card-bar progress::-moz-progress-bar { background: var(--brand); }
.setup-card-bar em { font-style: normal; font-size: .78rem; font-weight: 600; color: var(--brand-dark); }
.setup-card-cta { padding: .7rem 1.15rem; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 700; white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(207, 32, 48, .7); }
@media (max-width: 760px) {
  .setup-card { grid-template-columns: auto minmax(0, 1fr); padding: 1.05rem; gap: .85rem; align-items: start; }
  .setup-card-icon { width: 44px; height: 44px; border-radius: 13px; }
  .setup-card-cta { grid-column: 1 / -1; text-align: center; }
}
