:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --red: #dc2626;
  --orange: #d97706;
  --green: #16a34a;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  padding: 28px;
}

.phone-app {
  width: min(100%, 430px);
  height: min(900px, calc(100vh - 56px));
  min-height: 720px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 18px calc(116px + env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px));
}

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

.app-header.compact {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  text-align: center;
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.app-header.compact h1 {
  flex: 1;
  font-size: 19px;
}

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

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

.header-text-button {
  min-width: 42px;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.panel,
.money-card,
.profile-card,
.filter-bar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.panel,
.money-card,
.profile-card {
  padding: 16px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 4px 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f4f6;
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.segmented span {
  font-weight: 700;
}

.traffic-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.traffic-summary span {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.traffic-summary strong {
  color: var(--text);
  font-size: 18px;
}

.traffic-summary small {
  color: var(--muted);
  font-size: 11px;
}

.task-list,
.customer-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.task-row,
.customer-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.task-row span:not(.task-dot),
.customer-row span {
  flex: 1;
  display: grid;
  gap: 4px;
}

.task-row strong,
.customer-row strong {
  font-size: 15px;
}

.task-row small,
.customer-row small {
  color: var(--muted);
  font-size: 12px;
}

.task-row em,
.customer-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}

.task-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--blue);
}

.task-dot.danger {
  background: var(--red);
}

.task-dot.warning {
  background: var(--orange);
}

.task-dot.normal {
  background: var(--blue);
}

.task-dot.muted {
  background: #9ca3af;
}

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

.action-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.action-card.disabled {
  background: #f8fafc;
  color: #9ca3af;
}

.action-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.action-card strong {
  font-size: 15px;
}

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

.money-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.money-card p {
  margin: 0;
  color: var(--muted);
}

.money-card strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 30px;
}

.money-card small {
  color: var(--muted);
}

.progress {
  height: 8px;
  margin: 14px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

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

.money-foot {
  font-size: 12px;
}

.bottom-nav {
  min-height: calc(74px + env(safe-area-inset-bottom, 0px));
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.04);
}

.bottom-nav button {
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.bottom-nav button.active {
  color: var(--blue);
  font-weight: 700;
}

.desktop-note {
  max-width: 360px;
  padding: 28px;
}

.desktop-note h2 {
  margin: 0 0 12px;
  font-size: 32px;
}

.desktop-note p {
  color: var(--muted);
  line-height: 1.7;
}

.trial-note {
  display: grid;
  gap: 7px;
  margin: 18px 0;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.trial-note strong {
  color: var(--text);
  font-size: 15px;
}

.trial-note span {
  display: block;
}

.trial-note.compact {
  margin: -4px 0 0;
}

.trial-feedback-note {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.trial-feedback-note strong {
  color: var(--text);
  font-size: 13px;
}

.trial-feedback-note.compact {
  margin-top: 14px;
  padding: 8px 10px;
}

.desktop-note button,
.primary-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
}

.secondary-preview {
  margin-top: 10px;
  border: 1px solid var(--line) !important;
  background: #fff !important;
  color: var(--blue) !important;
}

.login-shell {
  width: min(720px, calc(100vw - 32px));
  min-height: min(620px, calc(100vh - 32px));
  display: grid;
  align-content: center;
  gap: 14px;
  place-items: center;
}

.login-panel {
  width: 100%;
  display: grid;
  gap: 22px;
  padding: 32px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 4px 0 8px;
  font-size: 32px;
}

.login-panel span {
  color: var(--muted);
}

.compliance-footer {
  width: 100%;
  padding: 12px 4px 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.compliance-footer a {
  color: inherit;
  text-decoration: none;
}

.compliance-footer a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.login-compliance {
  padding-top: 0;
}

.phone-compliance {
  padding: 22px 0 0;
}

.password-login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: #f8fbff;
}

.password-login-form label {
  display: grid;
  gap: 6px;
}

.password-login-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
}

.password-login-form button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
}

.password-login-form button:disabled,
.login-account-grid button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-notice {
  margin-top: -10px;
}

.login-shortcut-title {
  color: var(--muted);
  font-weight: 800;
}

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

.login-account-grid button {
  display: grid;
  gap: 8px;
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  text-align: left;
}

.login-account-grid button:hover,
.login-account-grid button:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  background: #fff;
  outline: none;
}

.login-account-grid strong {
  font-size: 20px;
}

.login-account-grid em {
  color: var(--blue);
  font-style: normal;
  font-weight: 700;
}

.account-switcher {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

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

.account-switcher div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-switcher button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.account-switcher button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.account-switcher button:disabled,
.account-switcher button.disabled {
  cursor: not-allowed;
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #94a3b8;
}

.admin-account-mini .account-switcher {
  gap: 8px;
  margin: 16px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-account-mini .account-switcher span {
  font-size: 12px;
}

.admin-account-mini .account-switcher div {
  grid-template-columns: 1fr;
  gap: 6px;
}

.admin-account-mini .account-switcher button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  text-align: left;
}

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  margin-bottom: 14px;
}

.filter-bar button {
  min-width: max-content;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: #f3f4f6;
  color: var(--muted);
}

.filter-bar button.active {
  background: var(--blue-soft);
  color: var(--blue);
}

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

.search-panel input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
}

.search-panel input::placeholder {
  color: #9ca3af;
}

.inline-notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 12px;
  background: #ecfdf5;
  color: #166534;
  font-size: 13px;
  line-height: 1.5;
}

.inline-notice.listening {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--blue-soft);
  color: var(--blue);
}

.warning-notice {
  margin: 12px 0 0;
  border-color: rgba(217, 119, 6, 0.25);
  background: #fffbeb;
  color: #92400e;
}

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

.customer-stage-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.customer-stage-main {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  border: 0;
  background: transparent;
  padding: 14px;
  text-align: left;
}

.customer-stage-main span {
  flex: 1;
  display: grid;
  gap: 4px;
}

.customer-stage-main strong {
  font-size: 16px;
}

.customer-stage-main small,
.customer-stage-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.customer-stage-main em {
  white-space: nowrap;
}

.customer-stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.customer-stage-foot button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 0 14px;
}

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

.customer-stage-foot .danger-action {
  border: 1px solid #fecaca;
  background: #fff;
  color: var(--red);
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.payment-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.payment-type-grid button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}

.payment-type-grid button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.compact-card .customer-stage-main {
  min-height: 76px;
}

.deposit-form-card {
  display: grid;
  gap: 14px;
}

.selected-payment-panel {
  display: grid;
  gap: 14px;
}

.selected-customer-summary {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.selected-customer-summary strong {
  font-size: 16px;
}

.selected-customer-summary small,
.selected-customer-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

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

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.form-grid input,
.form-grid select {
  min-height: 44px;
}

.form-grid textarea {
  min-height: 78px;
  resize: vertical;
  padding-top: 10px;
  line-height: 1.5;
}

.form-grid .form-wide {
  grid-column: 1 / -1;
}

.form-grid input::placeholder {
  color: #9ca3af;
}

.form-grid textarea::placeholder {
  color: #9ca3af;
}

.account-hint {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.lead-form-panel {
  margin-top: 0;
}

.lead-contact-block {
  display: grid;
  gap: 8px;
}

.lead-contact-block > span {
  color: var(--muted);
  font-size: 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.choice-grid button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}

.choice-grid button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.form-save-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
}

.deposit-match-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.deposit-match-item {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.deposit-match-item span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.deposit-match-item strong,
.deposit-match-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deposit-match-item small {
  color: var(--muted);
  font-size: 12px;
}

.deposit-match-item em {
  flex: 0 0 auto;
  color: var(--blue);
  font-style: normal;
  font-weight: 800;
}

.customer-edit-panel .form-save-button {
  margin-top: 12px;
}

.empty-state {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
}

[hidden] {
  display: none !important;
}

.todo-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.todo-summary button {
  min-height: 88px;
  display: grid;
  gap: 6px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
}

.todo-summary button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
  color: var(--blue);
}

.todo-summary strong {
  color: var(--text);
  font-size: 26px;
}

.todo-summary button.active strong {
  color: var(--blue);
}

.todo-summary span {
  font-size: 13px;
}

.todo-item {
  min-height: 82px;
}

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

.compact-rules {
  margin: 14px 0;
}

.rule-list span {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.shared-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.shared-card {
  width: 100%;
  min-height: 88px;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}

.shared-card span {
  display: grid;
  gap: 5px;
}

.shared-card strong {
  font-size: 16px;
}

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

.lead-type-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.lead-type-card {
  min-height: 142px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}

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

.lead-type-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.metric-grid span {
  display: grid;
  gap: 3px;
  padding: 12px 8px;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.metric-grid strong {
  color: var(--blue);
  font-size: 20px;
}

.metric-grid small {
  color: var(--muted);
  font-size: 11px;
}

.customer-row.large {
  min-height: 86px;
}

.profile-card h2 {
  margin: 4px 0 16px;
  font-size: 26px;
}

.customer-detail-card h2 {
  margin-bottom: 10px;
}

.detail-contact {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-grid span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.profile-grid strong {
  color: var(--text);
  font-size: 14px;
}

.my-profile-card {
  display: grid;
  gap: 14px;
}

.profile-user-line,
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-user-line > span:last-child,
.account-row > span {
  flex: 1;
  display: grid;
  gap: 4px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
}

.profile-user-line strong,
.account-row strong {
  font-size: 18px;
}

.profile-user-line small,
.account-row small,
.profile-status-line small {
  color: var(--muted);
  font-size: 12px;
}

.profile-status-line {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.profile-status-line span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.profile-status-line strong {
  font-size: 16px;
}

.profile-period-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.profile-period-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}

.profile-period-tabs button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-kpi-grid span {
  display: grid;
  gap: 5px;
  min-height: 92px;
  align-content: center;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.profile-kpi-grid span.wide {
  grid-column: 1 / -1;
}

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

.profile-kpi-grid strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.profile-kpi-grid em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

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

.profile-focus-card {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.profile-focus-card:not(.empty) {
  cursor: pointer;
}

.profile-focus-card.empty {
  background: #f8fafc;
  color: var(--muted);
}

.focus-count {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.profile-focus-card span:not(.focus-count) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-focus-card strong {
  font-size: 14px;
}

.profile-focus-card small,
.profile-focus-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.profile-focus-card em {
  grid-column: 2;
}

.account-row button,
.logout-confirm button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

.account-row button {
  color: var(--red);
}

.logout-confirm {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
}

.logout-confirm div {
  display: flex;
  gap: 8px;
}

.logout-confirm button:first-child {
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--red);
}

.payment-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payment-breakdown span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.payment-breakdown small,
.rich-record small,
.contact-record small {
  color: var(--muted);
}

.payment-breakdown strong {
  font-size: 16px;
}

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

.tool-list button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  padding: 0 14px;
}

.tool-list small {
  color: var(--muted);
}

.record-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0 0;
  color: var(--muted);
}

.payment-record-list,
.contact-record-list,
.followup-form {
  display: grid;
  gap: 10px;
}

.rich-record {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.rich-record span {
  display: grid;
  gap: 4px;
}

.rich-record span strong {
  color: var(--text);
  font-size: 14px;
}

.rich-record > strong {
  color: var(--text);
  white-space: nowrap;
}

.edited-record {
  background: #f8fafc;
}

.edited-record small {
  color: var(--orange);
}

.compact-empty {
  min-height: 68px;
}

.followup-form {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.followup-form label {
  display: grid;
  gap: 6px;
}

.followup-form label span {
  color: var(--muted);
  font-size: 12px;
}

.followup-form textarea,
.followup-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.followup-form textarea {
  min-height: 92px;
  resize: vertical;
  padding-top: 10px;
  line-height: 1.5;
}

.followup-form input {
  min-height: 44px;
}

.contact-record {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.contact-record div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.contact-record p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.contact-record em {
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
}

.hero-panel {
  margin-top: 20px;
}

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

.hero-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.placeholder-form,
.fake-reply {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.placeholder-form span,
.fake-reply {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
}

.ai-hero-panel h2 {
  margin: 8px 0;
  font-size: 23px;
  line-height: 1.25;
}

.ai-hero-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.ai-compose-panel {
  display: grid;
  gap: 12px;
}

.voice-button {
  min-width: 68px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
}

.voice-button.active {
  border-color: rgba(220, 38, 38, 0.3);
  background: #fef2f2;
  color: var(--red);
}

.ai-input {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 13px;
  font: inherit;
  line-height: 1.6;
}

.ai-input::placeholder {
  color: #9ca3af;
}

.section-chip {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.ai-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-option-grid button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}

.ai-option-grid button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.ai-output-panel {
  display: grid;
  gap: 12px;
}

.ai-output {
  white-space: pre-wrap;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  line-height: 1.75;
  font-size: 14px;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.metric-list span {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.metric-list strong,
.metric-list small {
  display: block;
}

.metric-list small {
  margin-top: 4px;
  color: var(--muted);
}

.ai-empty {
  min-height: 118px;
}

.ai-action-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 8px;
}

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

.ai-action-row .primary-button,
.secondary-action {
  min-height: 46px;
  border-radius: 10px;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
}

.secondary-action:disabled {
  color: #9ca3af;
  background: #f8fafc;
}

@media (max-width: 380px) {
  .ai-action-row,
  .ai-actions,
  .metric-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  #app {
    display: block;
    padding: 0;
  }

  .phone-app {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    height: min(100vh, calc(100dvh + 72px));
    min-height: min(100vh, calc(100dvh + 72px));
    max-height: min(100vh, calc(100dvh + 72px));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .desktop-note {
    display: none;
  }

  .login-shell {
    width: 100%;
    min-height: 100dvh;
    padding: 16px;
  }

  .login-panel {
    padding: 22px;
  }

  .password-login-form,
  .login-account-grid {
    grid-template-columns: 1fr;
  }
}

.admin-shell {
  width: min(1680px, calc(100vw - 40px));
  min-height: min(860px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: 230px 1fr;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #fbfcff;
}

.admin-sidebar strong {
  display: block;
  font-size: 18px;
}

.admin-sidebar small {
  color: var(--muted);
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.admin-store-switcher {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.admin-store-switcher span {
  color: var(--muted);
  font-size: 12px;
}

.admin-store-switcher button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  text-align: left;
  padding: 0 10px;
}

.admin-store-switcher button.active {
  border-color: transparent;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.admin-sidebar nav button,
.admin-back,
.admin-actions button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
}

.admin-sidebar nav button.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.admin-back {
  width: 100%;
  border-color: var(--line);
  background: #fff;
  color: var(--blue);
  text-align: center;
}

.admin-main {
  padding: 28px;
  overflow: auto;
  background: var(--bg);
}

.admin-compliance {
  margin-top: 18px;
}

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

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

.admin-title-row {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-title-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-title-filter span {
  color: var(--muted);
  font-size: 12px;
}

.admin-title-filter select {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  outline: none;
}

.admin-mobile-switcher {
  display: none;
}

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

.admin-actions button {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.admin-export-action {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 6px;
}

.admin-export-action small {
  flex-basis: 100%;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
}

.admin-period-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-period-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.admin-period-tabs button.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.admin-date-range {
  display: flex;
  align-items: end;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-date-range label {
  display: grid;
  gap: 3px;
}

.admin-date-range span {
  color: var(--muted);
  font-size: 11px;
}

.admin-date-range input {
  width: 130px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}

.admin-date-range em {
  padding-bottom: 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.admin-actions .primary-lite {
  background: var(--blue);
  color: #fff;
}

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

.admin-kpi,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-kpi {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
}

button.admin-kpi {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

button.admin-kpi:hover,
button.admin-kpi:focus-visible,
button.admin-kpi.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  outline: none;
}

.admin-kpi small,
.admin-kpi span,
.admin-panel-head span {
  color: var(--muted);
}

.admin-kpi strong {
  font-size: 25px;
}

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

.admin-mini-kpis.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-mini-kpis.seven {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

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

.admin-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.9fr);
  gap: 18px;
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-summary-card > div:first-child {
  display: grid;
  align-content: center;
  gap: 8px;
}

.admin-summary-card small,
.admin-summary-card span,
.admin-summary-card button,
.admin-summary-detail em {
  color: var(--muted);
}

.admin-summary-card strong {
  font-size: 34px;
  line-height: 1;
}

.admin-summary-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.admin-summary-detail button,
.admin-payment-breakdown span,
.admin-filter-row span {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f8fafc;
  text-align: left;
  font: inherit;
}

.admin-summary-detail button {
  cursor: pointer;
}

.admin-summary-detail button:hover,
.admin-summary-detail button.active {
  border-color: rgba(37, 99, 235, 0.32);
  background: var(--blue-soft);
}

.admin-summary-detail em,
.admin-payment-breakdown em {
  font-style: normal;
}

.admin-summary-detail b {
  font-size: 24px;
  color: var(--text);
}

.overview-detail-panel {
  margin-bottom: 14px;
}

.overview-middle-grid {
  align-items: stretch;
}

.overview-combo-card,
.overview-payment-card {
  min-height: 500px;
}

.overview-combo-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.overview-table-block {
  display: grid;
  gap: 8px;
}

.overview-table-block + .overview-table-block {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.compact-head {
  min-height: 30px;
  margin-bottom: 0;
}

.compact-head h2 {
  font-size: 18px;
}

.overview-compact-table th,
.overview-compact-table td {
  padding: 8px 7px;
  font-size: 12px;
  white-space: nowrap;
}

.overview-compact-table {
  min-width: 760px;
}

.overview-payment-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.overview-payment-card .admin-list {
  gap: 10px;
}

.overview-payment-card .admin-list span {
  min-height: 84px;
}

.admin-stage-grid,
.admin-link-grid {
  display: grid;
  gap: 10px;
}

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

.admin-stage-grid span,
.admin-link-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
}

.admin-stage-grid em,
.admin-link-card em {
  color: var(--muted);
  font-style: normal;
}

.admin-stage-grid strong {
  font-size: 24px;
}

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

.admin-link-card {
  min-height: 150px;
  align-content: space-between;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-link-card span {
  display: grid;
  gap: 6px;
}

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

.admin-link-card small,
.admin-link-card b {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.system-record-panel {
  margin-top: 16px;
}

.system-record-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.system-record-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.system-record-card small,
.system-record-card span {
  color: var(--muted);
  font-size: 12px;
}

.system-record-card strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.system-export-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.system-export-strip span {
  display: grid;
  gap: 4px;
}

.system-export-strip strong {
  font-size: 15px;
}

.system-export-strip small {
  color: var(--muted);
  font-size: 12px;
}

.system-safety-note {
  display: grid;
  gap: 5px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-left: 3px solid #d97706;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.55;
}

.system-safety-note strong {
  color: #78350f;
  font-size: 13px;
}

.system-backup-list {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.system-backup-list h3 {
  margin: 0;
  font-size: 16px;
}

.restore-inline-form {
  min-width: 240px;
  display: grid;
  gap: 8px;
}

.restore-inline-form input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
}

.admin-click-panel {
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.admin-click-panel:hover,
.admin-click-panel:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.08);
  outline: none;
}

.admin-click-panel:active {
  transform: translateY(1px);
}

.admin-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.admin-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.admin-panel {
  padding: 18px;
}

.admin-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.admin-table-scroll[data-payment-detail-scroll],
.admin-table-scroll[data-order-status-table-scroll],
.expense-record-scroll,
.fund-ledger-panel .admin-table-scroll,
.income-expense-ledger-panel .admin-table-scroll {
  max-height: min(620px, calc(100vh - 260px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-table-scroll[data-payment-detail-scroll] {
  min-height: clamp(380px, calc(100vh - 430px), 520px);
}

.admin-table-scroll[data-payment-detail-scroll] .admin-table th,
.admin-table-scroll[data-order-status-table-scroll] .admin-table th,
.expense-record-scroll .admin-table th,
.fund-ledger-panel .admin-table-scroll .admin-table th,
.income-expense-ledger-panel .admin-table-scroll .admin-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.admin-table-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-table-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-table-pager span {
  color: var(--muted);
  font-size: 13px;
  line-height: 32px;
  white-space: nowrap;
}

.admin-table-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.fund-table-footer {
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 0 2px;
}

.fund-table-footer small {
  color: var(--muted);
}

.wide-table {
  min-width: 1080px;
}

.matrix-table {
  min-width: 780px;
}

.admin-table th,
.admin-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
}

.muted-table-row {
  color: var(--muted);
  background: #f8fafc;
}

.fund-workbench,
.income-expense-workbench {
  display: grid;
  gap: 14px;
}

.income-expense-workbench {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.income-expense-workbench > * {
  min-width: 0;
}

.settings-workbench {
  display: grid;
  gap: 14px;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.settings-summary-grid span,
.settings-summary-grid button {
  display: grid;
  gap: 5px;
  min-height: 98px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

.settings-summary-grid button:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.settings-summary-grid button.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.settings-summary-grid small,
.settings-summary-grid em,
.settings-personnel-form span,
.settings-rules small {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.settings-summary-grid strong {
  font-size: 24px;
}

.settings-personnel-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: #f8fbff;
}

.settings-personnel-form label {
  display: grid;
  gap: 6px;
}

.settings-personnel-form input,
.settings-personnel-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.settings-personnel-form button {
  min-height: 38px;
  align-self: end;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
}

.settings-personnel-form .wide-field {
  grid-column: span 2;
}

.settings-rules {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.settings-subsection-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}

.settings-subsection-title h3 {
  margin: 0;
  font-size: 18px;
}

.settings-subsection-title span {
  color: var(--muted);
  font-size: 13px;
}

.personnel-table {
  min-width: 940px;
}

.personnel-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.account-password-cell {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.settings-account-edit-row td {
  background: #f8fbff;
}

.settings-account-delete-row td {
  background: #fff7ed;
}

.account-credential-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 10px;
  background: #fff;
}

.account-delete-editor {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(200px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 10px;
  background: #fff;
}

.account-delete-editor > div,
.account-delete-editor label {
  display: grid;
  gap: 6px;
}

.account-delete-editor input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
}

.account-delete-editor small,
.account-delete-editor span {
  color: var(--muted);
}

.account-credential-editor label {
  display: grid;
  gap: 6px;
}

.account-credential-editor input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
}

.account-credential-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.account-credential-editor > small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.personnel-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.personnel-status.active {
  background: #dcfce7;
  color: #15803d;
}

.personnel-status.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.fund-account-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 10px;
}

.fund-account-strip button {
  display: grid;
  gap: 6px;
  min-height: 102px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.fund-account-strip button:hover,
.fund-account-strip button:focus-visible,
.fund-account-strip button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f8fbff;
  outline: none;
}

.fund-account-strip span,
.fund-account-strip small,
.fund-toolbar span,
.fund-form-panel span,
.fund-inline-editor span {
  color: var(--muted);
}

.fund-account-strip strong {
  font-size: 22px;
}

.fund-home-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  background: #f8fbff;
}

.fund-home-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}

.fund-home-head > div,
.fund-home-head > button,
.fund-home-grid button,
.fund-home-summary button {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.fund-home-head > div {
  align-content: center;
}

.fund-home-head > div strong {
  font-size: 24px;
}

.fund-home-head > button,
.fund-home-grid button,
.fund-home-summary button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.fund-home-head > button:hover,
.fund-home-head > button:focus-visible,
.fund-home-head > button.active,
.fund-home-grid button:hover,
.fund-home-grid button:focus-visible,
.fund-home-grid button.active,
.fund-home-summary button:hover,
.fund-home-summary button:focus-visible,
.fund-home-summary button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #fff;
  outline: none;
}

.fund-home-head small,
.fund-home-head span,
.fund-home-grid small,
.fund-home-summary small,
.fund-home-summary span {
  color: var(--muted);
}

.fund-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.fund-home-grid button {
  grid-template-columns: minmax(110px, 0.8fr) minmax(120px, 1fr);
  align-items: center;
}

.fund-home-grid button strong,
.fund-home-summary button strong {
  justify-self: end;
  font-size: 18px;
}

.fund-home-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.fund-home-summary button {
  min-height: 82px;
}

.fund-balance-empty {
  display: none;
}

.fund-scope-kpi {
  cursor: pointer;
}

.fund-scope-kpi span {
  line-height: 1.45;
}

.fund-scope-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(180px, 0.6fr) minmax(0, 1.6fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  background: #f8fbff;
}

.fund-scope-summary > div {
  display: grid;
  align-content: center;
  gap: 5px;
}

.fund-scope-summary small,
.fund-scope-summary span {
  color: var(--muted);
}

.fund-scope-summary strong {
  font-size: 22px;
}

.fund-scope-accounts {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.fund-scope-accounts button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.fund-scope-accounts button:hover,
.fund-scope-accounts button:focus-visible {
  border-color: rgba(37, 99, 235, 0.4);
  outline: none;
}

.fund-scope-accounts button strong {
  font-size: 16px;
}

.fund-scope-empty {
  align-self: center;
}

.fund-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.fund-toolbar > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fund-toolbar label,
.fund-form-grid label,
.fund-inline-editor label {
  display: grid;
  gap: 5px;
}

.fund-toolbar select,
.fund-toolbar input,
.fund-form-grid input,
.fund-form-grid select,
.fund-inline-editor input,
.fund-inline-editor select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.fund-search {
  min-width: 260px;
}

.fund-form-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 14px;
  background: #f8fbff;
}

.fund-form-panel.compact {
  background: #f8fafc;
  border-color: var(--line);
}

.fund-form-head,
.fund-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.fund-form-grid .wide-field {
  grid-column: span 2;
}

.fund-form-actions {
  justify-content: flex-start;
}

.fund-form-actions .primary-lite,
.fund-toolbar .primary-lite {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 0 14px;
}

.fund-ledger-panel,
.income-expense-ledger-panel {
  overflow: hidden;
}

.fund-table {
  width: 100%;
  min-width: 1160px;
  table-layout: fixed;
}

.fund-table th:nth-child(1),
.fund-table td:nth-child(1) {
  width: 84px;
}

.fund-table th:nth-child(2),
.fund-table td:nth-child(2) {
  width: 94px;
}

.fund-table th:nth-child(3),
.fund-table td:nth-child(3),
.fund-table th:nth-child(4),
.fund-table td:nth-child(4),
.fund-table th:nth-child(5),
.fund-table td:nth-child(5) {
  width: 112px;
}

.fund-table th:nth-child(6),
.fund-table td:nth-child(6) {
  width: 86px;
}

.fund-table th:nth-child(7),
.fund-table td:nth-child(7) {
  width: 88px;
}

.fund-table th:nth-child(11),
.fund-table td:nth-child(11) {
  width: 116px;
}

.income-expense-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.income-expense-table-scroll {
  overflow-x: hidden;
}

.income-expense-table th:nth-child(1),
.income-expense-table td:nth-child(1) {
  width: 82px;
}

.income-expense-table th:nth-child(2),
.income-expense-table td:nth-child(2) {
  width: 56px;
}

.income-expense-table th:nth-child(5),
.income-expense-table td:nth-child(5) {
  width: 104px;
}

.income-expense-table th:nth-child(6),
.income-expense-table td:nth-child(6) {
  width: 88px;
}

.income-expense-table th:nth-child(7),
.income-expense-table td:nth-child(7) {
  width: 104px;
}

.income-expense-table th:nth-child(8),
.income-expense-table td:nth-child(8) {
  width: 78px;
}

.income-expense-table th:nth-child(10),
.income-expense-table td:nth-child(10) {
  width: 148px;
}

.income-expense-actions {
  justify-content: flex-start;
}

.income-expense-actions .table-inline-button {
  padding: 0 8px;
}

.fund-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.income-expense-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.income-expense-main-cell {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.income-expense-source-line {
  color: #64748b;
}

.income-expense-toolbar {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.income-expense-toolbar label {
  flex: 0 1 170px;
  min-width: 0;
}

.income-expense-toolbar label:nth-of-type(3) {
  flex-basis: 220px;
}

.income-expense-toolbar select,
.income-expense-toolbar input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.income-expense-toolbar select {
  text-overflow: ellipsis;
}

.income-expense-toolbar .fund-search {
  flex: 1 1 260px;
}

.income-expense-simple-summary {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(160px, 0.8fr) minmax(240px, 1.2fr);
  gap: 10px;
  min-width: 0;
}

.income-expense-simple-summary > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
}

.income-expense-simple-summary small,
.income-expense-simple-summary span {
  display: block;
  color: var(--muted);
}

.income-expense-simple-summary strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.income-expense-simple-summary .money-cell {
  text-align: left;
}

.fund-text-cell {
  min-width: 230px;
  max-width: 360px;
}

.money-cell {
  white-space: nowrap;
  text-align: right;
}

.money-cell.income {
  color: #15803d;
}

.money-cell.expense {
  color: #b91c1c;
}

.money-cell.balance {
  color: var(--text);
  font-weight: 700;
}

.money-cell.source-balance {
  color: var(--muted);
  font-weight: 700;
}

.fund-source-cell {
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.fund-audit-strip {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}

.fund-kind {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.fund-kind.income {
  background: #dcfce7;
  color: #15803d;
}

.fund-kind.expense {
  background: #fee2e2;
  color: #b91c1c;
}

.fund-kind.transfer {
  background: #e0f2fe;
  color: #0369a1;
}

.fund-kind.excluded {
  background: #fef3c7;
  color: #b45309;
}

.fund-edit-row td {
  background: #f8fbff;
}

.fund-inline-editor {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.fund-inline-editor .wide-field {
  grid-column: span 2;
}

.fund-inline-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.income-expense-scope {
  grid-template-columns: minmax(220px, 0.9fr) minmax(210px, 0.8fr) minmax(260px, 1fr);
  min-width: 0;
}

.income-expense-scope > div,
.income-expense-scope strong,
.income-expense-scope span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.income-expense-month-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  min-width: 0;
}

.income-expense-month-strip button {
  display: grid;
  gap: 5px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.income-expense-month-strip button:hover,
.income-expense-month-strip button:focus-visible,
.income-expense-month-strip button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f8fbff;
  outline: none;
}

.income-expense-month-strip span,
.income-expense-month-strip small,
.income-expense-detail-grid small {
  color: var(--muted);
}

.income-expense-detail-row td {
  background: #f8fbff;
}

.income-expense-detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 12px;
  padding: 12px;
  min-width: 0;
}

.income-expense-detail-grid > div {
  display: grid;
  gap: 6px;
  align-content: start;
}

.income-expense-split-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.income-expense-split-table td {
  padding: 7px 8px;
  border: 1px solid var(--line);
}

.customer-status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.customer-status-tags span,
.customer-alert-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.customer-alert-badge {
  background: #fff7ed;
  color: #f97316;
}

.customer-alert-badge.muted {
  background: #eef2f7;
  color: var(--muted);
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
}

.admin-customer-modal {
  width: min(720px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.admin-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.admin-modal-head h2 {
  margin: 2px 0 4px;
  font-size: 22px;
  line-height: 1.25;
}

.admin-modal-head span {
  color: var(--muted);
  font-size: 13px;
}

.admin-customer-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-customer-edit-form label {
  display: grid;
  gap: 6px;
}

.admin-customer-edit-form span {
  color: var(--muted);
  font-size: 12px;
}

.admin-customer-edit-form input,
.admin-customer-edit-form select,
.admin-customer-edit-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.admin-customer-edit-form input,
.admin-customer-edit-form select {
  min-height: 42px;
}

.admin-customer-edit-form textarea {
  min-height: 92px;
  resize: vertical;
  padding-top: 10px;
  line-height: 1.5;
}

.admin-customer-edit-form .wide-field {
  grid-column: 1 / -1;
}

.admin-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}

.admin-modal-actions span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-modal-actions div {
  display: flex;
  gap: 8px;
}

.admin-modal-actions .primary-button,
.admin-modal-actions .secondary-button {
  width: auto;
  min-width: 96px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
}

.admin-modal-actions .secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.payment-address-cell {
  min-width: 180px;
}

.payment-address-cell strong,
.payment-address-cell small {
  display: block;
}

.payment-address-cell small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.matrix-table td strong {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
}

.compact-table td,
.compact-table th {
  padding: 10px 6px;
}

.admin-list,
.admin-note-list {
  display: grid;
  gap: 10px;
}

.admin-total-card {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--blue-soft);
}

.admin-total-card small,
.admin-total-card span {
  color: var(--muted);
}

.admin-total-card strong {
  font-size: 25px;
}

.admin-total-card.large strong {
  font-size: 34px;
}

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

.payment-kpi-card {
  min-height: 126px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.payment-kpi-card small,
.payment-kpi-card em {
  color: var(--muted);
  font-style: normal;
}

.payment-kpi-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.payment-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 13px;
  font-weight: 800;
}

.payment-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.payment-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.payment-icon.purple {
  background: #ede9fe;
  color: #7c3aed;
}

.payment-icon.red {
  background: #fee2e2;
  color: #dc2626;
}

.admin-payment-type-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.order-status-card-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.order-status-card {
  grid-column: span 5;
  display: grid;
  gap: 7px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 13px;
  cursor: pointer;
}

.order-status-card:nth-child(n + 5) {
  grid-column: span 4;
}

.order-status-card:hover,
.order-status-card:focus-visible,
.order-status-card.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  outline: none;
}

.order-status-card small,
.order-status-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.order-status-card strong {
  font-size: 24px;
}

.order-status-content {
  display: grid;
  gap: 14px;
}

.order-status-table-head {
  align-items: center;
}

.order-status-table-head > div {
  display: grid;
  gap: 4px;
}

.order-status-search {
  max-width: 320px;
  min-width: 260px;
}

.payment-type-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.payment-type-card:hover,
.payment-type-card:focus-visible,
.payment-type-card.active {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  outline: none;
}

.payment-type-card.active {
  background: #f8fbff;
}

.payment-type-card:active {
  transform: translateY(1px);
}

.payment-type-card div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-type-card div:first-child span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.payment-type-card.refund div:first-child span {
  background: #fee2e2;
  color: #dc2626;
}

.payment-type-card.refund:hover,
.payment-type-card.refund:focus-visible,
.payment-type-card.refund.active {
  border-color: rgba(220, 38, 38, 0.35);
}

.payment-type-card small,
.payment-type-card em {
  color: var(--muted);
  font-style: normal;
}

.payment-type-card strong {
  font-size: 19px;
}

.payment-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.payment-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.payment-type-card.refund .payment-progress i {
  background: #ef4444;
}

.payment-detail-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
}

.payment-detail-head {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.payment-detail-search {
  flex: 0 1 320px;
  min-width: min(100%, 220px);
}

.payment-detail-head .payment-detail-meta {
  margin-left: auto;
}

.payment-detail-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  outline: none;
}

.payment-detail-search input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.payment-detail-search input::placeholder {
  color: #94a3b8;
}

.payment-detail-meta button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  padding: 0 10px;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-payment-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-payment-breakdown small,
.admin-filter-row span {
  color: var(--muted);
}

.admin-payment-breakdown strong {
  font-size: 18px;
}

.admin-filter-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.admin-search-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.admin-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-filter-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.admin-filter-toolbar span,
.admin-filter-toolbar em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.admin-filter-toolbar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.admin-filter-toolbar em {
  flex: 1 1 260px;
  line-height: 1.5;
}

.admin-summary-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: #f8fbff;
}

.admin-summary-note span {
  color: var(--muted);
  font-size: 13px;
}

.selected-order-overview {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 14px;
  background: #f8fbff;
  padding: 16px;
}

.selected-order-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.selected-order-meta span {
  display: grid;
  gap: 5px;
  min-height: 62px;
  align-content: center;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 12px;
}

.selected-order-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.selected-order-kpis div {
  display: grid;
  gap: 6px;
  min-height: 110px;
  align-content: center;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.selected-order-kpis small,
.selected-order-kpis span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.selected-order-kpis strong {
  font-size: 23px;
}

.profit-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.profit-order-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  height: clamp(680px, calc(100vh - 120px), 1130px);
}

.profit-order-list {
  flex: 1;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.profit-order-list button {
  display: grid;
  gap: 5px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 12px;
}

.profit-order-list button > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profit-order-list button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
}

.profit-order-list small,
.profit-order-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.order-status-badge.done {
  background: #dcfce7;
  color: #15803d;
}

.order-status-badge.pending {
  background: #fff7ed;
  color: #c2410c;
}

.order-status-badge.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.order-status-badge.refund {
  background: #fee2e2;
  color: #dc2626;
}

.order-status-badge.refund-pending {
  background: #fef3c7;
  color: #b45309;
}

.order-status-detail-panel {
  margin-bottom: 0;
}

.compact-order-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-order-kpis div {
  min-height: 92px;
}

.order-status-table td:first-child {
  min-width: 180px;
}

.order-status-table {
  min-width: 1040px;
}

.order-status-table td:first-child strong,
.order-status-table td:first-child small {
  display: block;
}

.order-status-table td:first-child small,
.order-status-action-note {
  color: var(--muted);
  font-size: 12px;
}

.order-install-form {
  min-width: 176px;
  display: grid;
  gap: 6px;
}

.order-install-form input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}

.order-refund-summary,
.refund-proof-form,
.order-refund-list {
  display: grid;
  gap: 6px;
}

.order-refund-summary strong {
  font-size: 13px;
}

.order-refund-summary small,
.refund-proof-form small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.refund-actions {
  min-width: 186px;
}

.refund-proof-form {
  min-width: 230px;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: 10px;
  background: #f8fbff;
}

.refund-proof-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.refund-proof-form input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}

.refund-proof-thumb {
  width: 132px;
  max-height: 92px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.refund-proof-link {
  width: fit-content;
  min-height: 28px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.refund-proof-link:hover,
.refund-proof-link:focus-visible {
  border-color: rgba(37, 99, 235, 0.55);
  background: #f8fbff;
  outline: none;
}

.order-status-scroll-helper {
  width: 100%;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: -4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-status-scroll-helper div {
  width: 1040px;
  height: 1px;
}

.order-refund-list {
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.order-refund-list > strong {
  font-size: 14px;
}

.order-refund-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.order-refund-list article:first-of-type {
  border-top: 0;
}

.order-refund-list b,
.order-refund-list small,
.order-refund-list span,
.order-refund-list em {
  display: block;
}

.order-refund-list small,
.order-refund-list span,
.order-refund-list em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.proof-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.proof-preview-panel {
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.proof-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.proof-preview-head strong,
.proof-preview-head span {
  display: block;
}

.proof-preview-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.proof-preview-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.proof-preview-body {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}

.proof-preview-body img {
  max-width: 100%;
  max-height: calc(100vh - 210px);
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.proof-preview-body iframe {
  width: 100%;
  height: min(640px, calc(100vh - 210px));
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.proof-download-link {
  color: var(--blue);
  font-weight: 700;
}

.proof-preview-meta {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-status-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.order-status-history strong {
  font-size: 14px;
}

.order-status-history span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.selected-order-row {
  background: #f8fbff;
}

.order-status-clickable-row {
  cursor: pointer;
}

.order-status-clickable-row:hover {
  background: #f8fbff;
}

.profit-main {
  display: grid;
  gap: 14px;
}

.profit-customer-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.profit-customer-strip span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.profit-customer-strip strong {
  color: var(--text);
  font-size: 15px;
}

.profit-audit-panel {
  display: grid;
  gap: 14px;
}

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

.profit-audit-card {
  min-height: 92px;
  display: grid;
  gap: 5px;
  align-content: center;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.profit-audit-card small,
.profit-audit-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.profit-audit-alerts {
  display: grid;
  gap: 8px;
}

.profit-audit-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.profit-audit-item strong {
  font-size: 14px;
}

.profit-audit-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.profit-audit-item.good {
  border-left-color: var(--green);
}

.profit-audit-item.warn {
  border-left-color: var(--orange);
}

.profit-audit-item.risk {
  border-left-color: var(--red);
}

.profit-audit-item.note {
  border-left-color: var(--blue);
}

.expense-analysis-panel {
  display: grid;
  gap: 14px;
}

.expense-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.expense-analysis-card {
  display: grid;
  gap: 8px;
  min-height: 124px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.expense-analysis-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.expense-analysis-card strong {
  font-size: 15px;
}

.expense-analysis-card em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  padding: 4px 8px;
}

.expense-analysis-card span,
.expense-analysis-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.expense-analysis-card i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.expense-analysis-card i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.expense-analysis-card.warn {
  border-left-color: var(--orange);
}

.expense-analysis-card.warn i b {
  background: var(--orange);
}

.expense-analysis-card.risk {
  border-left-color: var(--red);
}

.expense-analysis-card.risk i b {
  background: var(--red);
}

.expense-analysis-card.note {
  border-left-color: var(--blue);
}

.expense-analysis-card.note i b {
  background: var(--blue);
}

.profit-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 14px;
}

.profit-record-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.profit-record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.profit-record-row span {
  display: grid;
  gap: 4px;
}

.profit-record-row small {
  color: var(--muted);
}

.expense-category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.expense-category-grid button {
  display: grid;
  gap: 5px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 10px;
}

.expense-category-grid button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--blue-soft);
}

.expense-category-grid span {
  color: var(--muted);
  font-size: 12px;
}

.expense-category-grid strong {
  font-size: 17px;
}

.expense-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.expense-detail-actions button,
.expense-entry-form button,
.table-inline-button,
.row-action-group button {
  min-height: 32px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  padding: 0 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.expense-detail-actions span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.expense-detail-panel {
  margin-top: 14px;
}

.expense-record-scroll {
  margin-top: 10px;
  max-height: 340px;
}

.expense-entry-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.expense-entry-form label {
  display: grid;
  gap: 6px;
}

.expense-entry-form label span {
  color: var(--muted);
  font-size: 12px;
}

.expense-entry-form input,
.expense-entry-form select,
.expense-edit-row input,
.expense-edit-row select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font: inherit;
}

.table-inline-button {
  min-height: 30px;
}

.row-action-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.compact-actions {
  margin-top: 0;
}

.table-inline-button.danger,
.row-action-group button.danger {
  border-color: rgba(220, 38, 38, 0.24);
  color: #dc2626;
}

.edited-payment-row {
  background: #f8fafc;
}

.payment-detail-row {
  cursor: pointer;
}

.payment-detail-row:hover {
  background: #f8fbff;
}

.payment-note-cell,
.edit-note {
  display: block;
}

.edit-note {
  margin-top: 4px;
  color: var(--orange);
  font-size: 12px;
}

.payment-edit-actions {
  min-width: 170px;
  display: grid;
  gap: 6px;
}

.payment-edit-actions input,
.payment-edit-actions select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}

.secondary-inline {
  border-color: var(--line);
  color: var(--muted);
}

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

.admin-review-list span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.admin-review-list em,
.admin-review-list small {
  color: var(--muted);
  font-style: normal;
}

.admin-review-list strong {
  font-size: 16px;
}

.reconcile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.reconcile-badge.checked {
  background: #dcfce7;
  color: #166534;
}

.reconcile-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.reconcile-badge.issue {
  background: #fee2e2;
  color: #991b1b;
}

.admin-small-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--blue);
  padding: 0 12px;
}

.admin-other-payments {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.admin-other-payments span,
.admin-other-payments small {
  color: var(--muted);
}

.admin-other-payments strong {
  font-size: 14px;
}

.admin-list span,
.admin-note-list span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.admin-list em {
  color: var(--muted);
  font-style: normal;
}

.admin-list strong {
  font-size: 18px;
}

.admin-list small {
  color: var(--muted);
}

@media (max-width: 980px) {
  .admin-shell {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-main {
    padding: 24px;
  }

  .admin-topbar {
    display: grid;
    align-items: stretch;
  }

  .admin-topbar h1 {
    font-size: 30px;
    white-space: nowrap;
  }

  .admin-mobile-switcher {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .admin-mobile-switcher label {
    display: grid;
    gap: 6px;
  }

  .admin-mobile-switcher span {
    color: var(--muted);
    font-size: 12px;
  }

  .admin-mobile-switcher select,
  .admin-mobile-switcher button {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    padding: 0 12px;
  }

  .admin-mobile-switcher button {
    color: var(--blue);
  }

  .admin-actions {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .admin-date-range {
    flex: 1 1 100%;
  }

  .admin-date-range label {
    flex: 1 1 0;
  }

  .admin-date-range input {
    width: 100%;
  }

  .admin-panel-head {
    align-items: flex-start;
  }

  .admin-panel-head h2 {
    flex: 0 0 auto;
  }

  .admin-kpi-grid,
  .admin-mini-kpis,
  .admin-mini-kpis.six,
  .admin-mini-kpis.seven,
  .admin-payment-kpis,
  .admin-payment-type-grid,
  .settings-summary-grid,
  .settings-rules,
  .order-status-card-grid,
  .fund-account-strip,
  .income-expense-month-strip,
  .admin-overview-cards,
  .admin-detail-grid,
  .admin-link-grid,
  .profit-layout,
  .profit-detail-grid,
  .selected-order-kpis,
  .admin-grid.two,
  .admin-grid.three {
    grid-template-columns: 1fr;
  }

  .order-status-card,
  .order-status-card:nth-child(n + 5) {
    grid-column: auto;
  }

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

  .admin-payment-breakdown,
  .admin-stage-grid,
  .admin-filter-row,
  .profit-customer-strip,
  .profit-audit-grid,
  .selected-order-meta,
  .expense-analysis-grid,
  .expense-category-grid,
  .settings-personnel-form,
  .account-credential-editor,
  .account-delete-editor,
  .fund-home-head,
  .fund-home-grid,
  .fund-home-summary,
  .fund-scope-summary,
  .income-expense-simple-summary,
  .income-expense-scope,
  .income-expense-detail-grid,
  .fund-form-grid,
  .fund-form-grid .wide-field,
  .settings-personnel-form .wide-field,
  .fund-inline-editor,
  .fund-inline-editor .wide-field,
  .order-status-table-head,
  .expense-entry-form {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .fund-toolbar {
    display: grid;
    align-items: stretch;
  }

  .fund-search {
    min-width: 0;
  }

  .fund-inline-actions {
    align-items: stretch;
  }

  .fund-home-grid button {
    grid-template-columns: 1fr;
  }

  .order-status-table-head {
    display: grid;
    align-items: stretch;
  }

  .order-status-search {
    max-width: none;
    min-width: 0;
  }

  .profit-order-panel {
    max-height: min(560px, calc(100vh - 150px));
    position: static;
  }

  .admin-table-scroll[data-payment-detail-scroll],
  .admin-table-scroll[data-order-status-table-scroll],
  .expense-record-scroll,
  .fund-ledger-panel .admin-table-scroll {
    max-height: min(560px, calc(100vh - 220px));
  }

  .income-expense-ledger-panel .admin-table-scroll {
    max-height: min(560px, calc(100vh - 220px));
  }

  .admin-table-scroll[data-payment-detail-scroll] {
    min-height: min(420px, calc(100vh - 260px));
  }
}
