@font-face {
  font-family: Inter;
  src: url('/fonts/inter-regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url('/fonts/inter-semibold.ttf') format('truetype');
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: Bricolage;
  src: url('/fonts/bricolage-grotesque.ttf') format('truetype');
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  font: 1rem/1.5 Inter, system-ui, sans-serif;
  color: #162742;
  background: #f5f7fb;
  --ink: #12223d;
  --muted: #576781;
  --line: #e0e7f1;
  --accent: #3259bf;
  --font-heading: Bricolage, Inter, system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
button, select, input { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #5683ee; outline-offset: 3px; }
h1, h2, p { margin: 0; }
small { font-size: .8125rem; }
.muted, .subtitle { color: var(--muted); }
.nowrap { white-space: nowrap; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 28px 16px 20px;
  background: #13213a;
  color: #d4deee;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  white-space: nowrap;
  color: #fff;
  font: 650 1.12rem var(--font-heading);
}

.mark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 27px;
  height: 28px;
  padding: 6px;
  border-radius: 7px;
  background: #a8bfff;
}

.mark i { width: 4px; background: #1d387b; border-radius: 1px; }
.mark i:nth-child(1) { height: 6px; }
.mark i:nth-child(2) { height: 11px; }
.mark i:nth-child(3) { height: 16px; }
.sidebar nav, .side-links { display: grid; gap: 5px; }
.sidebar nav a, .side-links a, .side-links button { padding: 10px 12px; border-radius: 8px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; font-size: .875rem; }
.nav-symbol { width: 20px; color: #a6bdef; font-size: 1.16rem; line-height: 1; }
.sidebar nav a:hover, .side-links a:hover, .side-links button:hover { background: #213754; color: #fff; }
.sidebar nav a[aria-current] { background: #263f63; color: #fff; font-weight: 600; }
.side-links { margin-top: auto; border-top: 1px solid #334660; padding-top: 12px; font-size: .875rem; }
.side-links button.text-button { color: inherit; text-align: left; }

main {
  width: min(100%, 1450px);
  margin-inline: auto;
  padding: 36px clamp(22px, 3vw, 48px) 24px;
}

.page-header, .header-actions, .table-controls, .pager, .card-heading { display: flex; gap: 12px; }
.page-header { align-items: center; justify-content: space-between; margin-bottom: 23px; }
.page-header h1 { font: 700 clamp(2.05rem, 3.1vw, 3.4rem)/1.03 var(--font-heading); letter-spacing: -.042em; color: var(--ink); }
.subtitle { margin-top: 9px; }
.header-actions { flex: none; align-items: center; }
.button, select, input {
  border: 1px solid #cfd9e9;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 7px 11px;
  font-size: .875rem;
}
.button { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; }
.button:not(:disabled):hover { border-color: #9bb2df; background: #f0f5ff; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:not(:disabled):hover { background: #24469e; }

.export { position: relative; }
.export summary { list-style: none; }
.export summary::-webkit-details-marker { display: none; }
.chevron { display: inline-block; border-right: 1.5px solid; border-bottom: 1.5px solid; width: 7px; height: 7px; transform: rotate(45deg) translateY(-2px); }
.export-options {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 4;
  display: grid;
  min-width: 205px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 35px #142b501f;
}
.export-options button { border: 0; border-radius: 6px; background: transparent; padding: 8px; text-align: left; color: var(--ink); font-size: .875rem; }
.export-options button:hover { background: #edf3ff; }

.filters {
  display: grid;
  grid-template-columns: minmax(110px, .85fr) minmax(112px, .9fr) minmax(140px, 1.55fr) minmax(108px, .85fr) minmax(116px, .9fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  margin-bottom: 21px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
label { display: grid; gap: 4px; color: var(--muted); font-size: .875rem; }
label select, label input { width: 100%; min-width: 0; }
select {
  appearance: none;
  padding-right: 27px;
  background-image: linear-gradient(45deg, transparent 50%, #566680 50%), linear-gradient(135deg, #566680 50%, transparent 50%);
  background-position: right 15px center, right 11px center;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.text-button { background: transparent; border: 0; padding: 0; color: var(--accent); font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.filters .text-button { min-height: 40px; padding: 4px 6px; font-size: .875rem; }

#content { display: grid; gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi, .card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 9px #20396205;
  min-width: 0;
}
.kpi { min-height: 130px; padding: 16px 18px 15px; }
.kpi:first-child { border-color: #cbdaf9; background: linear-gradient(155deg, #ecf3ff, #fff 88%); }
.kpi h2 { font-size: .875rem; font-weight: 600; color: #445574; }
.kpi strong { display: block; margin: 7px 0 3px; color: var(--ink); font: 650 2.25rem/1.05 var(--font-heading); letter-spacing: -.036em; }
.kpi strong small { color: var(--muted); font: 500 1.1rem var(--font-heading); letter-spacing: normal; }
.kpi p { color: var(--muted); font-size: .8125rem; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; }
.card { padding: 20px; }
.card-heading { flex-direction: column; gap: 3px; margin-bottom: 16px; }
.card-heading h2 { color: var(--ink); font: 650 1.38rem/1.25 var(--font-heading); letter-spacing: -.025em; }
.card-heading p, .message, footer { color: var(--muted); font-size: .875rem; }
.message { padding: 15px; background: #edf3ff; margin-bottom: 16px; border-radius: 8px; }
footer { margin-top: 18px; font-size: .8125rem; }

.coral { --series: #ca6258; }
.cyan { --series: #25859d; }
.indigo { --series: #4665c8; }
.amber { --series: #ae7328; }
.violet { --series: #845bc3; }
.platform { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.platform-dot { width: 8px; height: 8px; background: var(--series); border-radius: 3px; flex: 0 0 auto; }
.rank-row, .rank-axis { display: grid; grid-template-columns: minmax(96px, 1.3fr) minmax(45px, 2.5fr) 48px 58px; align-items: center; gap: 10px; }
.rank-row { min-height: 39px; border-top: 1px solid #edf1f7; font-size: .875rem; }
.rank-row .text-button { text-align: left; color: var(--ink); }
.rank-axis { padding-bottom: 6px; color: var(--muted); font-size: .75rem; }
.axis-labels { display: flex; justify-content: space-between; }
.rank-count, .rank-score, .coverage-row { font-variant-numeric: tabular-nums; }
.rank-count { color: var(--muted); }
.track { overflow: hidden; height: 8px; border-radius: 10px; background: #edf1f7; }
.track span { display: block; width: var(--amount); height: 100%; border-radius: inherit; background: var(--series); }
.coverage-row { margin-top: 11px; }
.coverage-row:first-of-type { margin-top: 0; }
.coverage-row > div:first-child { display: flex; justify-content: space-between; gap: 6px; font-size: .875rem; margin-bottom: 5px; }
.coverage-row > div:first-child > span:last-child { color: var(--muted); }
.coverage-row strong { color: var(--ink); }
.coverage-row .track, .activity-row .track { height: 6px; }
.activity-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 34px; align-items: center; gap: 10px; padding: 5px 0; font-size: .875rem; }
.activity-row time { color: var(--muted); }
.empty { padding: 14px 0; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th, td { padding: 10px 11px; border-bottom: 1px solid #edf1f7; }
thead { background: #f3f6fb; }
thead th { font-weight: 600; color: #455775; white-space: nowrap; }
tbody th { font-weight: 600; }
tbody td { font-variant-numeric: tabular-nums; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #f8faff; }
.table-controls { align-items: center; justify-content: space-between; padding: 0 0 12px; font-size: .875rem; }
.search { width: min(270px, 55%); }
.inline-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.matrix { min-width: 780px; }
.matrix td { padding-block: 6px; }
.task-title { display: flex; align-items: baseline; gap: 8px; color: var(--ink); text-align: left; }
.task-title small, .row-task small { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }
.matrix-score { min-width: 52px; padding: 4px 7px; border: 1px solid transparent; border-radius: 6px; display: inline-flex; align-items: baseline; justify-content: center; gap: 5px; }
.matrix-score:hover { border-color: currentColor; }
.matrix-score small { font-size: .75rem; }
.matrix-score.high { color: #184b73; background: #e5f1fa; }
.matrix-score.medium { color: #39559a; background: #eef2ff; }
.matrix-score.low { color: #7d4920; background: #fff1d9; }
.empty-cell { color: #667892; }
.ratings-table { min-width: 880px; }
.row-task { min-width: 180px; display: block; }
.note p { min-width: 170px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note summary { color: var(--accent); }
.pager { align-items: center; justify-content: space-between; color: var(--muted); font-size: .875rem; margin-top: 14px; }
.pager > div { display: flex; gap: 6px; }

.distribution { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.distribution button { display: grid; gap: 3px; border: 1px solid transparent; border-radius: 7px; padding: 4px; color: var(--ink); background: #fafcff; font-size: .875rem; }
.distribution button:not(:disabled):hover, .distribution button[aria-pressed=true] { border-color: #adc2f1; background: #eaf1ff; }
.distribution button small { color: var(--muted); }
.column { display: flex; align-items: flex-end; height: 86px; border-bottom: 1px solid #dae3f4; }
.column b { width: 100%; height: var(--amount); border-radius: 4px 4px 0 0; background: #6283dc; }

dialog { max-width: min(440px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 14px; padding: 24px; color: var(--ink); box-shadow: 0 14px 50px #142b5033; }
dialog::backdrop { background: #17243d66; }
dialog form { display: grid; gap: 14px; }
dialog header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
dialog h2 { font: 650 1.45rem var(--font-heading); }
dialog .primary { justify-self: start; }
.error { color: #a33138; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
  body { grid-template-columns: 180px minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .text-button { justify-self: start; }
  .card { padding: 16px; }
}

@media (max-width: 850px) {
  body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 14px 18px 9px; gap: 10px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; }
  .sidebar nav a { padding: 7px 9px; }
  .side-links { display: flex; flex-wrap: wrap; border: 0; padding: 0; }
  .side-links a, .side-links button { padding: 3px 8px; }
  main { padding-top: 24px; }
}

@media (max-width: 620px) {
  main { padding-inline: 14px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .export-options { right: auto; left: 0; }
  .filters, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { min-height: 110px; padding: 14px; }
  .kpi strong { font-size: 2rem; }
  .two-columns { grid-template-columns: minmax(0, 1fr); }
  .rank-row, .rank-axis { gap: 6px; }
  .distribution { gap: 2px; }
  .distribution button { padding: 3px 1px; }
  .column { height: 60px; }
  .table-controls { flex-wrap: wrap; }
}
