:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6f8;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
header {
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  color: #fff;
  background: #111827;
  border-bottom: 4px solid #38b878;
}
.brand { display: flex; align-items: center; gap: 14px; font-size: 21px; font-weight: 750; }
.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #25875f;
}
main { width: min(920px, calc(100% - 40px)); margin: 52px auto; }
h1 { margin: 0 0 12px; font-size: clamp(32px, 7vw, 56px); letter-spacing: 0; }
p { max-width: 650px; margin: 0; color: #627087; font-size: 18px; line-height: 1.55; }
.status { margin-top: 34px; padding: 20px 0; border-top: 1px solid #ccd3dc; border-bottom: 1px solid #ccd3dc; }
.status strong { color: #187652; }
@media (max-width: 560px) {
  header { padding: 0 18px; }
  main { width: min(100% - 32px, 920px); margin-top: 36px; }
}

.control-body header { justify-content: space-between; }
.environment { color: #cbd5e1; font-size: 14px; }
.control-main { width: min(1120px, calc(100% - 40px)); }
.control-login { width: min(440px, 100%); margin: 72px auto 0; }
.eyebrow { color: #25875f; font-size: 14px; font-weight: 750; text-transform: uppercase; }
.control-login h1, .control-heading h1 { font-size: 40px; }
.control-login form { display: grid; gap: 18px; margin-top: 30px; }
.control-login label { display: grid; gap: 7px; font-weight: 700; }
.control-login input { min-height: 48px; padding: 10px 12px; border: 1px solid #aeb8c7; border-radius: 6px; font: inherit; }
.control-login button, .secondary-button { min-height: 48px; padding: 0 20px; border: 0; border-radius: 6px; background: #25875f; color: white; font: inherit; font-weight: 750; cursor: pointer; }
.secondary-button { border: 1px solid #aeb8c7; background: white; color: #172033; }
.form-error { min-height: 24px; color: #b42318; font-size: 15px; }
.control-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.control-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.control-heading p { font-size: 15px; }
.control-refresh-state { margin: 14px 0 0; color: #627087; font-size: 14px; }
.health-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-top: 34px; padding: 22px 0; border-block: 1px solid #ccd3dc; }
.health-strip strong { font-size: 26px; }
.health-strip > span:last-child { color: #627087; }
.health-state { width: max-content; padding: 7px 10px; border-radius: 4px; background: #d9f4e7; color: #12613f; font-weight: 750; }
.health-state.attention { background: #fee4e2; color: #b42318; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid #ccd3dc; }
.metric-grid > div { padding: 28px 20px 28px 0; }
.metric-grid span { display: block; color: #627087; }
.metric-grid strong { display: block; margin-top: 8px; font-size: 32px; }
.audit-section, .accounts-section { margin-top: 42px; }
.audit-section h2 { font-size: 25px; }
.icon-button { width: 42px; height: 42px; border: 1px solid #aeb8c7; border-radius: 6px; background: white; font-size: 24px; cursor: pointer; }
.audit-list { margin-top: 14px; border-top: 1px solid #ccd3dc; }
.audit-row { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 18px 0; border-bottom: 1px solid #d9dee6; }
.audit-row strong, .audit-row span { display: block; }
.audit-row strong { text-transform: capitalize; }
.audit-row span, .audit-row time { margin-top: 5px; color: #627087; font-size: 14px; }
.control-toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; border-radius: 6px; background: #111827; color: white; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.control-toast.visible { opacity: 1; transform: none; }
.search-field { display: grid; gap: 5px; color: #627087; font-size: 13px; }
.search-field input { width: min(320px, 45vw); min-height: 42px; padding: 8px 10px; border: 1px solid #aeb8c7; border-radius: 6px; font: inherit; }
.account-list { margin-top: 14px; border-top: 1px solid #ccd3dc; }
.account-row { display: grid; grid-template-columns: minmax(260px, 1fr) 160px 100px 116px; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid #d9dee6; }
.ledger-account-row { grid-template-columns: minmax(220px, 1fr) 150px 95px 118px 116px; }
.account-row strong, .account-row span { display: block; }
.account-row > div:first-child span { margin-top: 5px; color: #627087; font-size: 13px; text-transform: capitalize; }
.account-balance { text-align: right; font-variant-numeric: tabular-nums; }
.account-status { width: max-content; padding: 5px 8px; border-radius: 4px; background: #e8edf3; color: #465469; text-transform: capitalize; font-weight: 700; }
.account-status.active { background: #d9f4e7; color: #12613f; }
.account-status.suspended { background: #fee4e2; color: #b42318; }
.compact-action { min-height: 38px; padding: 0 12px; }
.compact-action:disabled { color: #8792a3; background: #eef1f5; cursor: not-allowed; }
.action-dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 7px; color: #172033; }
.ledger-detail-dialog { width: min(820px, calc(100% - 32px)); max-height: min(88vh, 920px); overflow-y: auto; padding: 28px; box-sizing: border-box; }
.ledger-detail-dialog p { color: #627087; }
.ledger-detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.ledger-detail-summary > div { display: grid; gap: 5px; padding: 14px; border: 1px solid #d9dee6; border-radius: 6px; }
.ledger-detail-summary span, .ledger-entry-row span, .ledger-entry-row time { color: #627087; font-size: 13px; }
.ledger-detail-summary strong { font-size: 18px; }
.ledger-detail-note { font-size: 14px; }
.ledger-entry-list { border-top: 1px solid #d9dee6; }
.ledger-entry-row { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid #d9dee6; overflow-wrap: anywhere; }
.ledger-entry-row strong { font-size: 17px; }
.action-dialog::backdrop { background: rgba(17, 24, 39, .62); }
.action-dialog form { display: grid; gap: 20px; padding: 28px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin: 5px 0 0; }
.action-dialog label { display: grid; gap: 7px; font-weight: 700; }
.action-dialog textarea, .action-dialog input { padding: 10px 12px; border: 1px solid #aeb8c7; border-radius: 6px; font: inherit; }
.action-dialog textarea { min-height: 110px; resize: vertical; }
.action-dialog input { min-height: 44px; }
.action-dialog small { color: #627087; font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; }
.dialog-actions button[type="submit"] { min-height: 48px; padding: 0 20px; border: 0; border-radius: 6px; background: #b42318; color: white; font: inherit; font-weight: 750; }
@media (max-width: 700px) {
  .environment { font-size: 12px; text-align: right; }
  .control-heading { align-items: flex-start; }
  .control-heading { flex-wrap: wrap; }
  .health-strip { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
  .section-heading { align-items: flex-start; }
  .search-field input { width: 46vw; }
  .account-row { grid-template-columns: 1fr auto; }
  .ledger-account-row { grid-template-columns: 1fr auto; }
  .account-balance { text-align: left; }
  .ledger-detail-summary { grid-template-columns: 1fr; }
}

/* DCB dark gold theme: shared by merchant products and the Control Plane. */
:root { color-scheme: dark; color: #f5efdf; background: #0d1119; }
body { background: #0d1119; }
header { background: #111722; border-bottom-color: #e2b34d; }
.mark { background: #e2b34d; color: #17130b; }
p, .control-heading p, .control-refresh-state, .health-strip > span:last-child,
.metric-grid span, .search-field, .account-row > div:first-child span,
.audit-row span, .audit-row time, .ledger-detail-dialog p,
.ledger-detail-summary span, .ledger-entry-row span, .ledger-entry-row time,
.action-dialog small { color: #b9b09e; }
.environment { color: #ead9ac; }
.eyebrow, .status strong { color: #e2b34d; }
.control-login { width: min(500px, 100%); padding: 30px; border: 1px solid #50442d; border-top: 4px solid #e2b34d; border-radius: 8px; background: #151c27; }
.control-login input, .search-field input, .action-dialog textarea, .action-dialog input { background: #202a37; color: #f5efdf; border-color: #5d574a; }
.control-login input:focus-visible, .search-field input:focus-visible,
.action-dialog textarea:focus-visible, .action-dialog input:focus-visible, button:focus-visible { outline: 3px solid #f0ca73; outline-offset: 2px; }
.control-login button { background: #e2b34d; color: #17130b; }
.control-login button:hover { background: #f0ca73; }
.secondary-button, .icon-button { background: #202a37; color: #f0ca73; border-color: #8b7139; }
.secondary-button:hover, .icon-button:hover { background: #322a1c; }
.health-strip, .metric-grid, .status, .audit-list, .account-list, .ledger-entry-list { border-color: #504a3f; }
.audit-row, .account-row, .ledger-entry-row, .ledger-detail-summary > div { border-color: #393d43; }
.health-state, .account-status.active { background: #3a301b; color: #f0ca73; }
.health-state.attention, .account-status.suspended { background: #482723; color: #ffaea7; }
.account-status { background: #202a37; color: #d0c6b1; }
.compact-action:disabled { background: #252a31; color: #8f9298; border-color: #4b4d51; }
.action-dialog { background: #151c27; color: #f5efdf; border: 1px solid #655536; }
.ledger-detail-summary > div { background: #1b2430; }
.control-toast { background: #e2b34d; color: #17130b; }
.form-error { color: #ff9d94; }
.dialog-actions button[type="submit"] { background: #b83d34; color: white; }
#submitControlPassword { background: #e2b34d; color: #17130b; }
.report-controls { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.report-controls .search-field input { width: 170px; }
.trace-controls .search-field input { width: min(400px, 65vw); }
@media (max-width: 560px) { .control-login { padding: 22px; margin-top: 30px; } }

.recruiter-admin-section { padding: 26px; border: 1px solid #50442d; border-top: 4px solid #e2b34d; border-radius: 8px; background: #151c27; }
.recruiter-admin-section h2 { margin: 5px 0 8px; }
.recruiter-admin-section .ledger-detail-note { max-width: 720px; }
.recruiter-invite-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.recruiter-invite-form label { display: grid; flex: 1 1 200px; gap: 7px; font-size: 14px; font-weight: 700; }
.recruiter-invite-form input, .recruiter-setup input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #5d574a; border-radius: 6px; background: #202a37; color: #f5efdf; font: inherit; }
.recruiter-invite-form button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 6px; background: #e2b34d; color: #17130b; font: inherit; font-weight: 750; cursor: pointer; }
.recruiter-invite-form input:focus-visible, .recruiter-setup input:focus-visible { outline: 3px solid #f0ca73; outline-offset: 2px; }
.recruiter-admin-status { font-size: 14px; }
.recruiter-setup { margin: 18px 0; padding: 16px; border: 1px solid #e2b34d; border-radius: 6px; background: #2a261d; }
.recruiter-setup p { margin: 6px 0 12px; font-size: 14px; }
.recruiter-setup-row { display: flex; gap: 10px; }
.recruiter-setup-row input { min-width: 0; flex: 1; }
.recruiter-admin-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid #393d43; }
.recruiter-admin-row strong, .recruiter-admin-row span { display: block; }
.recruiter-admin-row > div:first-child span { margin-top: 5px; color: #b9b09e; font-size: 14px; overflow-wrap: anywhere; }
.recruiter-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.recruiter-row-actions .secondary-button { white-space: nowrap; }
.sponsor-admin-section { padding: 26px; border: 1px solid #50442d; border-top: 4px solid #e2b34d; border-radius: 8px; background: #151c27; }
.sponsor-admin-section h2 { margin: 5px 0 8px; }
.sponsor-admin-section .ledger-detail-note { max-width: 720px; }
.sponsor-provision-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.sponsor-provision-form label { display: grid; flex: 1 1 200px; gap: 7px; font-size: 14px; font-weight: 700; }
.sponsor-provision-form .sponsor-reason-label { flex-basis: 100%; }
.sponsor-provision-form input, .sponsor-provision-form textarea, .sponsor-setup input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #5d574a; border-radius: 6px; background: #202a37; color: #f5efdf; font: inherit; }
.sponsor-provision-form textarea { min-height: 86px; resize: vertical; }
.sponsor-provision-form small { color: #b9b09e; font-weight: 400; }
.sponsor-provision-form button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 6px; background: #e2b34d; color: #17130b; font: inherit; font-weight: 750; cursor: pointer; }
.sponsor-provision-form input:focus-visible, .sponsor-provision-form textarea:focus-visible, .sponsor-setup input:focus-visible { outline: 3px solid #f0ca73; outline-offset: 2px; }
.sponsor-admin-status { font-size: 14px; }
.sponsor-setup { margin: 18px 0; padding: 16px; border: 1px solid #e2b34d; border-radius: 6px; background: #2a261d; }
.sponsor-setup p { margin: 6px 0 12px; font-size: 14px; }
.sponsor-setup-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sponsor-setup-row input { min-width: 0; flex: 1 1 260px; }
.sponsor-admin-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid #393d43; }
.sponsor-admin-row strong, .sponsor-admin-row span { display: block; }
.sponsor-admin-row > div:first-child span { margin-top: 5px; color: #b9b09e; font-size: 14px; overflow-wrap: anywhere; }
.sponsor-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 740px) {
  .recruiter-admin-section { padding: 18px; }
  .recruiter-admin-section .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .recruiter-admin-row { grid-template-columns: 1fr; }
  .recruiter-row-actions { justify-content: flex-start; }
  .recruiter-setup-row { flex-wrap: wrap; }
  .recruiter-setup-row button { width: 100%; }
  .sponsor-admin-section { padding: 18px; }
  .sponsor-admin-section .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .sponsor-admin-row { grid-template-columns: 1fr; }
  .sponsor-row-actions { justify-content: flex-start; }
  .sponsor-setup-row button { width: 100%; }
}
