:root {
  --navy: #062b55;
  --navy-2: #014475;
  --blue: #1d67c7;
  --teal: #009b8f;
  --orange: #ef7d00;
  --purple: #5f35bd;
  --green: #35a746;
  --red: #ef4444;
  --amber: #f5a524;
  --bg: #f6f9fd;
  --surface: #ffffff;
  --ink: #0c1d3a;
  --muted: #63708a;
  --line: #dbe4f0;
  --soft-line: #edf2f8;
  --shadow: 0 10px 30px rgba(15, 43, 83, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.96rem;
}

.app-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 14px;
  color: #fff;
  background:
    radial-gradient(circle at 40% 10%, rgba(52, 151, 255, 0.35), transparent 28%),
    linear-gradient(180deg, #073d73 0%, #032443 100%);
}

.seal {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.04),
    0 10px 22px rgba(0, 0, 0, 0.2);
}

.seal img {
  width: 104px;
  height: 104px;
  object-fit: contain;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab,
.quiet-link {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  text-align: left;
}

.tab {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  padding: 0 12px;
  font-weight: 800;
}

.tab.active,
.tab:hover {
  background: linear-gradient(90deg, #2f80ed, rgba(47, 128, 237, 0.35));
  color: #fff;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 900;
}

.side-search {
  display: grid;
  gap: 8px;
  margin-top: auto;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
}

.side-search input {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-search input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.sidebar-footer {
  display: grid;
  gap: 9px;
  padding-bottom: 10px;
}

.quiet-link {
  font-weight: 750;
  padding: 5px 4px;
}

.main-area {
  padding: 20px 18px 26px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.topbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-actions,
.filters,
.toolbar,
.dialog-actions,
.inline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.data-updated {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.button,
.file-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 850;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  background: var(--blue);
  color: #fff;
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.button.danger {
  background: #fff1f1;
  border-color: #ffd0d0;
  color: #bc2626;
}

.button.compact {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.file-button input,
.drop-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.surface {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.surface-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.surface-heading h2 {
  margin: 0;
}

.intake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.85fr;
  gap: 10px;
}

.admin-intake-grid {
  margin-bottom: 12px;
}

.admin-gate {
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
}

.admin-gate p {
  color: var(--muted);
  line-height: 1.5;
  max-width: 620px;
}

.admin-login {
  display: grid;
  gap: 10px;
}

.admin-content {
  display: grid;
  gap: 12px;
}

.admin-content[hidden],
.admin-gate[hidden] {
  display: none;
}

.admin-toolbar {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #b8daf7;
  border-radius: 8px;
  background: #edf7ff;
  color: #0b4f87;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 8px 12px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-error {
  min-height: 18px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 850;
}

.upload-card {
  display: grid;
  gap: 10px;
}

.compact-upload h2,
.process-card h2 {
  font-size: 0.94rem;
}

.drop-zone {
  --upload-bg: var(--blue);
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px dashed #b8c6d8;
  border-radius: 8px;
  background: #f9fbff;
  color: var(--blue);
  text-align: center;
  cursor: pointer;
  padding: 14px;
}

.drop-zone.teal {
  --upload-bg: var(--teal);
  color: var(--teal);
}

.upload-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--upload-bg);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 950;
}

.drop-zone small {
  color: var(--muted);
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  resize: vertical;
}

.inline-controls {
  align-items: end;
}

.inline-controls label {
  flex: 1;
}

.process-steps {
  height: calc(100% - 28px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.process-steps div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.process-steps div:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 23px;
  left: calc(50% + 30px);
  width: calc(100% - 42px);
  height: 2px;
  background: #9fb2cc;
}

.process-steps span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 950;
}

.process-steps div:nth-child(2) span {
  background: var(--teal);
}

.process-steps div:nth-child(3) span {
  background: var(--orange);
}

.process-steps div:nth-child(4) span {
  background: var(--purple);
}

.process-steps div:nth-child(5) span {
  background: var(--green);
}

.process-steps strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.visual-filters {
  justify-content: end;
  margin: 9px 0;
}

.visual-filters label {
  min-width: 160px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.kpi {
  min-height: 84px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 11px;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-weight: 950;
  font-size: 0.76rem;
}

.kpi:nth-child(2) .kpi-icon {
  background: var(--teal);
}

.kpi:nth-child(3) .kpi-icon {
  background: var(--orange);
}

.kpi:nth-child(4) .kpi-icon {
  background: var(--purple);
}

.kpi:nth-child(5) .kpi-icon {
  background: var(--green);
}

.kpi:nth-child(6) .kpi-icon {
  background: #0a65b7;
}

.kpi:nth-child(7) .kpi-icon {
  background: var(--red);
}

.kpi span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.kpi strong {
  display: block;
  margin: 3px 0;
  font-size: 1.35rem;
  line-height: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.38fr 0.92fr 1.1fr;
  gap: 10px;
  align-items: start;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.wide-panel,
.vote-panel,
.spending-panel,
.insight-grid .surface {
  min-height: 274px;
}

.flow-sankey-panel {
  grid-column: span 2;
}

.wide-panel,
.vote-panel {
  height: 430px;
}

.wide-panel .dense-table,
.vote-panel .vote-matrix {
  max-height: 370px;
  overflow: auto;
}

#dashboardLegislationTable table {
  min-width: 760px;
}

.legend {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.table-wrap,
.dense-table,
.vote-matrix {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--soft-line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.67rem;
  text-transform: uppercase;
}

td {
  font-size: 0.74rem;
}

td.money,
th.money {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

.item-link {
  color: var(--blue);
  font-weight: 850;
}

.action-meta,
.review-meta,
.review-text {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.4;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: capitalize;
}

.status-passed {
  background: #55bd69;
}

.status-pending {
  background: var(--amber);
}

.status-postponed {
  background: #f59e0b;
}

.status-failed,
.status-withdrawn {
  background: var(--red);
}

.vote-token {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 950;
}

.vote-yes {
  background: #dff5e6;
  color: #13813a;
}

.vote-no {
  background: #ffe2e0;
  color: #d52323;
}

.vote-abstain {
  background: #fff4d8;
  color: #a46200;
}

.vote-absent,
.vote-unknown {
  background: #eef2f7;
  color: #566174;
}

.spending-top {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 12px;
  align-items: center;
}

.gauge {
  --pct: 74;
  width: min(180px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), #dfe6ee 0);
}

.gauge::before {
  content: "";
  position: absolute;
}

.gauge-inner {
  width: 68%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  text-align: center;
}

.gauge-inner strong {
  color: var(--green);
  font-size: 1.85rem;
}

.gauge-inner span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.donut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mini-donut {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.donut {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--pct), #e5edf5 0);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 950;
}

.donut-label strong {
  display: block;
  font-size: 0.76rem;
}

.donut-label span {
  color: var(--muted);
  font-size: 0.69rem;
}

.trend-chart {
  height: 118px;
  margin-top: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(53, 167, 70, 0.12), transparent 62%),
    repeating-linear-gradient(to top, transparent 0 28px, #edf2f8 29px),
    linear-gradient(to right, transparent 0 8%, #edf2f8 8.2% 8.4%, transparent 8.6% 100%);
  position: relative;
  overflow: hidden;
}

.trend-line {
  position: absolute;
  left: 28px;
  right: 28px;
  height: 3px;
  border-radius: 999px;
  transform-origin: left center;
}

.trend-line.actual {
  bottom: 34px;
  background: var(--teal);
  transform: rotate(-7deg);
}

.trend-line.target {
  bottom: 56px;
  border-top: 2px dashed var(--blue);
  transform: rotate(-13deg);
}

.trend-label {
  position: absolute;
  right: 12px;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
}

.trend-label.actual {
  bottom: 22px;
  color: var(--teal);
}

.trend-label.target {
  bottom: 62px;
}

.bar-list,
.flow-board,
.review-list,
.member-list,
.breakdown,
.timeline,
.engagement-board {
  display: grid;
  gap: 8px;
}

.bar-row,
.breakdown-row {
  display: grid;
  gap: 6px;
}

.bar-row header,
.breakdown-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.flow-board {
  display: block;
  min-height: 260px;
}

.sankey-svg {
  width: 100%;
  height: auto;
  display: block;
}

.sankey-link {
  fill: none;
  stroke-linecap: round;
  opacity: 0.27;
  transition: opacity 150ms ease;
}

.sankey-link:hover {
  opacity: 0.54;
}

.sankey-node rect {
  stroke: #d8e3ef;
  stroke-width: 1;
}

.sankey-axis-label {
  fill: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sankey-node-label,
.sankey-node-count {
  fill: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
}

.sankey-node-count {
  text-anchor: end;
  fill: var(--blue);
}

.word-cloud {
  min-height: 214px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 9px 12px;
}

.word-cloud span {
  color: var(--word-color);
  font-size: var(--word-size);
  font-weight: var(--word-weight, 850);
  line-height: 0.98;
}

.engagement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 8px;
  align-items: center;
}

.engagement-row span {
  font-size: 0.74rem;
  font-weight: 800;
}

.timeline-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
}

.timeline-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e5f5ea;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 950;
}

.timeline-item h4 {
  margin: 0 0 2px;
  font-size: 0.78rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 18px 0 14px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar {
  justify-content: flex-end;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.budget-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
}

.compact-table {
  box-shadow: none;
}

.budget-source-copy {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 10px;
}

.budget-source-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.budget-source-summary > div {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f7fbff;
  padding: 10px;
}

.budget-source-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.budget-source-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.96rem;
}

.member-toggle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.member-toggle-button {
  min-height: 74px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  padding: 10px;
}

.member-toggle-button.active {
  border-color: var(--blue);
  background: #edf6ff;
  box-shadow: 0 0 0 2px rgba(29, 103, 199, 0.14);
}

.member-toggle-button img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  filter: grayscale(1);
  object-fit: cover;
  object-position: center top;
}

.member-toggle-button span {
  display: grid;
  gap: 3px;
}

.member-toggle-button strong {
  font-weight: 900;
  line-height: 1.15;
}

.member-toggle-button small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.2;
}

.member-profile,
.member-score-grid {
  display: grid;
  gap: 12px;
}

.member-hero {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) minmax(280px, 430px);
  gap: 18px;
  align-items: center;
}

.member-hero p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.member-hero h3 {
  margin-bottom: 6px;
  font-size: 1.5rem;
}

.member-role {
  margin-bottom: 8px;
  color: var(--blue) !important;
  font-size: 0.86rem;
  font-weight: 900;
}

.member-portrait {
  width: 116px;
  height: 116px;
  border-radius: 16px;
  filter: grayscale(1);
  object-fit: cover;
  object-position: center top;
  box-shadow: var(--shadow);
}

.member-contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.member-contact-grid a,
.member-contact-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fbff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
  padding: 0 10px;
}

.member-kpi-stack,
.budget-impact-grid,
.attendance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.score-metric {
  min-height: 74px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.score-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.18rem;
}

.member-score-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.member-attendance-card {
  grid-row: span 2;
}

.member-budget-impact-card {
  grid-column: 2;
}

.member-budget-categories-card {
  grid-column: 2;
}

.member-wide-card {
  grid-column: 1 / -1;
}

.vote-bar-yes {
  background: var(--green);
}

.vote-bar-no {
  background: var(--red);
}

.vote-bar-abstain {
  background: var(--amber);
}

.vote-bar-absent,
.vote-bar-recused {
  background: #9aa8bc;
}

.attendance-summary {
  margin-bottom: 10px;
}

.attendance-list {
  display: grid;
  gap: 8px;
}

.attendance-row {
  display: grid;
  grid-template-columns: 96px 82px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--soft-line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.attendance-row span {
  font-weight: 900;
}

.attendance-row strong {
  font-size: 0.74rem;
}

.attendance-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.attendance-present {
  border-left-color: var(--green);
}

.attendance-absent {
  border-left-color: var(--red);
}

.attendance-no-record {
  border-left-color: #9aa8bc;
}

.review-card,
.member-row,
.action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.member-row input {
  min-width: 220px;
}

dialog {
  width: min(860px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(12, 29, 58, 0.24);
}

dialog::backdrop {
  background: rgba(8, 30, 58, 0.45);
}

dialog form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-heading h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vote-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 8px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1320px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-grid,
  .insight-grid {
    grid-template-columns: 1fr 1fr;
  }

  .spending-panel,
  .flow-sankey-panel,
  .insight-grid .surface:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .seal,
  .sidebar-footer {
    display: none;
  }

  .tabs {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
  }

  .topbar,
  .section-heading,
  .surface-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .intake-grid,
  .hero-grid,
  .insight-grid,
  .budget-layout,
  .member-hero,
  .member-score-grid,
  .member-kpi-stack,
  .budget-impact-grid,
  .attendance-summary,
  .form-grid,
  .vote-grid,
  .spending-top {
    grid-template-columns: 1fr;
  }

  .attendance-row {
    grid-template-columns: 1fr;
  }

  .member-attendance-card,
  .member-budget-impact-card,
  .member-budget-categories-card {
    grid-column: auto;
    grid-row: auto;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .sidebar,
  .topbar-actions,
  .filters,
  .button,
  .icon-button {
    display: none !important;
  }

  .app-layout {
    display: block;
  }

  body {
    background: #fff;
  }

  .surface,
  .kpi,
  .table-wrap {
    box-shadow: none;
  }
}
