:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef3ee;
  --ink: #13201a;
  --muted: #66746d;
  --line: #dfe6df;
  --accent: #1f7a5a;
  --accent-2: #0d5f8f;
  --warn: #b7791f;
  --danger: #b42318;
  --success: #13795b;
  --shadow: 0 18px 45px rgba(24, 38, 30, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

body.app-loading .app-shell {
  visibility: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

[data-view] {
  cursor: pointer;
}

.spinner,
.is-loading::before {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(31, 122, 90, 0.22);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 780ms linear infinite;
}

.is-loading::before {
  content: "";
  border-color: rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  background: rgba(244, 246, 243, 0.42);
  backdrop-filter: blur(3px);
  transition: opacity 160ms ease;
}

.page-loader.show {
  opacity: 1;
}

.page-loader > span,
.page-loader > strong {
  grid-area: 1 / 1;
}

.page-loader > strong {
  transform: translateY(34px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.page-loader .spinner {
  width: 34px;
  height: 34px;
  border-width: 3px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(24, 38, 30, 0.14);
}

.toast-stack {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 70;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(31, 122, 90, 0.2);
  border-radius: 8px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(24, 38, 30, 0.14);
  color: var(--ink);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(19, 121, 91, 0.12);
}

.toast.error .toast-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}

.toast strong {
  font-size: 13px;
}

.back-control {
  min-height: 42px;
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.back-control.show {
  display: inline-flex;
}

.back-control svg {
  width: 18px;
  height: 18px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: #17251e;
  color: #eef7f1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #244234;
  color: #c9f4dd;
  font-weight: 800;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(20, 60, 47, 0.18);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #9db3a8;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding-right: 4px;
}

.side-nav {
  scrollbar-width: none;
}

.side-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #d7e2dc;
  text-align: left;
}

.nav-item svg,
.icon-btn svg,
.primary-btn svg,
.primary-small svg,
.quick-actions svg,
.settings-list svg,
.search-box svg,
.contact-grid svg,
.flow-card svg,
.notice-list svg,
.report-card svg,
.integration-list svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item:hover,
.nav-item.active {
  background: #274436;
  color: #ffffff;
}

.side-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.side-footer span,
.side-footer strong {
  display: block;
}

.side-footer span {
  color: #9db3a8;
  font-size: 12px;
}

.side-footer strong {
  margin-top: 4px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-heading {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.company-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
}

.company-heading strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.company-heading span {
  max-width: min(620px, 62vw);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input::placeholder,
textarea::placeholder {
  color: #9aa8a0;
  font-weight: 600;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 38px;
  line-height: 1.1;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
}

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

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.notification {
  position: relative;
}

.notification span {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--danger);
  box-shadow: 0 0 0 2px #fff;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dcefe4;
  color: #145c45;
  font-weight: 800;
}

.avatar.large {
  width: 68px;
  height: 68px;
  font-size: 20px;
}

.mobile-menu,
.mobile-tabs {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.45fr) repeat(3, minmax(170px, 0.65fr));
  gap: 16px;
}

.balance-panel,
.panel,
.metric-card,
.account-card,
.promo-card,
.bank-card,
.flow-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.balance-panel {
  grid-row: span 2;
  padding: 22px;
}

.panel-head,
.panel-title,
.profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-head p,
.metric-card p,
.account-card p,
.wealth-hero p,
.invoice-card p {
  margin-bottom: 6px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 0;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.success {
  background: #dcf7ea;
  color: var(--success);
}

.cash-chart {
  height: 150px;
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 26px 0 20px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 122, 90, 0.08), transparent),
    repeating-linear-gradient(0deg, transparent, transparent 35px, rgba(19, 32, 26, 0.06) 36px);
}

.cash-chart span {
  flex: 1;
  min-width: 12px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #1f7a5a, #7db79a);
}

.cash-chart span.bar-out {
  background: linear-gradient(180deg, #0d5f8f, #8bb6ca);
}

.cash-chart.empty-chart {
  align-items: center;
  justify-content: center;
}

.cash-chart.empty-chart em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions button,
.primary-btn,
.primary-small,
.promo-card button,
.report-card button,
.settings-list button,
.doc-list button,
.text-btn,
.filter,
.segmented button,
.faq-list button,
.integration-list button {
  border: 0;
  border-radius: 8px;
}

.quick-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #edf5f0;
  color: #155d46;
  font-weight: 700;
}

.metric-card {
  min-height: 132px;
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 16px;
  font-size: 26px;
}

.trend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.trend.up {
  color: var(--success);
}

.trend.warn {
  color: var(--warn);
}

.content-grid,
.two-col,
.help-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.two-col {
  margin-top: 0;
}

.wide-left {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.panel {
  padding: 18px;
}

.panel-title {
  margin-bottom: 16px;
}

.panel-title.wrap {
  align-items: center;
  flex-wrap: wrap;
}

.text-btn {
  background: transparent;
  color: var(--accent-2);
  font-weight: 700;
}

.table-list,
.transaction-table,
.bill-list,
.ticket-list,
.mini-list,
.settings-list,
.faq-list {
  display: grid;
  gap: 10px;
}

.row-item,
.transaction-row,
.bill-item,
.ticket-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.row-main {
  min-width: 0;
}

.row-item {
  grid-template-columns: minmax(0, 1fr) minmax(72px, 110px) auto;
}

.row-item > span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.row-item[data-view],
.transaction-row[data-view] {
  cursor: pointer;
}

.row-main strong,
.row-main span,
.mini-list strong,
.mini-list span {
  display: block;
}

.row-main span,
.mini-list span,
.bill-item span,
.ticket-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.amount {
  font-weight: 800;
  white-space: nowrap;
}

.amount.in {
  color: var(--success);
}

.amount.out {
  color: var(--ink);
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  padding: 13px;
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  background: #f4f8fa;
}

.alert-item.high {
  border-left-color: var(--warn);
  background: #fff8ea;
}

.alert-item strong,
.alert-item span {
  display: block;
}

.alert-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-card {
  min-height: 260px;
}

.profile-top {
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 18px;
}

.profile-top .status-pill {
  margin-left: auto;
}

.profile-top p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.detail-grid div,
.info-table div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

dt,
.info-table span,
.yield-row span {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 5px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.step-list {
  display: grid;
  gap: 18px;
}

.step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
}

.step > span {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 3px solid #b9c7bf;
  border-radius: 99px;
}

.step.done > span,
.step.active > span {
  border-color: var(--accent);
  background: var(--accent);
}

.step p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.account-card {
  min-height: 178px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.account-card::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -40px;
  width: 130px;
  height: 130px;
  border-radius: 99px;
  background: rgba(31, 122, 90, 0.1);
}

.account-card strong {
  display: block;
  margin: 24px 0 10px;
  font-size: 28px;
}

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

.account-card .text-btn {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 0;
}

.info-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.info-table strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(24, 38, 30, 0.08);
}

.transfer-form {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.transfer-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 118px;
  padding-top: 12px;
  resize: vertical;
}

.primary-btn,
.primary-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-btn {
  min-height: 46px;
  width: 100%;
}

.primary-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.mini-list div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

.filter.active {
  background: #dcefe4;
  color: #145c45;
}

.transaction-row {
  grid-template-columns: minmax(0, 1fr) minmax(96px, 130px) minmax(120px, 180px) minmax(120px, 170px);
}

.transaction-row > * {
  min-width: 0;
}

.transaction-row .amount {
  justify-self: end;
}

.transaction-row > span:not(.status-pill) {
  overflow-wrap: anywhere;
}

.transaction-row .status-pill {
  justify-self: end;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.wealth-hero {
  min-height: 330px;
  background:
    linear-gradient(135deg, rgba(31, 122, 90, 0.14), rgba(13, 95, 143, 0.1)),
    #ffffff;
}

.wealth-hero h3 {
  margin: 18px 0 8px;
  font-size: 28px;
}

.yield-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 26px 0;
}

.yield-row div {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.yield-row strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.disclosure-list p {
  padding: 13px;
  border-radius: 8px;
  background: #fff8ea;
  color: #6f4a0c;
}

.invoice-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.invoice-card strong,
.invoice-card span {
  display: block;
}

.invoice-card span {
  margin-top: 5px;
  color: var(--muted);
}

.progress {
  height: 8px;
  margin: 20px 0 10px;
  border-radius: 999px;
  background: #e5ebe6;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.promo-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(13, 95, 143, 0.09), rgba(31, 122, 90, 0.1)),
    #fff;
}

.promo-card strong {
  font-size: 22px;
}

.promo-card span {
  color: var(--muted);
}

.promo-card button {
  min-height: 40px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.settings-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-list span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.settings-list button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
}

.settings-list button.enabled {
  background: #dcf7ea;
  color: var(--success);
}

.search-panel h3 {
  margin-bottom: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-box input {
  min-height: 0;
  border: 0;
  padding: 0;
}

.faq-list {
  margin-top: 16px;
}

.faq-list button {
  min-height: 44px;
  padding: 0 12px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  text-align: left;
  font-weight: 700;
}

.contact-grid {
  display: grid;
  gap: 12px;
}

.contact-grid div {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 2px 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-grid svg {
  grid-row: span 2;
  color: var(--accent);
}

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

.detail-cta {
  margin-top: 16px;
}

.detail-view {
  max-width: 1280px;
}

.detail-grid-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.detail-hero {
  min-height: 250px;
  background:
    linear-gradient(135deg, rgba(31, 122, 90, 0.12), rgba(13, 95, 143, 0.08)),
    #fff;
}

.detail-hero h3 {
  margin: 16px 0 8px;
  font-size: 28px;
}

.detail-hero p {
  color: var(--muted);
  max-width: 760px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.detail-stats div,
.review-box div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.detail-stats span,
.review-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-stats strong,
.review-box strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.info-table.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.bank-card button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}

.detail-actions {
  max-width: 440px;
}

.help-article {
  max-width: 900px;
}

.help-article h3 {
  margin: 14px 0 10px;
  font-size: 26px;
}

.help-article p {
  color: var(--muted);
  line-height: 1.7;
}

.message-thread {
  display: grid;
  gap: 12px;
}

.message-thread div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.message-thread p {
  margin: 6px 0 0;
  color: var(--muted);
}

.onboarding-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flow-card {
  min-height: 158px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  box-shadow: none;
}

.flow-card svg {
  color: var(--muted);
}

.flow-card.done svg,
.flow-card.active svg {
  color: var(--accent);
}

.flow-card span,
.doc-list span,
.recipient-list span,
.member-list span,
.rule-list span,
.notice-list span,
.report-card span,
.integration-list span,
.api-card p {
  color: var(--muted);
  font-size: 13px;
}

.flow-card.active {
  border-color: rgba(31, 122, 90, 0.45);
  background: #f1fbf6;
}

.doc-list,
.recipient-list,
.member-list,
.rule-list,
.notice-list,
.integration-list {
  display: grid;
  gap: 10px;
}

.doc-list div,
.recipient-list div,
.member-list div,
.rule-list div,
.notice-list div,
.integration-list div {
  min-height: 58px;
  display: grid;
  align-items: center;
  gap: 4px 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.doc-list div,
.recipient-list div,
.member-list div,
.integration-list div {
  grid-template-columns: 1fr auto;
}

.doc-list strong,
.recipient-list strong,
.member-list strong,
.rule-list strong,
.notice-list strong,
.integration-list strong {
  display: block;
}

.doc-list span,
.recipient-list span,
.member-list span,
.integration-list span {
  grid-column: 1 / 2;
}

.doc-list button,
.integration-list button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
  grid-row: span 2;
}

.doc-list button:hover,
.integration-list button.enabled {
  background: #dcf7ea;
  color: var(--success);
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 380px));
  justify-content: start;
  gap: 16px;
  margin-bottom: 16px;
}

.card-list.single-card {
  justify-content: center;
}

.account-grid.empty-grid,
.card-list.empty-grid {
  grid-template-columns: 1fr;
}

.card-management {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  align-items: start;
  gap: 16px;
}

.bank-card {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1.586 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  color: #fff;
}

.bank-card.selected {
  box-shadow: 0 0 0 3px rgba(245, 190, 64, 0.7), 0 18px 42px rgba(31, 122, 90, 0.2);
}

.bank-card span,
.bank-card p {
  color: rgba(255, 255, 255, 0.78);
}

.bank-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.bank-card p {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.bank-card div:last-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dark-card {
  background: linear-gradient(135deg, #13201a, #244234);
}

.teal-card {
  background: linear-gradient(135deg, #0d5f8f, #1f7a5a);
}

.card-control {
  min-height: 0;
}

.recipient-list em,
.member-list em {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--success);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.rule-list div {
  display: block;
}

.rule-list span {
  display: block;
  margin-top: 4px;
}

.notice-list div {
  grid-template-columns: 24px 1fr;
}

.notice-list svg {
  grid-row: span 2;
  color: var(--accent-2);
}

.notice-list div.unread {
  border-color: rgba(31, 122, 90, 0.35);
  background: #f1fbf6;
}

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

.report-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.report-card svg {
  color: var(--accent);
}

.report-card strong {
  font-size: 20px;
}

.report-card button {
  min-height: 40px;
  margin-top: auto;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.integration-list div {
  grid-template-columns: 24px 1fr auto;
}

.integration-list svg {
  grid-row: span 2;
  color: var(--accent);
}

.integration-list span {
  grid-column: 2 / 3;
}

.api-card code {
  display: block;
  padding: 14px;
  border-radius: 8px;
  background: #13201a;
  color: #c9f4dd;
  font-family: "Cascadia Mono", Consolas, monospace;
  overflow-wrap: anywhere;
}

.api-card p {
  margin: 14px 0;
}

@media (max-width: 1160px) {
  .summary-grid,
  .account-grid,
  .promo-grid,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .balance-panel {
    grid-column: 1 / -1;
  }

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

  .card-management,
  .onboarding-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 284px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    padding: 16px;
  }

  .mobile-menu,
  .mobile-tabs {
    display: grid;
  }

  .mobile-tabs {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -16px 16px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }

  .mobile-tabs::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .chip {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 14px;
    background: #fff;
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
  }

  .chip.active {
    background: #17251e;
    color: #fff;
  }

  .topbar {
    align-items: center;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .top-actions .icon-btn {
    display: none;
  }

  .content-grid,
  .two-col,
  .help-grid,
  .wide-left {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .account-grid,
  .promo-grid,
  .report-grid,
  .card-list,
  .card-management,
  .onboarding-flow {
    grid-template-columns: 1fr;
  }

  .detail-grid,
  .info-table,
  .yield-row,
  .detail-stats,
  .review-box,
  .info-table.two {
    grid-template-columns: 1fr;
  }

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

  .transaction-row {
    grid-template-columns: 1fr;
  }

  .integration-list div {
    grid-template-columns: 24px 1fr;
  }

  .integration-list button {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .amount {
    white-space: normal;
  }

  .card-list {
    grid-template-columns: minmax(0, min(380px, 100%));
  }
}

@media (max-width: 520px) {
  .main {
    padding: 12px;
  }

  .mobile-tabs {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .balance-panel,
  .panel,
  .metric-card,
  .account-card,
  .promo-card,
  .bank-card,
  .flow-card,
  .report-card {
    padding: 14px;
  }

  h2 {
    font-size: 30px;
  }

  .panel-head,
  .panel-title,
  .profile-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-top .status-pill {
    margin-left: 0;
  }
}

.auth-body {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(244, 248, 245, 0.96) 0%, rgba(244, 248, 245, 0.82) 42%, rgba(19, 32, 26, 0.2) 100%),
    url("assets/brand/login-finance-bg.png") center / cover no-repeat;
  overflow-x: hidden;
}

.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04)),
    rgba(12, 33, 25, 0.08);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  align-items: center;
  gap: 42px;
  padding: 32px 0;
}

.auth-shell.compact {
  grid-template-columns: minmax(340px, 460px);
  justify-content: center;
}

.auth-panel,
.editor-modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 28px;
  backdrop-filter: blur(14px);
}

.auth-brand {
  padding: 0;
  color: var(--ink);
}

.auth-brand .brand-logo,
.admin-v2-brand .brand-logo {
  border-color: rgba(31, 122, 90, 0.28);
}

.auth-copy {
  margin: 42px 0 24px;
}

.auth-copy h1 {
  margin: 6px 0 10px;
  font-size: clamp(30px, 5vw, 46px);
}

.auth-copy p:last-child,
.auth-meta {
  color: var(--muted);
}

.auth-form,
.editor-grid {
  display: grid;
  gap: 14px;
}

.auth-form label,
.editor-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.form-message.error {
  color: var(--danger);
}

.auth-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
}

.auth-meta a {
  color: var(--accent-2);
  text-decoration: none;
}

.auth-showcase {
  display: grid;
  gap: 16px;
}

.auth-card-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px;
  background: #17251e;
  color: #eef7f1;
}

.admin-nav {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-nav-item {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #b9c9c0;
  font-weight: 800;
  text-align: left;
}

.admin-nav-item svg {
  width: 17px;
  height: 17px;
}

.admin-nav-item.active,
.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.admin-topbar,
.modal-head,
.modal-actions,
.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-topbar h1 {
  margin: 4px 0 0;
}

.admin-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #cddbd2;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 16px;
  background: #f7fbf8;
}

.admin-context.muted {
  background: #fbfcfb;
}

.admin-context h2 {
  margin: 3px 0 6px;
  font-size: 22px;
}

.admin-context p {
  margin: 0;
  color: var(--muted);
}

.scope-select {
  width: min(360px, 100%);
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.secondary-btn,
.danger-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.danger-btn {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff8f7;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-panel .panel-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.admin-table th {
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.admin-table td {
  max-width: 220px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.table-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(19, 32, 26, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.editor-modal {
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  padding: 22px;
}

.modal-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 4px 0 0;
}

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

.editor-grid label:has(textarea) {
  grid-column: 1 / -1;
}

.editor-grid .owner-field {
  grid-column: 1 / -1;
  border: 1px solid #cddbd2;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf8;
}

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

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.modal-actions .primary-btn {
  width: auto;
  padding: 0 18px;
}

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

  .auth-showcase {
    display: none;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .admin-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    width: min(100% - 24px, 1120px);
  }

  .auth-panel,
  .editor-modal {
    padding: 18px;
  }

  .auth-meta,
  .admin-topbar,
  .admin-context {
    align-items: flex-start;
    flex-direction: column;
  }

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

.admin-v2-body {
  background: #f4f6f3;
}

.admin-v2 {
  min-height: 100vh;
  padding: 18px;
}

.admin-v2-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 38, 30, 0.06);
}

.admin-v2-brand {
  padding: 0;
  color: var(--ink);
}

.admin-v2-brand .brand-mark {
  border-color: rgba(31, 122, 90, 0.28);
}

.admin-v2-actions,
.workspace-actions,
.module-board-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-config-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.user-directory,
.workspace-hero,
.module-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 38, 30, 0.05);
}

.user-directory {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 124px);
  padding: 14px;
  overflow: auto;
}

.user-directory {
  scrollbar-width: none;
}

.user-directory::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.directory-head,
.workspace-hero,
.module-board-head {
  justify-content: space-between;
}

.directory-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.directory-head h2,
.workspace-hero h1,
.module-board h3 {
  margin: 4px 0 0;
}

.directory-search {
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfb;
}

.directory-search svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.directory-search input {
  min-height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.user-card.active,
.user-card:hover {
  border-color: rgba(31, 122, 90, 0.38);
  background: #f3faf5;
}

.user-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #17251e;
  color: #d8f5e4;
  font-weight: 900;
}

.user-card span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-card strong,
.user-card em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card em,
.user-card small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.user-workspace {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.workspace-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.workspace-hero h1 {
  font-size: clamp(26px, 4vw, 38px);
}

.workspace-hero p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-board {
  padding: 14px;
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.module-tab {
  min-height: 58px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfcfb;
  color: var(--ink);
  text-align: left;
}

.module-tab svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.module-tab span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.module-tab strong,
.module-tab em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-tab em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.module-tab.active,
.module-tab:hover {
  border-color: rgba(31, 122, 90, 0.42);
  background: #edf8f1;
}

.records-panel {
  min-width: 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.wide-empty {
  min-height: 116px;
  display: grid;
  place-items: center;
  background: #fbfcfb;
}

.owner-banner {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  border: 1px solid #cddbd2;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf8;
}

.owner-banner span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.password-visible-field {
  grid-column: 1 / -1;
  border: 1px solid rgba(13, 95, 143, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: #f6fbff;
}

.password-visible-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

  .user-directory {
    position: static;
    max-height: none;
  }

  .user-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-v2 {
    padding: 10px;
  }

  .admin-v2-header,
  .workspace-hero,
  .module-board-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-summary-grid {
    grid-template-columns: 1fr;
  }

  .module-tabs {
    grid-template-columns: 1fr;
  }
}
