/* BNI MTL: same look as BNI Pulse (BNI red / granite / sterling grey, Arial, pill buttons, grey top menu). */
:root {
  --red: #CF2030; --red-dark: #951722; --red-tint: #FAE8EA;
  --granite: #64666A; --sterling: #C8C8C8;
  --ink: #3F4145; --muted: #7A7C80; --line: #E6E6E6; --bg: #F2F2F2; --card: #fff;
  --blue: #2C5C99; --plum: #5A3E82; --amber: #B5730E; --green: #1F7A4D;
  --G: #ACE1C4; --Y: #FDE380; --R: #EFA1AA; --X: #C8C8C8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.5 Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top menu ---- */
.topbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, #6B6D71, #585A5E); color: #fff; border-bottom: 3px solid var(--red); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.topbar-in { max-width: 1560px; margin: 0 auto; padding: 8px 28px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; }
.brand-mark { background: var(--red); color: #fff; font-weight: 800; padding: 3px 9px; border-radius: 4px; letter-spacing: .04em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 15px; letter-spacing: .3px; } .brand-text small { font-size: 10.5px; color: #E4E4E4; }
.nav-links { display: flex; gap: 6px; flex: 1; min-width: 0; }
.nav-btn { color: #fff; font-size: 13.5px; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.nav-btn:hover { background: rgba(255,255,255,.16); text-decoration: none; }
.nav-btn.on { background: var(--red); border-color: var(--red-dark); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-user { font-size: 12.5px; color: #F2F2F2; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.nav-out { font-size: 12.5px; color: #fff; border: 1px solid rgba(255,255,255,.55); padding: 6px 13px; border-radius: 999px; white-space: nowrap; }
.nav-out:hover { background: #fff; color: var(--red-dark); text-decoration: none; }
.to-top { position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .18s, transform .18s, background .12s; z-index: 60; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--red-dark); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.crumbs a { color: var(--red-dark); font-weight: 700; } .crumbs i { font-style: normal; color: var(--sterling); }

.wrap { max-width: 1240px; margin: 22px auto 90px; padding: 0 20px; }
.wrap.wide { max-width: 1560px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 24px 28px; }

h1 { font-size: 26px; margin: 0 0 4px; color: var(--ink); }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--ink); }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--sterling); background: #fff; color: var(--ink);
  padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: var(--red); color: var(--red-dark); text-decoration: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn.small { padding: 4px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.danger { color: var(--red); }
.btn.outline { background: #fff; color: var(--red-dark); border-color: var(--red); } .btn.outline:hover { background: var(--red-tint); }

label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 5px; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #CFCFCF; border-radius: 8px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
textarea { min-height: 64px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: #E5F3EA; border: 1px solid #B6E2C7; }
.flash.err { background: #FDECEE; border: 1px solid #F2B8BF; }
.flash.warn { background: #FBF0DE; border: 1px solid #E9CF9F; }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--granite); font-weight: 700; padding: 10px 12px; border-bottom: 3px solid var(--red); white-space: nowrap; }
table.t th:first-child { border-top-left-radius: 8px; } table.t th:last-child { border-top-right-radius: 8px; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tbody tr:nth-child(even) td, table.t tr:nth-child(even) td { background: #FAFAFA; }
table.t tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #222; }
.cG { background: var(--G); } .cY { background: var(--Y); } .cR { background: var(--R); } .cX { background: var(--X); }

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 118px; border-radius: 12px; padding: 11px 15px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--acc, var(--sterling)); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat b { display: block; font-size: 25px; line-height: 1.15; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.cG { background: var(--G); } .stat.cY { background: var(--Y); } .stat.cR { background: var(--R); } .stat.cX { background: var(--X); }
.stat.cG, .stat.cY, .stat.cR, .stat.cX { border-color: transparent; }
.stat.cG span, .stat.cY span, .stat.cR span, .stat.cX span { color: #333; }

.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; min-width: 120px; background: #eee; }
.bar i { display: block; height: 100%; }
.bar .G { background: var(--G); } .bar .Y { background: var(--Y); } .bar .R { background: var(--R); } .bar .X { background: var(--X); }

/* Chapter grid (mirrors the xlsm Final Results sheet) */
table.mtl { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: 100%; }
table.mtl th { position: sticky; top: 0; background: #fff; border-top: 0; font-size: 11px; color: var(--muted); font-weight: 600; padding: 6px 6px; border-bottom: 3px solid var(--red); text-align: center; white-space: nowrap; }
table.mtl th.grp { border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; }
table.mtl td { padding: 5px 6px; border-bottom: 1px solid #fff; border-right: 1px solid #fff; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.mtl td.name { text-align: left; font-weight: 600; }
table.mtl td.name a { color: var(--ink); }
table.mtl tbody tr:hover td { filter: brightness(0.97); }
table.mtl td.gap { border-left: 6px solid #fff; }
.delta { font-size: 11px; font-weight: 700; }
.delta.up { color: #1e8a4c; } .delta.down { color: var(--red); } .delta.same { color: var(--muted); }
.legend { display: flex; gap: 10px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }

.progress { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--red); transition: width .15s; }

/* Scoring reference cards */
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tiers .card { padding: 14px; margin: 0; }
.tiers table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tiers td { padding: 5px 8px; text-align: center; }
.tiers td:first-child { background: #fafafa; }

.login { max-width: 380px; margin: 60px auto; }
.member-head { display: flex; align-items: center; gap: 16px; }
.dot { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }


/* ---- Chapters page: leadership selector, key numbers, light distribution ---- */
.dh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dh-head h1 { margin: 0; } .dh-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); } .dh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scope { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 12px; padding: 14px 16px 12px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.scope-row { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.scope-row + .scope-row { border-top: 1px dashed var(--line); }
.scope-label { flex: 0 0 112px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 11px; margin: 0; }
.scope-btns { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.sb { display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1.5px solid var(--sterling); border-radius: 999px; padding: 5px 15px 5px 6px; min-height: 44px; font: inherit; color: var(--ink); cursor: pointer; text-align: left; transition: background .12s, border-color .12s, box-shadow .12s; }
.sb:hover { box-shadow: 0 2px 6px rgba(0,0,0,.12); } .sb:focus-visible { outline: 3px solid #222; outline-offset: 2px; }
.sb-av { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.sb-ad .sb-av { background: var(--red); } .sb-sdc .sb-av { background: #55575B; } .sb-dc .sb-av { background: var(--blue); }
.sb-t { display: flex; flex-direction: column; line-height: 1.15; } .sb-t b { font-size: 13.5px; } .sb-t small { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.sb-all { padding-left: 15px; }
.sb-ad:hover { border-color: var(--red); } .sb-sdc:hover { border-color: #55575B; } .sb-dc:hover { border-color: var(--blue); }
.sb.on { color: #fff; } .sb.on small { color: rgba(255,255,255,.88); }
.sb-ad.on { background: linear-gradient(135deg, #CF2030, #951722); border-color: #951722; } .sb-sdc.on { background: linear-gradient(135deg, #64666A, #46484C); border-color: #46484C; } .sb-dc.on { background: linear-gradient(135deg, #2C5C99, #1E4372); border-color: #1E4372; }
.sb.on .sb-av { background: rgba(255,255,255,.25); }
.scope-now { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpis .stat { text-align: left; }
.stat.t-red { --acc: #CF2030; } .stat.t-granite { --acc: #64666A; } .stat.t-blue { --acc: #2C5C99; } .stat.t-plum { --acc: #5A3E82; }
.stat span { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.stat small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; min-height: 15px; }
.stat.cG small, .stat.cY small, .stat.cR small, .stat.cX small { color: #444; }
.lightbar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #eee; margin: 4px 0 8px; }
.lightbar i { display: block; height: 100%; transition: width .25s; } .lightbar .G { background: var(--G); } .lightbar .Y { background: var(--Y); } .lightbar .R { background: var(--R); } .lightbar .X { background: var(--X); }
.lightkey { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); } .lightkey b { color: var(--ink); }
.lightkey .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.ch-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.ch-tools input[type=search] { flex: 1 1 200px; max-width: 290px; border-radius: 999px; }
.chips-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--sterling); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; color: var(--ink); cursor: pointer; }
.chip b { background: #EEE; border-radius: 999px; padding: 0 7px; font-size: 11px; }
.chip:hover { border-color: #777; } .chip.on { background: #3F4145; border-color: #3F4145; color: #fff; } .chip.on b { background: rgba(255,255,255,.25); color: #fff; }
table.t th .sortbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
table.t th .sortbtn::after { content: '\2195'; opacity: .55; font-size: 11px; }
table.t th[aria-sort=ascending] .sortbtn::after { content: '\25B2'; opacity: 1; font-size: 10px; }
table.t th[aria-sort=descending] .sortbtn::after { content: '\25BC'; opacity: 1; font-size: 10px; }
table.t th .sortbtn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
table.t th.num .sortbtn { flex-direction: row-reverse; }
table.t tbody tr.chrow:hover td { background: #FBEEF0; }
.tag { display: inline-block; font-size: 11px; padding: 1px 9px; border-radius: 999px; background: #EEE; color: #555; margin-right: 4px; }
.tag.ad { background: #FAE8EA; color: #951722; } .tag.sdc { background: #ECECEC; color: #46484C; } .tag.dc { background: #E4ECF6; color: #1E4372; }

@media (max-width: 900px) {
  .topbar-in { flex-wrap: wrap; padding: 8px 14px; gap: 8px 12px; }
  .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; }
  .nav-right { margin-left: auto; } .nav-user { display: none; }
  .wrap { padding: 0 14px; margin-top: 16px; }
  .scope-row { flex-direction: column; gap: 4px; } .scope-label { padding-top: 0; flex-basis: auto; }
  h1 { font-size: 22px; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, 1fr); } .sb { width: 100%; } .card { padding: 14px; } }
.tag { white-space: nowrap; }
table#chapters td:first-child { min-width: 230px; }
@media (max-width: 520px) { table#chapters td:first-child { min-width: 190px; } }
