:root {
  color-scheme: light;
  --nav-bg: #111827;
  --nav-deep: #0b1220;
  --nav-active: #1f2a44;
  --nav-accent: #2563eb;
  --nav-text: #d6deea;
  --nav-muted: #8fa3bf;
  --page-bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
.is-hidden { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}
.login-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--nav-bg); }
.login-card { width: min(420px, 100%); display: grid; gap: 16px; padding: 24px; border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 28px 70px rgba(0,0,0,.35); }
.login-card h1 { font-size: 28px; }
.login-card p { color: var(--muted); }
.login-brand { margin: -24px -24px 4px; }
.login-error { min-height: 20px; color: #b91c1c; font-size: 13px; font-weight: 800; }
.current-user { color: var(--muted); font-size: 13px; font-weight: 800; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .68; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.admin-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--nav-bg); color: var(--nav-text); }
.brand-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 32px; align-items: center; gap: 8px; min-height: 56px; padding: 0 18px; background: var(--nav-deep); }
.brand-row strong { color: #fff; font-size: 14px; white-space: nowrap; }
.brand-mark { position: relative; width: 26px; height: 26px; }
.brand-mark span { position: absolute; inset: 2px; border: 2px solid #fff; border-radius: 8px 11px 11px 8px; transform: skewY(-18deg); }
.brand-mark span:nth-child(2) { inset: 5px 1px 2px 5px; opacity: .82; }
.brand-mark span:nth-child(3) { inset: 8px 0 2px 8px; opacity: .62; }

.collapse-button, .nav-button, .submenu-button, .icon-button, .primary-action, .secondary-action, .segmented-control button, .modal-close { border: 0; }
.collapse-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; background: transparent; color: #fff; }
.nav-list { padding: 18px 0; }
.nav-list { scrollbar-width: none; }
.nav-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
.nav-button, .submenu-button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: transparent;
  color: var(--nav-text);
  text-align: left;
}
.submenu-button { grid-template-columns: 26px minmax(0, 1fr); min-height: 40px; font-size: 13px; }
.nav-button svg, .submenu-button svg { color: var(--nav-muted); }
.nav-button span, .submenu-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-button:hover, .submenu-button:hover { background: rgba(37, 99, 235, .12); color: #fff; }
.nav-button.active { background: var(--nav-active); color: #fff; font-weight: 700; }
.nav-button.active svg { color: var(--nav-accent); }
.submenu { display: none; background: #162033; }
.nav-group.open > .submenu { display: block; }
.submenu-button.active { background: var(--nav-accent); color: #fff; font-weight: 700; }
.submenu-button.active svg { color: #fff; }

.workspace { min-width: 0; padding: 28px; }
.workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
.workspace-header p, .panel-heading p, .stat-card small { color: var(--muted); }
.workspace-header p { margin-top: 8px; font-size: 14px; overflow-wrap: anywhere; }
.workspace-header > div:first-child { min-width: 0; max-width: 100%; }
.header-actions, .user-management-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.search-field { display: flex; align-items: center; gap: 8px; min-width: 300px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.icon-button, .primary-action, .secondary-action { height: 42px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.icon-button { width: 42px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.primary-action { gap: 8px; padding: 0 14px; background: var(--blue); color: #fff; }
.secondary-action { padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.sheet-link { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 8px; background: #eef2ff; color: var(--blue-dark); font-size: 13px; font-weight: 800; text-decoration: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card { display: grid; gap: 8px; min-height: 126px; padding: 18px; }
.stat-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-card strong { font-size: 25px; line-height: 1.1; }
.stat-card.accent { background: #1d4ed8; color: #fff; }
.stat-card.accent span, .stat-card.accent small { color: rgba(255,255,255,.84); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .95fr); gap: 16px; margin-bottom: 16px; }
.panel { overflow: hidden; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 18px; }
.panel-heading p { margin-top: 6px; font-size: 13px; }
.panel-count { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; margin-left: 8px; padding: 0 9px; border-radius: 999px; background: #eaf1ff; color: var(--blue-dark); font-size: 12px; font-weight: 800; vertical-align: middle; }
.bar-chart { display: grid; grid-template-columns: repeat(5, minmax(72px, 1fr)); align-items: end; gap: 16px; height: 280px; padding: 22px 18px 18px; }
.bar-item { display: grid; align-items: end; gap: 8px; min-width: 0; height: 100%; }
.bar-track { display: flex; align-items: flex-end; height: 205px; border-radius: 8px; background: #eaf1ff; overflow: hidden; }
.bar-fill { width: 100%; min-height: 10px; border-radius: 8px 8px 0 0; background: #2563eb; }
.bar-item.is-empty .bar-fill { background: #cbd5e1; }
.bar-item.is-empty .bar-track { background: #f1f5f9; }
.bar-label { display: grid; gap: 3px; text-align: center; }
.bar-label strong { font-size: 12px; }
.bar-label span { color: var(--muted); font-size: 11px; }

.category-list { display: grid; gap: 12px; padding: 18px; }
.category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; }
.category-row strong { font-size: 14px; }
.category-row span { color: var(--muted); font-size: 12px; }
.category-row small { color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.category-row .status-live { color: #047857; }
.category-row .status-pending { color: #9a3412; }
.gmpay-data-panel { margin-bottom: 16px; }
.gmpay-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 18px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.mini-stat { display: grid; gap: 6px; min-height: 82px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.mini-stat span { color: var(--muted); font-size: 12px; font-weight: 800; }
.mini-stat strong { font-size: 18px; line-height: 1.1; }
.mini-stat.negative strong, .negative-cell { color: #b91c1c; font-weight: 800; }
.segmented-control { display: inline-flex; padding: 3px; border-radius: 8px; background: #eaf1ff; }
.segmented-control button { height: 30px; padding: 0 12px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.segmented-control button.active { background: var(--surface); color: var(--blue-dark); box-shadow: 0 5px 14px rgba(52,82,232,.14); }
.date-filter { flex-wrap: wrap; justify-content: flex-end; max-width: 520px; }
.custom-date-range { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.custom-date-range label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.custom-date-range input { height: 36px; width: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--surface); color: var(--text); }
.gmpay-project-tabs button.active { background: var(--blue); color: #fff; }
.gateway-balance-filters, .report-filters, .crypto-panel-actions, .crypto-transaction-filters, .slack-record-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.gateway-balance-filters label, .report-filters label, .crypto-panel-actions label, .crypto-transaction-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.gateway-balance-filters select, .report-filters select, .crypto-panel-actions select, .crypto-transaction-filters select, .crypto-transaction-filters input { width: 180px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--text); font-weight: 700; }
.crypto-panel-actions { align-items: center; }
.crypto-tabs { margin: 0 18px 14px; }
.crypto-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 0 18px 18px; }
.crypto-transactions { display: grid; gap: 14px; }
.crypto-transaction-filters { justify-content: flex-start; padding: 0 18px; }
.crypto-transaction-table { min-width: 980px; }
.slack-record-actions { align-items: center; }
.slack-record-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(260px, 100%);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.slack-record-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.slack-record-summary { padding-top: 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.slack-record-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.slack-record-filters label { display: grid; gap: 6px; min-width: 150px; color: var(--muted); font-size: 12px; font-weight: 800; }
.slack-record-filters select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--text); font-weight: 700; }
.slack-record-filters label:first-child { min-width: 250px; flex: 1; }
.slack-filter-reset { width: auto; }
.slack-record-table th, .slack-record-table td { white-space: nowrap; }
.slack-settlement-table { min-width: 1480px; }
.slack-withdrawal-table { min-width: 1420px; }
.slack-source-settings-table { min-width: 1260px; }
.slack-thread-row td { padding: 0 18px 18px; background: #fbfdff; white-space: normal; }
.slack-timeline { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.slack-timeline-event { display: grid; grid-template-columns: 150px 180px minmax(0, 1fr); gap: 12px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.slack-timeline-event:last-child { border-bottom: 0; }
.slack-timeline-event span, .slack-timeline-event small, .slack-timeline-empty { color: var(--muted); font-size: 12px; }
.slack-timeline-event strong { font-size: 13px; }

.accounting-section { display: grid; gap: 16px; margin-bottom: 16px; }
.accounting-stats { margin-bottom: 0; }
.accounting-grid { margin-bottom: 0; }
.accounting-aging-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.accounting-table-grid { grid-template-columns: 1fr; }
.accounting-report-grid { grid-template-columns: 1fr; }
.accounting-report-panel { max-width: 100%; }
.accounting-panel .panel-heading { min-height: 84px; }
.accounting-panel .primary-action, .accounting-panel .secondary-action { flex: 0 0 auto; min-width: 136px; }
.accounting-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.accounting-panel-actions select {
  width: 156px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}
.accounting-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 100%);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.accounting-search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.accounting-page-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.base-currency-summary { border-top: 1px solid var(--line); border-bottom: 0; }
.exchange-rate-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
}
.exchange-rate-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.exchange-rate-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
}
.exchange-rate-field input[readonly] { background: var(--surface); color: var(--muted); }
.contact-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.payment-balance-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.payment-balance-card span, .payment-balance-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.payment-balance-card strong { font-size: 22px; }
.payment-history-list {
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
}
.payment-history-list-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.payment-history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.payment-history-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.payment-history-row strong { font-size: 14px; }
.payment-history-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.payment-history-actions button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
}
.accounting-table { min-width: 100%; table-layout: auto; }
.accounting-table th, .accounting-table td { padding: 13px 16px; white-space: normal; }
.accounting-table td:first-child, .accounting-table td:nth-last-child(-n + 2) { white-space: nowrap; }
.accounting-row-actions { min-width: 190px; }
.accounting-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.accounting-status.paid, .accounting-status.approved { background: #dcfce7; color: #047857; }
.accounting-status.partially-paid { background: #e0f2fe; color: #0369a1; }
.accounting-status.sent, .accounting-status.awaiting-payment { background: #eaf1ff; color: var(--blue-dark); }
.accounting-status.overdue { background: #fee2e2; color: #b91c1c; }
.accounting-status.draft { background: #f1f5f9; color: #475569; }
.accounting-report-list, .accounting-account-list { display: grid; padding: 10px 18px 18px; }
.accounting-report-section { display: grid; gap: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.accounting-report-section:last-child { border-bottom: 0; }
.accounting-report-section h3 { margin: 0 0 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.accounting-report-row, .accounting-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}
.accounting-report-row:last-child, .accounting-account-row:last-child { border-bottom: 0; }
.accounting-report-row span, .accounting-account-row span { color: var(--muted); font-size: 13px; font-weight: 700; }
.accounting-report-row strong, .accounting-account-row strong { font-size: 15px; }
.accounting-report-row.report-total-row, .accounting-report-row.report-grand-total { font-weight: 800; }
.accounting-report-row.report-grand-total { min-height: 64px; }
.accounting-report-row.report-grand-total span, .accounting-report-row.report-grand-total strong { color: var(--text); font-size: 18px; }
.accounting-report-row.negative strong { color: #b91c1c; }
.accounting-account-row > div { display: grid; gap: 4px; min-width: 0; }
.accounting-account-row > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounting-workspace-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.accounting-workspace-list button {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}
.accounting-workspace-list button:hover { border-color: #bfdbfe; background: #f8fbff; }
.accounting-workspace-list strong { font-size: 15px; }
.accounting-workspace-list span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.aging-report-list { display: grid; gap: 0; padding: 8px 18px 18px; }
.aging-report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.aging-report-row:hover strong { color: var(--blue-dark); }
.aging-report-row > div:first-child, .aging-report-amount { display: grid; gap: 4px; }
.aging-report-row strong { font-size: 14px; }
.aging-report-row span { color: var(--muted); font-size: 12px; font-weight: 800; }
.aging-report-amount { text-align: right; }
.aging-report-bar {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf1ff;
}
.aging-report-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.aging-report-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding-top: 12px;
  font-weight: 800;
}
.aging-report-total span { color: var(--muted); font-size: 13px; }

.table-wrap { overflow: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
.compact-table { min-width: 1080px; }
.compact-table.crypto-table { min-width: 760px; }
.compact-table.accounting-table { min-width: 100%; }
th, td { min-height: 54px; padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); background: var(--surface-soft); font-size: 12px; text-transform: uppercase; }
.sort-header { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; text-transform: inherit; }
.sort-header:hover { color: var(--blue-dark); }
.sort-header span { display: inline-flex; align-items: center; justify-content: center; width: 12px; color: var(--blue-dark); font-size: 13px; line-height: 1; }
td { font-size: 14px; }
.report-provider-row td { font-weight: 700; }
.report-sub-row td { background: #fbfdff; color: #334155; font-size: 13px; }
.report-sub-row .sub-label { display: inline-flex; align-items: center; gap: 8px; padding-left: 16px; color: var(--muted); font-weight: 800; }
.report-sub-row .sub-label::before { content: ""; width: 10px; height: 1px; background: #94a3b8; }
.report-total-row td { background: var(--surface-soft); font-weight: 800; }
.gateway-detail-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0; border: 0; background: transparent; color: var(--text); font-weight: 800; }
.gateway-detail-toggle span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--blue-dark); font-size: 14px; line-height: 1; }
.inline-action { display: inline-flex; align-items: center; min-height: 26px; margin: 6px 0 0; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.gateway-balance-row:has(.gateway-detail-toggle[aria-expanded="true"]) td { border-bottom-color: transparent; }
.gateway-detail-row td { padding-top: 0; background: #fbfdff; white-space: normal; }
.gateway-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 10px; padding: 4px 0 8px 94px; }
.gateway-detail-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.gateway-detail-item span { color: var(--muted); font-size: 12px; font-weight: 800; }
.gateway-detail-item strong { color: var(--text); font-size: 13px; }
.user-cell { display: grid; gap: 4px; }
.user-cell strong { font-size: 14px; }
.user-cell span { color: var(--muted); font-size: 12px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-chip, .status-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 12px; font-weight: 800; }
.permission-chip { height: 24px; padding: 0 9px; background: #eaf1ff; color: var(--blue-dark); }
.status-pill { min-width: 78px; height: 26px; }
.status-pill.active { background: #dcfce7; color: #047857; }
.status-pill.disabled { background: #fee2e2; color: #b91c1c; }
.row-actions { display: flex; gap: 6px; }
.row-actions button { min-height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--text); font-size: 12px; font-weight: 800; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: rgba(10,16,31,.54); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(720px, 100%); max-height: calc(100vh - 44px); overflow: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 28px 70px rgba(8,14,28,.28); }
.compact-modal { width: min(560px, 100%); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.modal-heading p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.modal-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 8px; background: var(--surface-soft); color: var(--muted); }
.user-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.form-field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
.form-field input, .form-field select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; background: var(--surface-soft); color: var(--text); }
.choice-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.choice-group legend { padding: 0 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.choice-group label { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; color: var(--text); font-size: 13px; font-weight: 700; }
.choice-group input { width: 16px; height: 16px; accent-color: var(--blue); }
.permission-choice-group { grid-template-columns: 1fr; }
.permission-choice-group > div { display: grid; gap: 14px; }
.permission-group { display: grid; gap: 8px; }
.permission-group strong { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.permission-group div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.import-preview-body { display: grid; gap: 14px; padding: 18px; }
.import-preview-body .accounting-page-summary { padding: 0; border: 0; background: transparent; }
.import-preview-errors {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
}
.import-preview-errors:empty { display: none; }
.import-preview-errors span { color: #991b1b; font-weight: 700; }
.import-preview-actions { padding: 0 18px 18px; }

@media (max-width: 1120px) {
  .admin-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .brand-row { grid-template-columns: 1fr; justify-items: center; padding: 12px; }
  .brand-row strong, .collapse-button, .nav-button span, .nav-button svg:last-child, .submenu-button span { display: none; }
  .nav-button, .submenu-button { grid-template-columns: 1fr; justify-items: center; padding: 0; }
}

@media (max-width: 900px) {
  .workspace { padding: 18px; }
  .workspace-header, .panel-heading { flex-direction: column; }
  .workspace-header p { max-width: min(100%, 340px); }
  .header-actions, .user-management-actions, .gateway-balance-filters, .report-filters, .crypto-panel-actions, .crypto-transaction-filters, .slack-record-actions, .slack-record-search, .accounting-panel-actions, .accounting-panel-actions select, .accounting-search-field, .search-field, .date-filter, .custom-date-range, .icon-button, .primary-action, .secondary-action { width: 100%; }
  .gateway-balance-filters, .report-filters, .crypto-panel-actions, .crypto-transaction-filters, .slack-record-actions { justify-content: flex-start; }
  .slack-record-filters, .slack-record-filters label, .slack-filter-reset { width: 100%; }
  .slack-record-filters label { min-width: 0; }
  .gateway-balance-filters label, .gateway-balance-filters select, .report-filters label, .report-filters select, .crypto-panel-actions label, .crypto-panel-actions select, .crypto-transaction-filters label, .crypto-transaction-filters select, .crypto-transaction-filters input { width: 100%; }
  .crypto-summary-grid { grid-template-columns: 1fr; }
  .slack-timeline-event { grid-template-columns: 1fr; gap: 4px; }
  .gateway-detail-grid { grid-template-columns: 1fr; padding-left: 0; }
  .date-filter { justify-content: flex-start; }
  .custom-date-range { justify-content: flex-start; flex-wrap: wrap; }
  .custom-date-range input { width: 150px; }
  .stats-grid, .dashboard-grid, .user-form, .choice-group, .accounting-grid, .accounting-page-summary, .exchange-rate-grid { grid-template-columns: 1fr; }
  .accounting-workspace-list { grid-template-columns: 1fr; }
  .permission-group div { grid-template-columns: 1fr; }
  .gmpay-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-actions { flex-direction: column-reverse; }
}

@media (max-width: 620px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .brand-row { grid-template-columns: 28px minmax(0, 1fr); justify-items: start; }
  .brand-row strong { display: block; }
  .nav-list { display: flex; width: 100vw; max-width: 100vw; overflow-x: auto; padding: 8px; }
  .nav-group, .submenu { display: contents; }
  .nav-group:not(.open) > .submenu { display: none; }
  .nav-group.open > .submenu { display: contents; }
  .nav-button, .submenu-button { width: 58px; flex: 0 0 auto; border-radius: 8px; }
  .workspace { padding: 14px; }
  .bar-chart { grid-template-columns: repeat(2, minmax(52px, 1fr)); height: auto; }
}
