:root {
  color-scheme: light;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #202622;
  background: #f4f6f4;
  --ink: #202622;
  --muted: #58625c;
  --line: #dde4df;
  --paper: #fff;
  --sidebar: #202321;
  --sidebar-text: #e4eae5;
  --accent: #f3bc4a;
  --accent-ink: #392e19;
  --forest: #365947;
  --green: #286444;
  --amber: #865207;
  --red: #9c3d33;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button[disabled] { cursor: wait; opacity: .65; }
a { color: #3a5747; text-underline-offset: 3px; }
a:hover { color: #6a4600; }
:focus-visible { outline: 3px solid #ab6800; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.055em; line-height: 1.08; }
h2 { font-size: 1.22rem; letter-spacing: -.022em; line-height: 1.3; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip-link { position: fixed; left: 1rem; top: -4rem; background: var(--paper); padding: 10px; z-index: 10; }
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; background: var(--sidebar); color: var(--sidebar-text); }
.brand { color: #f7faf7; padding: 23px 18px 20px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand:hover { color: #fff; }
.brand strong { font-size: 1.16rem; font-weight: 750; letter-spacing: -.046em; display: block; }
.brand b { color: #f4c253; }
.brand small { display: block; color: #bcc6bf; font-size: .78rem; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: #262319; display: grid; place-items: center; font-size: 1.23rem; font-weight: 900; }
#navigation { padding: 0 10px 10px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #555f57 transparent; }
.nav-group { margin: 0 0 16px; }
.nav-label { color: #b8c3bb; padding: 0 8px 3px; text-transform: uppercase; letter-spacing: .075em; font-size: .75rem; font-weight: 650; }
.nav-item { color: var(--sidebar-text); border-radius: 7px; text-decoration: none; display: flex; align-items: center; gap: 8px; min-height: 37px; padding: 6px 8px; font-size: .875rem; font-weight: 570; }
.nav-item:hover, .nav-item[aria-current="page"] { background: #343a35; color: #fff; }
.nav-item[aria-current="page"] { box-shadow: inset 3px 0 0 #f3bc4a; color: #ffd479; }
.nav-icon { width: 18px; text-align: center; font-size: .98rem; color: #bfcac1; }
.nav-item[aria-current="page"] .nav-icon { color: inherit; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #454c47; padding: 13px 18px; font-size: .8rem; color: #c0cbc2; }
.demo-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.page { display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); min-height: 63px; padding: 8px clamp(14px, 2.75vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.breadcrumbs, .connection { color: var(--muted); font-size: .875rem; }
.top-actions, .role-control { display: flex; align-items: center; gap: 10px; }
.role-control { font-weight: 650; }
.role-control span { white-space: nowrap; }
.connection { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.menu-button { display: none; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--ink); }
main { width: 100%; max-width: 1660px; margin: 0 auto; flex: 1; padding: 26px clamp(14px, 2.75vw, 42px) 42px; }
.footer { padding: 8px clamp(14px, 2.75vw, 42px) 20px; font-size: .8rem; color: var(--muted); }
.footer span { margin: 0 7px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; margin-bottom: 19px; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 76ch; }
.head-actions, .filters, .actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.filters { margin-bottom: 13px; }
.filters select, .filters input { max-width: 100%; }
.card { border: 1px solid var(--line); border-radius: 13px; background: var(--paper); min-width: 0; padding: 17px; }
.card + .card.stack { margin-top: 12px; }
.card-head { display: flex; justify-content: space-between; gap: 9px; align-items: start; flex-wrap: wrap; }
.card-head p, .card > h2 + p { margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.section { margin: 0 0 13px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.kpi { padding: 12px; border-radius: 11px; }
.kpi strong { display: block; font-size: clamp(1.15rem, 2.05vw, 1.83rem); font-variant-numeric: tabular-nums; letter-spacing: -.05em; margin: 4px 0; white-space: nowrap; }
.kpi .small { min-height: 2.55em; line-height: 1.28; font-weight: 640; }
.kpi small { display: block; font-size: .79rem; color: var(--muted); }
.kpi.attention { border-color: #e8b5a8; }
.kpi a { text-decoration: none; color: var(--ink); }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d3dcd5; border-radius: 8px; padding: 7px 12px; min-height: 38px; background: #fff; color: #26362c; font-size: .875rem; font-weight: 690; text-decoration: none; }
.button:hover { background: #f2f5f2; color: var(--ink); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: #e3a936; }
.button.primary:hover { background: #f8ca68; }
.button.small { min-height: 32px; padding: 4px 8px; }
.pill { display: inline-flex; align-items: center; max-width: 100%; border-radius: 5px; padding: 2px 7px; background: #edf1ed; color: #46524a; font-size: .79rem; font-weight: 690; }
.pill.green { background: #e6f1e8; color: var(--green); }
.pill.amber { background: #fff0d5; color: var(--amber); }
.pill.red { background: #fceae6; color: var(--red); }
.notice { margin-bottom: 14px; border: 1px solid #eed5a2; border-radius: 10px; background: #fff6df; color: #684709; padding: 12px 14px; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; }
.notice p { font-size: .9rem; }
.notice.danger { color: #87372e; background: #fff0ed; border-color: #edc3bb; }
.tabs { border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 3px 15px; margin: -1px 0 14px; }
.tabs a { border-bottom: 3px solid transparent; text-decoration: none; color: var(--muted); font-size: .875rem; font-weight: 650; padding: 7px 2px; }
.tabs a[aria-current="page"] { color: #553805; border-color: #c28320; }
.link-row { padding: 9px 0; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 5px 8px; border-bottom: 1px solid #eaf0eb; }
.link-row:last-child { border-bottom: 0; padding-bottom: 1px; }
.link-row a { font-weight: 680; }
.link-row small { display: block; color: var(--muted); font-size: .8rem; }
.task-list { margin-top: 8px; }
.linked-records { max-height: 420px; overflow: auto; }
.chart { min-height: 184px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; margin-top: 12px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: .76rem; padding: 0 0 23px; text-align: right; }
.chart-bars { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); align-items: end; gap: 3px; min-width: 0; background: repeating-linear-gradient(to top, transparent 0 42px, #e7ede9 42px 43px); background-size: 100% calc(100% - 23px); background-repeat: no-repeat; }
.bar-group { display: grid; grid-template-rows: minmax(0, 1fr) 23px; gap: 0; min-width: 0; height: 184px; border: 0; padding: 0 2px; background: transparent; color: var(--muted); font-size: .73rem; }
.bar-group:hover, .bar-group[aria-pressed="true"] { background: #f7f4e8; border-radius: 6px; }
.bar-pair { display: flex; align-items: end; justify-content: center; gap: 3px; min-height: 0; }
.bar { width: 33%; max-width: 31px; height: var(--height); border-radius: 4px 4px 0 0; background: #d19939; }
.bar.cost { background: #476756; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: .78rem; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: #d19939; margin-right: 4px; }
.legend span.cost::before { background: #476756; }
.mini-list { display: grid; gap: 9px; margin-top: 11px; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 7px; font-size: .875rem; }
.mini-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { display: block; width: 100%; height: 5px; border: 0; border-radius: 5px; background: #e7ede8; overflow: hidden; }
.meter::-webkit-progress-bar { background: #e7ede8; }
.meter::-webkit-progress-value { background: #637f69; }
.meter::-moz-progress-bar { background: #637f69; }
.table-wrap { overflow: auto; max-height: 540px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th { position: sticky; top: 0; background: #f2f5f2; text-align: left; color: #4b584f; font-size: .8rem; white-space: nowrap; }
th, td { padding: 9px 8px; border-bottom: 1px solid #e9eee9; }
th button { background: transparent; color: inherit; border: 0; padding: 1px; font-size: inherit; font-weight: 700; }
td:first-child { min-width: 150px; }
td a { font-weight: 680; }
.number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pagination { display: flex; justify-content: end; align-items: center; gap: 8px; margin-top: 11px; font-size: .85rem; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 10px; }
.form .wide { grid-column: 1 / -1; }
label { display: grid; gap: 4px; font-size: .875rem; color: #45534a; font-weight: 650; }
input, select, textarea { color: #26352b; background: #fff; border: 1px solid #c9d4cc; border-radius: 7px; padding: 7px 9px; font-size: .875rem; min-width: 0; min-height: 36px; }
select { appearance: none; padding-right: 29px; background-image: linear-gradient(45deg, transparent 50%, #4b5b50 50%), linear-gradient(135deg, #4b5b50 50%, transparent 50%); background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%; background-repeat: no-repeat; background-size: 5px 5px; }
textarea { width: 100%; min-height: 81px; resize: vertical; }
input[type="checkbox"] { justify-self: start; min-height: auto; }
.form-alert { color: var(--red); padding: 8px 10px; background: #fff1ee; border-radius: 6px; }
.details { margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }
.details div { min-width: 0; border-bottom: 1px solid #eaf0eb; padding-bottom: 6px; }
dt { font-size: .8rem; color: var(--muted); }
dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.notes { margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.field-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; text-decoration: none; min-height: 83px; align-content: center; }
.tile strong { font-size: 1.02rem; }
.tile:hover { border-color: #baa66b; background: #fffdf5; }
.toast { position: fixed; right: 14px; bottom: 14px; padding: 10px 13px; border-radius: 8px; max-width: min(calc(100vw - 28px), 460px); background: #24382d; color: #fff; z-index: 4; box-shadow: 0 4px 14px #101b1640; }
.empty { padding: 13px 0; color: var(--muted); }
@media (max-width: 1220px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi .small { min-height: auto; } }
@media (max-width: 1000px) { .app-shell { grid-template-columns: 201px minmax(0, 1fr); } .grid-2 { grid-template-columns: minmax(0, 1fr); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { display: none; height: unset; max-height: 75vh; position: absolute; inset: 54px auto auto 0; width: min(298px, 92vw); z-index: 3; box-shadow: 4px 8px 24px #09150e44; }
  .sidebar.is-open { display: flex; }
  .menu-button { display: block; white-space: nowrap; }
  .topbar { min-height: 54px; justify-content: space-between; }
  .breadcrumbs, .role-control span { display: none; }
  .top-actions { gap: 5px; }
  .topbar select { min-width: 0; max-width: 47vw; }
  .grid-3, .form { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { margin-bottom: 14px; }
  .card { padding: 12px; }
}
