:root {
  color-scheme: light;
  --bg: #f6f7fa;
  --card: #fff;
  --text: #202538;
  --muted: #6c7586;
  --line: #e1e5ec;
  --blue: #3659d6;
  --soft: #f1f4ff;
  --warn: #8d6828;
  --warnbg: #fff9eb;
  --green: #2d735e;
  --shadow: 0 2px 6px #25315606;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font:
    14px/1.6 -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-variant-numeric: tabular-nums;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
input,
select,
textarea {
  border: 1px solid #cdd5e3;
  border-radius: 5px;
  background: white;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 20px;
}
input:not([type="checkbox"]):not([type="radio"]),
select {
  height: 36px;
}
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #c7d0df;
  border-radius: 5px;
  background: white;
  color: #353e50;
  font-size: 13px;
  font-weight: 450;
  line-height: 20px;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: 0 1px 1px #24304a03;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
}
select { cursor: pointer; }
button:hover:not(:disabled),
.btn:hover {
  background: #f7f9fd;
  border-color: #a8b6cc;
  color: #2448bb;
  text-decoration: none;
}
button:active:not(:disabled),
.btn:active { background: #edf2fc; }
button:disabled {
  color: #a1a8b5;
  border-color: #e2e6ed;
  background: #fcfcfd;
  box-shadow: none;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #5478e7;
  outline-offset: 3px;
}
button.primary,
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 500;
  box-shadow: 0 1px 2px #2c4ec21a;
}
button.primary:hover:not(:disabled),
.btn.primary:hover {
  color: white;
  background: #2e4fc2;
  border-color: #2e4fc2;
}
button.primary:disabled { opacity: .55; }
.quiet { background: transparent; box-shadow: none; }
.danger { color: #aa4848; }
.small {
  font-size: 12px;
  min-height: 30px;
  padding: 4px 10px;
  line-height: 20px;
}
.icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  vertical-align: middle;
  pointer-events: none;
}
[hidden] { display: none !important; }
small,
.muted,
.meta {
  color: var(--muted);
  font-size: 12px;
}
header {
  background: white;
  border-bottom: 1px solid var(--line);
}
.topbar,
nav,
main,
footer {
  max-width: 1440px;
  padding-inline: clamp(18px, 3vw, 44px);
  margin: auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  gap: 20px;
}
.brand,
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.brand {
  min-width: 0;
  flex: 1 1 auto;
}
.brand-copy {
  display: block;
  min-width: 0;
}
.profile {
  flex: 0 0 auto;
}
.brand:hover {
  text-decoration: none;
}
.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0.2px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}
.brand small {
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}
.brand small,
.profile small {
  display: block;
}
.profile strong {
  font-size: 13px;
}
.avatar {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-weight: 600;
}
.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: contain;
}
nav {
  display: flex;
  gap: 28px;
  min-height: 47px;
  overflow: auto;
}
nav a {
  padding: 11px 3px;
  color: #616b7b;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
nav a.active {
  color: var(--text);
  border-color: var(--blue);
  font-weight: 650;
}
nav a:hover {
  text-decoration: none;
  color: var(--blue);
}
main {
  min-height: calc(100vh - 194px);
  padding-top: 28px;
  padding-bottom: 40px;
}
footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  padding-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
}
.page-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
}
.page-heading h1 {
  margin: 0 0 4px;
  font-size: 25px;
  letter-spacing: -0.5px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}
.panel h2,
.panel h3 {
  margin: 0;
  font-size: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-head p {
  margin: 4px 0 0;
}
.badge {
  display: inline-block;
  border-radius: 4px;
  background: var(--soft);
  color: var(--blue);
  font-size: 11px;
  padding: 3px 7px;
  white-space: nowrap;
}
.badge.neutral {
  background: #f1f3f6;
  color: #687182;
}
.badge.good {
  background: #edf7f1;
  color: var(--green);
}
.badge.warn {
  background: var(--warnbg);
  color: var(--warn);
}
.notice {
  padding: 12px 16px;
  border: 1px solid #e8d8b4;
  border-left: 3px solid #a98240;
  border-radius: 7px;
  background: var(--warnbg);
  color: var(--warn);
  font-size: 12px;
  margin-bottom: 20px;
}
.notice.info {
  background: #f0f3fc;
  border-color: #d9def5;
  border-left-color: #7c88c0;
  color: #52608e;
}
.notice strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
.notice p {
  margin: 3px 0;
}
.toast {
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: 7px;
  background: #edf8f1;
  border: 1px solid #cce5d4;
  color: #2c6a47;
}
.toast.error {
  background: #fff3f2;
  border-color: #f0d4d0;
  color: #a44941;
}
.loading {
  padding: 70px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}
.loading span {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid #dce1f0;
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.login-wrap {
  max-width: 460px;
  margin: 60px auto;
}
.login-wrap h1 {
  font-size: 24px;
  margin: 0 0 9px;
}
.login-wrap .panel {
  padding: 32px;
}
.login-wrap .intro {
  margin-bottom: 24px;
}
.login-wrap button[type="submit"] {
  width: 100%;
  margin-top: 5px;
}
.login-links {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label,
.field > span {
  font-size: 12px;
  font-weight: 550;
  color: #626d7e;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
}
.field.full {
  grid-column: 1/-1;
}
.field small {
  line-height: 1.5;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}
.project-picker { display: grid; gap: 14px; }
.project-choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.project-choice-heading { margin: 0 0 7px; padding: 0; color: #58677c; font-size: 12px; font-weight: 550; }
.project-choice-group > .project-choice + .project-choice { margin-top: 2px; }
.field .project-choice { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; color: var(--text); font-size: 12px; font-weight: 450; cursor: pointer; }
.project-choice:hover { background: #f6f8fc; }
.project-choice input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--blue); }
.project-choice-copy { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; min-width: 0; flex: 1; }
.project-choice-copy strong { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.project-choice-copy small { font-size: 11px; font-weight: 400; color: var(--muted); }
.assigned-projects { border-top: 1px solid var(--line); padding-top: 11px; }
.assigned-projects > summary { color: #647087; font-size: 12px; cursor: pointer; padding: 2px 0; }
.assigned-projects > summary:hover { color: var(--blue); }
.assigned-projects > summary:focus-visible { outline: 2px solid #5478e7; outline-offset: 3px; border-radius: 2px; }
.assigned-projects[open] > summary { margin-bottom: 7px; }
.assigned-projects .project-choice { cursor: default; }
.assigned-projects .project-choice:hover { background: transparent; }
.project-picker .project-empty { margin: 0; padding: 6px 10px; background: #f9fafc; border-radius: 5px; }
.form-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding-top: 18px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.customer-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 22px;
}
.customer-card.selected {
  border-color: #afb5de;
  box-shadow: 0 0 0 1px #dde0f5;
}
.customer-card .card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.customer-card h2 {
  font-size: 18px;
  margin: 0;
}
.customer-card .card-title .badge {
  margin-left: auto;
}
.customer-card p {
  color: var(--muted);
  font-size: 12px;
  margin: 7px 0;
}
.customer-card .actions {
  margin-top: 20px;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 20px;
}
.admin-grid > .panel {
  margin: 0;
}
.section-gap {
  margin-top: 24px;
}
.selection-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}
.selection-bar select {
  min-width: 140px;
}

.funding-selector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 22px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.funding-selector > label, .funding-selector > span { color: var(--muted); font-size: 13px; margin-right: 4px; }
.funding-types { display: inline-flex; align-items: center; gap: 0; }
.funding-types button { min-height: 34px; padding: 5px 16px; border-radius: 0; box-shadow: none; }
.funding-types button:first-child { border-radius: 5px 0 0 5px; }
.funding-types button:last-child { border-radius: 0 5px 5px 0; margin-left: -1px; }
.funding-types button[aria-pressed="true"] { background: var(--soft); color: var(--blue); border-color: #acbce9; position: relative; z-index: 1; }
.funding-selector select { min-width: 230px; max-width: 100%; }
.funding-empty { color: var(--muted); padding: 28px 22px; font-size: 13px; }
.funding-empty strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }
.funding-scope-note { color: var(--muted); font-size: 12px; line-height: 1.8; }
.wallet-kind { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 7px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .funding-selector { padding: 14px; gap: 10px; }
  .funding-selector select { width: 100%; min-width: 0; }
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.metric.featured {
  background: #f2f2ff;
  border-color: #c9ccec;
}
.metric .label {
  color: #646c7c;
  font-size: 12px;
  display: block;
}
.metric .value {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 680;
  letter-spacing: -0.6px;
  margin: 7px 0 4px;
  white-space: nowrap;
  display: block;
}
.metric.featured .value {
  color: var(--blue);
}
.metric .hint {
  font-size: 11px;
  color: var(--muted);
}
.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.filters .field {
  flex: 1;
  min-width: 140px;
}
.filters .date-pair {
  display: flex;
  gap: 8px;
  align-items: center;
}
.filters .date-pair input {
  min-width: 135px;
}
.filters .dates {
  flex: 1.5;
  min-width: 300px;
}
.filters .search-field {
  flex: 1.5;
  min-width: 180px;
}
.filter-lower {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 15px;
  gap: 12px;
}
.quick {
  display: flex;
  gap: 0;
}
.quick button {
  border-radius: 0;
  border-right: 0;
  font-size: 12px;
  padding: 5px 12px;
  font-weight: 400;
}
.quick button:first-child {
  border-radius: 4px 0 0 4px;
}
.quick button:last-child {
  border-radius: 0 4px 4px 0;
  border-right: 1px solid var(--line);
}
.table-wrap {
  overflow: auto;
  margin-inline: -22px;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}
.table-wrap th {
  color: #6a7383;
  font-weight: 550;
  background: #fafbfc;
  border-block: 1px solid var(--line);
  padding: 11px 16px;
}
.table-wrap td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f4;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
  padding-left: 22px;
}
.table-wrap th:last-child,
.table-wrap td:last-child {
  padding-right: 22px;
}
.table-wrap tr:last-child td {
  border-bottom: 0;
}
.table-wrap tbody tr:hover {
  background: #fcfcff;
}
.num {
  text-align: right;
}
.money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cell-muted {
  color: var(--muted);
}
.cell-truncate {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}
.empty {
  padding: 45px 15px;
  text-align: center;
  color: var(--muted);
}
.empty h2 {
  color: var(--text);
  font-size: 18px;
  margin: 10px 0;
}
.empty p {
  max-width: 440px;
  margin: 8px auto;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.two-col > .panel {
  margin: 0;
}
.chart {
  width: 100%;
  height: auto;
  max-height: 300px;
  display: block;
}
.chart text {
  fill: #87909f;
  font-size: 11px;
}
.chart .axis {
  stroke: #e8ebf2;
  stroke-width: 1;
}
.chart .line {
  stroke: var(--blue);
  stroke-width: 2.2;
  fill: none;
}
.chart .area {
  fill: #f1f2fd;
}
.chart .point {
  fill: var(--blue);
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}
.chart-legend:before {
  content: "";
  width: 14px;
  height: 3px;
  background: var(--blue);
}
.trend-panel .panel-head {
  align-items: flex-start;
}
.trend-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.trend-granularity {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8fb;
}
.trend-granularity button {
  min-height: 29px;
  padding: 4px 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  color: var(--muted);
}
.trend-granularity button[aria-pressed="true"] {
  background: white;
  color: var(--blue);
  box-shadow: 0 1px 3px #26355914;
}
.trend-day {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.trend-day select {
  width: 145px;
  height: 34px;
  font-size: 12px;
}
.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 15px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.trend-summary span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.trend-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}
.trend-note,
.trend-snapshot,
.trend-warning {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.trend-warning {
  color: var(--warn);
}
.trend-snapshot {
  font-size: 11px;
}
.chart .chart-empty {
  font-size: 14px;
  fill: var(--muted);
}
@media (max-width: 650px) {
  .trend-panel .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .trend-controls {
    justify-content: flex-start;
  }
  .trend-summary {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 12px;
  }
  .trend-summary strong {
    font-size: 17px;
  }
}
.wallet-value {
  font-size: 34px;
  font-weight: 680;
  letter-spacing: -0.7px;
  white-space: nowrap;
  margin: 12px 0;
}
.wallet-block {
  background: var(--soft);
  padding: 22px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.ranking-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  gap: 20px;
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
}
.ranking-row:last-child {
  border-bottom: 0;
}
.ranking-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.description {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
  font-size: 12px;
}
.description dt {
  color: var(--muted);
}
.description dd {
  margin: 0;
  text-align: right;
}
.preview-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #edf0ff;
  border: 1px solid #d9def7;
  border-radius: 7px;
  padding: 10px 16px;
  color: #4e5d9a;
  font-size: 12px;
  margin-bottom: 20px;
}
.compare {
  background: #f7f8fc;
  border: 1px solid #e1e5f1;
  border-radius: 7px;
  padding: 18px;
  margin-top: 20px;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.compare-grid small {
  display: block;
}
.compare-grid strong {
  display: block;
  font-size: 19px;
  margin: 5px 0;
  white-space: nowrap;
}
.compare .form-actions {
  margin-top: 14px;
  padding-top: 14px;
}
.rate-table {
  margin-top: 16px;
}
.rate-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rate-table th,
.rate-table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.rate-table th {
  color: var(--muted);
  font-weight: 500;
}
.inline-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.credential-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.credential-item:first-of-type {
  padding-top: 0;
}
.credential-item:last-child {
  border-bottom: 0;
}
.credential-item strong {
  font-size: 13px;
  display: block;
}
.credential-item small {
  display: block;
}
.separator {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: 90vh;
  color: var(--text);
  box-shadow: 0 24px 90px #17203b30;
}
dialog::backdrop {
  background: #1c23494a;
}
#dialog-body {
  padding: 26px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 20px;
}
.dialog-head button {
  border: 0;
  font-size: 20px;
  padding: 0 7px;
}
.form-error {
  color: #a44941;
  background: #fff3f2;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 12px;
  margin-bottom: 14px;
}
.subsection-title {
  font-size: 14px;
  font-weight: 650;
  margin: 20px 0 10px;
}
.read-only {
  color: #6a7593;
}
.schedule {
  color: #a9792d;
}
.project-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 14px;
  background: #f8f9fb;
  border-radius: 5px;
}
@media (max-width: 1000px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
  .metric .value {
    font-size: 27px;
  }
  .topbar {
    min-height: 75px;
  }
}
@media (max-width: 650px) {
  .topbar {
    padding-block: 14px;
    align-items: flex-start;
    gap: 12px;
  }
  .brand {
    gap: 9px;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  .profile .avatar,
  .profile small {
    display: none;
  }
  .profile {
    gap: 8px;
  }
  .profile strong {
    font-size: 12px;
  }
  .brand strong {
    font-size: 17px;
  }
  .brand small {
    font-size: 11px;
  }
  nav {
    gap: 22px;
  }
  main {
    padding-top: 20px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .page-heading h1 {
    font-size: 23px;
  }
  .panel {
    padding: 17px;
  }
  .metric-grid {
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .metric .value {
    font-size: 23px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .filters .dates {
    min-width: 100%;
  }
  .filters .date-pair input {
    min-width: 0;
  }
  .filter-lower {
    align-items: flex-start;
    flex-direction: column;
  }
  .table-wrap {
    margin-inline: -17px;
  }
  .table-wrap th:first-child,
  .table-wrap td:first-child {
    padding-left: 17px;
  }
  .table-wrap th:last-child,
  .table-wrap td:last-child {
    padding-right: 17px;
  }
  .table-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .login-wrap {
    margin: 20px auto;
  }
  .preview-strip {
    align-items: flex-start;
    gap: 14px;
  }
  .trend-panel .panel-head {
  align-items: flex-start;
}
.trend-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.trend-granularity {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8fb;
}
.trend-granularity button {
  min-height: 29px;
  padding: 4px 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  color: var(--muted);
}
.trend-granularity button[aria-pressed="true"] {
  background: white;
  color: var(--blue);
  box-shadow: 0 1px 3px #26355914;
}
.trend-day {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.trend-day select {
  width: 145px;
  height: 34px;
  font-size: 12px;
}
.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 15px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.trend-summary span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.trend-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}
.trend-note,
.trend-snapshot,
.trend-warning {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.trend-warning {
  color: var(--warn);
}
.trend-snapshot {
  font-size: 11px;
}
.chart .chart-empty {
  font-size: 14px;
  fill: var(--muted);
}
@media (max-width: 650px) {
  .trend-panel .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .trend-controls {
    justify-content: flex-start;
  }
  .trend-summary {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 12px;
  }
  .trend-summary strong {
    font-size: 17px;
  }
}
.wallet-value {
    font-size: 30px;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .description {
    gap: 10px;
  }
  .customer-card {
    padding: 18px;
  }
  .login-wrap .panel {
    padding: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading span {
    animation: none;
  }
}

/* Compact ledger operations; icons and text share a consistent baseline. */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 16px;
}
.table-toolbar h2 { font-size: 14px; font-weight: 600; }
.table-toolbar p { margin: 3px 0 0; }
.table-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.toolbar-button {
  min-height: 32px;
  height: 32px;
  padding: 5px 10px;
  gap: 6px;
  font-size: 12px;
  line-height: 20px;
  font-weight: 450;
}
a.toolbar-button { color: var(--blue); border-color: #bbc8e1; }
a.toolbar-button:hover { background: #f4f7ff; border-color: #91a8dd; }
.table-search {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  margin: 0;
}
.table-search > .icon {
  position: absolute;
  left: 10px;
  color: #8491a6;
}
.table-search input {
  height: 32px !important;
  width: clamp(180px, 20vw, 260px);
  padding: 5px 36px 5px 32px;
  font-size: 12px;
  border-color: #cdd5e3;
}
.table-search input::placeholder { color: #8a94a5; }
.table-search button { position: absolute; right: 1px; top: 1px; width: 30px; height: 30px; min-height: 30px; padding: 0; border: 0; background: transparent; box-shadow: none; color: #7b889d; }
.table-search button:hover { background: #f0f4fd; color: var(--blue); }
#filter-form > .filters.section-gap > .field { flex: 0 1 240px; }
.column-settings { position: relative; }
.column-settings button[aria-expanded="true"] {
  color: var(--blue);
  border-color: #9cafe0;
  background: #f4f7ff;
}
.column-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 248px;
  padding: 14px;
  border: 1px solid #d5dce8;
  border-radius: 7px;
  background: white;
  box-shadow: 0 8px 28px #24365818, 0 2px 5px #24365807;
  color: var(--text);
}
.column-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.column-popover-head strong { font-size: 13px; font-weight: 600; }
.column-popover-head button { font-size: 12px; min-height: 26px; padding: 2px 6px; border-color: transparent; color: var(--blue); box-shadow: none; }
.column-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 3px 6px; }
.column-option { display: flex; align-items: center; gap: 7px; min-height: 32px; font-size: 12px; cursor: pointer; }
.column-option input { margin: 0; width: 14px; height: 14px; accent-color: var(--blue); cursor: pointer; }
.column-option:has(input:disabled) { color: #7d8798; cursor: default; }
.column-note { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid #edf0f5; font-size: 11px; line-height: 1.6; color: var(--muted); }
.pagination { gap: 8px; }
.pagination .icon { width: 14px; height: 14px; flex-basis: 14px; }
.quick button { min-height: 30px; line-height: 18px; }
@media (max-width: 680px) {
  .table-toolbar-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .table-search { width: 100%; }
  .table-search input { width: 100%; }
  .column-popover { right: auto; left: 0; max-width: calc(100vw - 64px); }
}
@media (pointer: coarse) {
  button, .btn, .toolbar-button, .small, .quick button { min-height: 40px; }
  .column-option { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  button, .btn { transition: none; }
}

/* Separate admin overview and compact customer records. */
.home-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.3fr);
  gap: 20px;
  align-items: start;
}
.home-grid > .panel { margin-bottom: 0; }
.quick-links { display: grid; gap: 0; }
.quick-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #edf0f5;
  color: var(--text);
}
.quick-link:first-child { padding-top: 2px; }
.quick-link:last-child { border-bottom: 0; padding-bottom: 2px; }
.quick-link > .icon { color: var(--blue); }
.quick-link > .icon:last-child { margin-left: auto; color: #8b97aa; }
.quick-link:hover { text-decoration: none; color: var(--blue); }
.quick-link-copy { display: grid; gap: 3px; }
.quick-link-copy strong { font-size: 14px; font-weight: 550; }
.quick-link-copy small { font-size: 12px; color: var(--muted); }
.customer-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.customer-list-head,
.customer-record-main {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.25fr) minmax(150px, 1fr) minmax(220px, 1.55fr);
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
}
.customer-list-head {
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding-block: 11px;
  background: #f9fafc;
  color: #737e90;
  font-size: 12px;
  font-weight: 500;
}
.customer-list-head > :last-child { text-align: right; }
.customer-record + .customer-record { border-top: 1px solid var(--line); }
.customer-record-main { min-height: 102px; }
.customer-record-main:hover { background: #fdfdff; }
.record-customer { display: grid; gap: 2px; min-width: 0; }
.record-customer-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.record-customer .avatar { width: 34px; height: 34px; flex: 0 0 34px; font-size: 13px; }
.record-customer strong { font-size: 14px; font-weight: 600; display: block; }
.record-customer small { display: block; margin-top: 3px; }
.record-customer .badge { margin-top: 0; padding: 1px 5px; font-size: 10px; }
.record-customer small { font-size: 11px; }
.record-pool { display: grid; gap: 2px; }
.record-pool > span { font-size: 11px; color: var(--muted); }
.disabled-preview { opacity: .5; cursor: default; }
.customer-projects-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; padding-top: 15px; }
.customer-projects-heading strong { font-size: 12px; font-weight: 550; }
.customer-projects-heading small { font-size: 11px; }
.project-empty { font-size: 12px; color: var(--muted); }
.home-snapshot { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.quick-link-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 6px; color: var(--blue); background: var(--soft); }
.record-projects { min-width: 0; display: grid; gap: 6px; font-size: 12px; }
.record-projects strong { font-size: 13px; font-weight: 500; }
.record-projects small { display: block; margin-top: 2px; font-size: 11px; }
.record-wallet { min-width: 0; display: grid; gap: 6px; }
.record-wallet strong { font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.record-wallet small { display: block; font-size: 11px; }
.record-actions { display: flex; gap: 7px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.record-actions button, .record-actions .btn { font-size: 12px; min-height: 30px; padding: 4px 9px; }
.customer-projects {
  padding: 2px 22px 8px;
  background: #fafbfe;
  border-top: 1px solid #e7ebf3;
}
.project-config-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; }
.project-config-row + .project-config-row { border-top: 1px solid #e8ecf4; }
.project-config-copy { min-width: 0; }
.project-config-copy strong { display: block; font-size: 13px; font-weight: 550; }
.project-config-copy small { display: block; font-size: 12px; margin-top: 3px; }
.key-owner, .key-balance-mode { font-size: 12px; }
.project-identity { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.project-identity code { color: #7c8799; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.key-balance-mode small { display: block; margin-top: 3px; }
.assignment-summary { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfe; padding: 12px 14px; margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.assignment-summary strong { color: var(--text); font-weight: 550; }
.key-management-table td { vertical-align: middle; }
.collection-control { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.collection-control p { margin: 5px 0 0; font-size: 12px; }
.collection-control form { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.collection-control .check-row { font-size: 13px; }
.collection-source-table td { vertical-align: middle; }
.collection-source-table td { font-size: 12px; }
.collection-source-table .actions { flex-wrap: wrap; min-width: 130px; gap: 5px; }
.collection-source-table th { white-space: nowrap; }
.collection-date-cell { white-space: nowrap; }
.collection-date-cell small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.collection-coverage { display: grid; gap: 5px; min-width: 135px; font-size: 11px; line-height: 1.5; }
.collection-coverage strong { font-size: 13px; font-weight: 550; white-space: nowrap; font-variant-numeric: tabular-nums; }
.collection-coverage strong span, .collection-coverage > span, .collection-coverage small { color: var(--muted); font-size: 11px; font-weight: 400; }
.collection-coverage progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 8px; overflow: hidden; accent-color: var(--blue); background: #edf0f6; }
.collection-coverage progress::-webkit-progress-bar { background: #edf0f6; border-radius: 8px; }
.collection-coverage progress::-webkit-progress-value { background: var(--blue); border-radius: 8px; }
.collection-coverage progress::-moz-progress-bar { background: var(--blue); border-radius: 8px; }
.collection-coverage small b { color: #a06426; font-weight: 500; }
.collection-coverage-note { margin: -4px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.collection-blocked { display: block; margin-top: 5px; max-width: 170px; color: #a06426; font-size: 11px; line-height: 1.6; white-space: normal; }
.collection-review-table td { vertical-align: top; }
.collection-reason { min-width: 140px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
.collection-candidate-note { color: #8c642e; font-size: 12px; line-height: 1.7; white-space: normal; margin: 8px 0; }
#collection-jobs .table-wrap, #collection-issues .table-wrap { max-height: 360px; overflow: auto; }
#collection-candidates { scroll-margin-top: 24px; }
#price-preview .form-actions > .inline-note { flex-basis: 100%; margin: 0 0 5px; }
.collection-policy-table th, .collection-policy-table td { width: 33.33%; }
.collection-observations { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.collection-observations > div { display: grid; gap: 5px; padding: 12px 0; }
.collection-observations span { font-size: 12px; color: var(--muted); }
.collection-observations strong { font-size: 24px; font-weight: 550; white-space: nowrap; font-variant-numeric: tabular-nums; }
.collection-observations small { color: var(--muted); font-size: 11px; }
.collection-observation-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.collection-grains { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 6px; }
.collection-grains input[type="checkbox"] { width: 16px; }
.collection-customer-note { color: var(--muted); font-size: 12px; margin: 0 0 20px; line-height: 1.7; }
.collection-customer-note > div { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.collection-customer-note p { margin: 3px 0 0; }
@media (max-width: 760px) {
  .collection-observations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .collection-observations { grid-template-columns: 1fr; gap: 4px; }
}
.key-scope { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #f7f8fb; }
.key-scope button { min-height: 30px; padding: 4px 10px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; box-shadow: none; }
.key-scope button[aria-pressed="true"] { background: white; color: var(--blue); border-color: #d8dfef; }
.key-scope button span { font-size: 11px; }
.key-scope-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 17px; }
.key-scope-row > span { color: var(--muted); font-size: 12px; }
.key-scope-note { margin: -4px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.key-archived-badge { display: inline-block; padding: 1px 5px; margin-left: 3px; border: 1px solid #dce1e8; border-radius: 4px; background: #f5f6f8; color: #748092; font-size: 10px; font-weight: 400; vertical-align: middle; white-space: nowrap; }
.archived-projects { margin-top: 8px; min-width: 0; }
.archived-projects > summary { color: var(--muted); font-size: 12px; cursor: pointer; line-height: 1.8; }
.archived-projects[open] > summary { margin-bottom: 9px; }
.archived-projects > div { padding-left: 9px; border-left: 2px solid #e8ebf0; }
.archived-projects .record-project + .record-project { margin-top: 8px; }
.archive-dialog-copy { font-size: 14px; line-height: 1.8; }
@media (max-width: 650px) {
  .key-scope { max-width: 100%; }
  .key-management-table .actions { min-width: 190px; }
}
.pricing-grid { align-items: start; }
.pricing-keys { padding: 0; }
.pricing-selection { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.pricing-keys .project-choice-copy { display: block; }
.pricing-keys .project-choice-copy .project-identity { display: block; }
.pricing-project + .pricing-project { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.pricing-project-heading > strong { font-size: 13px; font-weight: 550; }
.rate-timeline { margin-top: 10px; }
.rate-timeline th, .rate-timeline td { padding: 10px 9px; font-size: 12px; white-space: nowrap; }
.rate-timeline th:first-child, .rate-timeline td:first-child { padding-left: 0; }
.pricing-candidate { margin-top: 18px; font-size: 12px; }
.pricing-candidate > summary { padding: 5px 0; color: var(--blue); cursor: pointer; }
.pricing-candidate[open] > summary { margin-bottom: 12px; }
.pricing-candidate .pricing-project { margin-top: 10px; }
.pricing-grid .compare table { font-size: 12px; }
.pricing-grid .compare table th, .pricing-grid .compare table td { padding: 10px 8px; }
.pricing-grid .compare table td:first-child { min-width: 110px; }
.pricing-grid .compare .project-identity { font-size: 10px; }
.pricing-grid .compare .compare-grid strong { font-size: 17px; }
.cost-key-select { flex: 1 1 300px; }
.cost-missing { margin: -6px 0 20px; color: #876025; }
.compare .cost-missing { margin: 12px 0; }
@media (max-width: 650px) {
  .pricing-selection { align-items: flex-start; flex-wrap: wrap; }
  .pricing-grid .compare { padding: 14px; }
  .pricing-grid .compare .compare-grid { grid-template-columns: 1fr; gap: 6px; }
  .cost-key-select { flex-basis: 100%; }
}
.customer-more { position: relative; }
.customer-more > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  list-style: none;
  border: 1px solid #c7d0df;
  border-radius: 5px;
  min-height: 30px;
  padding: 4px 9px;
  background: white;
  color: #536078;
  cursor: pointer;
  font-size: 12px;
}
.customer-more > summary::-webkit-details-marker { display: none; }
.customer-more > summary:hover,
.customer-more[open] > summary { background: #f4f7ff; color: var(--blue); border-color: #a8b9de; }
.customer-more > summary:focus-visible { outline: 2px solid #5478e7; outline-offset: 3px; }
.customer-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 25;
  min-width: 154px;
  padding: 5px;
  border: 1px solid #d5dce8;
  border-radius: 6px;
  background: white;
  box-shadow: 0 8px 24px #24365816;
}
.customer-more-menu a { display: flex; align-items: center; gap: 8px; padding: 7px 9px; color: #424e64; font-size: 12px; border-radius: 4px; }
.customer-more-menu a:hover { background: #f1f5ff; color: var(--blue); text-decoration: none; }
@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .customer-list-head, .customer-record-main { gap: 14px; grid-template-columns: minmax(135px, 1fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(165px, 1.2fr); }
}
@media (max-width: 760px) {
  .customer-list-head { display: none; }
  .customer-record-main { grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px; }
  .record-actions { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .customer-record-main { grid-template-columns: 1fr; gap: 14px; }
  .record-actions { border-top: 1px solid #edf0f5; padding-top: 13px; }
}
