:root {
  --ink: #1e1a17;
  --muted: #5e554d;
  --muted-2: #6b625a;
  --canvas: #fbf8f4;
  --surface: #fff;
  --surface-sidebar: #fffdfb;
  --surface-input: #fff;
  --surface-button: #f7f2ed;
  --surface-table: #fff;
  --surface-dialog: #fff;
  --surface-dialog-cell: #faf6f2;
  --surface-code: #f5f0ea;
  --surface-hover: #f7f2ed;
  --row-hover: #faf5ef;
  --row-line: #eee8e0;
  --track: #eee6dc;
  --text-secondary: #463c34;
  --primary-ink: #1e1a17;
  --shadow: rgba(63, 34, 17, .13);
  --backdrop: rgba(40, 23, 14, .48);
  --line: #e6ded5;
  --accent: #ff7f00;
  --accent-hover: #f07600;
  --accent-text: #994406;
  --accent-soft: #fff0e1;
  --accent-border: #f0b57e;
  --focus: #a85100;
  --green: #296744;
  --green-strong: #2b8150;
  --blue: #305f96;
  --amber: #8b5108;
  --red: #af3440;
  --violet: #6946a4;
  --radius: 16px;
  color-scheme: light;
  font-family: var(--plunitos-body-font);
  color: var(--ink);
  background: var(--canvas);
}

:root[data-theme="dark"] {
  --ink: #fcf4ec;
  --muted: #c4b5a8;
  --muted-2: #bba99a;
  --canvas: #1b1613;
  --surface: #251e19;
  --surface-sidebar: #211a16;
  --surface-input: #211a16;
  --surface-button: #302620;
  --surface-table: #251e19;
  --surface-dialog: #251e19;
  --surface-dialog-cell: #2b221d;
  --surface-code: #201914;
  --surface-hover: #332820;
  --row-hover: #30251e;
  --row-line: #3b3029;
  --track: #493a30;
  --text-secondary: #e7d8ca;
  --shadow: rgba(0, 0, 0, .32);
  --backdrop: rgba(15, 10, 7, .72);
  --line: #4b3a30;
  --accent-text: #ffb773;
  --accent-soft: #3b291b;
  --accent-border: #865231;
  --focus: #ffb773;
  --green: #93d4a5;
  --green-strong: #75bc8a;
  --blue: #a2c8f5;
  --amber: #efbb73;
  --red: #ff9ca6;
  --violet: #c5adee;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { color: var(--ink); background: var(--accent-soft); }
h1, h2, h3, .money-main, .systems-stats strong { font-family: var(--plunitos-display-font); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); transition: background-color .2s, color .2s; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.hidden { display: none !important; }

.login-card, .sidebar, .panel, .money-card, .filter-bar, .table-shell, .system-card, .transaction-dialog,
textarea, input, select, .secondary-button, .page-button, .theme-switch {
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}

.login-shell { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 18px; }
.login-card { width: min(100%, 458px); padding: clamp(22px, 5vw, 38px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.login-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-brand { display: block; width: clamp(108px, 29vw, 152px); height: auto; }
.eyebrow { margin: 0 0 9px; font-size: 11px; font-weight: 750; letter-spacing: .12em; color: var(--red); }
.login-card h1 { margin: 0; font-size: clamp(32px, 7vw, 48px); letter-spacing: -.035em; line-height: 1.03; }
.login-copy { margin: 12px 0 26px; color: var(--muted); line-height: 1.6; }
label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 13px; font-weight: 650; }
code { color: var(--accent-text); font-family: "SFMono-Regular", Consolas, monospace; }
textarea, input, select { color: var(--ink); background: var(--surface-input); border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color .2s, box-shadow .2s, background-color .2s; }
textarea:focus, input:focus, select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; resize: vertical; padding: 13px 14px; font: 12px/1.5 "SFMono-Regular", Consolas, monospace; }
.login-card input { width: 100%; padding: 13px 14px; }
.mfa-setup { margin-bottom: 20px; display: grid; gap: 9px; color: var(--text-secondary); }
.mfa-setup p, .recovery-codes p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mfa-setup img { width: min(210px, 100%); height: auto; aspect-ratio: 1; justify-self: center; padding: 8px; border-radius: 12px; background: #fff; }
.mfa-setup small { color: var(--muted-2); }
.mfa-setup code { padding: 9px; border: 1px solid var(--line); border-radius: 8px; text-align: center; word-break: break-all; background: var(--surface-code); }
.recovery-codes { display: grid; gap: 12px; }
#recovery-code-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
#recovery-code-list code { padding: 8px; border: 1px solid var(--line); border-radius: 7px; text-align: center; background: var(--surface-code); }
.primary-button { width: 100%; margin-top: 13px; min-height: 46px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 10px; background: var(--accent); color: var(--primary-ink); font-weight: 800; }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); }
.primary-button:disabled { opacity: .6; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
.login-card .form-error:empty { min-height: 0; margin: 0; }
.login-help { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 12px; line-height: 1.6; }
.theme-switch { min-height: 38px; padding: 8px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-button); color: var(--muted); font-size: 11px; font-weight: 700; }
.theme-switch:hover { color: var(--ink); border-color: var(--accent-border); }
.theme-switch:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sidebar-theme-switch { width: 100%; margin-bottom: 8px; }

.dashboard { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface-sidebar); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px; }
.brand-lockup img { display: block; width: 118px; height: auto; }
.brand-lockup span { color: var(--muted); font-size: 13px; font-weight: 650; }
nav { display: grid; gap: 7px; }
.nav-item { padding: 11px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 650; }
.nav-item:hover { color: var(--ink); background: var(--surface-hover); }
.nav-item.active { color: var(--accent-text); background: var(--accent-soft); }
.sidebar-foot { margin-top: auto; }
.secure-note { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-secondary); font-size: 11px; }
.secure-note i, .connection-status i, .auto-refresh i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green-strong); }
.secure-note small { color: var(--muted-2); }
.ghost-button { width: 100%; padding: 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.ghost-button:hover { color: var(--red); }

main { min-width: 0; padding: 0 clamp(24px, 4vw, 64px) 70px; }
.topbar { min-height: 108px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-status { padding: 8px 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-secondary); font-size: 11px; }
.connection-status.offline i { background: var(--red); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); font-size: 19px; }
.icon-button:hover { border-color: var(--accent-border); color: var(--accent-text); }
.icon-button.loading { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.content-section { padding-top: 32px; }
.content-section.view-hidden { display: none; }
.filter-bar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.date-field label { margin: 0 0 4px 2px; color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.date-field input { padding: 8px 10px; color-scheme: inherit; }
.date-divider { align-self: center; color: var(--muted-2); }
.secondary-button, .page-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-button); color: var(--ink); font-size: 12px; font-weight: 700; }
.secondary-button:hover, .page-button:hover:not(:disabled) { border-color: var(--accent-border); }
.last-update { margin-left: auto; align-self: center; color: var(--muted-2); font-size: 11px; }
.alert { margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--red) 8%, transparent); color: var(--red); font-size: 13px; }
.section-heading { margin: 34px 0 16px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.section-copy { max-width: 620px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.auto-refresh { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 11px; }
.auto-refresh i { width: 5px; height: 5px; }
.money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.money-card { min-height: 184px; padding: 21px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.money-card-empty { min-height: 0; color: var(--muted); font-size: 14px; }
.money-card-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }
.currency-badge { padding: 5px 8px; border: 1px solid var(--accent-border); border-radius: 7px; color: var(--accent-text); background: var(--accent-soft); font-weight: 800; }
.money-main { margin: 22px 0 20px; font-size: clamp(29px, 3vw, 42px); font-weight: 760; letter-spacing: -.035em; }
.money-subgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px 8px; }
.money-subgrid span { display: block; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.money-subgrid strong { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 12px; }
.split-grid { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 12px; }
.panel { min-height: 280px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.metric-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.status-row { display: grid; grid-template-columns: 110px 1fr 34px; gap: 12px; align-items: center; margin: 13px 0; }
.status-name { color: var(--text-secondary); font-size: 12px; }
.status-track { height: 5px; border-radius: 999px; overflow: hidden; background: var(--track); }
.status-fill { height: 100%; min-width: 3px; border-radius: 999px; background: var(--green); }
.status-row[data-status="processing"] .status-fill, .status-row[data-status="pending"] .status-fill { background: var(--amber); }
.status-row[data-status="payment_failed"] .status-fill, .status-row[data-status="canceled"] .status-fill { background: var(--red); }
.status-row[data-status="refunded"] .status-fill { background: var(--violet); }
.status-count { color: var(--muted); text-align: right; font: 11px "SFMono-Regular", Consolas, monospace; }
.application-item { padding: 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; border-bottom: 1px solid var(--line); }
.application-item:last-child { border-bottom: 0; }
.application-name { display: block; color: var(--text-secondary); font: 12px "SFMono-Regular", Consolas, monospace; overflow: hidden; text-overflow: ellipsis; }
.application-meta { display: block; margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.application-amount { color: var(--green); font-size: 12px; font-weight: 750; white-space: nowrap; }
.audit-panel { min-height: 0; margin-top: 12px; }
.audit-list { display: grid; }
.audit-item { padding: 11px 0; display: grid; grid-template-columns: 130px 1fr auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border-bottom: 0; }
.audit-action { color: var(--violet); font: 10px "SFMono-Regular", Consolas, monospace; }
.audit-action.failure { color: var(--red); }
.audit-resource { min-width: 0; color: var(--text-secondary); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-meta { display: block; margin-top: 4px; color: var(--muted-2); font: 9px "SFMono-Regular", Consolas, monospace; }
.audit-time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }

.systems-section { padding-top: 32px; }
.systems-intro { margin: 0 0 16px; font-size: 13px; }
.systems-layout { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: 12px; align-items: start; }
.systems-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.systems-stats > div { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.systems-stats strong, .systems-stats span { display: block; }
.systems-stats strong { color: var(--ink); font-size: 20px; letter-spacing: -.04em; }
.systems-stats span { margin-top: 3px; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.system-form { min-height: 0; }
.system-form h2 { margin: 0 0 20px; font-size: 20px; }
.system-form input, .system-form select { width: 100%; margin-bottom: 14px; padding: 10px 11px; }
.systems-list { display: grid; gap: 10px; }
.system-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.system-card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.system-card h3 { margin: 0; font-size: 16px; }
.system-slug { display: block; margin-top: 4px; color: var(--blue); font: 10px "SFMono-Regular", Consolas, monospace; }
.system-state { color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.system-state.disabled { color: var(--red); }
.system-actions { display: flex; gap: 7px; margin-top: 13px; }
.system-provider-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 8px; margin-top: 15px; }
.system-provider { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-code); }
.system-provider.configured { border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.system-provider-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.system-provider-heading strong { font-size: 11px; }
.provider-state { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: var(--muted); background: var(--surface-button); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.provider-state.active { color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.provider-state.inactive { color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, transparent); }
.provider-state.pending { color: var(--muted-2); }
.system-provider-detail, .system-provider-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-provider-detail { margin-top: 9px; color: var(--ink); font: 10px "SFMono-Regular", Consolas, monospace; }
.system-provider-meta { margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.provider-page { max-width: 920px; margin: 0 auto; padding-bottom: 60px; }
.provider-page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.provider-page-heading h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.provider-system-name { margin: 5px 0 0; color: var(--blue); font: 11px "SFMono-Regular", Consolas, monospace; }
.provider-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 18px 0; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-code); }
.provider-tabs button { padding: 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.provider-tabs button.active { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-border); }
.provider-form { display: grid; gap: 12px; }
.provider-intro { display: grid; gap: 4px; padding: 13px 15px; border: 1px solid var(--accent-border); border-radius: 9px; background: var(--accent-soft); }
.provider-intro strong { color: var(--ink); font-size: 13px; }
.provider-intro span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.provider-step { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-code); }
.provider-step-heading { display: grid; grid-template-columns: 25px 1fr; gap: 10px; align-items: start; margin-bottom: 14px; }
.provider-step-heading > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--primary-ink); background: var(--accent); font-size: 10px; font-weight: 850; }
.provider-step-heading strong, .provider-step-heading small { display: block; }
.provider-step-heading strong { color: var(--ink); font-size: 12px; }
.provider-step-heading small { margin-top: 3px; color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.provider-status-row { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: end; }
.provider-status-row label, .provider-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.provider-status-row select, .provider-fields input { width: 100%; padding: 10px 11px; }
.provider-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.provider-fields label:nth-child(n+3), #paguelo-facil-fields label { grid-column: 1 / -1; }
.provider-fields small { color: var(--muted-2); font-size: 9px; font-weight: 400; }
.switch-field { min-height: 39px; display: flex !important; align-items: center; gap: 9px !important; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-input); }
.switch-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.provider-security-note { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--green) 20%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--green) 5%, transparent); font-size: 11px; }
.provider-security-note strong { color: var(--green); }
.provider-security-note span { color: var(--muted); }
.provider-guide ol { margin: 0; padding-left: 20px; color: var(--text-secondary); font-size: 11px; line-height: 1.55; }
.provider-guide li + li { margin-top: 7px; }
.provider-callback-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-input); }
.provider-callback-row > div { min-width: 0; flex: 1; }
.provider-callback-row span, .provider-callback-row code { display: block; }
.provider-callback-row span { margin-bottom: 5px; color: var(--muted-2); font-size: 9px; }
.provider-callback-row code { overflow: hidden; color: var(--blue); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.provider-save-result { min-height: 0; margin: 0; color: var(--green); font-size: 11px; text-align: right; }
.provider-save-result:empty { display: none; }
.provider-form-actions { position: sticky; bottom: 10px; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-dialog); box-shadow: 0 12px 35px var(--shadow); }
.key-list { margin-top: 14px; border-top: 1px solid var(--line); }
.key-row { padding: 11px 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: 0; padding-bottom: 0; }
.key-name { display: block; color: var(--text-secondary); font-size: 11px; }
.key-meta { display: block; margin-top: 4px; color: var(--muted-2); font: 9px/1.5 "SFMono-Regular", Consolas, monospace; }
.key-reveal { margin-bottom: 12px; padding: 16px; border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--green) 6%, transparent); }
.key-reveal strong { color: var(--green); font-size: 13px; }
.key-reveal p { margin: 5px 0 12px; color: var(--muted); font-size: 11px; }
.key-reveal > div { display: flex; gap: 8px; align-items: center; }
.key-reveal code { min-width: 0; padding: 9px; flex: 1; overflow: hidden; border-radius: 7px; background: var(--surface-code); text-overflow: ellipsis; white-space: nowrap; }

.transactions-section { padding-top: 32px; }
.transaction-heading { margin-top: 0; }
.transaction-filters { display: flex; gap: 8px; margin-bottom: 11px; }
.transaction-filters select, .transaction-filters input { min-width: 165px; padding: 9px 10px; font-size: 11px; }
.table-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-table); }
table { width: 100%; border-collapse: collapse; min-width: 950px; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .11em; }
td { padding: 14px; border-bottom: 1px solid var(--row-line); color: var(--text-secondary); font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
.cell-main { display: block; color: var(--text-secondary); }
.cell-sub { display: block; max-width: 165px; margin-top: 4px; color: var(--muted-2); font: 9px "SFMono-Regular", Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--green) 8%, transparent); color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.processing, .status-pill.pending { color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, transparent); }
.status-pill.payment_failed, .status-pill.canceled { color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.status-pill.refunded { color: var(--violet); background: color-mix(in srgb, var(--violet) 8%, transparent); }
.app-tag { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); font: 9px "SFMono-Regular", Consolas, monospace; }
.align-right { text-align: right; }
.amount-cell { color: var(--ink); font-weight: 750; white-space: nowrap; }
.empty-state { padding: 50px; text-align: center; color: var(--muted-2); }
.empty-state span, .empty-state strong { display: block; }
.empty-state span { margin-bottom: 10px; color: var(--green); font-size: 26px; }
.empty-state strong { color: var(--text-secondary); }
.empty-state p { margin: 6px 0 0; font-size: 11px; }
.pagination { padding-top: 13px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; color: var(--muted-2); font-size: 11px; }
.page-button:disabled { opacity: .35; cursor: not-allowed; }

.row-action { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.row-action:hover { border-color: color-mix(in srgb, var(--blue) 45%, transparent); color: var(--blue); }
.transaction-dialog { width: min(680px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 25px; overflow-y: auto; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--surface-dialog); box-shadow: 0 35px 100px var(--shadow); }
.transaction-dialog::backdrop { background: var(--backdrop);  }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; }
.dialog-close:hover { color: var(--ink); border-color: var(--muted-2); }
#dialog-status { margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.detail-grid > div { min-width: 0; padding: 13px; background: var(--surface-dialog-cell); }
.detail-grid .detail-wide { grid-column: 1 / -1; }
.detail-grid dt { margin-bottom: 6px; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.detail-grid dd { margin: 0; overflow: hidden; color: var(--text-secondary); font: 11px/1.45 "SFMono-Regular", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-button { padding: 9px 13px; border: 1px solid color-mix(in srgb, var(--red) 36%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); font-size: 12px; font-weight: 800; }
.danger-button:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 18%, transparent); }
.danger-button:disabled { opacity: .35; cursor: not-allowed; }
.refund-confirmation { margin-top: 20px; padding: 18px; border: 1px solid color-mix(in srgb, var(--red) 28%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--red) 5%, transparent); }
.refund-confirmation h3 { margin: 0 0 8px; font-size: 18px; }
.refund-copy { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.refund-confirmation select, .refund-confirmation input { width: 100%; margin-bottom: 13px; padding: 10px 11px; }
.fraud-warning { margin: -4px 0 13px; padding: 9px 10px; border-left: 1px solid var(--red); color: var(--red); background: color-mix(in srgb, var(--red) 6%, transparent); font-size: 11px; line-height: 1.5; }
.refund-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.action-message { min-height: 18px; margin: 15px 0 0; color: var(--green); font-size: 12px; }
.action-message.error { color: var(--red); }

.skeleton { position: relative; overflow: hidden; min-height: 184px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--accent-soft), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 900px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px 20px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-lockup { padding: 0; }
  nav { margin-left: auto; display: flex; }
  .sidebar-foot { margin: 0 0 0 10px; }
  .secure-note { display: none; }
  .ghost-button { width: auto; }
  .sidebar-foot { display: flex; align-items: center; gap: 4px; }
  .sidebar-theme-switch { width: auto; margin: 0; padding: 8px; }
  .split-grid { grid-template-columns: 1fr; }
  .systems-layout { grid-template-columns: 1fr; }
  .system-actions { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 6px; padding: 12px 14px; }
  .brand-lockup { grid-row: 1; grid-column: 1; }
  .brand-lockup img { width: min(112px, 100%); }
  .brand-lockup span { display: none; }
  .sidebar-foot { grid-row: 1; grid-column: 2; margin: 0; gap: 0; }
  .sidebar-foot .ghost-button { padding: 8px; white-space: nowrap; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0; }
  .sidebar nav .nav-item { display: grid; min-height: 44px; place-items: center; padding: 8px 4px; text-align: center; font-size: 12px; }
  main { padding: 0 16px 50px; }
  .topbar { min-height: 92px; }
  .connection-status { display: none; }
  .sidebar nav .nav-item[href="/docs"] { display: none; }
  .last-update { width: 100%; margin-left: 0; }
  .money-grid { grid-template-columns: 1fr; }
  .provider-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .systems-stats { grid-template-columns: 1fr; }
  .system-actions > button { flex: 1 1 100%; }
  .provider-page-heading { align-items: stretch; flex-direction: column; }
  .provider-page-heading button { width: 100%; }
  .provider-status-row, .provider-fields { grid-template-columns: 1fr; }
  .provider-fields label { grid-column: auto !important; }
  .provider-callback-row { align-items: stretch; flex-direction: column; }
  .provider-callback-row button { width: 100%; }
  .transaction-filters { display: grid; grid-template-columns: 1fr; }
  .transaction-filters select, .transaction-filters input { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .detail-wide { grid-column: auto; }
  .action-row > button { flex: 1 1 45%; }
  .audit-item { grid-template-columns: 1fr; gap: 5px; }
}
