:root {
  --green-950: #103b33;
  --green-800: #176b5b;
  --green-600: #2f8f74;
  --green-300: #a9d6c3;
  --green-100: #e7f4ee;
  --orange-500: #f59e0b;
  --orange-100: #fff3d7;
  --ink: #1f2d35;
  --muted: #6a7880;
  --line: #d7e7df;
  --paper: #f5faf7;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #edf5f1;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 26, 22, 0.62);
  backdrop-filter: blur(5px);
}

.password-dialog {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--charcoal, #171a16);
  border-radius: 8px;
  background: var(--white, #fff);
  box-shadow: 8px 8px 0 rgba(23, 26, 22, 0.3);
}

.password-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.password-form label {
  display: grid;
  gap: 7px;
  color: var(--charcoal, #171a16);
  font-size: 13px;
  font-weight: 900;
}

.password-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #8f9888;
  border-radius: 6px;
  background: #fbfcf9;
  color: var(--charcoal, #171a16);
}

.password-form input:focus {
  border-color: var(--charcoal, #171a16);
  outline: none;
  box-shadow: 0 0 0 3px var(--lime-300, #d7f59a);
}

.password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 30px;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--green-950);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  background: var(--green-600);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  font-size: 24px;
  font-weight: 900;
}

.brand h1 {
  font-size: 23px;
}

.brand p,
.side-card p {
  color: rgba(255, 255, 255, 0.72);
}

.side-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.side-card h2 {
  font-size: 18px;
}

.nav-steps {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.nav-steps a {
  display: block;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}

.nav-steps a:hover,
.nav-steps a:focus-visible {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
}

.nav-steps a.active {
  border-color: rgba(255, 255, 255, 0.46);
  background: var(--green-600);
  box-shadow: 0 8px 24px rgba(4, 32, 27, 0.2);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.panel-head,
.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 20px;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--green-300);
  border-radius: 10px;
  background: var(--white);
  color: var(--green-950);
  font-size: 13px;
  font-weight: 900;
}

.eyebrow {
  color: var(--green-800);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 28px;
}

.page-context {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.app-view {
  display: none !important;
}

.app-view.active {
  display: block !important;
}

.hero-panel.app-view.active {
  display: flex !important;
}

.upload-panel.app-view.active,
.grid.app-view.active {
  display: grid !important;
}

.funds-dashboard.app-view.active,
.history-panel.app-view.active,
.account-panel.app-view.active,
.login-logs-panel.app-view.active,
.access-review-panel.app-view.active {
  margin-top: 0;
}

.panel,
.hero-panel,
.upload-panel,
.schema-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 18px 50px rgba(16, 59, 51, 0.07);
}

.login-panel {
  display: grid;
  gap: 18px;
  max-width: 560px;
  padding: 26px;
}

.login-panel p,
.hero-panel p,
.upload-panel p,
.panel-head span,
.result-card p,
.message,
.muted {
  color: var(--muted);
}

.login-form {
  display: flex;
  gap: 10px;
}

.login-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline-color: var(--green-600);
}

.request-access-button {
  justify-self: start;
  padding: 0;
  background: transparent;
  color: var(--green-800);
}

.request-access-button:hover,
.request-access-button:focus-visible {
  text-decoration: underline;
}

.access-request-panel {
  display: grid;
  max-width: 820px;
  gap: 18px;
}

.access-request-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.access-request-form label {
  display: grid;
  gap: 7px;
  color: var(--green-950);
  font-size: 13px;
  font-weight: 900;
}

.access-request-form input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  outline-color: var(--green-600);
}

.phone-verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.verification-button {
  min-width: 112px;
  padding: 0 12px;
  border: 1px solid var(--charcoal);
  border-radius: 7px;
  background: var(--green-800);
  color: var(--white);
  box-shadow: 2px 2px 0 var(--charcoal);
}

.verification-button:hover:not(:disabled) {
  background: var(--green-700);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--charcoal);
}

.verification-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.phone-with-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.phone-verification-status {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.phone-verification-status.verified {
  background: var(--green-100);
  color: var(--green-800);
}

.phone-verification-status.unverified {
  background: var(--orange-100);
  color: #8a4b00;
}

.access-request-form .primary-inline {
  grid-column: 1 / -1;
  justify-self: start;
}

button,
.download-link,
.table-link {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.login-form button,
.primary,
.upload-panel button {
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--green-800);
  color: var(--white);
}

.primary {
  width: 100%;
  margin-top: 16px;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost {
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--green-100);
  color: var(--green-800);
}

.hero-panel {
  margin-bottom: 18px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(231, 244, 238, 0.92), rgba(255, 255, 255, 0.96)),
    var(--white);
}

.hero-panel h3 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--orange-100);
  color: #8a4b00;
  font-weight: 900;
}

.upload-panel {
  display: grid;
  min-height: 238px;
  place-items: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  outline: 2px dashed transparent;
}

.upload-panel.dragging {
  outline-color: var(--green-600);
  background: var(--green-100);
}

.upload-panel input {
  display: none;
}

.upload-icon {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 16px;
  background: var(--green-800);
  color: var(--white);
  font-size: 32px;
  font-weight: 900;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel,
.schema-panel {
  padding: 20px;
}

.file-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.file-list .empty {
  color: var(--muted);
}

.result-card {
  min-height: 106px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.download-link,
.table-link {
  display: inline-flex;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--orange-500);
  color: #2b1b00;
}

.audit-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.audit-card > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.audit-card span {
  color: var(--muted);
  font-size: 13px;
}

.audit-card ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  margin: 0;
}

.audit-error {
  background: #fde2e2;
  color: #9c0006;
  border-color: #ef9a9a;
}

.audit-warning {
  background: #fff3d7;
  color: #8a4b00;
  border-color: #f4c76a;
}

.audit-passed {
  background: var(--green-100);
  color: var(--green-800);
  border-color: var(--green-300);
}

.audit-unknown {
  background: #eef2f4;
  color: var(--muted);
}

.table-link {
  margin: 0;
}

.history-panel,
.schema-panel {
  margin-top: 18px;
}

.funds-dashboard {
  margin-bottom: 22px;
  scroll-margin-top: 20px;
}

.dashboard-head,
.chart-head,
.dashboard-controls,
.chart-legend {
  display: flex;
  align-items: center;
}

.dashboard-head,
.chart-head {
  justify-content: space-between;
  gap: 18px;
}

.dashboard-head {
  padding: 22px 24px;
  border: 1px solid #c9dfd5;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(16, 59, 51, 0.07);
}

.dashboard-head h3 {
  margin: 4px 0 6px;
  color: var(--green-950);
  font-size: 28px;
}

.dashboard-head p:last-child {
  color: var(--muted);
}

.dashboard-controls {
  flex: 0 0 auto;
  gap: 9px;
}

.dashboard-controls label {
  color: var(--green-950);
  font-size: 13px;
  font-weight: 900;
}

.dashboard-controls select {
  min-width: 112px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--green-300);
  border-radius: 9px;
  background: var(--white);
  color: var(--green-950);
  font-weight: 900;
  outline-color: var(--green-600);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.dashboard-kpi {
  display: grid;
  min-width: 0;
  min-height: 126px;
  align-content: space-between;
  gap: 8px;
  padding: 16px;
  border: 1px solid #c9dfd5;
  border-radius: 12px;
  background: var(--white);
}

.dashboard-kpi[data-tone="income"] {
  border-top: 4px solid #2f8f74;
}

.dashboard-kpi[data-tone="expense"] {
  border-top: 4px solid #e58b3a;
}

.dashboard-kpi[data-tone="balance"] {
  border-top: 4px solid #356f9d;
}

.dashboard-kpi[data-tone="net"] {
  border-top: 4px solid #6f9d55;
}

.dashboard-kpi[data-tone="opening"] {
  border-top: 4px solid #7c8f87;
}

.dashboard-kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-kpi strong {
  color: var(--green-950);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.18;
  white-space: nowrap;
}

.dashboard-kpi small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 12px;
}

.dashboard-chart {
  min-width: 0;
  padding: 18px;
  border: 1px solid #c9dfd5;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 14px 36px rgba(16, 59, 51, 0.055);
}

.dashboard-ranking-card {
  grid-column: 1 / -1;
}

.chart-head > div:first-child {
  display: grid;
  gap: 3px;
}

.chart-head span,
.chart-head > strong {
  color: var(--green-950);
  font-weight: 900;
}

.chart-head small {
  color: var(--muted);
}

.chart-legend {
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.chart-legend i,
.structure-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.legend-income {
  background: #2f8f74;
}

.legend-expense {
  background: #e58b3a;
}

.chart-stage {
  width: 100%;
  height: 310px;
  margin-top: 12px;
}

.chart-stage svg,
.donut-stage svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dashboard-empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
  text-align: center;
}

.dashboard-kpis > .dashboard-empty {
  grid-column: 1 / -1;
  min-height: 110px;
}

.structure-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(180px, 1.1fr);
  align-items: center;
  gap: 12px;
  min-height: 322px;
}

.donut-stage {
  width: 100%;
  height: 250px;
}

.structure-legend {
  display: grid;
  gap: 10px;
}

.structure-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.structure-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list {
  display: grid;
  min-height: 180px;
  gap: 10px;
  margin-top: 16px;
}

.ranking-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(260px, 1.7fr) 150px;
  align-items: center;
  gap: 14px;
}

.ranking-label {
  min-width: 0;
}

.ranking-label strong,
.ranking-label span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-label strong {
  color: var(--ink);
  font-size: 13px;
}

.ranking-label span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ranking-track {
  height: 12px;
  overflow: hidden;
  border-radius: 3px;
  background: #e9f1ed;
}

.ranking-bar {
  min-width: 2px;
  height: 100%;
  border-radius: 3px;
  background: #2f8f74;
}

.ranking-bar.negative {
  background: #c75d4c;
}

.ranking-value {
  color: var(--green-950);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.account-panel {
  margin-top: 18px;
}

.account-panel .panel-head > div {
  display: grid;
  gap: 4px;
}

.account-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.account-kpi {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--green-300);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(231, 244, 238, 0.88)),
    var(--green-100);
}

.account-kpi span {
  color: var(--green-800);
  font-size: 13px;
  font-weight: 900;
}

.account-kpi strong {
  color: var(--green-950);
  font-size: 25px;
  line-height: 1.1;
}

.account-kpi small {
  color: var(--muted);
  line-height: 1.5;
}

.account-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
}

.account-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.account-table {
  min-width: 1180px;
}

.account-table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.account-table .income {
  color: var(--green-800);
  font-weight: 800;
}

.account-table .expense {
  color: #a45b00;
  font-weight: 800;
}

.account-table .closing {
  color: var(--green-950);
  font-weight: 900;
}

.registry-panel {
  margin-top: 18px;
}

.registry-head {
  align-items: flex-start;
}

.registry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-inline {
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--green-800);
  color: var(--white);
}

.primary-inline:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.registry-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--green-300);
  border-radius: 12px;
  background: var(--green-100);
  color: var(--green-950);
  font-size: 14px;
}

.registry-table-wrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.registry-table {
  min-width: 1480px;
}

.registry-table input,
.registry-table select {
  width: 100%;
  min-width: 112px;
  padding: 8px 9px;
  border: 1px solid #c7ddd4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline-color: var(--green-600);
}

.registry-table td {
  padding: 8px;
}

.registry-table .pending-delete {
  background: #fff3d7;
  opacity: 0.76;
}

.registry-table .pending-delete input,
.registry-table .pending-delete select {
  text-decoration: line-through;
}

.login-log-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.login-log-kpi {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.login-log-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-log-kpi strong {
  color: var(--green-950);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.login-log-kpi.warning strong {
  color: #a84530;
}

.login-log-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.login-log-table {
  min-width: 1120px;
}

.login-log-table td:nth-child(1),
.login-log-table td:nth-child(2),
.login-log-table td:nth-child(3),
.login-log-table td:nth-child(4),
.login-log-table td:nth-child(5) {
  white-space: nowrap;
}

.login-log-table td:nth-child(6) {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
}

.login-result {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.login-result.success {
  background: var(--green-100);
  color: var(--green-800);
}

.login-result.failed {
  background: #fde2e2;
  color: #a11a1a;
}

.access-review-table-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.access-review-table {
  min-width: 1180px;
}

.access-review-table td {
  white-space: nowrap;
}

.account-management-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.management-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 18px 2px 10px;
  border-top: 1px solid var(--line);
}

.management-section-head h4 {
  margin: 0;
  color: var(--green-950);
  font-size: 17px;
}

.management-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.application-review-head {
  margin-top: 28px;
}

.user-account-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
}

.user-account-table {
  min-width: 1040px;
}

.user-account-table td {
  white-space: nowrap;
}

.account-state,
.protected-account {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.account-state.enabled {
  background: var(--green-100);
  color: var(--green-800);
}

.account-state.disabled {
  background: #fde2e2;
  color: #a11a1a;
}

.protected-account {
  background: var(--blue-100);
  color: #31577a;
}

.review-button.enable {
  background: var(--green-800);
}

.review-button.disable {
  background: #b74d34;
}

.review-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.review-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.review-status.pending {
  background: var(--orange-100);
  color: #8a4b00;
}

.review-status.approved {
  background: var(--green-100);
  color: var(--green-800);
}

.review-status.rejected {
  background: #fde2e2;
  color: #a11a1a;
}

.review-actions {
  display: flex;
  gap: 7px;
}

.review-button {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--white);
  font-size: 12px;
}

.review-button.approve {
  background: var(--green-800);
}

.review-button.reject {
  background: #b74d34;
}

.mini-button {
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--white);
}

.mini-button.danger {
  background: #b74d34;
}

.mini-button.restore {
  background: var(--green-600);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--green-800);
  color: var(--white);
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: var(--paper);
}

.badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.success {
  background: var(--green-100);
  color: var(--green-800);
}

.badge.failed {
  background: #fde2e2;
  color: #a11a1a;
}

.badge.running {
  background: var(--orange-100);
  color: #8a4b00;
}

.badge.audit-error {
  background: #fde2e2;
  color: #9c0006;
}

.badge.audit-warning {
  background: #fff3d7;
  color: #8a4b00;
}

.badge.audit-passed {
  background: var(--green-100);
  color: var(--green-800);
}

.badge.audit-unknown {
  background: #eef2f4;
  color: var(--muted);
}

.schema-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.schema-grid span {
  padding: 10px;
  border-left: 4px solid var(--green-600);
  border-radius: 10px;
  background: var(--paper);
}

@media (max-width: 1380px) and (min-width: 981px) {
  .dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-ranking-card {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .shell,
  .grid,
  .account-kpis,
  .login-log-kpis,
  .dashboard-kpis,
  .dashboard-grid,
  .schema-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-ranking-card {
    grid-column: auto;
  }

  .dashboard-head,
  .dashboard-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .structure-layout,
  .ranking-row {
    grid-template-columns: 1fr;
  }

  .ranking-value {
    text-align: left;
  }

  .workspace,
  .sidebar {
    padding: 22px;
  }

  .nav-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .login-form,
  .access-request-form,
  .registry-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-panel.app-view.active {
    align-items: stretch;
    flex-direction: column;
  }

  .registry-actions {
    justify-content: flex-start;
  }

  .session-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .access-request-form {
    grid-template-columns: 1fr;
  }

  .access-request-form .primary-inline {
    grid-column: auto;
  }
}

/* 2026 Paytin-inspired finance UI refresh */
:root {
  --lime-500: #b9eb58;
  --lime-300: #d7f59a;
  --lime-100: #effbd7;
  --charcoal: #171a16;
  --charcoal-2: #252a22;
  --blue-100: #dff3ff;
  --blue-500: #4c9fca;
  --coral-100: #fff0e5;
  --coral-500: #f28a4b;
  --grid-line: rgba(23, 26, 22, 0.045);
  --green-950: #171a16;
  --green-800: #30472d;
  --green-600: #78a934;
  --green-300: #cbe99b;
  --green-100: #effbd7;
  --orange-500: #f28a4b;
  --orange-100: #fff0e5;
  --ink: #171a16;
  --muted: #687066;
  --line: #cfd6c9;
  --paper: #f5f7f1;
  --white: #ffffff;
}

body {
  background-color: #f4f5f1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--charcoal);
}

.shell {
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 22px;
  border-right: 1px solid #080a08;
  background: var(--charcoal);
  color: var(--white);
}

.brand {
  margin-bottom: 24px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid #090b09;
  border-radius: 8px;
  background: var(--lime-500);
  color: var(--charcoal);
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.18);
  font-size: 21px;
}

.brand h1 {
  font-size: 21px;
}

.brand p {
  margin-top: 3px;
  color: #bfc7b9;
  font-size: 12px;
}

.side-card {
  gap: 10px;
  padding: 15px;
  border: 1px solid #3d4438;
  border-radius: 8px;
  background: var(--charcoal-2);
  box-shadow: none;
}

.side-card h2 {
  color: var(--lime-500);
  font-size: 14px;
}

.side-card p {
  color: #c9d0c4;
  font-size: 12px;
  line-height: 1.65;
}

.nav-steps {
  counter-reset: finance-nav;
  gap: 8px;
  margin-top: 22px;
}

.nav-steps a {
  counter-increment: finance-nav;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #3d4438;
  border-radius: 7px;
  background: #20241e;
  color: #edf1e9;
  font-size: 13px;
}

.nav-steps a::before {
  content: counter(finance-nav, decimal-leading-zero);
  color: #858e80;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.nav-steps a:hover,
.nav-steps a:focus-visible {
  border-color: var(--lime-500);
  background: #2b3028;
}

.nav-steps a.active {
  border-color: var(--lime-500);
  background: var(--lime-500);
  color: var(--charcoal);
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.18);
}

.nav-steps a.active::before {
  color: #4c651f;
}

.workspace {
  padding: 24px 30px 42px;
}

.topbar {
  min-height: 78px;
  margin-bottom: 22px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--charcoal);
}

.topbar h2 {
  margin-top: 6px;
  font-size: 29px;
  line-height: 1.08;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid var(--charcoal);
  border-radius: 4px;
  background: var(--lime-500);
  color: var(--charcoal);
  font-size: 10px;
}

.page-context {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.session-actions {
  gap: 8px;
}

.user-badge {
  min-height: 36px;
  border: 1px solid var(--charcoal);
  border-radius: 7px;
  background: var(--charcoal);
  color: var(--lime-500);
}

.panel,
.hero-panel,
.upload-panel,
.schema-panel,
.dashboard-head,
.dashboard-chart,
.dashboard-kpi {
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 4px 4px 0 #dce3d6;
}

.panel,
.schema-panel {
  padding: 19px;
}

.login-panel {
  max-width: 760px;
  padding: 22px;
}

.login-panel h3,
.access-request-panel h3 {
  font-size: 22px;
}

.login-form input,
.access-request-form input,
.registry-table input,
.registry-table select,
.dashboard-controls select {
  border: 1px solid #8f9888;
  border-radius: 6px;
  background: #fbfcf9;
  color: var(--charcoal);
}

.login-form input:focus,
.access-request-form input:focus,
.registry-table input:focus,
.registry-table select:focus,
.dashboard-controls select:focus {
  border-color: var(--charcoal);
  outline: none;
  box-shadow: 0 0 0 3px var(--lime-300);
}

.login-form button,
.primary,
.upload-panel button,
.primary-inline,
.ghost {
  border: 1px solid var(--charcoal);
  border-radius: 7px;
  background: var(--lime-500);
  color: var(--charcoal);
  box-shadow: 2px 2px 0 var(--charcoal);
}

.login-form button:hover,
.primary:hover,
.upload-panel button:hover,
.primary-inline:hover,
.ghost:hover {
  background: #c8f36e;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--charcoal);
}

.primary:disabled,
.primary-inline:disabled {
  box-shadow: none;
  transform: none;
}

.request-access-button {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--charcoal);
  color: var(--charcoal);
}

.dashboard-head {
  padding: 20px 22px;
  background: var(--lime-100);
}

.dashboard-head h3 {
  color: var(--charcoal);
  font-size: 27px;
}

.dashboard-controls label {
  color: var(--charcoal);
}

.dashboard-kpis {
  gap: 10px;
  margin: 11px 0;
}

.dashboard-kpi {
  min-height: 122px;
  padding: 15px;
}

.dashboard-kpi span,
.dashboard-kpi small,
.dashboard-kpi strong {
  color: var(--charcoal);
}

.dashboard-kpi strong {
  font-size: 21px;
}

.dashboard-kpi[data-tone="opening"] {
  border-top: 1px solid var(--charcoal);
  background: var(--charcoal);
}

.dashboard-kpi[data-tone="opening"] span {
  color: var(--lime-500);
}

.dashboard-kpi[data-tone="opening"] strong,
.dashboard-kpi[data-tone="opening"] small {
  color: var(--white);
}

.dashboard-kpi[data-tone="income"] {
  border-top: 1px solid var(--charcoal);
  background: var(--lime-500);
}

.dashboard-kpi[data-tone="expense"] {
  border-top: 5px solid var(--coral-500);
  background: var(--coral-100);
}

.dashboard-kpi[data-tone="balance"] {
  border-top: 5px solid var(--blue-500);
  background: var(--blue-100);
}

.dashboard-kpi[data-tone="net"] {
  border-top: 5px solid #76a930;
  background: var(--lime-100);
}

.dashboard-grid {
  gap: 11px;
}

.dashboard-chart {
  padding: 17px;
}

.chart-head span,
.chart-head > strong {
  color: var(--charcoal);
}

.legend-income {
  border: 1px solid var(--charcoal);
  background: var(--lime-500);
}

.legend-expense {
  background: var(--charcoal);
}

.dashboard-empty,
.account-empty {
  border: 1px dashed #8d9686;
  border-radius: 6px;
  background: #f7f9f4;
}

.ranking-track {
  height: 13px;
  border: 1px solid var(--charcoal);
  border-radius: 2px;
  background: #eef1e9;
}

.ranking-bar {
  border-radius: 0;
  background: var(--lime-500);
}

.ranking-bar.negative {
  background: var(--coral-500);
}

.ranking-value {
  color: var(--charcoal);
}

.hero-panel {
  padding: 20px;
  background: var(--lime-100);
}

.hero-panel h3 {
  font-size: 22px;
}

.status-pill,
.badge,
.login-result,
.review-status {
  border: 1px solid currentColor;
  border-radius: 999px;
}

.upload-panel {
  min-height: 230px;
  border: 1px dashed var(--charcoal);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--lime-300);
}

.upload-panel.dragging {
  outline: 3px solid var(--lime-500);
  background: var(--lime-100);
}

.upload-icon {
  width: 56px;
  height: 56px;
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  background: var(--charcoal);
  color: var(--lime-500);
}

.file-list li,
.result-card,
.audit-card,
.registry-warning,
.schema-grid span {
  border-radius: 6px;
}

.file-list li,
.result-card {
  border-color: #b9c1b3;
  background: #f7f9f4;
}

.download-link,
.table-link {
  border: 1px solid var(--charcoal);
  border-radius: 6px;
  background: var(--charcoal);
  color: var(--lime-500);
}

.account-kpis {
  gap: 10px;
}

.account-kpi {
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 3px 3px 0 #dce3d6;
}

.account-kpi:nth-child(4n + 1) {
  background: var(--charcoal);
}

.account-kpi:nth-child(4n + 1) span,
.account-kpi:nth-child(4n + 1) strong,
.account-kpi:nth-child(4n + 1) small {
  color: var(--white);
}

.account-kpi:nth-child(4n + 1) span {
  color: var(--lime-500);
}

.account-kpi:nth-child(4n + 2) {
  background: var(--lime-500);
}

.account-kpi:nth-child(4n + 3) {
  background: var(--blue-100);
}

.account-kpi:nth-child(4n + 4) {
  background: var(--coral-100);
}

.table-wrap,
.account-table-wrap,
.registry-table-wrap,
.login-log-table-wrap,
.access-review-table-wrap,
.user-account-table-wrap {
  border: 1px solid var(--charcoal);
  border-radius: 7px;
  background: var(--white);
}

th {
  border-bottom: 2px solid var(--lime-500);
  background: var(--charcoal);
  color: var(--white);
}

td {
  border-bottom-color: #d8ddd3;
}

tbody tr:nth-child(even) {
  background: #f3f6ee;
}

tbody tr:hover {
  background: var(--lime-100);
}

.login-log-kpi {
  border: 1px solid var(--charcoal);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 3px 3px 0 #dce3d6;
}

.login-log-kpi:first-child {
  background: var(--lime-500);
}

.login-log-kpi.warning {
  background: var(--coral-100);
}

.review-button,
.mini-button {
  border: 1px solid var(--charcoal);
  border-radius: 6px;
}

.review-button.approve,
.review-button.enable,
.mini-button.restore {
  background: var(--lime-500);
  color: var(--charcoal);
}

.review-button.reject,
.review-button.disable,
.mini-button.danger {
  background: var(--charcoal);
  color: var(--white);
}

.schema-grid span {
  border: 1px solid #b8c0b2;
  border-left: 5px solid var(--lime-500);
  background: var(--white);
}

@media (max-width: 1200px) and (min-width: 981px) {
  .shell {
    grid-template-columns: 254px minmax(0, 1fr);
  }

  .workspace {
    padding-inline: 22px;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .workspace {
    padding: 18px 16px 32px;
  }

  .topbar {
    min-height: 0;
  }

  .nav-steps a {
    min-height: 42px;
  }

  .panel,
  .schema-panel {
    padding: 16px;
  }

  .dashboard-head,
  .dashboard-chart {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .side-card {
    display: none;
  }

  .nav-steps {
    margin-top: 16px;
  }

  .topbar h2 {
    font-size: 25px;
  }

  .dashboard-kpi strong,
  .account-kpi strong {
    font-size: 20px;
  }
}
