:root {
  color-scheme: light;
  --ink: #192c27;
  --muted: #52645d;
  --surface: #fff;
  --background: #f3f6f3;
  --line: #e0e8e2;
  --green: #1c5946;
  --green-strong: #144736;
  --pale: #eaf4ed;
  --nav: #112a24;
  --nav-muted: #a1b9ae;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  line-height: 1.5;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { opacity: .7; cursor: wait; }
:focus-visible { outline: 3px solid #52a886; outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; left: 12px; top: 12px; padding: 12px; background: white; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
code { font: .875em ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  background: var(--nav); color: white; display: flex; flex-direction: column; padding: 25px 15px 17px;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.sidebar-header { padding: 3px 13px 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 760; font-size: 1.19rem; letter-spacing: -.035em; text-decoration: none; white-space: nowrap; }
.brand-mark {
  flex: 0 0 33px; width: 33px; height: 33px; border-radius: 9px; background: #b8efd1;
  display: grid; grid-template-columns: repeat(2, 5px); grid-template-rows: repeat(2, 5px);
  gap: 2px; align-content: center; justify-content: center; transform: rotate(-7deg);
}
.brand-mark i { background: #174736; border-radius: 1px; }
.brand-mark i:nth-child(2) { background: #449475; }
.brand-mark i:nth-child(3) { background: #2b7457; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-group p {
  font-size: .75rem; font-weight: 680; color: var(--nav-muted); padding: 3px 13px 9px; letter-spacing: .06em; text-transform: uppercase;
}
.nav-group a {
  min-height: 41px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px;
  display: flex; align-items: center; gap: 11px; color: #d1e0d7; font-size: .935rem; text-decoration: none;
}
.nav-group a .icon { color: #a0bdb0; }
.nav-group a:hover { color: #fff; background: #1d3a30; }
.nav-group a[aria-current="page"] { background: #285044; color: white; border-color: #365e50; font-weight: 660; }
.nav-group a[aria-current="page"] .icon { color: #bbf1d3; }
.sidebar-footer { padding: 15px 7px 0; border-top: 1px solid #2c453b; display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.profile { min-width: 0; display: flex; align-items: center; gap: 9px; text-decoration: none; flex: 1; }
.profile:hover strong { text-decoration: underline; }
.avatar { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #315344; color: #e2f5e9; font-weight: 700; }
.profile-text { min-width: 0; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: .875rem; }
.profile small { color: var(--nav-muted); font-size: .75rem; }
.icon-button { display: grid; place-items: center; border: none; width: 38px; height: 38px; border-radius: 8px; background: transparent; color: var(--nav-muted); }
.icon-button:hover { color: white; background: #285044; }
.menu-toggle { display: none; }

.topbar { min-height: 64px; display: flex; align-items: center; gap: 13px; padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.topbar-divider { height: 13px; width: 1px; background: #b6c2bb; transform: rotate(21deg); flex: 0 0 1px; }
.topbar-page { color: var(--ink); font-weight: 630; overflow-wrap: anywhere; }
.main-content { padding: 30px 32px 44px; max-width: 1570px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
h1 { font-size: clamp(1.95rem, 3.15vw, 2.65rem); line-height: 1.12; font-weight: 760; letter-spacing: -.052em; overflow-wrap: anywhere; }
.page-heading p { color: var(--muted); margin-top: 7px; font-size: .95rem; }
.period-form { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.select-wrap { display: flex; align-items: center; position: relative; }
.select-wrap > .icon { position: absolute; left: 12px; color: var(--green); pointer-events: none; }
.select-wrap::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); position: absolute; right: 14px; top: 15px; transform: rotate(45deg); pointer-events: none; }
select { appearance: none; min-height: 42px; padding: 8px 32px 8px 37px; border: 1px solid #d5e1d9; border-radius: 8px; color: var(--ink); font-size: .875rem; font-weight: 650; background: white; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric { padding: 15px 16px 14px; min-height: 114px; min-width: 0; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: .875rem; font-weight: 620; }
.metric strong { display: block; margin-top: 3px; font-size: clamp(1.4rem, 3.15vw, 2.22rem); line-height: 1.18; font-variant-numeric: tabular-nums; letter-spacing: -.05em; overflow-wrap: anywhere; }
.metric-primary { background: #19523f; border-color: #19523f; color: white; }
.metric-primary .metric-top { color: #e0eee6; }
.metric-primary .icon-tile { background: #34715b; color: #e2f8eb; }
.icon-tile { display: inline-grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 9px; color: var(--green); background: var(--pale); }

.monitor-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(305px, 1fr); align-items: stretch; gap: 18px; margin-bottom: 18px; }
.panel { min-width: 0; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 17px 19px 14px; }
.panel-heading h2 { font-size: 1.125rem; font-weight: 740; line-height: 1.35; letter-spacing: -.021em; }
.panel-heading p { font-size: .875rem; color: var(--muted); margin-top: 3px; }
.chart-panel { min-height: 295px; }
.legend { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .8125rem; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; background: #34916d; }
.legend span + span::before { background: #c4a86f; }
.chart-area { position: relative; padding: 0 15px 9px; }
.chart-area canvas { width: 100%; height: 205px; display: block; }
.chart-empty { position: absolute; inset: 0 20px 34px 40px; padding: 0 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; font-size: .875rem; color: var(--muted); pointer-events: none; }
.chart-empty strong { margin-top: 3px; font-weight: 720; color: var(--ink); background: #fff; padding-inline: 5px; }
.chart-empty > span:last-child:not(.icon-tile) { background: #fff; padding-inline: 4px; }
.chart-data { margin: 2px 16px 12px; font-size: .875rem; color: var(--muted); }
.chart-data summary { width: fit-content; }

.provider-panel { display: flex; flex-direction: column; }
.provider-panel .panel-heading { padding-bottom: 12px; }
.provider-body { padding: 0 18px 17px; display: flex; flex-direction: column; flex: 1; }
.provider-name {
  display: flex; align-items: center; gap: 9px; background: #f4f7f5; border: 1px solid #e6ece7;
  border-radius: 9px; padding: 9px; flex-wrap: wrap;
}
.provider-symbol { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; background: #183f32; color: #eafeef; border-radius: 8px; }
.provider-name strong { display: block; font-size: .94rem; line-height: 1.2; }
.provider-name p { color: var(--muted); font-size: .75rem; line-height: 1.3; margin-top: 3px; }
.provider-name .state { margin-left: auto; }
.state { display: inline-block; white-space: nowrap; border-radius: 20px; font-size: .75rem; font-weight: 670; line-height: 1.3; padding: 5px 8px; }
.state-neutral { color: #5a4e32; background: #f2ebd9; }
.state-success { color: #21563f; background: #e4f2e9; }
.state-error { color: #8a302a; background: #faeae6; }
.provider-details { margin: 7px 0 11px; font-size: .87rem; }
.provider-details div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.provider-details dt { color: var(--muted); }
.provider-details dd { font-weight: 630; text-align: right; overflow-wrap: anywhere; }
.provider-body form, .provider-setup { margin-top: auto; }
.provider-setup .button, .provider-body form .button { width: 100%; }
.provider-help, .provider-setup p { color: var(--muted); font-size: .875rem; margin: 0 0 9px; }
.provider-setup p { margin: 8px 0 0; }
.provider-setup summary { list-style: none; }
.provider-setup summary::-webkit-details-marker { display: none; }
.button { min-height: 41px; padding: 8px 13px; border-radius: 8px; border: 1px solid #cfe0d5; color: var(--green); font-size: .875rem; font-weight: 680; text-decoration: none; background: white; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-align: center; }
.button:hover { background: #f1f8f2; }
.button-primary { background: var(--green); color: white; border-color: var(--green); }
.button-primary:hover { background: var(--green-strong); border-color: var(--green-strong); }
.button-secondary { background: #f5f9f6; }
.button-danger { color: #8a302a; border-color: #e9ccc4; }
.button-danger:hover { background: #faeae6; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th, td { padding: 12px 12px; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
th { color: var(--muted); background: #f6f8f6; border-block: 1px solid var(--line); font-size: .8125rem; font-weight: 650; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
.requests-panel table { min-width: 625px; }
.empty-row { height: 70px; color: var(--muted); text-align: center; }
.empty-row .icon { color: #59836d; vertical-align: -4px; margin-right: 3px; }

.team-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, 1fr); align-items: start; gap: 18px; }
.team-stack { display: grid; gap: 18px; }
.team-grid table { min-width: 390px; }
.panel-form { display: grid; gap: 13px; padding: 0 19px 19px; }
.panel-form .button { justify-self: start; }
label, legend { color: var(--ink); font-size: .875rem; font-weight: 630; }
label > input:not([type="checkbox"]) { display: block; margin-top: 5px; width: 100%; }
input:not([type="checkbox"]) { min-height: 42px; padding: 8px 10px; border: 1px solid #cddad1; border-radius: 8px; background: white; color: var(--ink); }
input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; flex: 0 0 16px; margin: 0; }
.grant-picker { border: 0; border-top: 1px solid var(--line); padding: 8px 0 4px; margin: 4px 0; min-width: 0; }
.grant-picker legend { padding-right: 8px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.check-label { display: flex; align-items: center; gap: 6px; min-height: 31px; font-weight: 490; }
.panel-form small { margin-top: -7px; }
.text-link { color: var(--green); font-weight: 680; text-underline-offset: 3px; }
.cell-subtitle { display: block; color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.back-link { margin-bottom: 11px; font-size: .875rem; }
.account-panel { max-width: 500px; }
.section-empty { min-height: 278px; display: grid; align-content: center; justify-items: center; gap: 7px; text-align: center; padding: 18px; }
.section-empty .icon-tile { width: 52px; height: 52px; border-radius: 13px; margin-bottom: 4px; }
.section-empty h2 { font-size: 1.12rem; }
.section-empty p { font-size: .875rem; color: var(--muted); }

.notice { display: flex; align-items: center; gap: 8px; padding: 10px 13px; margin-bottom: 15px; border-radius: 8px; font-size: .875rem; }
.notice-error { background: #faeae6; color: #8a302a; border: 1px solid #efd6cf; }
.notice-success { background: #e4f2e9; color: #21563f; border: 1px solid #d1e7d8; }

.access-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(285px, .8fr) minmax(0, 1.2fr); }
.access-side { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; color: white; background: var(--nav); padding: clamp(22px, 5.7vw, 80px); }
.access-side .brand { align-self: start; }
.access-side p { font-size: clamp(2rem, 4.1vw, 4rem); font-weight: 750; letter-spacing: -.058em; line-height: 1.12; margin-bottom: 9vh; }
.access-lines { position: absolute; border: 1px solid #355b4c; width: 305px; height: 305px; border-radius: 26%; right: -95px; top: 20%; transform: rotate(-12deg); z-index: -1; box-shadow: 0 0 0 22px #1b372e, 0 0 0 23px #2f5144, 0 0 0 45px #192f29, 0 0 0 46px #27473a; }
.access-main { display: grid; place-items: center; padding: 30px; }
.access-form { width: min(100%, 390px); display: grid; gap: 15px; }
.access-form h1 { font-size: clamp(1.85rem, 3.2vw, 2.4rem); }
.access-form p { color: var(--muted); }
.access-form .button { min-height: 44px; margin-top: 3px; }
.access-form .notice { margin: 0; }
.error-body { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.error-content { padding: 24px; width: min(100%, 520px); display: grid; gap: 15px; justify-items: start; }
.error-content h1 { font-size: 1.85rem; }
.error-content p { color: var(--muted); }

.icon { display: inline-block; position: relative; flex: 0 0 18px; width: 18px; height: 18px; line-height: 1; vertical-align: middle; }
.icon::before, .icon::after { position: absolute; display: block; }
.icon-grid::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 1px; top: 2px; left: 2px; box-shadow: 8px 0, 0 8px, 8px 8px; }
.icon-bars::before { content: ""; left: 2px; bottom: 2px; height: 7px; width: 3px; background: currentColor; border-radius: 1px; box-shadow: 5px -4px, 10px -7px; }
.icon-bars::after { content: ""; width: 15px; left: 1px; bottom: 1px; border-bottom: 1px solid currentColor; }
.icon-trend::before, .icon-pulse::before { content: ""; inset: 2px 1px; background: currentColor; clip-path: polygon(0 67%, 31% 39%, 48% 58%, 100% 17%, 100% 31%, 49% 75%, 30% 56%, 0 82%); }
.icon-pulse::before { clip-path: polygon(0 45%, 24% 45%, 38% 9%, 57% 72%, 70% 45%, 100% 45%, 100% 56%, 76% 56%, 55% 97%, 36% 35%, 30% 56%, 0 56%); }
.icon-flag::before { content: ""; border-left: 1.5px solid currentColor; height: 16px; left: 3px; top: 1px; }
.icon-flag::after { content: ""; width: 11px; height: 9px; left: 4px; top: 2px; background: currentColor; clip-path: polygon(0 0, 100% 0, 76% 50%, 100% 100%, 0 100%, 0 83%, 72% 83%, 56% 50%, 72% 17%, 0 17%); }
.icon-card::before, .icon-book::before, .icon-chat::before, .icon-report::before, .icon-calendar::before { content: ""; inset: 3px 1px; border: 1.5px solid currentColor; border-radius: 3px; }
.icon-card::after { content: ""; inset: 7px 2px auto; border-top: 1.5px solid currentColor; }
.icon-book::after { content: ""; width: 1.5px; height: 11px; background: currentColor; left: 8px; top: 3px; }
.icon-chat::before { bottom: 4px; }
.icon-chat::after { content: ""; border-bottom: 1.5px solid currentColor; border-left: 1.5px solid currentColor; left: 5px; bottom: 2px; width: 4px; height: 4px; transform: skewY(-30deg); }
.icon-report::before { inset: 1px 3px; border-radius: 2px; }
.icon-report::after { content: ""; width: 6px; left: 6px; top: 6px; height: 1px; background: currentColor; box-shadow: 0 3px, 0 6px; }
.icon-calendar::before { inset: 3px 2px 2px; }
.icon-calendar::after { content: ""; width: 12px; left: 3px; top: 7px; border-top: 1.5px solid currentColor; }
.icon-users::before { content: ""; width: 6px; height: 6px; left: 4px; top: 1px; border: 1.5px solid currentColor; border-radius: 50%; box-shadow: 6px 1px 0 -1px currentColor; }
.icon-users::after { content: ""; width: 12px; height: 7px; left: 1px; bottom: 2px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; box-shadow: 4px 0 0 -1px currentColor; }
.icon-logout::before { content: ""; inset: 1px 6px 1px 2px; border: 1.5px solid currentColor; border-right: 0; border-radius: 3px; }
.icon-logout::after { content: ""; inset: 4px 1px 4px 6px; background: currentColor; clip-path: polygon(0 42%, 73% 42%, 48% 10%, 58% 0, 100% 50%, 58% 100%, 48% 90%, 73% 58%, 0 58%); }
.icon-layers::before, .icon-layers::after { content: ""; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; transform: scaleY(.68) rotate(45deg); left: 4px; top: 1px; }
.icon-layers::after { top: 6px; clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.icon-input::before, .icon-output::before { content: ""; width: 13px; height: 6px; border: 1.5px solid currentColor; border-top: 0; border-radius: 0 0 2px 2px; bottom: 2px; left: 2px; }
.icon-input::after, .icon-output::after { content: ""; width: 9px; height: 11px; top: 1px; left: 4px; background: currentColor; clip-path: polygon(42% 0, 58% 0, 58% 70%, 87% 47%, 100% 58%, 50% 100%, 0 58%, 13% 47%, 42% 70%); }
.icon-output::after { transform: rotate(180deg); }
.icon-spark::before { content: ""; background: currentColor; inset: 0; clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%); }
.icon-settings::before { content: ""; border: 1.5px solid currentColor; border-radius: 50%; inset: 2px; }
.icon-settings::after { content: ""; border: 1.5px solid currentColor; border-radius: 50%; inset: 6px; }
.icon-menu::before { content: ""; height: 1.5px; background: currentColor; inset: 4px 1px auto; box-shadow: 0 5px, 0 10px; }
.icon-check::before { content: ""; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; width: 8px; height: 13px; top: 1px; left: 5px; transform: rotate(45deg); }
.icon-info::before { content: ""; border: 1.5px solid currentColor; border-radius: 50%; inset: 1px; }
.icon-info::after { content: "!"; inset: 2px 0 0; text-align: center; font-size: 12px; font-weight: 800; }

@media (max-width: 1120px) {
  .app-layout { grid-template-columns: 208px minmax(0, 1fr); }
  .topbar, .main-content { padding-left: 23px; padding-right: 23px; }
  .monitor-grid { grid-template-columns: minmax(0, 1.4fr) minmax(275px, 1fr); }
  .metric { padding-inline: 12px; }
  .chart-panel .panel-heading { flex-wrap: wrap; }
}
@media (max-width: 910px) {
  .monitor-grid, .team-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-top { min-height: 41px; }
  .metric-top .icon-tile { display: none; }
  .metric { min-height: 100px; }
}
@media (max-width: 680px) {
  .app-layout { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; }
  .sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0; }
  .brand { font-size: 1.1rem; }
  .brand-mark { width: 29px; height: 29px; flex-basis: 29px; }
  .sidebar-nav { grid-column: 1 / -1; grid-row: 2; margin: 8px 0; }
  .nav-group + .nav-group { margin-top: 10px; }
  .js .sidebar-nav { display: none; }
  .js .sidebar[data-menu-open] .sidebar-nav, .js .menu-toggle { display: grid; }
  .sidebar-footer { grid-column: 2; grid-row: 1; padding: 0 0 0 6px; border-top: 0; margin: 0; }
  .profile-text { display: none; }
  .profile { flex: none; }
  .avatar { width: 29px; height: 29px; flex-basis: 29px; }
  .topbar { min-height: 45px; padding: 8px 15px; }
  .main-content { padding: 19px 14px 30px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 17px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
  .metric { min-height: 86px; }
  .metric-top { min-height: 30px; }
  .metric-top .icon-tile { display: inline-grid; width: 26px; height: 26px; flex-basis: 26px; }
  .metric strong { font-size: 1.65rem; }
  .monitor-grid, .team-grid, .team-stack { gap: 12px; margin-bottom: 12px; }
  .panel-heading { padding: 14px; }
  .provider-body, .panel-form { padding-inline: 14px; }
  .access-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .access-side { padding: 16px 18px; }
  .access-side p, .access-lines { display: none; }
  .access-main { padding: 22px 17px; }
}
