/* Nexora Pay · refresh layer for operating surfaces (painel, admin, onboarding).
   Loaded last. Keeps the brand: violet accent (or the user's blue/graphite choice),
   space-ink dark theme, Space Grotesk headings, DM Sans body. */

:root {
  --rf-bg: #e9e7f0;
  --rf-surface: #ffffff;
  --rf-surface-2: #f2f1f6;
  --rf-line: #e7e4f0;
  --rf-line-strong: #d5d0e4;
  --rf-text: #16131f;
  --rf-text-2: #433e55;
  --rf-muted: #625d75;
  --rf-accent: var(--nx-accent-fill, #6d28d9);
  --rf-accent-hover: var(--nx-accent-hover, #5b21b6);
  --rf-accent-text: var(--nx-accent-text, #5b21b6);
  --rf-accent-soft: var(--nx-accent-soft, #f3e8ff);
  --rf-ring: var(--nx-focus-ring, #6d28d9);
  --rf-ok: #0f7a4f; --rf-ok-soft: #e3f6ec;
  --rf-warn: #8a5a00; --rf-warn-soft: #fdf1d8;
  --rf-bad: #b42343; --rf-bad-soft: #fde8ec;
  --rf-info: #3b4fb8; --rf-info-soft: #e8ecfd;
  --rf-radius: 6px;
  --rf-radius-sm: 4px;
  --rf-shadow: 0 1px 2px rgba(22, 19, 31, .05), 0 10px 28px -16px rgba(40, 24, 90, .22);
  --rf-shadow-lift: 0 2px 4px rgba(22, 19, 31, .06), 0 18px 40px -18px rgba(40, 24, 90, .32);
  --rf-ease: cubic-bezier(.16, 1, .3, 1);
  --rf-font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rf-display: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --rf-bucket-available: var(--rf-accent);
  --rf-bucket-pending: #a78bfa;
  --rf-bucket-reserved: #f0b44c;
  --rf-bucket-blocked: #e5677f;
}

:root:not(.theme-light) {
  --rf-bg: #07030e;
  --rf-surface: #140e22;
  --rf-surface-2: #1b1430;
  --rf-line: #2a2140;
  --rf-line-strong: #3c3058;
  --rf-text: #f2eefb;
  --rf-text-2: #c8c0dc;
  --rf-muted: #9890b0;
  --rf-ok: #5fd6a2; --rf-ok-soft: rgba(55, 201, 139, .14);
  --rf-warn: #f3c46b; --rf-warn-soft: rgba(243, 180, 81, .14);
  --rf-bad: #f38ba3; --rf-bad-soft: rgba(229, 103, 127, .15);
  --rf-info: #9db0ff; --rf-info-soft: rgba(79, 140, 255, .15);
  --rf-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -18px rgba(0, 0, 0, .7);
  --rf-shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 22px 44px -20px rgba(0, 0, 0, .8);
  --rf-bucket-pending: #8b74d8;
}

/* ---------- Base & browser surfaces ---------- */
:root:root body.platform-body,
:root:root body.onboarding-body,
:root:root body.auth-body {
  font-family: var(--rf-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root:root body.platform-body { color: var(--rf-text); }
.platform-body ::selection { background: color-mix(in srgb, var(--rf-accent) 24%, transparent); color: inherit; }
.platform-body { accent-color: var(--rf-accent); caret-color: var(--rf-accent); scrollbar-color: var(--rf-line-strong) transparent; }
.platform-body ::-webkit-scrollbar { width: 10px; height: 10px; }
.platform-body ::-webkit-scrollbar-thumb { background: var(--rf-line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
.platform-body ::-webkit-scrollbar-track { background: transparent; }
.platform-body :focus-visible { outline: 2px solid var(--rf-ring) !important; outline-offset: 2px !important; }
.platform-body a { text-underline-offset: .2em; }

:root:root body.platform-body :is(h1, h2, h3, .panel h2, .app-header h1, .admin-heading h1, .admin-panel-head h2) {
  font-family: var(--rf-display) !important;
  letter-spacing: -.025em;
  text-wrap: balance;
}

/* Money and tables line up */
.platform-body :is(.nx-table, .nx-balance, .metric-card strong, .admin-stat strong, .nx-details dd, .nx-activity, .receipts-summary, .nx-chart-summary, code) {
  font-variant-numeric: tabular-nums;
}

/* Kickers above headings carry no information the heading lacks */
:root:root .platform-body :is(.app-header .eyebrow, .admin-view-badge) { display: none !important; }
:root:root body.admin-body .admin-dashboard-kicker { font-family: var(--rf-display) !important; font-size: 18px !important; font-weight: 600 !important; letter-spacing: -.015em !important; text-transform: none !important; color: var(--rf-text) !important; margin: 28px 0 12px !important; }

/* ---------- Header ---------- */
:root:root body.platform-body .app-header { align-items: flex-end; gap: 20px; margin-bottom: 24px; }
:root:root body.platform-body .app-header h1 { font-size: clamp(26px, 2.4vw, 32px) !important; line-height: 1.1; margin: 0 !important; color: var(--rf-text) !important; }
:root:root body.platform-body .app-header .view-intro { color: var(--rf-muted) !important; font-size: 14px; margin: 6px 0 0; max-width: 62ch; }
:root:root body.platform-body .app-header .nx-today::first-letter { text-transform: uppercase; }

/* ---------- Buttons ---------- */
:root:root body.platform-body .button {
  font-family: var(--rf-font);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.005em;
  min-height: 40px;
  padding: 0 16px;
  gap: 8px;
  justify-content: center;
  border-radius: var(--rf-radius-sm);
  transition: background-color .18s var(--rf-ease), border-color .18s var(--rf-ease), color .18s var(--rf-ease), box-shadow .18s var(--rf-ease), transform .18s var(--rf-ease);
}
:root:root body.platform-body .button.compact { min-height: 36px; padding: 0 14px; font-size: 13px; }
:root:root body.platform-body .button.button-primary,
html[data-nx-accent] body.platform-body .button.button-primary {
  background: var(--rf-accent) !important;
  border: 1px solid var(--rf-accent) !important;
  color: #fff !important;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08), 0 6px 16px -8px var(--nx-accent-shadow, rgba(109, 40, 217, .45)) !important;
}
:root:root body.platform-body .button.button-primary:hover:not(:disabled),
html[data-nx-accent] body.platform-body .button.button-primary:hover:not(:disabled) {
  background: var(--rf-accent-hover) !important; border-color: var(--rf-accent-hover) !important; transform: translateY(-1px);
}
:root:root body.platform-body .button:disabled,
html[data-nx-accent] body.platform-body .button:disabled { opacity: .5 !important; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

:root:root body.platform-body .button.outline,
html[data-nx-accent] body.platform-body .button.outline,
html[data-nx-accent] body.platform-body .button-secondary {
  background: var(--rf-surface) !important;
  border: 1px solid var(--rf-line-strong) !important;
  color: var(--rf-text) !important;
  box-shadow: 0 1px 1px rgba(22, 19, 31, .04) !important;
}
:root:root body.platform-body .button.outline:hover:not(:disabled),
html[data-nx-accent] body.platform-body .button.outline:hover:not(:disabled),
html[data-nx-accent] body.platform-body .button-secondary:hover:not(:disabled) {
  background: var(--rf-accent-soft) !important;
  border-color: var(--nx-accent-border, var(--rf-accent)) !important;
  color: var(--rf-accent-text) !important;
}
:root:root body.platform-body .button.outline.danger,
html[data-nx-accent] body.platform-body .button.outline.danger { color: var(--rf-bad) !important; }
:root:root body.platform-body .button.outline.danger:hover,
html[data-nx-accent] body.platform-body .button.outline.danger:hover { background: var(--rf-bad-soft) !important; border-color: var(--rf-bad) !important; color: var(--rf-bad) !important; }

:root:root body.platform-body .icon-button,
html[data-nx-accent] body.platform-body .icon-button {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  background: var(--rf-surface) !important;
  border: 1px solid var(--rf-line) !important;
  color: var(--rf-text-2) !important;
  border-radius: var(--rf-radius-sm);
  box-shadow: 0 1px 1px rgba(22, 19, 31, .04) !important;
  transition: background-color .18s var(--rf-ease), color .18s var(--rf-ease), border-color .18s var(--rf-ease);
}
:root:root body.platform-body .icon-button:hover,
html[data-nx-accent] body.platform-body .icon-button:hover {
  background: var(--rf-accent-soft) !important; color: var(--rf-accent-text) !important; border-color: var(--rf-line-strong) !important;
}
:root:root body.platform-body .icon-button[aria-pressed="true"] { color: var(--rf-accent-text) !important; background: var(--rf-accent-soft) !important; }
:root:root body.platform-body .header-actions { gap: 8px; }
.platform-body .nx-unread { background: var(--rf-accent) !important; box-shadow: 0 0 0 2px var(--rf-surface); }

:root:root body.platform-body .table-action,
html[data-nx-accent] body.platform-body .table-action:not(.danger) {
  background: transparent !important;
  border: 1px solid var(--rf-line-strong) !important;
  color: var(--rf-text) !important;
  border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 12.5px;
}
:root:root body.platform-body .table-action.highlight,
html[data-nx-accent] body.platform-body .table-action.highlight { background: var(--rf-accent) !important; border-color: var(--rf-accent) !important; color: #fff !important; }
:root:root body.platform-body .table-action.danger { color: var(--rf-bad) !important; border-color: color-mix(in srgb, var(--rf-bad) 40%, transparent) !important; background: transparent !important; }

/* ---------- Surfaces ---------- */
:root:root body.platform-body :is(.panel, .admin-panel, .settings-card, .account-card, .connection-panel) {
  background: var(--rf-surface) !important;
  border: 1px solid var(--rf-line) !important;
  border-radius: var(--rf-radius) !important;
  box-shadow: var(--rf-shadow) !important;
}
:root:root body.platform-body .panel { padding: 22px 24px; }
:root:root body.platform-body .panel h2 { font-size: 17px !important; color: var(--rf-text) !important; }
:root:root body.platform-body .panel p { color: var(--rf-muted) !important; font-size: 13px !important; }
:root:root body.platform-body .panel-head { gap: 16px; flex-wrap: wrap; }
:root:root body.platform-body .panel-head > div:last-child:not(:first-child) { display: flex; gap: 8px; flex-wrap: wrap; }

/* Status line instead of a heavy banner */
:root:root body.platform-body .app-main > .nx-banner,
:root:root body.platform-body .nx-banner {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: var(--rf-surface-2) !important;
  border: 1px solid var(--rf-line) !important;
  border-radius: var(--rf-radius-sm) !important;
  padding: 12px 16px !important;
  color: var(--rf-text-2) !important;
  box-shadow: none !important;
}
:root:root body.platform-body .nx-banner b { color: var(--rf-text) !important; font-size: 14px; }
:root:root body.platform-body .nx-banner b::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 8px; background: var(--rf-accent); vertical-align: 1px;
}
:root:root body.platform-body .nx-banner span { color: var(--rf-muted) !important; font-size: 13.5px; }

/* ---------- Balance overview ---------- */
.platform-body .nx-balance {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
  background: var(--rf-surface);
  border: 1px solid var(--rf-line);
  border-radius: calc(var(--rf-radius) + 4px);
  box-shadow: var(--rf-shadow);
  overflow: hidden;
  margin: 18px 0 16px;
}
.platform-body .nx-balance-primary {
  padding: 28px 30px;
  display: flex; flex-direction: column; gap: 6px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--rf-accent) 13%, transparent) 0%, transparent 60%),
    var(--rf-surface);
  border-right: 1px solid var(--rf-line);
}
.platform-body .nx-balance-label { font-size: 13px; font-weight: 600; color: var(--rf-muted); }
.platform-body .nx-balance-amount {
  font-family: var(--rf-display); font-weight: 600;
  font-size: clamp(34px, 4.2vw, 48px); line-height: 1.05; letter-spacing: -.035em;
  color: var(--rf-text);
}
.platform-body .nx-balance-note { margin: 4px 0 0; font-size: 13px; color: var(--rf-muted); }
.platform-body .nx-balance-note b { color: var(--rf-text-2); font-weight: 600; }
.platform-body .nx-balance-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 18px; }
.platform-body .nx-balance-breakdown { padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; }
.platform-body .nx-balance-bar { display: flex; gap: 3px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--rf-surface-2); }
.platform-body .nx-balance-bar i { display: block; min-width: 6px; flex-basis: 0; }
.platform-body .nx-balance-bar.is-empty i { flex: 1; background: var(--rf-line); }
.platform-body .nx-balance-breakdown dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.platform-body .nx-balance-breakdown dl > div { display: grid; gap: 2px; min-width: 0; }
.platform-body .nx-balance-breakdown dt { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--rf-text-2); }
.platform-body .nx-balance-breakdown dt i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.platform-body .nx-balance-breakdown dd { margin: 0; font-family: var(--rf-display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; color: var(--rf-text); }
.platform-body .nx-balance-breakdown small { font-size: 12px; color: var(--rf-muted); line-height: 1.4; }
.platform-body [data-bucket="available"] :is(i), .platform-body .nx-balance-bar i[data-bucket="available"] { background: var(--rf-bucket-available); }
.platform-body [data-bucket="pending"] dt i, .platform-body .nx-balance-bar i[data-bucket="pending"] { background: var(--rf-bucket-pending); }
.platform-body [data-bucket="reserved"] dt i, .platform-body .nx-balance-bar i[data-bucket="reserved"] { background: var(--rf-bucket-reserved); }
.platform-body [data-bucket="blocked"] dt i, .platform-body .nx-balance-bar i[data-bucket="blocked"] { background: var(--rf-bucket-blocked); }

@media (max-width: 1100px) {
  .platform-body .nx-balance { grid-template-columns: 1fr; }
  .platform-body .nx-balance-primary { border-right: 0; border-bottom: 1px solid var(--rf-line); }
}
@media (max-width: 560px) {
  .platform-body .nx-balance-primary, .platform-body .nx-balance-breakdown { padding: 20px; }
  .platform-body .nx-balance-breakdown dl { gap: 14px 16px; }
  .platform-body .nx-balance-breakdown dd { font-size: 18px; }
  .platform-body .nx-balance-actions .button { flex: 1; }
}

/* ---------- Activity list ---------- */
:root:root body.platform-body .nx-activity { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 13px 0 !important; border-bottom: 1px solid var(--rf-line) !important; }
:root:root body.platform-body .nx-activity:last-child { border-bottom: 0 !important; }
:root:root body.platform-body .nx-activity > :is(strong, b:last-of-type) { text-align: right; }

/* ---------- Status pills ---------- */
:root:root body.platform-body .nx-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  border: 0 !important;
  background: var(--rf-surface-2) !important; color: var(--rf-text-2) !important;
}
:root:root body.platform-body .nx-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
:root:root body.platform-body .nx-status:is(.paid, .succeeded, .completed, .approved, .active) { background: var(--rf-ok-soft) !important; color: var(--rf-ok) !important; }
:root:root body.platform-body .nx-status:is(.pending, .requested, .overdue, .under_review, .refund_pending) { background: var(--rf-warn-soft) !important; color: var(--rf-warn) !important; }
:root:root body.platform-body .nx-status:is(.processing) { background: var(--rf-info-soft) !important; color: var(--rf-info) !important; }
:root:root body.platform-body .nx-status:is(.cancelled, .canceled, .failed, .rejected, .blocked, .refunded) { background: var(--rf-bad-soft) !important; color: var(--rf-bad) !important; }

/* ---------- Tables ---------- */
:root:root body.platform-body .nx-table-wrap { border: 1px solid var(--rf-line) !important; border-radius: var(--rf-radius) !important; background: var(--rf-surface) !important; box-shadow: var(--rf-shadow); overflow: auto; }
:root:root body.platform-body .nx-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
:root:root body.platform-body .nx-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--rf-surface-2) !important; color: var(--rf-muted) !important;
  font-size: 12px !important; font-weight: 600 !important; letter-spacing: .01em !important; text-transform: none !important;
  padding: 11px 16px !important; border-bottom: 1px solid var(--rf-line) !important; text-align: left;
}
:root:root body.platform-body .nx-table tbody td { padding: 13px 16px !important; border-bottom: 1px solid var(--rf-line) !important; color: var(--rf-text-2); vertical-align: middle; }
:root:root body.platform-body .nx-table tbody tr:last-child td { border-bottom: 0 !important; }
:root:root body.platform-body .nx-table tbody tr { transition: background-color .15s var(--rf-ease); }
:root:root body.platform-body .nx-table tbody tr:hover td { background: color-mix(in srgb, var(--rf-accent) 4%, var(--rf-surface)); }
:root:root body.platform-body .nx-table :is(small, td small) { color: var(--rf-muted) !important; }
:root:root body.platform-body .nx-table .nx-link,
:root:root body.platform-body .nx-table td > button.nx-link { color: var(--rf-text) !important; font-weight: 600; text-decoration: none !important; }
:root:root body.platform-body .nx-table .nx-link:hover { color: var(--rf-accent-text) !important; text-decoration: underline !important; }
:root:root body.platform-body .nx-empty { color: var(--rf-muted) !important; border-color: var(--rf-line-strong) !important; border-radius: var(--rf-radius) !important; padding: 28px 20px !important; text-align: center; }

/* ---------- Forms & toolbars ---------- */
:root:root body.platform-body .nx-toolbar { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; margin: 16px 0 14px; }
:root:root body.platform-body .nx-toolbar > .button { align-self: end; }
:root:root body.platform-body :is(.nx-field, .nx-toolbar label) { color: var(--rf-text-2); font-size: 13px; font-weight: 600; }
:root:root body.platform-body :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  font-family: var(--rf-font) !important;
  background-color: var(--rf-surface) !important;
  border: 1px solid var(--rf-line-strong) !important;
  border-radius: var(--rf-radius-sm) !important;
  color: var(--rf-text) !important;
  min-height: 40px;
  transition: border-color .15s var(--rf-ease), box-shadow .15s var(--rf-ease);
}
:root:root body.platform-body :is(input, select, textarea)::placeholder { color: color-mix(in srgb, var(--rf-muted) 85%, transparent) !important; }
:root:root body.platform-body :is(input:not([type=checkbox]):not([type=radio]), select, textarea):focus {
  border-color: var(--rf-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rf-accent) 18%, transparent) !important;
  outline: none !important;
}

/* Tabs */
:root:root body.platform-body :is(.nx-view-tabs, .nx-chart-tabs) { display: inline-flex; gap: 2px; padding: 3px; background: var(--rf-surface-2) !important; border: 1px solid var(--rf-line) !important; border-radius: 11px; }
:root:root body.platform-body :is(.nx-view-tabs, .nx-chart-tabs) button {
  border: 0 !important; background: transparent !important; color: var(--rf-muted) !important;
  font-weight: 600; font-size: 13px; padding: 7px 14px !important; border-radius: 8px !important; box-shadow: none !important;
}
:root:root body.platform-body :is(.nx-view-tabs, .nx-chart-tabs) button:is(.active, [aria-selected="true"]) {
  background: var(--rf-surface) !important; color: var(--rf-text) !important;
  box-shadow: 0 1px 2px rgba(22, 19, 31, .08), 0 0 0 1px var(--rf-line) !important;
}
:root:root body.platform-body .view-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin: 14px 0; }

/* ---------- Sidebar ---------- */
:root:root body.platform-body .sidebar { background: var(--rf-surface) !important; border-right: 1px solid var(--rf-line) !important; }
:root:root body.platform-body .side-nav a {
  color: var(--rf-text-2) !important; font-size: 14px !important; font-weight: 500;
  border-radius: 9px !important; border: 0 !important; box-shadow: none !important;
  transition: background-color .15s var(--rf-ease), color .15s var(--rf-ease);
}
:root:root body.platform-body .side-nav a:hover { background: var(--rf-surface-2) !important; color: var(--rf-text) !important; }
:root:root body.platform-body :is(.side-nav a.active, .side-nav a[aria-current="page"]) {
  background: var(--rf-accent-soft) !important; color: var(--rf-accent-text) !important; font-weight: 600;
}
:root:root body.platform-body .side-nav small { color: var(--rf-muted) !important; font-size: 11px !important; letter-spacing: .06em !important; font-weight: 600; }
.platform-body .admin-nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--rf-accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }

/* ---------- Dialogs ---------- */
:root:root .nx-dialog {
  border: 1px solid var(--rf-line) !important;
  border-radius: 18px !important;
  background: var(--rf-surface) !important;
  color: var(--rf-text) !important;
  box-shadow: 0 30px 80px -30px rgba(18, 10, 40, .55) !important;
}
:root:root .nx-dialog::backdrop { background: rgba(10, 7, 22, .48); backdrop-filter: blur(3px); }
:root:root .nx-dialog[open] { animation: rf-dialog-in .32s var(--rf-ease); }
:root:root .nx-dialog h2 { font-family: var(--rf-display) !important; font-size: 21px !important; letter-spacing: -.02em; }
:root:root .nx-dialog .nx-form-error:not(:empty) { color: var(--rf-bad); background: var(--rf-bad-soft); padding: 10px 12px; border-radius: var(--rf-radius-sm); font-size: 13.5px; }
:root:root .nx-dialog footer { gap: 8px; }
.nx-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
:root:root .nx-dialog .nx-details > div { border-color: var(--rf-line) !important; }
:root:root .nx-dialog .nx-details dt { color: var(--rf-muted) !important; }
@keyframes rf-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- Admin specifics ---------- */
:root:root body.admin-body .admin-stat { background: var(--rf-surface) !important; border: 1px solid var(--rf-line) !important; border-radius: var(--rf-radius) !important; box-shadow: var(--rf-shadow) !important; }
:root:root body.admin-body .admin-stat strong { font-family: var(--rf-display); letter-spacing: -.02em; }
:root:root body.admin-body .admin-panel-head p { color: var(--rf-muted) !important; max-width: 72ch; }
:root:root body.admin-body .metric-card { border-left-width: 1px !important; border-left-color: var(--rf-line) !important; }
:root:root body.admin-body .metric-card > span[style] { color: var(--rf-muted) !important; }
:root:root body.admin-body .admin-payout-notice { background: var(--rf-warn-soft) !important; color: var(--rf-text-2) !important; border: 0 !important; border-radius: var(--rf-radius-sm) !important; }

:root:root body.admin-body .admin-brand { padding: 4px 10px; min-height: 48px; }
:root:root body.admin-body .admin-brand img { width: auto !important; height: 34px !important; max-width: 170px; object-fit: contain; }
:root:root body.admin-body .admin-brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:root:root body.admin-body [data-admin-open-logo-modal] {
  width: 100%; justify-content: center;
  background: transparent !important; border: 1px dashed rgba(198, 165, 255, .35) !important; color: #d9c9f5 !important;
  border-radius: var(--rf-radius-sm) !important; padding: 8px 10px !important; font-size: 12.5px !important; font-weight: 600 !important;
}
:root:root body.admin-body [data-admin-open-logo-modal]:hover { border-color: #c6a5ff !important; color: #fff !important; }
:root:root body.admin-body .admin-side-nav a { font-size: 14px !important; border-radius: 9px !important; }
:root:root body.admin-body .admin-nav-label { letter-spacing: .06em !important; }
:root:root body.admin-body :is(.eyebrow, .admin-header-title small, .admin-header-title > span:first-child:not(:only-child)) { display: none !important; }
:root:root body.admin-body :is(.admin-stat, .metric-card) { border-top: 1px solid var(--rf-line) !important; }
:root:root body.admin-body .admin-heading h1 { font-size: clamp(30px, 3vw, 38px) !important; letter-spacing: -.03em; color: var(--rf-text) !important; }
:root:root body.admin-body .admin-heading { padding-top: 24px !important; }
:root:root body.admin-body .admin-header { background: color-mix(in srgb, var(--rf-surface) 86%, transparent) !important; border-bottom: 1px solid var(--rf-line) !important; backdrop-filter: saturate(140%) blur(8px); }

@media (prefers-reduced-motion: reduce) {
  .platform-body *, .nx-dialog { animation: none !important; transition: none !important; }
}

:root:root body.admin-body .admin-actions .button,
:root:root body.platform-body .table-action { white-space: nowrap; }
:root:root body.platform-body td .table-action { margin: 2px 4px 2px 0; }

/* Legibility floor */
:root:root body.platform-body .workspace span { font-size: 11px !important; }
:root:root body.platform-body .profile i { font-size: 11px !important; }
:root:root body.platform-body :is(.nx-chart-summary small, .nx-chart-labels span, .nx-chart-summary span) { font-size: 11.5px !important; }
:root:root body.admin-body .admin-workspace small { font-size: 10.5px !important; }
:root:root body.admin-body .admin-nav-label { font-size: 11px !important; }
:root:root body.admin-body .admin-sidebar-bottom small { font-size: 11.5px !important; }
:root:root body.admin-body ::placeholder { color: #67627a !important; }
:root:root body.admin-body .admin-stat::before { display: none !important; }
:root:root body.admin-body .admin-sidebar a { color: inherit; }

/* ===== Cobogó language for the app (v2) ===== */
:root:root body.platform-body { background-color: var(--rf-bg) !important; }
:root:root body.platform-body :is(h1, h2, .panel h2, .app-header h1, .admin-heading h1, .admin-panel-head h2) { font-weight: 800 !important; font-variation-settings: 'wdth' 110; letter-spacing: -.02em !important; }
:root:root body.platform-body h3 { font-variation-settings: 'wdth' 106; }
:root:root body.platform-body .nx-balance-amount, :root:root body.platform-body .nx-balance-breakdown dd, :root:root body.platform-body .metric-card strong, :root:root body.admin-body .admin-stat strong { font-weight: 800 !important; font-variation-settings: 'wdth' 112; }

/* Buttons: blocks with one 2px stroke */
:root:root body.platform-body .button { border-width: 2px !important; font-variation-settings: 'wdth' 106; }
:root:root body.platform-body .button.outline,
html[data-nx-accent] body.platform-body .button.outline { border-color: var(--rf-text) !important; background: transparent !important; box-shadow: none !important; }
:root:root body.platform-body .button.outline:hover:not(:disabled),
html[data-nx-accent] body.platform-body .button.outline:hover:not(:disabled) { background: var(--rf-text) !important; border-color: var(--rf-text) !important; color: var(--rf-surface) !important; }
:root:root body.platform-body .nx-status { border-radius: 3px !important; }

/* Sidebar: graphite with a faint cobogó texture and the violet light on the active item */
:root:root body.platform-body .sidebar {
  background-color: #0d0818 !important; border-right: 1px solid #2a2140 !important; color: #d8d2e8;
  background-image: linear-gradient(180deg, rgba(13, 8, 24, .2) 0%, rgba(13, 8, 24, .92) 40%, #0d0818 100%), url("ceu-retrato.webp") !important; background-size: cover !important; background-position: center top !important;
  isolation: isolate;
}
/* Desktop: o menu fica preso à tela e ocupa a altura toda (antes um position: relative aqui
   anulava o sticky e o menu subia junto com a página, deixando um vazio preto embaixo). */
@media (min-width: 851px) {
  :root:root body.platform-body .sidebar {
    position: sticky; top: 0; align-self: flex-start; height: 100dvh; max-height: 100dvh;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  }
  :root:root body.platform-body .sidebar::-webkit-scrollbar { display: none; }
}
/* Telas de notebook: itens mais baixos para o menu inteiro caber sem rolar. */
@media (min-width: 851px) and (max-height: 880px) {
  :root:root body.platform-body .sidebar { padding-top: 16px !important; padding-bottom: 12px !important; }
  :root:root body.platform-body .sidebar .workspace { margin: 12px 0 8px !important; padding-top: 8px !important; padding-bottom: 8px !important; }
  :root:root body.platform-body .side-nav { gap: 1px !important; }
  :root:root body.platform-body .side-nav a { min-height: 0 !important; padding-top: 7px !important; padding-bottom: 7px !important; }
  :root:root body.platform-body .side-nav small { margin-top: 10px !important; margin-bottom: 2px !important; }
  :root:root body.platform-body .sidebar .nx-help { margin-top: 8px !important; }
  :root:root body.platform-body .sidebar .profile { margin-top: 8px !important; padding-top: 10px !important; }
}
@media (min-width: 851px) and (max-height: 700px) {
  :root:root body.platform-body .sidebar .workspace { display: none !important; }
  :root:root body.platform-body .side-nav a { padding-top: 5px !important; padding-bottom: 5px !important; font-size: 13.5px !important; }
}
:root:root body.platform-body .sidebar .nx-help { display: flex; align-items: center; gap: 10px; }
:root:root body.platform-body .side-nav a { color: #cfc8e2 !important; }
:root:root body.platform-body .side-nav a:hover { background: rgba(242, 241, 246, .08) !important; color: #fff !important; }
:root:root body.platform-body :is(.side-nav a.active, .side-nav a[aria-current="page"]) { background: var(--rf-accent) !important; color: #fff !important; box-shadow: 0 10px 24px -14px rgba(109, 40, 217, .9); }
:root:root body.platform-body .side-nav a .nx-icon, :root:root body.platform-body .side-nav a svg { color: inherit !important; }
:root:root body.platform-body .side-nav small { color: #8f87a8 !important; }
:root:root body.platform-body .sidebar .workspace { background: rgba(242, 241, 246, .06) !important; border: 1px solid rgba(242, 241, 246, .14) !important; color: #fff !important; }
:root:root body.platform-body .sidebar .workspace :is(span, small, label) { color: #a8a0bf !important; }
:root:root body.platform-body .sidebar .workspace :is(strong, select, b) { color: #fff !important; background: transparent !important; }
:root:root body.platform-body .sidebar .platform-brand-nexora { color: #f7f5ff !important; }
:root:root body.platform-body .sidebar .platform-brand-pay { color: #b39cff !important; }
:root:root body.platform-body .sidebar :is(.sidebar-bottom, .nx-help, .profile) { color: #cfc8e2 !important; border-color: rgba(242, 241, 246, .14) !important; }
:root:root body.platform-body .sidebar .profile b { color: #fff !important; }

/* Overview header carries a band of the 3D wall */
:root:root body.platform-body .app-header:has(.nx-today) {
  position: relative; isolation: isolate; overflow: hidden;
  margin: -8px 0 22px; padding: 30px 30px 26px; border-radius: var(--rf-radius);
  background: url("ceu-faixa.webp") 70% 40% / cover no-repeat, #12052e;
}
:root:root body.platform-body .app-header:has(.nx-today)::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(7, 3, 14, .9) 0%, rgba(7, 3, 14, .6) 50%, rgba(7, 3, 14, .55) 100%); }
:root:root body.platform-body .app-header:has(.nx-today) h1 { color: #fff !important; }
:root:root body.platform-body .app-header:has(.nx-today) .view-intro { color: #d7cff0 !important; }
:root:root body.platform-body .app-header:has(.nx-today) .icon-button { background: rgba(242, 241, 246, .1) !important; border-color: rgba(242, 241, 246, .2) !important; color: #fff !important; }
:root:root body.platform-body .app-header:has(.nx-today) .icon-button:hover { background: #f2f1f6 !important; color: #1a1326 !important; }

/* Balance: the primary amount sits on graphite like the landing's saldo block */
:root:root body.platform-body .nx-balance { border: 0 !important; border-radius: var(--rf-radius) !important; }
:root:root body.platform-body .nx-balance-primary { background: #1a1326 !important; border-right: 0 !important; }
:root:root body.platform-body .nx-balance-primary .nx-balance-label { color: #a8a0bf !important; }
:root:root body.platform-body .nx-balance-primary .nx-balance-amount { color: #fff !important; }
:root:root body.platform-body .nx-balance-primary .nx-balance-note { color: #c9c2dc !important; }
:root:root body.platform-body .nx-balance-primary .nx-balance-note b { color: #fff !important; }
:root:root body.platform-body .nx-balance-primary .button.outline { border-color: rgba(242, 241, 246, .55) !important; color: #fff !important; }
:root:root body.platform-body .nx-balance-primary .button.outline:hover { background: #f2f1f6 !important; color: #1a1326 !important; }

/* Admin: same graphite sidebar */
:root:root body.admin-body .admin-sidebar { --admin-nav-bg: #1a1326; --admin-nav-line: #2e2640; background: #1a1326 !important; }
:root:root body.admin-body .admin-side-nav a[aria-current="page"], :root:root body.admin-body .admin-side-nav a.is-active { background: var(--rf-accent) !important; color: #fff !important; }

:root { --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='white' fill-rule='evenodd' d='M0 0H100V100H0Z M27 8.5H73A18.5 18.5 0 0 0 91.5 27V73A18.5 18.5 0 0 0 73 91.5H27A18.5 18.5 0 0 0 8.5 73V27A18.5 18.5 0 0 0 27 8.5Z'/%3E%3C/svg%3E"); }

/* Retire the old starfield backdrop; the app sits on the cal ground */
:root:root body.platform-body::before { background-image: none !important; background-color: var(--rf-bg) !important; }
:root:root body.platform-body .sidebar .workspace { background-image: none !important; box-shadow: none !important; }
:root:root body.platform-body .sidebar .workspace::before, :root:root body.platform-body .sidebar .workspace::after { display: none !important; }

/* Night theme details */
:root:root body.platform-body .app-header:has(.nx-today) .button.button-primary { background: var(--rf-accent) !important; border-color: var(--rf-accent) !important; color: #fff !important; }
:root:root body.platform-body .app-header:has(.nx-today) .icon-button { background: rgba(7, 3, 14, .6) !important; }
:root:not(.theme-light) body.platform-body .nx-balance-primary { background: linear-gradient(160deg, #2a1268 0%, #1a0b40 60%, #120830 100%) !important; }
:root:not(.theme-light) body.platform-body .nx-balance { box-shadow: 0 0 0 1px var(--rf-line), 0 30px 60px -30px #000 !important; }
:root:root body.admin-body .admin-sidebar { background: #0d0818 !important; border-right: 1px solid #2a2140 !important; }

/* Integrations */
:root:root body.platform-body .connection-panel-head > .button { white-space: nowrap; flex: none; }
:root:root body.platform-body .connection-panel p a { color: var(--rf-accent-text); text-decoration: underline; }

