:root {
  color-scheme: light;
  --ink: #172f28;
  --muted: #5d7068;
  --primary: #176347;
  --primary-dark: #104c36;
  --primary-light: #e3f3ea;
  --sidebar: #112c25;
  --page: #f4f6f3;
  --line: #dfe7df;
  --surface: #fff;
  --danger: #9e3b2e;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #2d8e6b; outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 8px; padding: 10px; background: white; transform: translateY(-200%); z-index: 5; }
.skip-link:focus { transform: translateY(0); }
svg { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; padding: 26px 16px 20px; color: #d7e7df; background: var(--sidebar); }
.identity { display: flex; align-items: center; gap: 11px; margin: 0 8px 43px; }
.logo { display: grid; place-items: center; flex: 0 0 42px; height: 42px; background: #23493c; border: 1px solid #305747; border-radius: 12px; }
.identity strong { display: block; font-size: 19px; letter-spacing: -.5px; color: #f4fbf7; }
.identity span { display: block; margin-top: 3px; color: #a6c0b4; font-size: 11px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav button { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; color: #c2d8cb; border-radius: 9px; padding: 11px 10px; text-align: left; line-height: 1.35; font-weight: 550; font-size: 13px; }
.sidebar nav button:hover { background: #1d3a32; }
.sidebar nav button[aria-current="page"] { background: #234b3d; border-color: #396353; color: #edfff5; }
.sidebar nav button[aria-current="page"] svg { color: #a6e5c7; }
.sidebar nav [data-icon] { display: grid; flex: 0 0 18px; place-items: center; }
.sidebar-footer { margin-top: auto; padding: 16px 7px 0; display: flex; align-items: center; gap: 8px; border-top: 1px solid #315044; color: #b8cdc2; font-size: 12px; }
.sidebar-footer svg { width: 15px; height: 15px; }
.main-column { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px clamp(16px, 3vw, 46px); background: var(--surface); border-bottom: 1px solid var(--line); }
.source-badge { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #4e6057; }
.source-badge strong { font-weight: 650; }
.source-badge span { width: 8px; height: 8px; border-radius: 50%; background: #ad8151; }
.source-badge.ready span { background: #378861; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; border: 1px solid transparent; min-height: 38px; padding: 8px 13px; font-weight: 650; font-size: 13px; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:not(:disabled):hover { background: var(--primary-dark); }
.button.secondary { background: white; color: var(--ink); border-color: #cfddd2; }
.button.secondary:not(:disabled):hover, .button.text:hover { background: #eaf4ed; }
.button.text { color: var(--primary-dark); background: transparent; }
.button.small { min-height: 31px; padding: 5px 8px; }
.import-status { padding: 11px 16px; margin: 16px clamp(16px, 3vw, 46px) 0; border: 1px solid #c2ddca; border-radius: 8px; background: var(--primary-light); }
.import-status.error { background: #fbeee9; border-color: #e9ccc3; color: var(--danger); }
main { max-width: 1600px; margin: 0 auto; padding: 31px clamp(16px, 3vw, 46px) 45px; }
main:focus { outline: none; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px, 3vw, 37px); line-height: 1.1; letter-spacing: -.042em; font-weight: 720; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 680; letter-spacing: -.018em; }
.page-heading { margin-bottom: 23px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-heading p { margin-top: 7px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; box-shadow: 0 2px 4px #213b2b05; }
.filter-panel { padding: 15px 17px; margin-bottom: 17px; }
.filter-grid { display: grid; grid-template-columns: minmax(150px, 1.6fr) .66fr .68fr 1fr 1fr minmax(150px, 1.6fr); gap: 13px; }
.fiscal-filter-grid { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.4fr) .35fr; gap: 13px; align-items: end; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child { color: #41574d; font-size: 11px; font-weight: 680; letter-spacing: .015em; }
.field select, .number-field, .search-input { width: 100%; height: 36px; background: #fafcf9; border: 1px solid #d9e2d8; color: var(--ink); border-radius: 7px; }
.field select { padding: 0 8px; text-overflow: ellipsis; }
.search-input { padding: 0 9px; }
.filter-extra { display: flex; align-items: end; grid-column: 1/-1; gap: 18px; }
.filter-extra .field { width: min(165px, 45%); }
.checkbox { display: inline-flex; min-height: 36px; align-items: center; gap: 5px; color: #4c6156; font-size: 12px; }
.checkbox input { accent-color: var(--primary); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 0 0 17px; }
.metric { display: flex; flex-direction: column; gap: 6px; padding: 14px 15px; }
.metric-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-weight: 650; font-size: 12px; }
.metric-icon { flex: 0 0 32px; display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: #267053; background: var(--primary-light); }
.metric-icon svg { width: 16px; height: 16px; }
.metric > strong { display: block; font-size: clamp(17px, 1.7vw, 27px); letter-spacing: -.04em; overflow-wrap: anywhere; font-weight: 720; }
.metric small, .table-card small { display: block; font-size: 11px; color: var(--muted); }
.positive, .metric small.positive { color: #176347; font-weight: 650; }
.negative, .metric small.negative { color: #9e3b2e; font-weight: 650; }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(270px, 1fr); align-items: start; gap: 15px; margin-bottom: 17px; }
.fiscal-grid { grid-template-columns: minmax(288px, 1fr) minmax(0, 1.85fr); }
.chart-card, .scenario-card { padding: 17px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-heading p { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.panel-heading .field { width: 126px; }
.segmented { display: flex; gap: 3px; padding: 3px; background: #eff3ed; border: 1px solid #e1e8e1; border-radius: 7px; flex-shrink: 0; }
.segmented button { padding: 4px 7px; border: 1px solid transparent; color: #536b5c; background: transparent; border-radius: 5px; font-size: 10px; font-weight: 650; }
.segmented button[aria-pressed="true"] { color: var(--primary-dark); background: white; border-color: #dce5de; }
.chart-container { padding-top: 14px; }
.chart-container svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-container svg line { stroke: #e1e8e2; }
.chart-container svg text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.base-bar { fill: #b4d1c1; }
.scenario-bar { fill: #237758; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; padding: 6px 0 2px; color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { height: 9px; width: 9px; background: #237758; border-radius: 2px; }
.legend .base-dot { background: #b4d1c1; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled { opacity: .65; }
.scenario-fields, .goal-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin-top: 14px; }
.number-field { display: flex; align-items: center; }
.number-field input { border: 0; background: transparent; color: inherit; width: 100%; min-width: 0; height: 100%; padding: 6px 6px 6px 9px; border-radius: 7px; }
.number-field > span { padding-right: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.scenario-actions { display: flex; align-items: center; gap: 5px; margin-top: 13px; }
.goal { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.goal summary { font-size: 12px; color: var(--primary-dark); cursor: pointer; font-weight: 650; }
.goal-actions { display: flex; flex-wrap: wrap; gap: 2px; grid-column: 1/-1; }
.goal-actions .button { font-size: 11px; }
.form-message { margin-top: 10px; color: var(--primary-dark); font-size: 12px; line-height: 1.4; }
.form-message.error { color: var(--danger); }
.table-card > .panel-heading { padding: 15px 17px 13px; }
.table-scroll { overflow: auto; }
table { border-spacing: 0; width: 100%; text-align: left; font-size: 12px; white-space: nowrap; }
thead th { color: #466050; background: #f0f5ef; font-size: 11px; font-weight: 680; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e8ede8; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { padding-left: 17px; }
tbody th { font-weight: 620; }
tbody tr:nth-child(even) { background: #fcfdfb; }
tbody tr:hover { background: #f1f7f0; }
tbody small { margin-top: 3px; font-weight: 400; max-width: 235px; overflow: hidden; text-overflow: ellipsis; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 9px 17px; }
.pagination span { color: var(--muted); margin-right: 4px; font-size: 11px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 17px 13px; }
.target-card { border-radius: 8px; border: 1px solid #e1e9e1; background: #f5f8f4; padding: 10px; }
.target-card > div { display: grid; gap: 4px; }
.target-card span, .target-card small { color: var(--muted); font-size: 11px; }
.target-card strong { font-size: 13px; }
.target-card small { margin-top: 5px; }
.target-card small b { color: var(--ink); }
.uf-button[aria-current="true"] { color: var(--primary-dark); background: var(--primary-light); }
.tax-summary { display: flex; flex-wrap: wrap; gap: 8px 15px; padding: 12px 17px; color: var(--muted); font-size: 11px; }
.tax-summary b { color: var(--ink); margin-left: 2px; }
.source-panel { padding: 18px; margin-bottom: 15px; line-height: 1.5; }
.source-panel > p { color: var(--muted); }
.source-stats, .sources-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.source-stats div { padding: 12px; border-radius: 7px; background: #edf5ee; }
.source-stats dt { color: var(--muted); font-size: 12px; }
.source-stats dd { margin: 2px 0 0; font-size: 21px; font-weight: 700; }
.sources-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rule-list { margin-bottom: 0; }
.rule-list div { padding: 9px 0; border-top: 1px solid var(--line); }
.rule-list dt { font-weight: 670; }
.rule-list dd { color: var(--muted); margin: 2px 0 0; }
.import-details { margin-bottom: 0; padding-left: 18px; color: var(--muted); }
@media (max-width: 1250px) {
  .filter-grid { grid-template-columns: 1.7fr .7fr .7fr 1fr 1fr 1.7fr; gap: 10px; }
  .metric { padding: 12px; }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .identity { margin-inline: 3px; }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 12px 13px 10px; }
  .identity { margin: 0 0 10px; }
  .logo { width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px; }
  .logo img { width: 26px; height: 26px; }
  .identity strong { font-size: 16px; }
  .identity span, .sidebar-footer { display: none; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .sidebar nav button { font-size: 10px; gap: 5px; padding: 7px; justify-content: center; }
  .sidebar nav [data-icon] { flex-basis: 13px; }
  .sidebar nav svg { width: 13px; height: 13px; }
  .topbar { min-height: 52px; }
  main { padding-top: 23px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { padding-inline: 7px; font-size: 11px; }
  .fiscal-filter-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .fiscal-filter-grid .field:first-child { grid-column: 1/-1; }
  .sources-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 450px) {
  .page-heading p { font-size: 12px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-header { font-size: 11px; }
  .metric-icon { width: 25px; height: 25px; flex-basis: 25px; }
  .metric-icon svg { width: 14px; height: 14px; }
  .source-stats { grid-template-columns: minmax(0, 1fr); }
}
