:root {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #183234;
  background: #eef4f0;
  font-size: 15px;
  --ink: #183234;
  --muted: #52676a;
  --brand: #126553;
  --brand-dark: #0a493e;
  --accent: #d0f18f;
  --canvas: #eef4f0;
  --surface: #fff;
  --soft: #f6faf7;
  --line: #d7e4de;
  --control: #bdcec5;
  --table-head: #eaf3ee;
  --table-stripe: #f7faf8;
  --table-hover: #ecf7ef;
  --focus: #12877a;
  --shadow: 0 2px 3px #123e3610, 0 10px 30px #123e3608;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.5; }
button, input, select { font: inherit; }
a { color: var(--brand); }
button, input, select { min-height: 42px; border: 1px solid var(--control); border-radius: 9px; background: var(--surface); color: var(--ink); }
input, select { padding: 9px 12px; min-width: 0; max-width: 100%; }
button { cursor: pointer; padding: 8px 14px; font-weight: 650; font-size: .87rem; }
button:hover:not(:disabled) { border-color: var(--brand); background: var(--soft); color: var(--brand-dark); }
button:disabled { opacity: .52; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--brand-dark); color: #fff; }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; flex: 0 0 auto; }
input::placeholder { color: var(--muted); opacity: .86; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 650; }
.skip-link { position: fixed; top: 12px; left: 12px; transform: translateY(-160%); z-index: 20; background: var(--surface); padding: 10px 15px; border-radius: 8px; }
.skip-link:focus { transform: none; }
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
aside { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #103b3a; color: #e9f5ee; padding: 25px 17px; scrollbar-color: #55776e #103b3a; }
.sidebar-top { margin-bottom: 23px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 760; line-height: 1; }
.brand-mark { flex: none; display: grid; place-items: center; width: 45px; height: 45px; border-radius: 13px; color: #e8ffd7; background: #ffffff16; border: 1px solid #d0f18f45; }
.brand-mark svg { width: 25px; height: 25px; }
.brand small { display: block; margin-top: 6px; color: #c2d9d1; font-size: .64rem; font-weight: 500; line-height: 1.1; }
#menuToggle { display: none; }
.sidebar-body { display: grid; gap: 20px; }
.scope { display: grid; gap: 10px; padding: 12px; border: 1px solid #ffffff24; border-radius: 12px; background: #ffffff09; }
.scope label { color: #dceee7; font-size: .75rem; }
.scope select { width: 100%; min-height: 37px; font-size: .78rem; }
aside button, aside select { color: #ecf7f1; background: #1b4b48; border-color: #527971; }
aside button:hover:not(:disabled) { background: #2b5d53; color: #fff; border-color: #9ac0ac; }
aside :focus-visible { outline-color: #d0f18f; }
#refresh { min-height: 34px; font-size: .75rem; }
#nav, .nav-group { display: grid; gap: 3px; }
#nav { gap: 16px; }
.nav-group > span { color: #b9d3c8; text-transform: uppercase; letter-spacing: .09em; font-size: .64rem; font-weight: 760; padding: 0 9px 3px; }
.nav-group button { min-height: 37px; padding: 7px 10px; text-align: left; border-color: transparent; background: transparent; font-weight: 550; font-size: .83rem; }
.nav-group button.active { background: #d0f18f; color: #163a29; font-weight: 760; }
.nav-group button.active:hover { background: #e2f8ba; color: #163a29; }
.aside-foot { display: grid; gap: 8px; border-top: 1px solid #ffffff27; padding-top: 14px; font-size: .75rem; overflow-wrap: anywhere; }
.aside-foot a, .aside-foot span { color: #c2d9d1; }
main { width: 100%; max-width: 1800px; margin: 0 auto; min-width: 0; padding: clamp(18px, 3.1vw, 46px); }
.page-hero {
  isolation: isolate; position: relative; overflow: hidden; display: flex; flex-wrap: wrap;
  align-items: flex-end; justify-content: space-between; gap: 22px; margin: 0 0 20px;
  padding: clamp(24px, 3.5vw, 45px); border-radius: 22px; color: #f5fff6;
  background: radial-gradient(ellipse at 90% 0%, #2f8268 0%, #226853 25%, transparent 64%), linear-gradient(120deg, #12473f, #0a3535);
  box-shadow: 0 12px 26px #103b3a1c;
}
.page-hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 390px; height: 390px; right: -100px; top: -190px; border-radius: 50%; border: 1px solid #d0f18f55; box-shadow: 0 0 0 28px #d0f18f18, 0 0 0 60px #d0f18f14, 0 0 0 96px #d0f18f0c; }
.hero-copy { flex: 1 1 375px; }
.eyebrow { display: inline-flex; gap: 9px; align-items: center; text-transform: uppercase; letter-spacing: .15em; font-size: .71rem; font-weight: 750; color: #e2f6d1; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1, h2, h3 { line-height: 1.2; }
h1 { margin: 9px 0 8px; font-size: clamp(2rem, 4vw, 3.35rem); font-weight: 720; letter-spacing: -.045em; }
h2 { margin: 0 0 10px; font-size: 1.27rem; letter-spacing: -.02em; }
h3 { margin: 16px 0 10px; font-size: .98rem; }
p { margin: 8px 0 14px; }
.hero-copy p { margin: 0; max-width: 63ch; color: #e0f1e9; font-size: .94rem; }
.header-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.badge { border: 1px solid #ffffff45; border-radius: 30px; background: #ffffff13; color: #f0ffe9; padding: 6px 10px; font-size: .68rem; letter-spacing: .05em; font-weight: 750; white-space: nowrap; }
.page-hero button { border-color: #d8efce; background: #eefbdd; color: #174334; }
.page-hero button:hover:not(:disabled) { background: #d9f1ba; color: #174334; }
.notice { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); padding: 11px 15px; font-size: .85rem; }
.notice strong { color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 20px 0; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.search-field { flex: 1 1 250px; }
.search-input { position: relative; display: block; }
.search-input svg { width: 17px; height: 17px; position: absolute; top: 50%; transform: translateY(-50%); left: 13px; color: var(--muted); pointer-events: none; }
.search-input input { width: 100%; padding-left: 39px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.card, .panel { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.card { padding: 20px; border-top: 3px solid #79aa8e; }
.card small { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 720; font-size: .69rem; }
.card strong { display: block; color: var(--brand-dark); font-size: clamp(1.45rem, 2.6vw, 2.12rem); font-variant-numeric: tabular-nums; line-height: 1.15; margin: 9px 0 6px; overflow-wrap: anywhere; }
.card span { color: var(--muted); font-size: .81rem; }
.panel { margin: 20px 0; padding: clamp(15px, 2.3vw, 28px); }
.row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.row h2 { margin: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two .panel { margin: 0; }
.table-tools, .pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; color: var(--muted); font-size: .81rem; margin: 10px 0; }
.pagination { justify-content: flex-end; margin: 13px 0 0; }
.tablewrap { max-height: min(67vh, 600px); overflow: auto; border: 1px solid var(--line); border-radius: 11px; scrollbar-color: #86a69a var(--soft); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; background: var(--table-head); color: var(--ink); border-bottom: 1px solid var(--control); padding: 12px 14px; text-align: left; font-size: .79rem; }
th:has(button) { padding: 0; }
th button { border: 0; border-radius: 0; background: transparent; padding: 12px 14px; width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 10px; color: inherit; font-size: inherit; font-weight: 730; }
th button:focus-visible { outline-offset: -3px; }
th[aria-sort] { background: var(--table-hover); color: var(--brand-dark); }
.sort-icon { color: var(--muted); font-size: .85rem; }
th[aria-sort] .sort-icon { color: var(--brand); }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--table-stripe); }
tbody tr:hover, tbody tr:focus-within { background: var(--table-hover); }
td button { min-height: 36px; padding: 6px 10px; font-size: .77rem; }
.long-cell { min-width: 230px; max-width: 360px; white-space: normal; overflow-wrap: anywhere; }
.neg { color: #a9283f; font-weight: 720; }
.pos { color: var(--brand); }
.muted { color: var(--muted); font-size: .84rem; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.formgrid .full { grid-column: 1/-1; }
.check { flex-direction: row; align-items: center; }
.actions, .inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions { margin-top: 14px; }
.inline { align-items: end; }
.inline input { flex: 1; }
.grow-field { flex: 1 1 215px; }
.lookup-block { padding: 13px 0; border-top: 1px solid var(--line); }
.lookup-block h3 { margin: 0 0 10px; }
.lookup-block p { margin: 10px 0 0; }
.results-status { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .85rem; color: var(--ink); }
details { border-top: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 650; color: var(--brand-dark); }
.empty { padding: 28px 14px; text-align: center; color: var(--muted); white-space: normal; }
.insight { padding: 13px 0; border-bottom: 1px solid var(--line); }
.insight:last-child { border: 0; }
.insight b { display: block; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 18px; border-top: 1px solid var(--line); color: var(--muted); padding-top: 15px; font-size: .75rem; }
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); width: min(900px, calc(100% - 28px)); max-height: 90vh; padding: clamp(17px, 3vw, 28px); box-shadow: 0 20px 70px #0d293744; }
dialog::backdrop { background: #102c3d88; }
.close { float: right; margin-left: 10px; font-size: 1.15rem; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); border-radius: 10px; color: white; padding: 12px 18px; display: none; z-index: 10; max-width: 90%; font-size: .88rem; }
.error { color: #a9283f; padding: 8px 0; font-size: .84rem; white-space: pre-wrap; }
.error:empty { display: none; }
.step { color: var(--muted); font-size: .83rem; margin-bottom: 12px; }
.wrap { white-space: normal; max-width: 450px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; background: var(--soft); border-radius: 9px; padding: 14px; }
body.dark { color-scheme: dark; --ink: #e5f3eb; --muted: #b4cec5; --brand: #166752; --brand-dark: #bceec4; --canvas: #102322; --surface: #18312e; --soft: #203e36; --line: #3c5d50; --control: #587d6e; --table-head: #27483f; --table-stripe: #1c3931; --table-hover: #2e5144; --focus: #b5f3aa; }
body.dark a, body.dark .sort-icon { color: #bceec4; }
body.dark .neg, body.dark .error { color: #ffacb5; }
body.dark button.primary:hover:not(:disabled) { background: #245f4c; }
@media (max-width: 1180px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .app { display: block; }
  aside { position: static; height: auto; padding: 14px 16px; overflow: visible; }
  .sidebar-top { display: flex; justify-content: space-between; align-items: center; margin: 0; gap: 10px; }
  #menuToggle { display: inline-flex; align-items: center; gap: 8px; }
  .sidebar-top:has(#menuToggle[aria-expanded="false"]) + .sidebar-body { display: none; }
  .sidebar-body { margin-top: 14px; }
  .scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #refresh { justify-self: start; }
  #nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr; }
  .page-hero { gap: 16px; }
}
@media (max-width: 490px) {
  main { padding: 14px; }
  .page-hero { border-radius: 15px; padding: 22px 17px; }
  .toolbar { padding: 12px; gap: 9px; }
  .toolbar > label:not(.search-field) { flex: 1 1 calc(50% - 9px); }
  .formgrid { grid-template-columns: minmax(0, 1fr); }
  .inline label { flex: 1 1 100%; }
  .cards { gap: 8px; }
  .card { padding: 13px; }
  .table-tools { align-items: flex-start; }
  .pagination { justify-content: space-between; }
}
.quick-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.quick-links button { position: relative; text-align: left; padding: 15px 38px 15px 15px; border-color: var(--line); box-shadow: var(--shadow); }
.quick-links button::after { content: "↗"; position: absolute; top: 16px; right: 15px; color: var(--brand-dark); }
.quick-links strong, .quick-links span { display: block; }
.quick-links span { font-size: .78rem; color: var(--muted); font-weight: 500; margin-top: 3px; }
.contextual { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
@media (max-width: 600px) { .quick-links { grid-template-columns: 1fr; } }

.catalog-exact { margin-top: 10px; }
.print-only { display: none; }

@media print {
  @page { size: landscape; margin: 11mm; }
  .app { display: block; }
  body, body.dark, .page-hero, .panel, .card, th, tbody tr:nth-child(even) {
    background: #fff;
    color: #182d30;
    box-shadow: none;
  }
  .skip-link, aside, .header-actions, .toolbar, .quick-links, .pagination,
  .table-tools, .row > button, form, .actions, dialog, #toast { display: none !important; }
  main, .page-hero, .panel, .card { padding: 0; }
  main { max-width: none; }
  .page-hero, .panel, .card { border: 0; margin: 0 0 12pt; }
  .page-hero::after, .eyebrow::before { display: none; }
  .hero-copy p, .eyebrow, .card strong, .card small, .card span, .muted, footer { color: #263c3d; }
  .print-only { display: block; color: #263c3d; }
  .tablewrap { max-height: none; overflow: visible; }
  table { white-space: normal; table-layout: auto; font-size: 8pt; }
  th, td, .long-cell { position: static; min-width: 0; overflow-wrap: anywhere; padding: 4pt; }
  th button { display: block; min-height: 0; padding: 4pt; }
  td button, .sort-icon { display: none; }
  tr { break-inside: avoid; }
}
