:root {
  color-scheme: light;
  --paper: #e9ede4;
  --surface: #eef0e8;
  --ink: #26392e;
  --muted: #4e5c53;
  --gold: #f3e5b6;
  --umber: #614831;
  --lift: 8px 8px 20px #cdd3ca, -8px -8px 20px #fafbf5;
  --inset: inset 3px 3px 7px #d1d8ce, inset -3px -3px 7px #f8faf4;
  font: 15px/1.5 system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #ecefeb;
}
* { box-sizing: border-box; }
:where(body, .palette-swatch) {
  --paper: #ecefeb;
  --surface: #f1f3ef;
  --rail: #e6ebe5;
  --field: #e9ede7;
  --line: #dce3da;
  --rim: #f7f8f5;
  --shade: #d3d9d1;
  --light: #fbfcf9;
  --metric-top: #f2f4f0;
  --metric-base: #e7ede5;
  --attention-top: #f3f3eb;
  --attention-base: #ebeee4;
  --login-glow: #e1e9df;
  --ink: #26392e;
  --muted: #4e5c53;
  --link: #335746;
  --link-hover: #593c21;
  --focus: #43684e;
  --accent: #d8e7ce;
  --accent-hover: #cbdcbe;
  --accent-rim: #f1f6ed;
  --accent-shade: #c8d3c4;
  --accent-light: #fafcf7;
  --accent-ink: #263e30;
  --nav-hover: #edf1e7;
  --nav-current: #d7e5ce;
  --nav-shade: #bfcfba;
  --nav-light: #edf6e5;
  --quiet: #ede6d9;
  --quiet-ink: #614831;
  --lift: 8px 8px 20px var(--shade), -8px -8px 20px var(--light);
  --inset: inset 3px 3px 7px var(--shade), inset -3px -3px 7px var(--light);
}
body { margin: 0; background-color: var(--paper); color: var(--ink); }
.theme-ivory {
  --paper: #fbfaf8; --surface: #fff; --rail: #f1f0ed; --field: #fff;
  --line: #e5e1dd; --rim: #e5e1dd; --shade: #eae6e2; --light: #fff;
  --metric-top: #fff; --metric-base: #fff;
  --attention-top: #fff; --attention-base: #fff;
  --ink: #292831; --muted: #5f5b65; --link: #5f4b80; --link-hover: #44335e; --focus: #725e93;
  --accent: #eae2f5; --accent-hover: #e1d6f0; --accent-rim: #dcd1ec;
  --accent-ink: #423352;
  --nav-hover: #eae8e5; --nav-current: #e6e1ee;
  --notice: #ede7f4; --quiet: #f9f8f7; --quiet-ink: var(--ink);
  --lift: 0 1px 3px #28222b08; --inset: none;
}
.workspace.theme-ivory aside { border-inline-end: 1px solid var(--line); }
.login.theme-ivory { background: var(--paper); }
.theme-ivory :is(input, select, textarea) { border-color: var(--line); }
.theme-ivory nav a.current,
.theme-ivory :is(button, .button),
.theme-ivory input::file-selector-button { box-shadow: none; }
.theme-ivory .quiet { border-color: var(--line); }
.theme-ivory .quiet:hover { background: var(--nav-hover); }
.theme-stone {
  --paper: #ebedee; --surface: #f0f1f2; --rail: #e3e7e8; --field: #e8ebed;
  --line: #dce1e2; --rim: #f7f8f8; --shade: #d3d8da; --light: #fafbfc;
  --metric-top: #f1f3f3; --metric-base: #e6eaeb;
  --attention-top: #f2f3ef; --attention-base: #e8ebe6; --login-glow: #e1e7e6;
}
.theme-mist {
  --paper: #e8eee9; --surface: #eef3ef; --rail: #e0e9e2; --field: #e5ede7;
  --line: #d5e2d8; --rim: #f5f9f6; --shade: #cedad2; --light: #f8fbf9;
  --metric-top: #eef4ef; --metric-base: #e1ebe4;
  --attention-top: #f0f3ef; --attention-base: #e6eee5; --login-glow: #dceae0;
}
.theme-linen {
  --paper: #f1eee6; --surface: #f7f3eb; --rail: #ebe7dc; --field: #ece8df;
  --line: #e1dbce; --rim: #fdfaf3; --shade: #ddd6c9; --light: #fffdf8;
  --metric-top: #f8f4ed; --metric-base: #eae8db;
  --attention-top: #f6efd9; --attention-base: #efe8d6; --login-glow: #e8e8d8;
  --ink: #333a2a; --muted: #565e4a; --link: #475836; --link-hover: #5e4933; --focus: #606d48;
  --accent: #dce4c9; --accent-hover: #d2ddba; --accent-rim: #f4f7ea;
  --accent-shade: #d1d4c2; --accent-light: #fffcf4; --accent-ink: #344228;
  --nav-hover: #f3f0e6; --nav-current: #dfe5d0; --nav-shade: #c9d1b9; --nav-light: #f0f4e7;
  --notice: #e3ead5; --quiet: #eae2d3; --quiet-ink: #634d36;
}
.theme-slate {
  --paper: #e8edf3; --surface: #eff3f7; --rail: #e0e7ef; --field: #e4eaf1;
  --line: #dbe3ec; --rim: #f7faff; --shade: #d0d9e4; --light: #fbfdff;
  --metric-top: #f3f6fa; --metric-base: #e4ebf4;
  --attention-top: #eef1f8; --attention-base: #e1e7f0; --login-glow: #dbe6f1;
  --ink: #25394b; --muted: #4e6072; --link: #3a5774; --link-hover: #2d4460; --focus: #416689;
  --accent: #d1e1f2; --accent-hover: #c2d8ed; --accent-rim: #eef5fe;
  --accent-shade: #c9d5e2; --accent-light: #f9fcff; --accent-ink: #27445e;
  --nav-hover: #edf3f9; --nav-current: #d7e5f4; --nav-shade: #c2d4e7; --nav-light: #eef5fd;
  --notice: #dbe8f5; --quiet: #e4eaf1; --quiet-ink: #3f5469;
}
.theme-plum {
  --paper: #eee9ef; --surface: #f5f0f5; --rail: #e8e0e9; --field: #ebe4ed;
  --line: #e3d9e5; --rim: #fcf8fc; --shade: #dcd1df; --light: #fffbff;
  --metric-top: #f7f2f7; --metric-base: #ece3ee;
  --attention-top: #f6edf2; --attention-base: #eee3ed; --login-glow: #e9dce9;
  --ink: #3e3045; --muted: #605269; --link: #624368; --link-hover: #4d3658; --focus: #77547d;
  --accent: #e8d7ea; --accent-hover: #e0cde3; --accent-rim: #faf0fa;
  --accent-shade: #d9cadc; --accent-light: #fffaff; --accent-ink: #503655;
  --nav-hover: #f4edf5; --nav-current: #e9d9eb; --nav-shade: #d6c5da; --nav-light: #faf1fb;
  --notice: #eddeee; --quiet: #ece2ec; --quiet-ink: #604661;
}
a { color: var(--link); text-underline-offset: .23em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.06; letter-spacing: -.055em; }
h2 { font-size: 1.13rem; letter-spacing: -.025em; margin-bottom: 15px; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
aside { background: var(--rail); padding: 24px 17px; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-size: 1.1rem; font-weight: 760; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.brand-mark { display: block; width: 52px; height: 38px; flex: none; object-fit: cover; object-position: center 62%; }
.login-card .brand-mark { width: 78px; height: 55px; }
nav { display: grid; gap: 5px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 10px 9px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 580; }
.nav-icon { display: block; flex: none; width: 20px; height: 20px; color: inherit; }
nav a:hover { background: var(--nav-hover); }
nav a.current { background: var(--nav-current); box-shadow: inset 2px 2px 6px var(--nav-shade), inset -2px -2px 5px var(--nav-light); font-weight: 740; }
aside form { margin-top: auto; }
main { width: 100%; max-width: 1500px; min-width: 0; padding: clamp(19px, 4vw, 52px); }
header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; }
.eyebrow { color: var(--muted); margin-bottom: 9px; font-weight: 700; font-size: .78rem; }
.panel { background: var(--surface); box-shadow: var(--lift); border-radius: 20px; padding: 21px; margin-bottom: 20px; border: 1px solid var(--rim); }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.metric { background: linear-gradient(145deg,var(--metric-top),var(--metric-base)); min-height: 105px; }
.metric span { display: block; color: var(--muted); font-weight: 630; }
.metric strong { display: block; margin-top: 7px; font-size: clamp(1.12rem,2vw,1.7rem); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric:nth-child(3) { background: linear-gradient(145deg,var(--attention-top),var(--attention-base)); }
.switch, .quick { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.registry-header { display: grid; grid-template-columns: minmax(0, 1fr); }
.registry-filters { max-width: 100%; }
.registry-filters > label:first-of-type { flex: 0 1 15rem; }
.registry-filters > label:has(select) { max-width: 100%; }
.registry-filters .registry-search { flex: 1 1 15rem; }
.registry-filters button, .registry-filters .button { white-space: nowrap; }
.fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 14px; margin-bottom: 15px; }
label { display: grid; min-width: 0; gap: 6px; font-size: .82rem; color: var(--muted); font-weight: 700; }
input, select, textarea { background: var(--field); box-shadow: var(--inset); border: 1px solid transparent; border-radius: 11px; font: inherit; color: var(--ink); padding: 9px 11px; min-height: 43px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
button, .button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--accent-rim); background: var(--accent); box-shadow: 4px 4px 9px var(--accent-shade), -4px -4px 9px var(--accent-light); color: var(--accent-ink); font: inherit; font-weight: 720; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-hover); }
button:active, .button:active { box-shadow: var(--inset); }
input[type="file"] { max-width: 100%; padding: 5px 9px; }
input::file-selector-button {
  border: 1px solid var(--accent-rim);
  border-radius: 9px;
  margin-inline-end: 8px;
  padding: 6px 9px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 2px 2px 5px var(--accent-shade), -2px -2px 5px var(--accent-light);
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}
input::file-selector-button:hover { background: var(--accent-hover); }
input::file-selector-button:active { box-shadow: var(--inset); }
.quiet { background: var(--quiet); color: var(--quiet-ink); }
.notice { background: var(--notice, #dce9d4); padding: 10px 14px; border-radius: 11px; margin-bottom: 18px; }
.error, .warning { background: var(--gold); color: var(--umber); }
.pill { display: inline-block; padding: 4px 9px; border-radius: 20px; background: var(--accent); font-size: .78rem; font-weight: 720; }
.pill.warning { background: var(--gold); }
.scroll { max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { color: var(--muted); background: var(--field); font-size: .8rem; }
th, td { padding: 9px 12px; vertical-align: middle; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); min-width: 80px; }
.date-group th { background: var(--metric-base); color: var(--ink); font-size: .9rem; font-variant-numeric: tabular-nums; }
.empty, .muted { color: var(--muted); }
.muted { margin: -6px 0 20px; }
.mini .fields { display: none; }
.mini button { min-height: 35px; padding: 4px 8px; font-size: .8rem; }
.login { display: grid; min-height: 100vh; place-items: center; background: radial-gradient(ellipse at top left,var(--login-glow),transparent 64%),radial-gradient(ellipse at bottom right,var(--light),transparent 52%),var(--paper); }
.login main { max-width: 500px; }
.login-card { padding: clamp(22px,7vw,39px); }
.login-card h1 { margin-top: 18px; }
.login-card p { color: var(--muted); margin: 10px 0 22px; }
.login-card form { display: grid; gap: 15px; }
.overview-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 16px;
}
.overview-header + .metrics { margin-bottom: 16px; }
.overview-header + .metrics .metric { margin-bottom: 0; }
.overview-filter { position: relative; min-width: 0; }
.overview-filter summary { justify-content: space-between; gap: 10px; list-style: none; }
.overview-filter summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-filter summary::-webkit-details-marker { display: none; }
.overview-filter summary::after {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.overview-filter[open] summary::after { transform: translateY(2px) rotate(225deg); }
.overview-filter ul {
  position: absolute;
  z-index: 2;
  inset-inline-end: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 38px));
  max-height: min(60vh, 25rem);
  overflow: auto;
  list-style: none;
  margin: 6px 0 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 6px 16px #28222b16;
}
.overview-filter li a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}
.overview-filter li a:hover,
.overview-filter li a[aria-current] { background: var(--nav-current); }
@media (max-width: 520px) {
  .overview-header { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .overview-filter ul { inset-inline: 0 auto; }
}

@media (max-width: 1020px) { .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } header { align-items: start; flex-direction: column; } }
.mobile-menu { display: none; }
@media (max-width: 700px) {
  .workspace { display: block; }
  .workspace aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
  }
  .workspace aside > form { grid-column: 2; grid-row: 1; margin: 0; }
  .brand > span { min-width: 0; overflow-wrap: anywhere; }
  .desktop-nav { display: none; }
  .mobile-menu { display: block; grid-column: 1 / -1; }
  .mobile-menu summary { width: 100%; min-height: 44px; justify-content: space-between; gap: 8px; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu summary::after { content: '▾'; }
  .mobile-menu[open] summary::after { content: '▴'; }
  .mobile-menu summary span { margin-inline-start: auto; font-size: .82rem; text-align: end; }
  .mobile-menu nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding-top: 8px; }
  .mobile-menu nav a { min-height: 44px; padding: 7px; gap: 7px; overflow-wrap: anywhere; font-size: .88rem; }
  .overview-header { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .overview-filter, .overview-filter summary { width: 100%; }
  .overview-filter ul { inset-inline: 0; width: 100%; max-width: 100%; }
  .registry-filters { width: 100%; }
  .registry-filters > label:first-of-type { flex-basis: 100%; }
  .registry-filters select[name=org] { min-width: 0; width: 100%; }
  input, select, textarea { font-size: 16px; min-inline-size: 0; }
  button, .button { min-height: 44px; }
  .panel { padding: 15px; }
  .metrics { gap: 10px; }
}
@media (max-width: 340px) { .metrics { grid-template-columns: 1fr; } .brand small { display: none; } }

.panel > .quick + .scroll, .panel > .quick + .empty { margin-top: 15px; }
#contact-form, #contract-form { scroll-margin-top: 18px; }

.palette-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 146px), 1fr));
  gap: 12px;
}
.palette-option {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 680;
  min-width: 0;
}
.palette-option:hover { background: var(--nav-hover); color: var(--ink); }
.palette-option[aria-current='true'] {
  border-color: var(--focus);
  box-shadow: var(--inset);
}
.palette-swatch {
  position: relative;
  display: block;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--rim);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--rail) 24%, var(--paper) 24%);
}
.palette-swatch::before, .palette-swatch::after { content: ''; position: absolute; display: block; }
.palette-swatch::before {
  top: 12px;
  left: 35%;
  right: 12%;
  height: 18px;
  border: 1px solid var(--rim);
  border-radius: 5px;
  background: linear-gradient(145deg, var(--surface), var(--metric-base));
  box-shadow: 2px 2px 5px var(--shade), -2px -2px 5px var(--light);
}
.palette-swatch::after {
  bottom: 8px;
  left: 35%;
  width: 28%;
  height: 9px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 1px 2px 4px var(--accent-shade);
}
.palette-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 16px;
}
.palette-actions p { color: var(--muted); }

/* Native selection, with a themed picker in browsers that support it. */
select {
  appearance: none;
  padding-inline-end: 33px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

@supports (appearance: base-select) and selector(::picker(select)) {
  select, ::picker(select) { appearance: base-select; }
  select {
    align-items: center;
    padding-inline-end: 12px;
    background-image: none;
  }
  select::picker-icon { color: var(--muted); }
  select:open::picker-icon { transform: rotate(180deg); }
  ::picker(select) {
    margin-block: 6px;
    padding: 5px;
    max-height: min(50vh, 320px);
    overflow: auto;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--rim);
    border-radius: 13px;
    box-shadow: 5px 8px 20px var(--shade), -2px -2px 8px var(--light);
  }
  select option {
    align-items: center;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 8px;
    font-weight: 550;
    cursor: pointer;
  }
  select option:checked { background: var(--nav-current); font-weight: 700; }
  select option:hover, select option:focus-visible {
    background: var(--accent);
    outline: none;
  }
  select option::checkmark {
    order: 1;
    margin-inline-start: auto;
    color: var(--accent-ink);
  }
}


.report-views,
.report-period,
.report-period form { display: flex; flex-wrap: nowrap; align-items: end; gap: 10px; }
.report-views,
.report-period { overflow-x: auto; padding: 4px; margin-inline: -4px; }
.report-views .button,
.report-period > *,
.report-period form button { flex: none; white-space: nowrap; }
.report-views .button:not([aria-current]) {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
  box-shadow: none;
}
.report-views .button:not([aria-current]):hover { background: var(--nav-hover); }
.report-period { margin-top: 10px; }
.report-period input { width: auto; min-inline-size: 9rem; }
