:root {
  --navy: #0d2038;
  --navy-2: #16324f;
  --navy-3: #24466a;
  --gold: #b1872f;
  --gold-2: #d9b768;
  --gold-soft: #f6edd7;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #101c2e;
  --ink-2: #3d4d63;
  --muted: #74839a;
  --line: #e2e7ee;
  --line-2: #edf0f5;
  --good: #0d7357;
  --good-bg: #e6f4ee;
  --warn: #8f6200;
  --warn-bg: #fcf2da;
  --bad: #ab2a20;
  --bad-bg: #fbeae7;
  --info: #175d8c;
  --info-bg: #e8f1f8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 28, 46, .05), 0 18px 40px -30px rgba(16, 28, 46, .35);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --display: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font-family: inherit; }
select, input { font-family: inherit; }

.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */

.topbar {
  background:
    radial-gradient(900px 220px at 12% -60%, rgba(217, 183, 104, .18), transparent 70%),
    linear-gradient(120deg, #0b1b30 0%, #10263f 55%, #14304d 100%);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.topbar-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 32px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 18px; }

.monogram {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(217, 183, 104, .55);
  background: linear-gradient(150deg, rgba(217, 183, 104, .22), rgba(217, 183, 104, .04));
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .06em;
  color: #f2dfae;
  flex: 0 0 auto;
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #d9b768;
  font-weight: 600;
  margin-bottom: 4px;
}

.topbar h1 {
  font-family: var(--display);
  font-size: 27px;
  letter-spacing: .01em;
  font-weight: 500;
  line-height: 1.15;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #c2cfdd;
}

.meta-pill {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .05);
  border-radius: 999px;
  padding: 6px 12px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.meta-pill strong { color: #fff; font-weight: 600; }

/* ---------- toolbar ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px -16px rgba(16, 28, 46, .5);
}

.toolbar-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.tabs { display: flex; gap: 6px; background: #eef1f5; border-radius: 12px; padding: 4px; }

.tab {
  border: 0;
  background: transparent;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}

.tab .tab-no {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  background: #fff;
}

.tab:hover { color: var(--ink); }

.tab.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(13, 32, 56, .8);
}

.tab.active .tab-no { color: #e8cf95; border-color: rgba(232, 207, 149, .4); background: transparent; }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.scope-toggle {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.scope-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.scope-toggle button:hover { color: var(--ink); }

.scope-toggle button.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(13, 32, 56, .8);
}

.scope-toggle button:focus-visible { outline: 2px solid var(--navy-3); outline-offset: 1px; }

.field.branch select { max-width: 228px; }

.field {
  position: relative;
  display: flex;
  align-items: center;
}

.field select,
.field input {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  border-radius: 9px;
  padding: 9px 30px 9px 11px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  max-width: 200px;
}

.field input { padding-right: 11px; cursor: text; width: 190px; }

.field select:hover, .field input:hover { border-color: #c8d1dd; }

.field select:focus, .field input:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(36, 70, 106, .12);
}

.field::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field.search::after { display: none; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  border-radius: 9px;
  padding: 9px 13px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn .btn-ico { flex: none; }
.btn:hover { border-color: #c4ceda; color: var(--ink); }

.btn.gold {
  background: var(--gold-soft);
  border-color: #e5d3a6;
  color: #6d5316;
}

.btn.gold:hover { background: #f1e4c4; }

.btn:focus-visible, .tab:focus-visible, .kpi-card:focus-visible, tbody tr:focus-visible {
  outline: 2px solid var(--navy-3);
  outline-offset: 2px;
}

/* ---------- data refresh bar ---------- */

.databar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.databar-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 9px 32px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.databar-lead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.databar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  flex: none;
}

.databtn .fname {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
}

.databtn .fname:empty { display: none; }

.databtn.has-file {
  background: var(--gold-soft);
  border-color: #e5d3a6;
  color: #6d5316;
}

.databtn.has-file .fname { color: #6d5316; }

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn:disabled:hover { border-color: var(--line); color: var(--ink-2); }

.dstatus {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dstatus[data-state="busy"] { color: var(--info); }
.dstatus[data-state="ok"] { color: var(--good); font-weight: 600; }
.dstatus[data-state="err"] { color: var(--bad); font-weight: 600; }

/* ---------- layout ---------- */

main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 32px 40px;
}

.page[hidden] { display: none; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-head h2 {
  font-family: var(--display);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.1;
}

.scope {
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}

.scope strong { color: var(--ink); font-weight: 600; }

.weightbar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.wchip {
  font-size: 10.5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 6px;
  padding: 3px 7px;
}

.wchip b { color: var(--ink); font-weight: 700; }

.wchip.gold { border-color: #e7d5a8; background: var(--gold-soft); color: #6d5316; }
.wchip.gold b { color: #5f4712; }

/* ---------- KPI cards ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px 13px;
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  text-align: left;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--navy-3) 55%, var(--gold));
  opacity: 0;
  transition: opacity .16s ease;
}

.kpi-card:hover { transform: translateY(-1px); border-color: #cfd8e4; }
.kpi-card:hover::before { opacity: 1; }
.kpi-card.is-spotlight { border-color: #c9b071; box-shadow: 0 0 0 1px #e7d8b4, var(--shadow); }
.kpi-card.is-spotlight::before { opacity: 1; }

.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.kpi-name {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.35;
}

.kpi-weight {
  font-size: 10px;
  font-weight: 700;
  color: #6d5316;
  background: var(--gold-soft);
  border: 1px solid #ecdcb4;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}

.kpi-weight.muted { color: var(--muted); background: #f2f4f7; border-color: var(--line); }

.kpi-weight.scored { font-variant-numeric: tabular-nums; cursor: help; }
.kpi-weight.scored b { font-weight: 800; color: #4a3608; }

.kpi-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-top: 8px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-value .sub-val { font-size: 15px; color: var(--muted); font-weight: 600; }

.kpi-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 9px;
  border-radius: 50%;
  background: #0d7357;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 5px;
  cursor: default;
}

.kpi-sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kpi-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: #c3ccd8; }

.kpi-nat { margin-top: 1px; font-size: 10.5px; }
.kpi-nat b { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kpi-nat .arr { font-size: 8.5px; line-height: 1; }
.kpi-nat .arr.pos { color: var(--good); }
.kpi-nat .arr.neg { color: var(--bad); }
.kpi-nat .arr.flat { color: #97a3b5; }

.kpi-lb { border-top: 1px solid var(--line-2); margin-top: 2px; padding-top: 6px; }
.kpi-lb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.kpi-lb-head span:last-child { color: #8b98ab; letter-spacing: .08em; }
.kpi-lb-row { display: flex; align-items: baseline; gap: 7px; font-size: 11px; line-height: 1.6; }
.kpi-lb-row .r { flex: none; width: 9px; color: #8b98ab; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-lb-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.kpi-lb-row .nr { flex: none; font-size: 9px; font-weight: 600; color: #8b98ab; }
.kpi-lb-row .vv { flex: none; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-lb-row.first .r { color: var(--gold); }
.kpi-lb-row.first .nm { color: var(--ink); font-weight: 600; }

.hist {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
  margin: 9px 0 7px;
}

.hist .hcol {
  flex: 1;
  min-width: 2px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 2px;
}

.hist .hcol[data-hist] { cursor: pointer; }
.hist .hcol[data-hist]:hover { background: rgba(29, 74, 114, .08); }

.hist .hcol i {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: #d4dde8;
}

.hist .hcol[data-hist] i { min-height: 3px; }

.hist .hcol.hot i { background: var(--navy-3); }

.hist-pop {
  position: absolute;
  z-index: 95;
  width: 248px;
  max-width: calc(100vw - 24px);
  max-height: 300px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hist-pop[hidden] { display: none; }

.hp-head {
  padding: 8px 11px 7px;
  border-bottom: 1px solid var(--line-2);
  background: #fbfcfe;
}

.hp-head b { display: block; font-size: 12px; color: var(--ink); }
.hp-head span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }

.hp-list { overflow: auto; padding: 4px; }

.hp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 11.5px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.hp-row:hover { background: #f1f5fa; }
.hp-row .v { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.kpi-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.8px;
  color: var(--muted);
  border-top: 1px solid var(--line-2);
  padding-top: 8px;
}

.kpi-foot b { color: var(--ink); font-weight: 600; }
.kpi-foot .top-branch { overflow: hidden; text-overflow: ellipsis; }

/* ---------- panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}

.panel-head h3 {
  font-size: 13.5px;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  gap: 9px;
}

.panel-head h3::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--gold);
}

.panel-head .hint { font-size: 11px; color: var(--muted); }

.panel-body { padding: 16px 18px; }

/* ---------- table ---------- */

.table-wrap {
  overflow: auto;
  max-height: 660px;
  scrollbar-width: thin;
}

.table-wrap.compact { max-height: none; overflow-y: visible; }
.table-wrap.compact thead th { position: static; }
.table-wrap.compact tbody td { padding: 4px 10px; }
.table-wrap.compact .rank-badge { width: 21px; height: 21px; font-size: 10px; border-radius: 6px; }
.table-wrap.compact .branch-cell .bn { font-size: 12px; }
.table-wrap.compact .branch-cell .bm { margin-top: 0; font-size: 10px; }
.table-wrap.compact .fom-cell .fn { font-size: 11.2px; }
.table-wrap.compact .spark { height: 18px; width: 64px; }

table { border-collapse: separate; border-spacing: 0; width: 100%; }

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f7f9fb;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: right;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

thead th:hover { color: var(--ink); background: #f1f5f9; }
thead th.left { text-align: left; }
thead th.sorted { color: var(--navy); }
thead th.sorted::after { content: " ▾"; font-size: 9px; }
thead th.sorted.asc::after { content: " ▴"; }
thead th.sticky-l1 { left: 0; z-index: 7; }
thead th.sticky-l2 { left: 52px; z-index: 7; }

tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  background: #fff;
  white-space: nowrap;
}

tbody tr { cursor: pointer; transition: background .12s ease; }
tbody tr:hover td { background: #f7fafd; }
tbody tr:nth-child(3n) td { background: #fcfdfe; }
tbody tr:hover td { background: #f4f8fc; }

td.sticky-l1, td.sticky-l2 { z-index: 3; }
td.sticky-l1 { left: 0; }
td.sticky-l2 { left: 52px; }

tbody td.left { text-align: left; }

.rank-cell { width: 52px; }

.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #f0f3f7;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rank-badge.g1 { background: #0c2f55; color: #ffffff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 3px 8px -4px rgba(12, 47, 85, .8); }
.rank-badge.g2 { background: #1e5f92; color: #ffffff; box-shadow: inset 0 0 0 1px rgba(8, 30, 52, .35); }
.rank-badge.g3 { background: #3577ab; color: #ffffff; box-shadow: inset 0 0 0 1px rgba(8, 30, 52, .3); }
.rank-cell .rk2 { font-size: 8.5px; font-weight: 600; color: #8b98ab; margin-top: 1px; white-space: nowrap; letter-spacing: .01em; }

.branch-cell { min-width: 186px; }
.branch-cell .bn { font-size: 12.5px; font-weight: 600; color: var(--ink); letter-spacing: .005em; }
.branch-cell .bm { font-size: 10.5px; color: var(--muted); margin-top: 1px; display: flex; gap: 6px; align-items: center; }
.branch-cell .bm .sep { width: 2px; height: 2px; border-radius: 50%; background: #c3ccd8; }

.fom-cell { min-width: 148px; }
.fom-cell .fn { font-size: 11.8px; color: var(--ink-2); }
.fom-cell .fd { font-size: 10.3px; color: var(--muted); margin-top: 1px; }

.val { font-weight: 600; color: var(--ink); }
.val.neg { color: var(--bad); }
.val.pos { color: var(--good); }

.chip {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 1px 5px;
  border-radius: 5px;
  margin-left: 5px;
  vertical-align: 1px;
  background: #f1f4f8;
  color: #61708a;
  font-variant-numeric: tabular-nums;
}

.chip.t1 { background: #0c2f55; color: #ffffff; }
.chip.t2 { background: #1e5f92; color: #ffffff; }
.chip.t3 { background: #3577ab; color: #ffffff; }
.chip.low { background: var(--bad-bg); color: var(--bad); }

.seg {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef2f7;
  color: #4c5c74;
  border: 1px solid #e2e8f0;
}

.seg[data-s="A-Diamond"] { background: #eaf2fb; color: #1a5a93; border-color: #d3e4f6; }
.seg[data-s="B-Titanium"] { background: #eef0f4; color: #4d5666; border-color: #dfe3ea; }
.seg[data-s="C-Platinum"] { background: #f0f0f7; color: #534a7d; border-color: #e3e2ef; }
.seg[data-s="D-Gold"] { background: var(--gold-soft); color: #745a19; border-color: #ecdcb4; }
.seg[data-s="E-Silver"] { background: #f3f5f8; color: #59667a; border-color: #e6eaf0; }
.seg[data-s="F-Express"] { background: #ecf5f1; color: #23654f; border-color: #d8ebe3; }
.seg[data-s="G-Satellite"] { background: #f6f1ea; color: #75583a; border-color: #eadfd1; }

.spark { display: block; }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 18px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  flex-wrap: wrap;
}

.legend { display: flex; gap: 12px; align-items: center; font-size: 10.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.muted { color: var(--muted); }

.kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.support-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 16px 18px 18px;
}

.sup-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sup-top span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--muted); }
.sup-top b { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sup-top small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.sup-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.sup-bar { height: 7px; background: #eef2f7; border-radius: 4px; overflow: hidden; margin-top: 9px; }
.sup-bar i { display: block; height: 100%; background: linear-gradient(90deg, #13294b, #4a7ea9); border-radius: 4px; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-top: 9px; background: #eef2f7; }
.stack i { display: block; height: 100%; }
.sup-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 7px; font-size: 10px; color: var(--muted); }
.sup-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sup-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

.watch-head {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 46px;
  gap: 10px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-2);
}
.watch-head span:last-child { text-align: right; }
.watch-row {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 46px;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  margin: 0 -4px;
  border-radius: 7px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-2);
}
.watch-row:hover { background: #f5f8fb; }
.wr-name b { display: block; font-size: 11.8px; font-weight: 600; }
.wr-name span { display: block; font-size: 9.8px; color: var(--muted); }
.wr-flags { display: flex; flex-wrap: wrap; gap: 3px; }
.wr-score { text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.watch-foot { font-size: 9.8px; color: var(--muted); margin-top: 9px; line-height: 1.5; }

.pstats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pstats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portfolio-best { margin-top: 10px; font-size: 11.5px; color: var(--ink-2); }
.portfolio-note { margin-top: 6px; font-size: 10.5px; color: var(--muted); line-height: 1.55; }
.portfolio-note b { color: var(--ink-2); font-weight: 600; }
.pstat { background: #f8fafc; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.pstat[data-tip] { cursor: help; }
.pstat[data-tip]:hover { background: #f1f5fa; border-color: #dbe4ee; }
.pstat .l { font-size: 8.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.pstat .v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pstat .s { font-size: 9.5px; color: var(--muted); }

.insight.full { grid-column: 1 / -1; }

tbody td.sticky-l1, tbody td.sticky-l2 { position: sticky; }
thead th.sticky-l1 { left: 0; }
thead th.sticky-l2 { left: 52px; }
.rank-cell { width: 52px; min-width: 52px; max-width: 52px; padding-left: 9px; padding-right: 6px; }

/* ---------- two column ---------- */

.cols {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.cols > .panel { margin-bottom: 0; }

.pills { display: flex; gap: 5px; flex-wrap: wrap; }

.pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 9px;
  cursor: pointer;
  transition: all .14s ease;
}

.pill:hover { border-color: #c3cddb; }

.pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.leader-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }

.lb-head {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 700;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 7px;
}

.lb-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s ease;
}

.lb-row:hover { background: #f5f8fb; }
.lb-pos { font-size: 10px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-name { font-size: 11.6px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name .bar { display: block; height: 3px; border-radius: 2px; background: #dfe7f1; margin-top: 4px; overflow: hidden; }
.lb-name .bar i { display: block; height: 100%; background: var(--navy-3); border-radius: 2px; }
.lb-val { font-size: 11.6px; font-weight: 700; font-variant-numeric: tabular-nums; }

.lb-row.bad .lb-name .bar i { background: #c98a80; }
.lb-row.bad .lb-val { color: var(--bad); }

/* division table */

.div-table { width: 100%; }
.div-table th { position: static; background: transparent; padding: 0 0 7px; cursor: default; border-bottom: 1px solid var(--line-2); }
.div-table th:hover { background: transparent; }
.div-table td { border: 0; padding: 7px 0; font-size: 11.8px; background: transparent !important; cursor: default; }
.div-table tr:hover td { background: transparent !important; }
.div-table .dname { text-align: left; font-weight: 600; color: var(--ink-2); }
.div-table .dbar { width: 34%; }
.dbar-track { height: 5px; background: #eef1f6; border-radius: 3px; overflow: hidden; }
.dbar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-3), #4a7ea9); border-radius: 3px; }
.div-table .dnum { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.div-table .dcount { text-align: right; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }

.div-notes {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line-2);
}

.div-notes .dn-head {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 7px;
}

.div-notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.div-notes li { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.div-notes b { color: var(--ink); }

/* ---------- chart tooltip ---------- */

.tip {
  position: fixed;
  z-index: 240;
  left: 0;
  top: 0;
  max-width: 290px;
  padding: 7px 10px;
  background: #102641;
  color: #e8eef6;
  font-size: 11px;
  line-height: 1.55;
  border-radius: 8px;
  box-shadow: 0 12px 28px -12px rgba(5, 14, 25, .75);
  pointer-events: none;
}

.tip b { color: #f0dcab; }
.tip .t-dim { color: #9fadc0; }

/* ---------- analysis ---------- */

.analysis {
  background: linear-gradient(180deg, #fbfcfe, #f7f9fb);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 6px;
  box-shadow: var(--shadow);
  margin-top: 4px;
}

.analysis-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.analysis-top h3 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
}

.analysis-top span { font-size: 11px; color: var(--muted); }

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.insight {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px 15px 13px;
  min-width: 0;
}

.insight.wide { grid-column: span 2; }
.insight.dark {
  background: linear-gradient(145deg, #102641, #16324f);
  border-color: #1d3d5e;
  color: #e8eef6;
}

.insight h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.insight.dark h4 { color: var(--gold-2); }

.insight p {
  font-size: 12.4px;
  line-height: 1.62;
  color: var(--ink-2);
}

.insight.dark p { color: #cfdcea; }
.insight p + p { margin-top: 8px; }
.insight p.ana-note {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.insight.dark p.branch-cmp {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-left: 2px solid var(--gold-2);
  border-radius: 6px;
  background: rgba(255, 255, 255, .055);
  color: #dfe9f4;
}
.cmp-wrap { overflow-x: auto; margin-top: 2px; }
.cmp-table th, .cmp-table td { white-space: nowrap; }
.cmp-table td.l, .cmp-table th.l { position: sticky; left: 0; background: #fff; }
.insight b { color: var(--ink); font-weight: 600; }
.insight.dark b { color: #fff; }
.insight .em-good { color: var(--good); font-weight: 600; }
.insight.dark .em-good { color: #7fd7b6; }
.insight .em-bad { color: var(--bad); font-weight: 600; }
.insight.dark .em-bad { color: #f0a49a; }
.insight .em-warn { color: var(--warn); font-weight: 600; }
.insight.dark .em-warn { color: #ecc978; }

.mini-table { width: 100%; margin-top: 2px; }
.mini-table th {
  position: static;
  background: transparent;
  border-bottom: 1px solid var(--line-2);
  padding: 0 0 6px;
  font-size: 9px;
  cursor: default;
}
.mini-table th:hover { background: transparent; }
.mini-table td {
  border: 0;
  padding: 6px 0;
  font-size: 11.5px;
  background: transparent !important;
  text-align: right;
}
.mini-table tr:hover td { background: transparent !important; }
.mini-table tr[data-tip] { cursor: help; }
.mini-table tr[data-tip]:hover td { background: #f6f9fc !important; }
.mini-table td[data-tip] { cursor: help; }
.mini-table td.l { text-align: left; color: var(--ink-2); }
.mini-table .mbar { display: inline-block; width: 44px; height: 4px; border-radius: 2px; background: #eef1f6; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.mini-table .mbar i { display: block; height: 100%; background: var(--navy-3); }
.pareto-table td { padding: 5px 0; }
.pareto-table td:nth-child(3) .mbar { width: 58px; margin-left: 6px; margin-right: 0; }
.pareto-table .pareto-sel { font-weight: 700; color: var(--ink); }
.pareto-table tbody tr.pareto-other td { border-top: 1px solid var(--line-2); color: var(--muted); }

.actions { list-style: none; margin: 0; padding: 0; }
.actions li {
  position: relative;
  padding: 0 0 9px 18px;
  font-size: 12.2px;
  line-height: 1.55;
  color: var(--ink-2);
}
.actions li:last-child { padding-bottom: 0; }
.actions li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--gold);
}
.actions b { color: var(--ink); }

.flag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: 1px 5px; margin: 1px 3px 1px 0; white-space: nowrap; }
.flag.bad { background: var(--bad-bg); color: var(--bad); }
.flag.warn { background: var(--warn-bg); color: var(--warn); }
.flag.info { background: var(--info-bg); color: var(--info); }
.flag.good { background: var(--good-bg); color: var(--good); }

/* ---------- drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 38, .42);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 80;
}

.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: 760px;
  max-width: 94vw;
  background: #f7f9fb;
  z-index: 90;
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.22, .7, .3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 70px -40px rgba(6, 18, 32, .65);
}

.drawer.open { transform: translateX(0); }

.drawer-head {
  background:
    radial-gradient(600px 180px at 20% -40%, rgba(217, 183, 104, .2), transparent 70%),
    linear-gradient(130deg, #0c1e34, #14304d);
  color: #fff;
  padding: 20px 26px 18px;
  position: relative;
  flex: 0 0 auto;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
}

.drawer-close:hover { background: rgba(255, 255, 255, .14); }

.drawer-actions {
  position: absolute;
  top: 16px;
  right: 60px;
  display: flex;
  gap: 7px;
  z-index: 2;
}

.drawer-print {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease;
}

.drawer-print:hover { background: rgba(255, 255, 255, .14); }
.drawer-print svg { flex: none; }
.d-print-note { display: none; }

@media (max-width: 520px) {
  .drawer-actions { right: 56px; gap: 6px; }
  .drawer-print { padding: 0 9px; }
  .drawer-print .dp-txt { display: none; }
}

.drawer-head .d-eyebrow {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #d9b768;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.drawer-head h2 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  margin: 7px 0 4px;
  letter-spacing: .01em;
}

.drawer-head .d-meta { font-size: 11.5px; color: #b9c8d9; display: flex; gap: 10px; flex-wrap: wrap; }
.drawer-head .d-meta .sep { color: #4f6d8c; }
.drawer-head .d-meta span[data-tip] { cursor: help; }

.drawer-body { overflow-y: auto; padding: 18px 22px 34px; flex: 1 1 auto; }

.d-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 16px; }

.d-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.d-tile .l { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.d-tile .v { font-size: 19px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.d-tile .r { font-size: 10px; color: var(--muted); margin-top: 1px; }
.d-tile .r2 { font-size: 9.5px; color: #8b98ab; }
.d-tile .v.neg { color: var(--bad); }
.d-tile .v.pos { color: var(--good); }

.d-sec { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }

.d-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line-2);
}

.d-sec-head h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); }
.d-sec-head span { font-size: 10px; color: var(--muted); }
.d-sec-body { padding: 13px 15px; }

.pts-row { display: grid; grid-template-columns: 118px 1fr 74px 44px; gap: 10px; align-items: center; padding: 7px 0; }
.pts-row + .pts-row { border-top: 1px solid var(--line-2); }
.pts-label { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.pts-label small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.pts-track { height: 7px; border-radius: 4px; background: #eef2f7; overflow: hidden; position: relative; }
.pts-track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--navy-3), #5286b1); }
.pts-track i.full { background: linear-gradient(90deg, #12805f, #3fb28c); }
.pts-track i.low { background: linear-gradient(90deg, #b4573f, #d08a6f); }
.pts-val { font-size: 11px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.pts-val b { color: var(--ink); font-size: 12px; }
.pts-max { font-size: 10px; text-align: right; color: var(--muted); }

.pts-note {
  font-size: 9.8px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line-2);
}

.chart-wrap { padding: 6px 4px 2px; }
.chart { width: 100%; height: auto; display: block; }

.kpi-rows { width: 100%; }
.kpi-rows th {
  position: static; background: transparent; border-bottom: 1px solid var(--line-2);
  padding: 0 6px 6px; font-size: 9px; cursor: default;
}
.kpi-rows th:hover { background: transparent; }
.kpi-rows td { border: 0; padding: 8px 6px; background: transparent !important; font-size: 11.8px; text-align: right; }
.kpi-rows tr:hover td { background: transparent !important; }
.kpi-rows td.l { text-align: left; color: var(--ink-2); font-weight: 600; }
.kpi-rows td .muted { color: var(--muted); font-size: 10.5px; }
.kpi-rows td .rk2 { font-size: 9.5px; color: #8b98ab; margin-top: 2px; }
.kpi-rows tr + tr td { border-top: 1px solid var(--line-2); }

.pctbar { height: 5px; border-radius: 3px; background: #eef2f7; overflow: hidden; width: 100%; }
.pctbar i { display: block; height: 100%; background: var(--navy-3); border-radius: 3px; }
.pctbar i.low { background: #c4665a; }

.month-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mchip {
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 7px;
  padding: 5px 6px;
  text-align: center;
  font-size: 9.5px;
  color: var(--muted);
  line-height: 1.35;
}
.mchip .m { font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #93a1b4; }
.mchip .x { font-size: 11px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mchip.good { background: var(--good-bg); border-color: #cfe9df; }
.mchip.good .x { color: var(--good); }
.mchip.bad { background: var(--bad-bg); border-color: #f2d4cf; }
.mchip.bad .x { color: var(--bad); }
.mchip.warn { background: var(--warn-bg); border-color: #f0e2bd; }
.mchip.warn .x { color: var(--warn); }
.mchip.na { opacity: .55; }

.prof-fin { display: flex; gap: 6px; margin-top: 6px; }
.pf-item {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 7px;
}
.pf-l { font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #93a1b4; }
.pf-v { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pf-v.pos { color: var(--good); }
.pf-v.neg { color: var(--bad); }
.pf-v.na { color: var(--muted); }

.pf-item.pf-pos { background: #dff1e8; border-color: #b3dccb; }
.pf-item.pf-neg { background: #f9e0db; border-color: #e9b7ae; }
.pf-item.pf-pos .pf-l,
.pf-item.pf-pos .pf-v { color: #0a5a43; }
.pf-item.pf-neg .pf-l,
.pf-item.pf-neg .pf-v { color: #8c1b13; }

.ops-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.ops-card { border: 1px solid var(--line-2); background: #fbfcfd; border-radius: 9px; padding: 10px 12px; }
.ops-card .oh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ops-card .oh .on { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--muted); }
.ops-card .oh .ov { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ops-card .os { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.ops-card .mini { margin-top: 8px; font-size: 10px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }

.d-insights { background: #102641; color: #dbe5ef; border-radius: 12px; padding: 14px 16px; }
.d-insights h4 { font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 9px; }
.d-insights ul { margin: 0; padding-left: 16px; }
.d-insights li { font-size: 11.8px; line-height: 1.6; margin-bottom: 6px; }
.d-insights li:last-child { margin-bottom: 0; }
.d-insights b { color: #fff; }

/* ---------- footer ---------- */

footer {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 32px 40px;
  font-size: 10.8px;
  color: var(--muted);
  line-height: 1.7;
}

footer .rule { height: 1px; background: var(--line); margin-bottom: 14px; }
footer b { color: var(--ink-2); font-weight: 600; }

/* ---------- pareto card ---------- */

.pareto-card { padding: 16px 17px 15px; }

.pareto-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pareto-head h4 { margin-bottom: 3px; }
.pareto-sub { font-size: 11px; color: var(--muted); }
.pareto-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pareto-field select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 600 11.5px var(--font);
  padding: 0 26px 0 10px;
  cursor: pointer;
  max-width: 230px;
}

.btn-review {
  height: 32px;
  padding: 0 13px;
  font-size: 11.5px;
  background: var(--navy-2);
  border-color: var(--navy-2);
  color: #fff;
}

.btn-review:hover { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }

.pareto-split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pareto-chartwrap, .pareto-tablewrap { min-width: 0; }
.pareto-chart { width: 100%; height: auto; display: block; }
.pareto-chart rect { cursor: help; }

.pareto-legend {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 10px;
  color: var(--muted);
}

.pareto-legend i {
  display: inline-block;
  width: 10px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

.pareto-legend .lg-bar { background: #b1872f; }
.pareto-legend .lg-line { width: 12px; height: 0; border-top: 2px solid #1d4a72; border-radius: 0; background: none; vertical-align: 2px; }
.pareto-legend .lg-cut { width: 0; height: 10px; background: none; border-left: 1px dashed #1d4a72; border-radius: 0; vertical-align: -1px; }

.pareto-tail { margin-top: 5px; font-size: 10px; color: var(--muted); line-height: 1.5; }

.pareto-headline {
  margin-top: 9px;
  font-size: 11.8px;
  line-height: 1.55;
  color: var(--ink-2);
}

.pareto-headline b { color: var(--ink); font-weight: 700; }
.pareto-empty { padding: 18px 14px; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; }
.pareto-table td { font-size: 11px; }

.pareto-strategy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ps-col {
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 10px 12px;
}

.ps-col:first-child { border-color: #e5d3a6; background: #fdf8ec; }

.ps-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

.ps-col p { font-size: 11px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.ps-col b { color: var(--ink); font-weight: 700; }

.pareto-sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 16px 0 9px; }
.pareto-sec-head h5 { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.pareto-sec-head span { font-size: 10.5px; color: var(--muted); }

.mx-wrap { padding-left: 2px; }
.mx-y, .mx-x { font-size: 9px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mx-y { margin-bottom: 6px; }
.mx-x { margin-top: 6px; text-align: right; }
.mx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.mx-quad {
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 9px 11px 10px;
  background: #fbfcfd;
  min-height: 62px;
}

.mx-quad.q-act { background: #fdf3ec; border-color: #eed9c6; }
.mx-quad.q-plan { background: #faf6ea; border-color: #e9e0cb; }
.mx-quad.q-quick { background: #f1f7f3; border-color: #d9e8de; }
.mx-quad.q-watch { background: #f7f9fb; }

.mx-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.mx-h b { font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.mx-h span { font-size: 9.5px; color: var(--muted); }
.mx-items { display: flex; flex-wrap: wrap; gap: 5px; }

.mx-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10px;
  color: var(--ink-2);
  cursor: help;
}

.mx-chip b { font-weight: 600; color: var(--ink); }
.mx-chip i { font-style: normal; font-size: 9px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.mx-chip.sm { font-size: 9.5px; padding: 2px 5px; }
.mx-empty { color: var(--muted); font-size: 10.5px; }

/* ---------- business review ---------- */

.rv-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 32, .55);
  backdrop-filter: blur(3px);
  z-index: 110;
}

.rv-modal {
  position: fixed;
  top: 3vh;
  bottom: 3vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(880px, 94vw);
  background: #f6f8fb;
  border-radius: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(4, 14, 28, .8);
}

.rv-modal[hidden], .rv-scrim[hidden] { display: none; }

.rv-head {
  background:
    radial-gradient(620px 180px at 18% -40%, rgba(217, 183, 104, .22), transparent 70%),
    linear-gradient(130deg, #0c1e34, #14304d);
  color: #fff;
  padding: 19px 24px 17px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}

.rv-eyebrow { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2); font-weight: 700; }
.rv-head h2 { font-family: var(--display); font-size: 25px; font-weight: 500; margin: 5px 0 3px; letter-spacing: .01em; }
.rv-sub { font-size: 11px; color: #bbc9db; }

.rv-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.rv-close:hover { background: rgba(255, 255, 255, .14); }

.rv-body {
  padding: 15px 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rv-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }
.rv-stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.rv-stat .l { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-stat .v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; color: var(--ink); }
.rv-stat .s { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rv-sec { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px 14px; margin-bottom: 11px; }
.rv-sec-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.rv-no { font-size: 9.5px; font-weight: 700; color: var(--gold); letter-spacing: .08em; }
.rv-sec h3 { font-family: var(--display); font-size: 16.5px; font-weight: 500; color: var(--ink); }
.rv-sec p { font-size: 12.2px; line-height: 1.62; color: var(--ink-2); }
.rv-sec b { color: var(--ink); font-weight: 600; }
.rv-sec .pareto-chart { margin-top: 9px; }
.rv-sec .pareto-legend { margin-top: 4px; }

.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.rv-chips span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--gold-soft);
  color: #6d5320;
  border-radius: 5px;
  padding: 2px 7px;
}

.rv-focus { margin-top: 10px; border-top: 1px solid var(--line-2); }

.rv-focus-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 78px 52px 52px;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 11.3px;
  align-items: baseline;
}

.rv-focus-row:last-child { border-bottom: 0; }
.rf-r { font-size: 9px; color: var(--muted); font-weight: 700; }
.rf-n { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-v, .rf-s, .rf-c { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rf-c { color: var(--gold); font-weight: 700; }
.rv-focus-more { padding: 7px 0 0; font-size: 10.5px; color: var(--muted); }

.rv-bench { display: grid; gap: 8px; margin: 10px 0 8px; }

.rv-bench-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 74px minmax(0, 1.4fr);
  gap: 10px;
  align-items: baseline;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 11.3px;
}

.rv-bench-row b { color: var(--ink); }
.rv-bench-row span { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 10.5px; }
.rv-bench-row em { font-style: normal; color: var(--ink-2); text-align: right; }
.rv-note { font-size: 11.3px; color: var(--muted); margin-top: 4px; }

.rv-actions { list-style: none; margin: 6px 0 0; padding: 0; }
.rv-actions li { position: relative; padding: 0 0 9px 17px; font-size: 12.1px; line-height: 1.58; color: var(--ink-2); }
.rv-actions li:last-child { padding-bottom: 0; }
.rv-actions li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 2px; background: var(--gold); }
.rv-actions b { color: var(--ink); }

.rv-foot { margin-top: 4px; font-size: 10px; color: var(--muted); line-height: 1.55; }

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .insight.wide { grid-column: span 2; }
  .insight.full { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .topbar-inner, .toolbar-inner, .databar-inner, main, footer { padding-left: 16px; padding-right: 16px; }
  .dstatus { width: 100%; margin-left: 0; }
  .topbar h1 { font-size: 21px; }
  .topbar-meta { display: none; }
  .toolbar { position: static; }
  .filters { width: 100%; }
  .field select { flex: 1; max-width: none; }
  .field { flex: 1; }
  .scope-toggle { width: 100%; }
  .scope-toggle button { flex: 1; }
  .field.branch { flex-basis: 100%; }
  .field.branch select { max-width: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-grid.four { grid-template-columns: 1fr; }
  .support-body { grid-template-columns: 1fr; gap: 16px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .insight.wide { grid-column: span 1; }
  .pstats.four { grid-template-columns: 1fr 1fr; }
  .page-head h2 { font-size: 24px; }
  .scope { text-align: left; }
  .leader-list { grid-template-columns: 1fr; gap: 0; }
  .d-tiles { grid-template-columns: repeat(2, 1fr); }
  .ops-grid { grid-template-columns: 1fr; }
  .pts-row { grid-template-columns: 96px 1fr 64px; }
  .pts-max { display: none; }
  .drawer { width: 100%; max-width: 100%; }
  .pareto-split { grid-template-columns: 1fr; gap: 12px; }
  .pareto-strategy { grid-template-columns: 1fr; }
  .rv-modal { top: 2vh; bottom: 2vh; width: 96vw; }
  .rv-stats { grid-template-columns: 1fr 1fr; }
  .rv-sec { padding: 12px 13px; }
}

@media (max-width: 520px) {
  .pareto-head { gap: 8px; }
  .pareto-tools { width: 100%; }
  .pareto-field { flex: 1; }
  .pareto-field select { width: 100%; max-width: none; }
  .mx-grid { grid-template-columns: 1fr; }
  .mx-h span { display: none; }
  .rv-focus-row { grid-template-columns: 16px minmax(0, 1fr) 64px 44px; }
  .rf-s { display: none; }
  .rv-bench-row { grid-template-columns: 1fr; gap: 3px; }
  .rv-bench-row em { text-align: left; }
  .rv-head { padding: 15px 16px 14px; }
  .rv-head h2 { font-size: 21px; }
  .rv-body { padding: 12px 12px 18px; }
}

/* ---------- print ---------- */

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  @page branch-report {
    size: A4 portrait;
    margin: 10mm 10mm 13mm;
    @bottom-right {
      content: counter(page) " / " counter(pages);
      font: 8.5pt "Segoe UI", Arial, sans-serif;
      color: #74839a;
      text-align: right;
    }
  }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 9px; }
  .topbar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar-inner { padding: 9px 0 8px; }
  .topbar h1 { font-size: 17px; }
  .toolbar, .databar, .scrim, .drawer, .tip, .hist-pop, .table-foot .legend, .rv-scrim, .rv-modal, .pareto-tools { display: none !important; }
  main { max-width: none; padding: 6px 0; }
  .page-head { margin-bottom: 10px; }
  .page-head h2 { font-size: 18px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
  .kpi-card { padding: 9px 11px; }
  .kpi-ok { width: 13px; height: 13px; margin-left: 6px; font-size: 8.5px; vertical-align: 3px; }
  .panel { margin-bottom: 10px; }
  .panel-head { padding: 8px 12px 7px; }
  .panel-body { padding: 10px 12px; }
  .table-wrap { max-height: none; overflow: visible; }
  thead { position: static; }
  thead th { position: static; padding: 6px 8px; font-size: 8.5px; }
  tbody td { padding: 3px 8px; font-size: 9.5px; }
  .rank-cell { width: 38px; }
  .rank-badge { width: 17px; height: 17px; font-size: 9px; border-radius: 5px; }
  .rank-cell .rk2 { font-size: 7.5px; }
  .branch-cell { min-width: 130px; }
  .branch-cell .bn { font-size: 10px; }
  .branch-cell .bm { font-size: 8.5px; margin-top: 0; }
  .fom-cell { min-width: 100px; }
  .fom-cell .fn { font-size: 9px; }
  .fom-cell .fd { font-size: 8.5px; }
  .spark { width: 56px; height: 14px; }
  .analysis { padding: 12px 14px 2px; }
  .analysis-grid { gap: 8px; }
  .insight { padding: 10px 12px; }
  .insight p { font-size: 9.8px; line-height: 1.5; }
  .panel, .insight, .kpi-card { box-shadow: none; }
  .insight, .kpi-card { break-inside: avoid; }
  .pareto-card { break-inside: avoid; padding: 10px 12px; }
  .pareto-head { margin-bottom: 8px; }
  .pareto-split { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 10px; }
  .pareto-strategy { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
  .ps-col, .mx-quad { break-inside: avoid; padding: 7px 9px; }
  .ps-col p, .pareto-headline { font-size: 9.6px; line-height: 1.45; }
  .mx-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .mx-chip { font-size: 9px; }
  td.sticky-l1, td.sticky-l2 { position: static; }
  .page[hidden] { display: none; }
  body.printing .page[hidden] { display: block; }
  #page2 { break-before: page; }
  footer { break-inside: avoid; }
  .table-wrap:not(.compact) tbody tr:nth-child(n+40) { display: none; }

  body.printing-drawer .topbar,
  body.printing-drawer .toolbar,
  body.printing-drawer .databar,
  body.printing-drawer main,
  body.printing-drawer footer,
  body.printing-drawer .scrim,
  body.printing-drawer .tip,
  body.printing-drawer .hist-pop { display: none !important; }
  body.printing-drawer { overflow: visible; }
  body.printing-drawer .drawer {
    display: block !important;
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    transform: none;
    background: #fff;
    border: 0;
    box-shadow: none;
    page: branch-report;
  }
  body.printing-drawer .drawer-head { padding: 16px 18px 14px; }
  body.printing-drawer .drawer-head h2 { font-size: 24px; }
  body.printing-drawer .drawer-close,
  body.printing-drawer .drawer-actions { display: none !important; }
  body.printing-drawer .d-print-note {
    display: block;
    margin-top: 6px;
    font-size: 9.5px;
    letter-spacing: .04em;
    color: #b9c8d9;
  }
  body.printing-drawer .drawer-body { overflow: visible; height: auto; padding: 12px 0 0; }
  body.printing-drawer .d-tiles,
  body.printing-drawer .d-sec,
  body.printing-drawer .d-insights { break-inside: avoid; }
}
