/* Hashpayments — sistema visual único do painel, do portal do cliente e do login. */
:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #161619;
  --surface-3: #1d1d21;
  --hover: #222227;
  --border: #26262b;
  --border-strong: #3a3a41;
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --primary: #e32320;
  --primary-text: #fff;
  --primary-hover: #c91e1b;
  --ring: #e32320;
  --ring-soft: rgba(227, 35, 32, 0.16);
  --green: #4ade80;
  --green-bg: rgba(34, 197, 94, 0.12);
  --green-text: #86efac;
  --amber: #fbbf24;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --amber-text: #fcd34d;
  --red: #f87171;
  --red-bg: rgba(239, 68, 68, 0.12);
  --red-text: #fca5a5;
  --blue-bg: rgba(59, 130, 246, 0.14);
  --blue-text: #93c5fd;
  --radius: 12px;
  --radius-sm: 8px;
  --badge-radius: 4px;
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --font: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  --font-heading: 'IBM Plex Mono', var(--mono);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg);
}
/* Navegadores com personalização WebKit permitem também o estado de hover. */
@supports selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track,
  ::-webkit-scrollbar-corner {
    background: var(--bg);
  }
  ::-webkit-scrollbar-thumb {
    border: 2px solid var(--bg);
    border-radius: 999px;
    background: var(--primary);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
  }
}
html {
  scrollbar-gutter: stable;
  scroll-padding-top: 76px;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
body:has(dialog[open]),
body.nav-open {
  overflow: hidden;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.065em;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
}
h2 {
  font-size: 16px;
  line-height: 1.35;
}
h3 {
  font-size: 14px;
}
p {
  color: var(--muted);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
[hidden] {
  display: none !important;
}
::selection {
  background: #3f3f46;
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
code,
pre {
  font-family: var(--mono);
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Marca */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/IBMPlexSans-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/IBMPlexSans-Medium.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/IBMPlexSans-Bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-Medium.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.065em;
  color: var(--text);
  white-space: nowrap;
}
.brand-wordmark {
  display: inline-flex;
}
.brand-hash {
  color: #e32320;
}
.brand-glitch {
  position: relative;
  display: inline-block;
  width: fit-content;
}
.brand-glitch::before,
.brand-glitch::after {
  content: attr(data-text) / '';
  position: absolute;
  left: 0;
  top: 0;
  color: inherit;
  pointer-events: none;
}
.brand-glitch::before {
  animation: hash-glitch-top 1s linear infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}
.brand-glitch::after {
  animation: hash-glitch-bottom 1.5s linear infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}
/* Mesmos cortes, tempos e deslocamentos do texto da referência Hakai. */
@keyframes hash-glitch-top {
  2%,
  64% {
    transform: translate(2px, -2px);
  }
  4%,
  60% {
    transform: translate(-2px, 2px);
  }
  62% {
    transform: translate(13px, -1px) skew(-13deg);
  }
}
@keyframes hash-glitch-bottom {
  2%,
  64% {
    transform: translate(-2px);
  }
  4%,
  60% {
    transform: translate(-2px);
  }
  62% {
    transform: translate(-22px, 5px) skew(21deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .brand-glitch::before,
  .brand-glitch::after {
    display: none;
    animation: none;
  }
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.3s ease-in-out,
    border-color 0.3s ease-in-out,
    color 0.3s ease-in-out;
  text-decoration: none;
}
.btn .icon {
  width: 15px;
  height: 15px;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}
.btn-primary:is(:hover, :focus-visible):not(:disabled) {
  background: #fff;
  color: var(--primary);
}
.btn-secondary {
  background: transparent;
  border-color: var(--primary);
  color: var(--text);
}
.btn-secondary:is(:hover, :focus-visible):not(:disabled) {
  background: #fff;
  border-color: #fff;
  color: var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) {
  background: transparent;
  color: var(--primary);
}
.btn-danger {
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red-text);
}
.btn-danger:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  gap: 6px;
}
.btn-lg {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
}
.btn-block {
  width: 100%;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}
.link:hover {
  color: var(--text);
  text-decoration-color: var(--muted);
}
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--primary);
}

/* Mesma tipografia e feedback em ações fixas e criadas pela interface. */
button,
.btn,
.nav-item,
.link,
summary {
  font-family: var(--mono);
}
.button-label {
  position: relative;
  display: inline-block;
  min-width: 0;
  pointer-events: none;
}
:is(.btn-ghost, .nav-item, .link, [role='tab'], summary):is(:hover, :focus-visible):not(:disabled)
  .button-label::before,
:is(.btn-ghost, .nav-item, .link, [role='tab'], summary):is(:hover, :focus-visible):not(:disabled)
  .button-label::after {
  content: attr(data-text) / '';
  position: absolute;
  inset: 0;
  color: inherit;
  pointer-events: none;
}
:is(.btn-ghost, .nav-item, .link, [role='tab'], summary):is(:hover, :focus-visible):not(:disabled)
  .button-label::before {
  animation: hash-glitch-top 1s linear infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}
:is(.btn-ghost, .nav-item, .link, [role='tab'], summary):is(:hover, :focus-visible):not(:disabled)
  .button-label::after {
  animation: hash-glitch-bottom 1.5s linear infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}
.ui-effects-defs {
  position: fixed;
  width: 0;
  height: 0;
  pointer-events: none;
}
.ui-noise-active {
  filter: url('#hash-ui-noise');
}
@media (prefers-reduced-motion: reduce) {
  .button-label::before,
  .button-label::after {
    display: none;
  }
  .ui-noise-active {
    filter: none;
  }
}
.icon-btn .icon {
  width: 18px;
  height: 18px;
}

/* Campos */
input,
select,
textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  caret-color: var(--text);
}
textarea {
  height: auto;
  padding: 10px 12px;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
  opacity: 1;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #52525b;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
input:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
input:-webkit-autofill {
  -webkit-box-shadow: inset 0 0 0 1000px var(--surface-3);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
  cursor: pointer;
  text-overflow: ellipsis;
}
option {
  background: var(--surface-2);
  color: var(--text);
}
input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--text);
  flex-shrink: 0;
  cursor: pointer;
}
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
/* Datas com o mesmo chevron dos seletores; o calendário abre ao clicar no campo. */
@supports selector(::-webkit-calendar-picker-indicator) {
  input[type='date'] {
    background-image: var(--chevron);
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 34px;
    cursor: pointer;
  }
  input[type='date']::-webkit-calendar-picker-indicator {
    display: none;
  }
}
input[type='date'].is-empty::-webkit-datetime-edit {
  color: var(--faint);
}
input[type='date']::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.field-label small {
  font-weight: 400;
  color: var(--faint);
  font-size: 12px;
}
.hint {
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.55;
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group > .addon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.input-group > input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-variant-numeric: tabular-nums;
}
.field-control {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
}
.field-control > input,
.field-control > select,
.field-control > textarea {
  padding-left: 38px;
}
.field-control > .field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.field-control:has(> textarea) > .field-icon {
  top: 12px;
  transform: none;
}
.field-control:focus-within > .field-icon {
  color: var(--text);
}
.field-control:has(> :disabled) > .field-icon {
  opacity: 0.55;
}
.check-icon {
  display: inline-block;
  vertical-align: -3px;
  margin-right: 5px;
  color: var(--muted);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  cursor: pointer;
}
.check input {
  margin-top: 2px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.form-actions .btn-primary {
  min-width: 140px;
}
details.more {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
details.more > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
details.more > summary::-webkit-details-marker {
  display: none;
}
details.more > summary::after {
  content: '';
  width: 16px;
  height: 16px;
  background: var(--chevron) center / 16px no-repeat;
  transition: transform 0.15s;
}
details.more[open] > summary::after {
  transform: rotate(180deg);
}
details.more > .stack {
  padding: 4px 12px 14px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* Shell */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  z-index: 40;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px 20px;
}
.sidebar-head .brand {
  font-size: 20px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-caption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 16px 10px 6px;
}
.nav-caption:first-child {
  padding-top: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-item .icon {
  width: 17px;
  height: 17px;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--primary);
}
.nav-item.active {
  background: rgba(227, 35, 32, 0.1);
  color: var(--primary);
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--amber-bg);
  color: var(--amber-text);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-chip {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 6px 0 6px 8px;
  min-width: 0;
}
.user-chip > span {
  display: flex;
  flex: 1;
  min-width: 0;
}
.user-chip strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot .btn {
  justify-content: flex-start;
  flex-shrink: 0;
  padding: 0 6px;
  gap: 6px;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-status {
  padding: 0 8px 14px;
}
.menu-btn {
  display: none;
}
.content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px clamp(16px, 2.2vw, 32px) 32px;
  flex: 1;
}
#setup-notice {
  margin-bottom: 20px;
}
.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header p {
  margin-top: 4px;
  font-size: 14px;
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-backdrop {
  display: none;
}

/* Cartões */
/* Recorta fundos de filtros, tabelas e rodapés no contorno do cartão. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  overflow: clip;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.card-header p {
  font-size: 13px;
  margin-top: 2px;
}
.card-header + .card-body {
  padding-top: 0;
}
.card-body {
  padding: 20px;
}
.card-body > p + p {
  margin-top: 10px;
}
.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.layout-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}
.alert .icon {
  margin-top: 1px;
}
.alert-warning {
  background: var(--amber-bg);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--amber-text);
}
.alert-danger {
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red-text);
}
.alert-success {
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.28);
  color: var(--green-text);
}
.alert .link {
  color: inherit;
}

/* Indicadores */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.overview-kpis {
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
}
.kpis-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.kpis.kpis-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.kpi {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.kpi-label .icon {
  color: var(--faint);
}
.kpi-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
  min-height: 30px;
}
.kpi.highlight {
  background: linear-gradient(160deg, #1b1b1f, #121214);
  border-color: var(--border-strong);
}
.balance-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.balance-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.balance-details dt {
  color: var(--muted);
}
.balance-details dd {
  margin: 0 0 0 auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.balance-card .kpi-foot {
  flex-wrap: wrap;
  margin-top: auto;
}
.balance-card .kpi-foot > span {
  flex: 1 1 140px;
  min-width: 0;
}
.overview-kpis > .kpi:not(.balance-card) .kpi-foot {
  margin-top: auto;
}
button.kpi {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
button.kpi:hover {
  border-color: var(--border-strong);
}
.mini-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.mini-stats strong {
  display: block;
  font-size: 18px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* Margem da plataforma */
.financial-card .card-header {
  padding-bottom: 20px;
}
.financial-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
  margin: 0 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.financial-metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 20px;
}
.financial-metric + .financial-metric {
  border-left: 1px solid var(--border);
}
.financial-result {
  background: var(--surface-2);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.financial-label {
  font-size: 12.5px;
  color: var(--muted);
}
.financial-value {
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.financial-result .financial-value {
  font-size: clamp(24px, 2.5vw, 34px);
}
.financial-caption {
  font-size: 12px;
  color: var(--faint);
}
.financial-value.positive,
.financial-amount.positive {
  color: var(--green-text);
}
.financial-value.negative,
.financial-amount.negative {
  color: var(--red-text);
}
.financial-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.financial-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.financial-footer > .financial-caption {
  flex-shrink: 0;
}
.financial-explanation {
  max-width: 560px;
  font-size: 12px;
  color: var(--muted);
}
.financial-explanation summary {
  cursor: pointer;
}
.financial-explanation p {
  margin-top: 8px;
  line-height: 1.6;
}
.financial-empty {
  padding: 4px 20px 20px;
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 760px) {
  .financial-summary {
    grid-template-columns: minmax(0, 1fr);
    margin-left: 16px;
    margin-right: 16px;
  }
  .financial-metric {
    padding: 16px;
  }
  .financial-metric + .financial-metric {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .financial-result {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
  .financial-footer {
    flex-direction: column;
    padding-left: 16px;
    padding-right: 16px;
  }
  .financial-empty {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--badge-radius);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.badge.positive {
  background: var(--green-bg);
  color: var(--green-text);
}
.badge.waiting {
  background: var(--amber-bg);
  color: var(--amber-text);
}
.badge.negative {
  background: var(--red-bg);
  color: var(--red-text);
}
.badge.info {
  background: var(--blue-bg);
  color: var(--blue-text);
}
.badge.neutral {
  background: var(--surface-3);
  color: var(--muted);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--badge-radius);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}
.status-pill.ok::before {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}
.status-pill.bad::before {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--badge-radius);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Filtros */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.card-header + .toolbar {
  border-top: 0;
  padding-top: 0;
}
.toolbar input,
.toolbar select {
  height: 36px;
  font-size: 13px;
}
.toolbar select {
  width: auto;
  max-width: 220px;
}
.toolbar > .field-select {
  width: auto;
  max-width: 250px;
}
.toolbar .field-select select {
  width: 100%;
  max-width: none;
}
.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}
.search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.search input {
  padding-left: 34px;
}
.control {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  cursor: pointer;
}
.control:hover {
  border-color: #52525b;
}
.control:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
.control > span {
  padding-left: 11px;
  font-size: 13px;
  color: var(--faint);
  white-space: nowrap;
  user-select: none;
}
.control > input {
  border: 0;
  background-color: transparent;
  height: 34px;
  box-shadow: none;
  padding-left: 8px;
  width: min(152px, 100%);
  font-size: 13px;
}
.control > input:focus {
  box-shadow: none;
}
.control > .field-icon {
  margin-left: 10px;
  color: var(--muted);
  pointer-events: none;
}
.control:has(> .field-icon) > span {
  padding-left: 7px;
}
.toolbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-end:not(:has(> :not([hidden]))) {
  display: none;
}
.result-count {
  font-size: 13px;
  color: var(--faint);
  white-space: nowrap;
}

/* Tabelas */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}
thead th {
  position: sticky;
  top: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 0.12s;
}
tbody tr:hover td {
  background: rgba(255, 255, 255, 0.018);
}
th:first-child,
td:first-child {
  padding-left: 20px;
}
th:last-child,
td:last-child {
  padding-right: 20px;
}
th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td.num {
  color: var(--text);
  font-weight: 500;
}
th.actions,
td.actions {
  text-align: right;
  width: 1%;
}
.cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 320px;
}
.cell strong {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell small {
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-icon {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kind-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}
.kind-icon.in {
  color: var(--green-text);
}
.kind-icon.out {
  color: var(--blue-text);
}
.row-actions {
  display: inline-flex;
  gap: 2px;
  justify-content: flex-end;
}
.row-actions .btn-sm {
  padding: 0 8px;
}
/* Listas de integração ocupam a largura disponível e crescem com o conteúdo. */
.adaptive-table-card {
  container-type: inline-size;
}
.adaptive-table .table-wrap {
  overflow: visible;
}
.adaptive-table table {
  table-layout: fixed;
}
.adaptive-table th,
.adaptive-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}
.adaptive-table .cell {
  max-width: none;
}
.adaptive-table .cell strong,
.adaptive-table .cell small {
  overflow: visible;
}
.adaptive-table .cell small {
  margin-top: 4px;
}
.adaptive-table .row-actions {
  flex-wrap: wrap;
}
.adaptive-table .row-actions .btn {
  min-width: 0;
  height: auto;
  min-height: 30px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#integrations-list th:first-child {
  width: 30%;
}
#integrations-list th:nth-child(2) {
  width: 26%;
}
#integrations-list th:nth-child(3) {
  width: 12%;
}
#integrations-list th:nth-child(4) {
  width: 18%;
}
#integrations-list th:last-child {
  width: 14%;
}
#integrations-list .row-actions .btn {
  white-space: nowrap;
  overflow-wrap: normal;
}
#client-destinations th:first-child {
  width: 46%;
}
#client-destinations th:nth-child(2) {
  width: 14%;
}
#client-destinations th:nth-child(3),
#client-destinations th.actions {
  width: 20%;
}
@container (max-width: 860px) {
  .adaptive-table table,
  .adaptive-table tbody {
    display: block;
  }
  .adaptive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .adaptive-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
    padding: 20px;
    border-top: 1px solid var(--border);
  }
  .adaptive-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .adaptive-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 400;
    color: var(--faint);
  }
  .adaptive-table td.actions {
    width: auto;
  }
  #client-destinations td:first-child,
  #client-destinations td.actions {
    grid-column: 1 / -1;
  }
}
@container (max-width: 480px) {
  .adaptive-table tr {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
}
/* A listagem de clientes se adapta à largura do próprio painel. */
#clients-card {
  container-type: inline-size;
}
#clients-table table {
  table-layout: fixed;
}
#clients-table th,
#clients-table td {
  padding: 12px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#clients-table th:nth-child(1) {
  width: 17%;
}
#clients-table th:nth-child(2) {
  width: 15%;
}
#clients-table th:nth-child(3) {
  width: 18%;
}
#clients-table th:nth-child(4),
#clients-table th:nth-child(5) {
  width: 17%;
}
#clients-table th.actions {
  width: 16%;
}
#clients-table td.num {
  white-space: normal;
}
#clients-table .badge {
  white-space: nowrap;
  padding: 0 6px;
  gap: 4px;
  font-size: 11px;
}
#clients-table .row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
}
#clients-table .row-actions .btn {
  min-width: 0;
  height: auto;
  min-height: 30px;
  padding: 4px 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}
@container (max-width: 900px) {
  #clients-table table,
  #clients-table tbody {
    display: block;
  }
  #clients-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #clients-table tbody {
    padding: 12px;
  }
  #clients-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
  }
  #clients-table tr:last-child {
    margin-bottom: 0;
  }
  #clients-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    padding: 0;
    text-align: left;
    border-bottom: 0;
  }
  #clients-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 400;
    color: var(--faint);
  }
  #clients-table td:first-child,
  #clients-table td.actions {
    grid-column: 1 / -1;
  }
  #clients-table td.actions {
    width: auto;
    border-top: 1px solid var(--border);
  }
  #clients-table .row-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@container (max-width: 300px) {
  #clients-table tr {
    grid-template-columns: minmax(0, 1fr);
  }
}
@container (max-width: 480px) {
  #clients-table .row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.status-cell small {
  font-size: 12px;
  color: var(--faint);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-cell small.warn {
  color: var(--amber-text);
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 28px 20px;
}
.empty .empty-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-bottom: 6px;
}
.empty strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.empty span {
  font-size: 13px;
  color: var(--faint);
  max-width: 360px;
}
.loading-region {
  position: relative;
}
.loading-region[aria-busy='true']:empty {
  min-height: 200px;
}
.loading-replacement > :not(.loading-indicator) {
  visibility: hidden;
}
.loading-indicator,
.loading-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
}
.loading-indicator {
  position: absolute;
  inset: 0;
}
.loading-spinner {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 0;
  color: var(--primary);
  background: linear-gradient(currentColor, currentColor) center / 3px 60% no-repeat;
}
.loading-spinner::before,
.loading-spinner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: currentColor;
  animation: loading-bars 0.9s steps(4) infinite;
}
.loading-spinner::before {
  left: 0;
}
.loading-spinner::after {
  right: 0;
  animation-delay: -0.3s;
}
.hash-loader {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  color: var(--text);
}
.hash-loader-wordmark {
  display: inline-flex;
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.065em;
}
.hash-loader-track {
  position: relative;
  width: 180px;
  max-width: 100%;
  height: 3px;
  overflow: hidden;
  background: repeating-linear-gradient(to right, #29292e 0 10px, transparent 10px 14px);
}
.hash-loader-track::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 32%;
  background: repeating-linear-gradient(to right, var(--primary) 0 10px, transparent 10px 14px);
  animation: loading-transfer 1.5s steps(16) infinite;
}
@keyframes loading-bars {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}
@keyframes loading-transfer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(312.5%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hash-loader-track::after {
    transform: translateX(100%);
  }
}
.loading-indicator-update {
  flex-direction: row;
  inset: auto 12px 10px auto;
  min-height: 0;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--badge-radius);
  font-size: 12px;
  pointer-events: none;
}
.loading-indicator-update .loading-spinner {
  width: 14px;
  height: 14px;
  font-size: 11px;
}
.app-loading {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}
.page-loading {
  min-height: 280px;
}
.page-loading > :not(.page-header):not(.page-loading-status) {
  display: none !important;
}
.page-loading-status {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: normal;
}
.button-loading .loading-spinner {
  width: 14px;
  height: 14px;
  font-size: 11px;
}
.button-loading .loading-spinner {
  color: currentColor;
}
button.button-loading:disabled {
  opacity: 1;
  cursor: wait;
}
.button-loading > .icon {
  display: none;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  scroll-margin-top: 88px;
}
.pagination-top {
  border-top: 0;
  border-bottom: 1px solid var(--border);
}
.pagination-summary {
  display: grid;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.pagination-range strong {
  color: var(--text-2);
  font-weight: 600;
}
.pagination-caption {
  color: var(--faint);
  font-size: 11px;
}
.pagination-controls {
  margin-left: auto;
}
.pagination-controls,
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-button {
  flex-shrink: 0;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.pagination-button:hover:not(:disabled):not([aria-current='page']) {
  border-color: var(--border-strong);
  background: var(--hover);
  color: var(--text);
}
.pagination-button[aria-current='page'] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 600;
}
.pagination-button:disabled {
  opacity: 0.35;
}
.pagination-prev,
.pagination-next {
  gap: 6px;
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.pagination-prev {
  margin-right: 4px;
}
.pagination-next {
  flex-direction: row-reverse;
  margin-left: 4px;
}
.pagination-ellipsis {
  width: 24px;
  text-align: center;
  color: var(--faint);
}
.pagination-button-label,
.pagination-mobile-status {
  white-space: nowrap;
}
.pagination-mobile-status {
  display: none;
}

/* Gráfico de recebimentos */
.receipts-chart {
  padding-bottom: 34px;
}
.receipts-chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 11px;
  color: var(--muted);
}
.receipts-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.receipts-chart-legend::before {
  content: '';
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: #ef4444;
  box-shadow: 0 0 10px #ef444430;
}
.receipts-chart-period {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
}
.receipts-chart-layout {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 18px;
}
.receipts-chart-axis {
  position: relative;
  min-width: 62px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.receipts-chart-axis > span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  white-space: nowrap;
}
.receipts-chart-plot {
  position: relative;
  height: 240px;
  min-width: 0;
  margin: 0 4px;
}
.receipts-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.receipts-chart-grid {
  stroke: var(--border);
  stroke-dasharray: 3 6;
  vector-effect: non-scaling-stroke;
}
.receipts-chart-line {
  fill: none;
  stroke: #ef4444;
  stroke-width: 2.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.receipts-chart-guide {
  position: absolute;
  top: 6.36%;
  bottom: 7.27%;
  border-left: 1px dashed #ef44444d;
  pointer-events: none;
}
.receipts-chart-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #f87171;
  box-shadow: 0 0 0 5px #ef444418;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.receipts-chart-tooltip {
  position: absolute;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 152px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: 0 6px 20px #0003;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.receipts-chart-tooltip > span {
  font-size: 10px;
  color: var(--muted);
}
.receipts-chart-tooltip > strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.receipts-chart-dates {
  position: absolute;
  inset: 0 0 -34px;
}
.receipts-chart-day {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 16.6667%;
  height: 100%;
  padding: 0;
  transform: translateX(-50%);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: crosshair;
  touch-action: pan-y;
}
.receipts-chart-day:first-child {
  width: 8.3333%;
  justify-content: flex-start;
  transform: none;
}
.receipts-chart-day:last-child {
  width: 8.3333%;
  justify-content: flex-end;
  transform: translateX(-100%);
}
.receipts-chart-day.is-active {
  color: #f87171;
}
.receipts-chart-day:focus-visible {
  outline: 1px dashed #ef444480;
  outline-offset: 4px;
}
@media (max-width: 600px) {
  .receipts-chart-layout {
    gap: 12px;
  }
  .receipts-chart-axis {
    min-width: 54px;
    font-size: 9px;
  }
  .receipts-chart-plot {
    height: 200px;
  }
  .receipts-chart-day {
    font-size: 9px;
  }
}
.chart-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 14px;
}
.chart-total strong {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.chart-total span {
  font-size: 13px;
  color: var(--faint);
}

/* Ações rápidas e passos */
.quick-list {
  display: flex;
  flex-direction: column;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  text-align: left;
  width: 100%;
  color: var(--text-2);
}
.quick-link:first-child {
  border-top: 0;
  padding-top: 4px;
}
.quick-link > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.quick-link strong {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.quick-link small {
  font-size: 12.5px;
  color: var(--faint);
}
.quick-link > .icon:last-child {
  margin-left: auto;
  color: var(--faint);
  transition: transform 0.15s;
}
.quick-link:hover > .icon:last-child {
  transform: translateX(2px);
  color: var(--text);
}
.quick-icon {
  width: 24px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: step;
}
.steps li {
  display: flex;
  gap: 12px;
  counter-increment: step;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.steps li::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  border-radius: var(--badge-radius);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
}
.steps strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}

/* Código */
pre,
.code {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow: auto;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
}
.code-box {
  position: relative;
}
.code-box .copy {
  position: absolute;
  top: 8px;
  right: 8px;
}
.code-box:has(.copy) pre {
  padding-top: 48px;
  word-break: normal;
  overflow-wrap: anywhere;
}
code {
  font-size: 12.5px;
  background: var(--surface-3);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
pre code,
.code code {
  background: none;
  padding: 0;
}
.secret {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  word-break: break-all;
}
.secret > span {
  flex: 1;
}

/* Detalhes */
.detail-list {
  display: flex;
  flex-direction: column;
}
dialog.operation-dialog {
  width: min(760px, calc(100% - 32px));
}
.operation-section {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.operation-section > h3 {
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 13px;
}
.operation-section > .hint,
.operation-section .more {
  margin-top: 14px;
}
.operation-section .detail-row {
  align-items: flex-start;
}
.operation-section .detail-row > :first-child {
  flex: 0 0 38%;
}
.operation-section .detail-row > :last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .operation-section {
    padding: 16px;
  }
  .operation-section .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .operation-section .detail-row > :last-child {
    text-align: left;
  }
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.detail-row:last-child {
  border-bottom: 0;
}
.detail-row > :last-child {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}
.detail-row .mono {
  font-weight: 400;
  color: var(--text-2);
}
.amount-hero {
  text-align: center;
  padding: 6px 0 14px;
}
.amount-hero strong {
  display: block;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.amount-hero span {
  font-size: 13px;
  color: var(--faint);
}
.qr-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 260px;
  max-width: 100%;
  min-height: 236px;
  margin: 6px auto 14px;
  text-align: center;
}
.qr-frame .qr {
  margin: 0;
}
.qr {
  display: block;
  width: 216px;
  max-width: 100%;
  margin: 6px auto 14px;
  background: #fff;
  padding: 10px;
  border-radius: 10px;
}
.available {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.available strong {
  font-size: 18px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Portal: formulário, orientação e histórico sem lacunas entre cartões. */
.withdrawal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.withdrawal-heading h2,
.available > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.withdrawal-heading h2 > .icon {
  color: var(--muted);
}
.withdrawal-heading .available {
  padding: 9px 12px;
  gap: 20px;
}
.withdrawal-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}
.withdrawal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.withdrawal-footer > .hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 660px;
}
.withdrawal-footer > .hint .icon {
  margin-top: 2px;
}
.withdrawal-footer .form-actions {
  flex-shrink: 0;
}
.withdrawal-guide {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}
.withdrawal-guide h2 {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.withdrawal-guide .steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.toolbar.toolbar-inline {
  padding: 0;
  border: 0;
  background: transparent;
}
.toolbar-inline .toolbar-end {
  margin-left: 0;
}
#client-withdrawals {
  border-top: 1px solid var(--border);
}
.integration-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.integration-settings {
  min-width: 0;
  gap: 20px;
}
.integration-layout .hint {
  overflow-wrap: anywhere;
}
.integration-layout .secret > span {
  min-width: 0;
}
.integration-layout .secret > .icon-btn {
  flex-shrink: 0;
}
.integration-api h2,
.integration-webhooks h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.integration-api h2 .icon,
.integration-webhooks h2 .icon {
  color: var(--muted);
}
.api-header {
  gap: 16px;
}
.api-credential {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
}
.api-credential .icon {
  width: 15px;
  height: 15px;
}
.api-base {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px 18px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.api-base > span:first-child {
  color: var(--faint);
  font-size: 12px;
  flex-shrink: 0;
}
.api-base .mono {
  color: var(--text-2);
  overflow-wrap: anywhere;
  min-width: 0;
}
.api-base .icon-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}
.api-tabs {
  display: flex;
  gap: 26px;
  overflow-x: auto;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.api-tabs button {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.api-tabs button:hover {
  color: var(--primary);
}
.api-tabs button[aria-selected='true'] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.api-tabs .icon {
  width: 16px;
  height: 16px;
}
.api-tabs button:focus-visible,
.api-workspace:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 4px;
}
.api-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 32px;
  padding: 24px 20px;
}
.api-description {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.api-description h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}
.api-description .hint {
  color: var(--muted);
}
.api-endpoint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.api-endpoint > .mono {
  overflow-wrap: anywhere;
  color: var(--text-2);
  line-height: 1.6;
}
.api-method {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--green-text);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.8;
  flex-shrink: 0;
}
.api-params {
  margin: 0;
  font-size: 12px;
}
.api-params > div {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.api-params dt {
  font-family: var(--mono);
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.6;
}
.api-params dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.api-note {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}
.api-example {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.api-request {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}
.api-request-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.api-request pre {
  border: 0;
  border-radius: 0;
  padding: 16px;
  font-size: 12px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
}
.api-code-origin {
  color: var(--faint);
}
.api-code-path {
  color: var(--text-2);
}
.api-code-param {
  display: block;
}
.api-code-punctuation {
  color: var(--faint);
}
.api-code-key {
  color: var(--blue-text);
}
.api-code-value {
  color: var(--green-text);
}
.api-request-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0 16px 16px;
}
.api-example-hint {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--faint);
}
.api-response {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
}
.api-response > .icon {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.api-response strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.api-response p {
  font-size: 12px;
  line-height: 1.65;
  margin-top: 4px;
}
.api-footer {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  color: var(--faint);
}
.api-footer > .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}
.api-footer p {
  color: inherit;
  font-size: 12px;
  line-height: 1.6;
}
@media (max-width: 1100px) {
  .api-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}
@media (max-width: 480px) {
  .api-tabs {
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
  }
  .api-tabs button {
    font-size: 12px;
    gap: 6px;
  }
  .api-base {
    margin-left: 16px;
    margin-right: 16px;
    gap: 8px;
  }
  .api-base .mono {
    font-size: 11px;
  }
  .api-workspace {
    padding: 20px 16px;
  }
  .api-request pre {
    padding: 16px 12px;
    font-size: 11.5px;
  }
  .api-request-header,
  .api-request-actions {
    padding-left: 12px;
    padding-right: 12px;
  }
}

.webhook-header {
  border-bottom: 1px solid var(--border);
}
.webhook-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
}
.webhook-settings {
  padding: 24px;
  min-width: 0;
  gap: 20px;
  align-self: start;
}
.webhook-settings h3,
.destination-header h3 {
  margin-bottom: 5px;
}
.webhook-settings .form-actions {
  flex-wrap: wrap;
  margin-top: 0;
}
.webhook-status {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.webhook-status::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--faint);
}
.webhook-status[data-state='active']::before {
  background: var(--green);
}
.webhook-status[data-state='paused']::before {
  background: var(--amber);
}
.webhook-destinations {
  min-width: 0;
  padding: 24px;
  border-left: 1px solid var(--border);
  background: var(--bg);
}
.destination-header {
  margin-bottom: 20px;
}
.destination-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.destination-item {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.destination-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.destination-icon,
.destination-empty-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.destination-icon {
  width: 36px;
  height: 36px;
}
.destination-content {
  flex: 1;
  min-width: 0;
}
.destination-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.destination-heading strong {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.destination-default {
  padding: 2px 6px;
  font-size: 10px;
  color: var(--muted);
}
.destination-address {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}
.destination-address > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  line-height: 1.65;
}
.destination-copy {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.destination-item .row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.destination-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.destination-item-footer > .hint {
  font-size: 11px;
}
.destination-empty {
  padding: 28px 20px;
  min-height: 208px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
.destination-empty-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: 12px;
}
.destination-empty-icon > .icon {
  width: 21px;
  height: 21px;
}
.destination-empty strong {
  font-size: 14px;
  font-weight: 500;
}
.destination-empty p {
  max-width: 300px;
}
.destination-footnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  color: var(--faint);
}
.destination-footnote > .icon {
  margin-top: 2px;
  width: 14px;
  height: 14px;
}
.destination-footnote p {
  color: inherit;
  font-size: 12px;
  line-height: 1.6;
}
@media (max-width: 1180px) {
  .webhook-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .webhook-destinations {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .destination-empty {
    min-height: 180px;
  }
}
@media (max-width: 480px) {
  .webhook-settings,
  .webhook-destinations {
    padding: 20px 16px;
  }
  .destination-footnote {
    padding: 14px 16px;
  }
  .destination-item {
    padding: 14px;
  }
  .destination-icon {
    display: none;
  }
  .api-params > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}
.client-view .empty {
  display: grid;
  grid-template-columns: 40px minmax(0, 460px);
  justify-content: center;
  text-align: left;
  column-gap: 14px;
  row-gap: 3px;
}
.client-view .empty .empty-icon {
  grid-row: 1 / span 2;
  margin: 0;
}
.client-view .empty > strong,
.client-view .empty > span:last-child:not(.empty-icon) {
  grid-column: 2;
  max-width: none;
}
.client-view .empty.empty-no-icon {
  grid-template-columns: minmax(0, 460px);
}
.client-view .empty.empty-no-icon > strong,
.client-view .empty.empty-no-icon > span {
  grid-column: 1;
}
.client-view #client-destinations .empty {
  display: flex;
  align-items: flex-start;
}
.client-view #client-destinations .empty-icon {
  display: none;
}

/* Diálogos */
dialog {
  --font-heading: var(--font);
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.48),
    0 4px 16px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}
dialog.wide {
  width: min(640px, calc(100% - 32px));
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(4px);
}
dialog[open] {
  display: flex;
  flex-direction: column;
  /* Mantém a cor opaca desde o primeiro quadro da abertura. */
  animation: dialog-enter 0.18s ease-out;
}
@keyframes dialog-enter {
  from {
    transform: translateY(8px);
  }
  to {
    transform: none;
  }
}
dialog :is(h2, h3) {
  font-weight: 600;
  letter-spacing: -0.015em;
}
dialog h2 {
  font-size: 17px;
  line-height: 1.4;
}
dialog :is(button, .btn, .link, summary) {
  font-family: var(--font);
}
dialog .button-label::before,
dialog .button-label::after {
  display: none;
}
dialog .btn {
  min-height: 40px;
  border-radius: var(--radius-sm);
}
dialog .btn-primary:is(:hover, :focus-visible):not(:disabled) {
  background: var(--primary-hover);
  color: var(--primary-text);
}
dialog .btn-secondary {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text-2);
}
dialog :is(.btn-secondary, .btn-ghost):is(:hover, :focus-visible):not(:disabled) {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text);
}
dialog :is(input:not([type='checkbox'], [type='radio']), textarea, select) {
  background-color: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  caret-color: var(--text);
}
dialog :is(input, textarea)::placeholder {
  color: var(--faint);
}
dialog .hint {
  color: var(--muted);
}
dialog :is(input, textarea, select):hover {
  border-color: var(--faint);
}
dialog :is(input, textarea, select):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 35, 32, 0.15);
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--primary);
}
.dialog-header {
  flex: 0 0 auto;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.dialog-header > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.dialog-header .icon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}
.dialog-header .icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.dialog-header p {
  font-size: 13px;
  margin-top: 5px;
  line-height: 1.5;
}
.dialog-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: var(--border-strong) var(--surface);
}
.dialog-body::-webkit-scrollbar-track,
.dialog-body::-webkit-scrollbar-corner {
  background: var(--surface);
}
.dialog-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-color: var(--surface);
}
.dialog-body::-webkit-scrollbar-thumb:hover {
  background: var(--faint);
}
.dialog-body > * {
  flex-shrink: 0;
}
.dialog-footer {
  position: sticky;
  bottom: -24px;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 0 24px;
  margin-bottom: -24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
dialog .amount-hero {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
dialog .amount-hero strong {
  font-size: 30px;
  line-height: 1.3;
}
dialog .amount-hero span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
dialog .detail-row {
  padding: 12px 0;
}

/* Avisos flutuantes */
.toast-region {
  position: fixed;
  inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
  z-index: 1000;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
  color: var(--text);
}
.toast-region:popover-open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-region:not([popover]) {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-region::backdrop {
  background: transparent;
  pointer-events: none;
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  animation: rise 0.18s ease-out;
  pointer-events: auto;
}
.toast > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  max-height: 30dvh;
  overflow-y: auto;
}
.toast .toast-close {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin: -4px -4px -4px 0;
}
.toast .toast-close .icon {
  color: var(--muted);
  margin: 0;
}
.toast .icon {
  margin-top: 2px;
  color: var(--green);
}
.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}
.toast.error .icon {
  color: var(--red);
}

/* Login */
.auth {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--bg);
}
.auth-layout {
  width: 100%;
  max-width: 384px;
}
.auth-brand {
  font-size: 21px;
  line-height: 1.15;
}
.auth-card {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.auth-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.auth-card-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: var(--bg);
}
.auth-card form {
  gap: 20px;
}
.auth-card .field {
  gap: 9px;
}
.auth-card input {
  height: 44px;
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-sm);
}
.auth-card input:hover {
  border-color: var(--border-strong);
}
.auth-card input:focus {
  border-color: var(--ring);
}
.auth-card form > .btn {
  height: 42px;
  border-radius: 4px;
  gap: 10px;
}
@media (max-width: 480px) {
  .auth {
    padding: 32px 16px;
  }
  .auth-card-header,
  .auth-card-body {
    padding: 20px;
  }
}

/* Guia público */
.doc {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.doc .card-body h2 {
  margin: 22px 0 8px;
}
.doc .card-body h2:first-child {
  margin-top: 0;
}
.doc .card-body p {
  font-size: 14px;
  line-height: 1.7;
}
.doc .card-body pre {
  margin: 10px 0;
}
.doc ul {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  padding-left: 20px;
  margin: 8px 0;
}
.doc a:not(.btn) {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsivo */
@media (max-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .integration-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .nav-open .sidebar {
    transform: none;
  }
  .nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.55);
  }
  .menu-btn {
    display: inline-grid;
    align-self: flex-start;
    margin: 16px 0 0 20px;
  }
  .content {
    padding: 22px 20px 32px;
  }
  .layout-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .withdrawal-footer {
    align-items: flex-start;
  }
  .integration-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  h1 {
    font-size: 21px;
  }
  .kpis,
  .kpis.kpis-3,
  .layout-3,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpi-value {
    font-size: 24px;
  }
  .content {
    padding: 18px 16px 28px;
  }
  .menu-btn {
    margin-left: 16px;
  }
  .page-header {
    align-items: flex-start;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions .btn {
    flex: 1;
  }
  .card-header,
  .card-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .toolbar {
    padding: 12px 16px;
  }
  .search {
    flex-basis: 100%;
  }
  .toolbar select {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
  .toolbar > .field-select {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }
  .toolbar .control {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .control > span {
    padding-left: 10px;
  }
  .control > input {
    width: 100%;
    min-width: 0;
    padding-left: 6px;
    padding-right: 28px;
    background-position: right 8px center;
  }
  .toolbar-end {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .crumbs > span,
  .crumbs > .icon {
    display: none;
  }
  .hide-sm {
    display: none;
  }
  th:first-child,
  td:first-child {
    padding-left: 16px;
  }
  th:last-child,
  td:last-child {
    padding-right: 16px;
  }
  .pagination {
    gap: 12px;
    padding: 12px 16px;
  }
  .pagination-summary {
    width: 100%;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px 12px;
  }
  .pagination-controls {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .pagination-button {
    min-width: 40px;
    height: 40px;
  }
  .pagination-page:not([aria-current='page']),
  .pagination-ellipsis {
    display: none;
  }
  .pagination-mobile-status {
    display: block;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .pagination-caption {
    font-size: 10px;
  }
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
  .dialog-header,
  .dialog-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .form-actions .btn,
  .dialog-footer .btn {
    flex: 1;
  }
  .withdrawal-heading .available {
    width: 100%;
  }
  .withdrawal-fields,
  .withdrawal-guide .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .withdrawal-guide {
    padding-left: 16px;
    padding-right: 16px;
  }
  .withdrawal-guide .steps {
    gap: 14px;
  }
  .withdrawal-footer {
    flex-direction: column;
  }
  .withdrawal-footer .form-actions,
  .toolbar-inline {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .toolbar .control {
    flex-basis: 100%;
  }
}

/* Webhooks recebidos */
:root {
  --series-accepted: #3987e5;
  --series-rejected: #d03b3b;
}
.incoming-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.incoming-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.incoming-swatch {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.incoming-swatch.s-accepted {
  background: var(--series-accepted);
}
.incoming-swatch.s-rejected {
  background: var(--series-rejected);
}
.incoming-chart {
  position: relative;
  min-height: 200px;
}
.incoming-chart svg {
  display: block;
  overflow: visible;
}
.incoming-chart .grid {
  stroke: var(--border);
  stroke-width: 1;
}
.incoming-chart .baseline {
  stroke: var(--border-strong);
  stroke-width: 1;
}
.incoming-chart .tick {
  fill: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.incoming-chart .bar.s-accepted {
  fill: var(--series-accepted);
}
.incoming-chart .bar.s-rejected {
  fill: var(--series-rejected);
}
.incoming-chart .band {
  fill: var(--hover);
  opacity: 0.6;
}
.incoming-chart .hit {
  fill: transparent;
  cursor: crosshair;
}
.incoming-tip {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  color: var(--text-2);
  pointer-events: none;
  z-index: 2;
}
.incoming-tip .tip-title {
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}
.incoming-tip .tip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 1.7;
}
.incoming-tip .tip-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.incoming-tip .tip-row strong {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.incoming-tip .tip-note {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--faint);
}
.incoming-panels {
  align-items: stretch;
}
dialog.incoming-dialog {
  width: min(760px, calc(100% - 32px));
}
.incoming-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.incoming-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.incoming-section h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.incoming-section .code-box pre {
  max-height: 320px;
}
.incoming-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.incoming-attempts,
.incoming-timeline {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.incoming-attempts li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 4px;
  padding: 8px 0 8px 18px;
  border-left: 1px solid var(--border);
}
.incoming-attempts li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--surface);
}
.incoming-attempts li.attempt-processed::before {
  background: var(--green);
}
.incoming-attempts li.attempt-unmatched::before {
  background: var(--red);
}
.incoming-attempts strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.incoming-attempts small {
  font-size: 12px;
  color: var(--faint);
}
.incoming-timeline li {
  padding: 4px 0;
}
.incoming-timeline .link:disabled {
  color: var(--text);
  text-decoration: none;
  cursor: default;
}

.fee-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(18px, 2vw, 24px);
}
.fee-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fee-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
}
.fee-rate {
  display: block;
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.fee-note {
  margin-top: 6px;
  font-size: 13px;
}
.fee-limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: auto 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.fee-limits dt {
  color: var(--muted);
  font-size: 12px;
}
.fee-limits dd {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Estrutura comum: conteúdo legível e ações acessíveis em qualquer largura. */
.page-header > div:first-child,
.card-header > div,
.alert > span {
  min-width: 0;
}
.page-header p,
.card-header p,
.hint,
.alert,
.quick-link,
.kpi-foot {
  overflow-wrap: anywhere;
}
.btn {
  max-width: 100%;
}
.field-label {
  flex-wrap: wrap;
}
.input-group > input {
  min-width: 0;
}
.detail-row > :first-child {
  flex: 0 0 38%;
}
.detail-row > :last-child {
  min-width: 0;
}
.secret > span {
  min-width: 0;
}
.secret > button {
  flex-shrink: 0;
}
fieldset legend {
  padding: 0 8px 0 0;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
}
.kpi-foot {
  min-height: 0;
  flex-wrap: wrap;
  margin-top: auto;
}
.kpi-value {
  font-size: clamp(22px, 2.1vw, 30px);
  white-space: normal;
  overflow-wrap: anywhere;
}
.overview-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.overview-kpis .balance-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px 32px;
}
.balance-card .kpi-label,
.balance-card .kpi-value,
.balance-card .kpi-foot {
  grid-column: 1;
}
.balance-card .balance-details {
  grid-column: 2;
  grid-row: 1 / 4;
  margin: 0;
  padding: 0 0 0 24px;
  border-top: 0;
  border-left: 1px solid var(--border);
  justify-content: center;
}
.kpis-5 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.kpis-5 > :first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 24px;
}
.kpis-5 > :first-child .kpi-value {
  grid-column: 1;
  font-size: 30px;
}
.kpis-5 > :first-child .kpi-foot {
  grid-column: 2;
  grid-row: 1 / 3;
  gap: 16px;
}
.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.settings-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.withdrawal-guide .steps {
  margin-top: 14px;
}
.sidebar-head {
  position: relative;
}
.sidebar-close {
  display: none;
}
.nav {
  min-height: 0;
  padding-bottom: 16px;
}
.nav-item {
  flex-shrink: 0;
}
.sidebar-foot {
  flex-shrink: 0;
}
.page-load-failed > :not(.page-header):not(.page-load-error):not(.page-loading-status) {
  display: none !important;
}
.page-load-error {
  align-items: center;
  flex-wrap: wrap;
}
.page-load-error > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 200px;
}
.page-load-error .btn {
  flex-shrink: 0;
}
.list-load-error .btn {
  margin-top: 8px;
}
#portal-error {
  margin-bottom: 16px;
}

/* Busca e situação sempre visíveis; os filtros adicionais compartilham a mesma área. */
.toolbar {
  gap: 10px;
}
.toolbar > .search {
  flex: 1 1 260px;
  min-width: min(200px, 100%);
}
.toolbar > .field-select {
  flex: 0 1 210px;
  max-width: 250px;
}
.toolbar .filter-toggle {
  height: 36px;
  flex-shrink: 0;
}
.filter-toggle.has-filters {
  border-color: var(--muted);
  color: var(--text);
}
.filter-extra {
  order: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.filter-extra > .field-control,
.filter-extra > .control {
  flex: 1 1 190px;
}
.filter-extra .field-control,
.filter-extra select,
.filter-extra .control {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.filter-extra .control input {
  width: 100%;
  min-width: 0;
}
.filter-periods {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.filter-periods > span {
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
}
.filter-summary {
  order: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--badge-radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
}
.filter-chip:hover {
  border-color: var(--muted);
}
.filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-chip .icon {
  width: 13px;
  height: 13px;
}
.search input {
  padding-right: 36px;
}
.search .search-clear {
  position: absolute;
  right: 4px;
  top: 3px;
  width: 30px;
  height: 30px;
}
.search .search-clear .icon {
  position: static;
  transform: none;
  width: 14px;
  height: 14px;
}
.toolbar-inline {
  max-width: 100%;
}
.toolbar-inline .filter-summary {
  justify-content: flex-end;
}

/* As listas passam a fichas quando o espaço do próprio cartão fica estreito. */
.responsive-table {
  container-type: inline-size;
  min-width: 0;
}
.responsive-table .table-wrap {
  overscroll-behavior-x: contain;
}
.responsive-table .cell {
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.responsive-table .cell small {
  white-space: normal;
}
.responsive-table .status-cell small {
  white-space: normal;
  overflow-wrap: anywhere;
}
.responsive-table td.num .cell {
  align-items: flex-end;
}
.responsive-table td.num .cell small {
  white-space: nowrap;
}
.responsive-table .cell strong,
.responsive-table .cell small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.responsive-table .operation-margin > strong {
  color: var(--green-text);
}
#charges-table .operation-reference-id strong {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  overflow-wrap: normal;
  text-overflow: ellipsis;
}
#clients-table td.num .cell small {
  white-space: normal;
  display: block;
}
#clients-table .cell small {
  display: block;
  overflow: visible;
}
.responsive-table .row-actions {
  flex-wrap: wrap;
  gap: 4px;
}
@container (max-width: 720px) {
  .responsive-table table,
  .responsive-table tbody {
    display: block;
  }
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .responsive-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    padding: 16px;
    border-top: 1px solid var(--border);
  }
  .responsive-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
  }
  .responsive-table td:first-child,
  .responsive-table td.actions {
    grid-column: 1 / -1;
  }
  .responsive-table td.actions {
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .responsive-table td.actions::before {
    display: none;
  }
  .responsive-table .cell,
  .responsive-table .truncate,
  .responsive-table .status-cell small {
    max-width: 100% !important;
  }
  .responsive-table .truncate {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .responsive-table td.num .cell {
    align-items: flex-start;
  }
  .responsive-table .row-actions {
    justify-content: flex-start;
  }
}
@container (max-width: 380px) {
  .responsive-table tbody tr {
    gap: 12px;
  }
  .responsive-table .badge {
    height: auto;
    min-height: 22px;
    white-space: normal;
  }
}
@media (max-width: 1180px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpis-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .sidebar-close {
    display: inline-grid;
    position: absolute;
    right: 0;
    top: -3px;
  }
  .sidebar {
    width: min(288px, calc(100% - 40px));
  }
  .nav-item {
    min-height: 42px;
  }
}
@media (max-width: 640px) {
  .overview-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
  .overview-kpis .balance-card {
    display: flex;
  }
  .balance-card .balance-details {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 12px 0 0;
    margin-top: 4px;
  }
  .kpis-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpis-5 > :first-child {
    display: flex;
  }
  .kpis-5 > :first-child .kpi-foot {
    width: 100%;
  }
  .kpis-5 .kpi {
    padding: 16px;
  }
  .kpi-value {
    font-size: 23px;
  }
  .toolbar > .field-select {
    flex: 1 1 160px;
    width: auto;
    max-width: none;
  }
  .toolbar > .toolbar-end {
    width: auto;
    margin-left: auto;
  }
  .filter-extra > .field-control,
  .filter-extra > .control {
    flex-basis: 100%;
  }
  .btn {
    height: auto;
    min-height: 36px;
    padding-top: 7px;
    padding-bottom: 7px;
    white-space: normal;
    text-align: center;
  }
  .btn-sm {
    min-height: 34px;
  }
  .page-actions .btn {
    flex: 1 1 130px;
  }
  .dialog-footer .btn,
  .form-actions .btn {
    flex: 1 1 120px;
  }
  .toast {
    margin: 0;
  }
  .dialog-header {
    padding: 14px 16px;
  }
  .dialog-body {
    padding: 16px;
  }
  .dialog-footer {
    bottom: -16px;
    padding-bottom: 16px;
    margin-bottom: -16px;
  }
  .status-pill {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .incoming-chart {
    overflow: hidden;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .withdrawal-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Portal do cliente: o mesmo agrupamento visual da página de integração. */
.portal-section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.portal-section-header h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.portal-section-header h2 > .icon {
  color: var(--muted);
}
.portal-section-header > .tag {
  flex-shrink: 0;
}
.portal-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.portal-icon > .icon {
  width: 19px;
  height: 19px;
}
.portal-panel-footnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  color: var(--faint);
}
.portal-panel-footnote > .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}
.portal-panel-footnote p {
  color: inherit;
  font-size: 12px;
  line-height: 1.6;
}
.account-balance,
.account-balance-main {
  display: flex;
  align-items: center;
}
.account-balance {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px;
}
.account-balance-main {
  gap: 16px;
  min-width: 0;
}
.account-balance-main > div {
  min-width: 0;
}
.account-balance .portal-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}
.account-balance .kpi-label {
  margin-bottom: 6px;
}
.account-balance .kpi-value {
  font-size: clamp(28px, 2.8vw, 36px);
  line-height: 1.25;
  margin-bottom: 4px;
}
.account-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.account-metric {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px;
}
.account-metric + .account-metric {
  border-left: 1px solid var(--border);
}
.account-metric .kpi-label {
  margin: 0;
  font-size: 12px;
}
.account-metric .kpi-value {
  font-size: clamp(18px, 1.8vw, 25px);
}
.account-metric .kpi-foot {
  font-size: 11.5px;
  line-height: 1.6;
}
.account-metrics-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
button.account-metric {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background 0.15s;
}
button.account-metric + .account-metric,
.account-metric + button.account-metric {
  border-left: 1px solid var(--border);
}
button.account-metric:hover {
  background: var(--surface-2);
}
button.account-metric:focus-visible {
  outline-offset: -3px;
}
.receipts-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.receipts-total > span {
  color: var(--faint);
  font-size: 11px;
}
.receipts-total > strong {
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.portal-receipts > .card-body {
  padding: 24px;
}
#receipts-empty {
  margin-bottom: 16px;
}
.portal-list > .toolbar {
  padding: 16px 24px;
  background: var(--bg);
}
.portal-list .pagination {
  padding-left: 24px;
  padding-right: 24px;
}
.portal-list .empty {
  min-height: 208px;
  margin: 24px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.portal-list .empty .empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 0 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.portal-list .empty > span:last-child {
  max-width: 340px;
  line-height: 1.65;
}
.withdrawal-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
}
.withdrawal-workspace > form {
  min-width: 0;
  padding: 24px;
  gap: 20px;
  align-self: start;
}
.withdrawal-workspace .withdrawal-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
}
.withdrawal-workspace .withdrawal-fields > .field:last-child {
  grid-column: 1 / -1;
}
.withdrawal-quote {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.withdrawal-workspace .withdrawal-footer {
  justify-content: flex-end;
}
.withdrawal-workspace .withdrawal-footer .form-actions {
  flex-wrap: wrap;
  margin: 0;
}
.withdrawal-composer > .portal-section-header .available {
  padding: 9px 12px;
  gap: 16px;
  background: var(--bg);
}
.withdrawal-composer .available > span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.withdrawal-workspace .withdrawal-guide {
  padding: 24px;
  border-top: 0;
  border-left: 1px solid var(--border);
  background: var(--bg);
}
.withdrawal-guide h3 {
  margin-bottom: 5px;
}
.withdrawal-workspace .steps {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
}
.withdrawal-processing {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.withdrawal-processing > .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}
.portal-fees > .fees-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.portal-fees .fee-card {
  padding: 28px 24px;
  gap: 28px;
}
.portal-fees .fee-card + .fee-card {
  border-left: 1px solid var(--border);
  background: var(--bg);
}
.portal-fees .fee-heading {
  justify-content: flex-start;
}
.portal-fees .fee-policy {
  margin: auto 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
@media (max-width: 900px) {
  .portal-fees > .fees-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .portal-fees .fee-card + .fee-card {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
.fee-caption {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--faint);
}
.notification-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.notification-guide > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.notification-guide > div:nth-child(2) {
  align-items: center;
  text-align: center;
}
.notification-guide > div:last-child {
  align-items: flex-end;
  text-align: right;
}
.notification-guide-label {
  display: flex;
  align-items: center;
  gap: 9px;
}
.notification-guide strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.notification-guide p {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--faint);
}
.delivery-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.delivery-indicator.delivered {
  background: var(--green);
}
.delivery-indicator.pending {
  background: var(--amber);
}
.delivery-indicator.dead {
  background: var(--red);
}
/* Administrativo: superfícies, divisórias e formulários seguem o portal. */
.admin-balance {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
}
.admin-balance .account-balance {
  align-self: stretch;
}
.admin-balance .balance-details {
  gap: 12px;
  margin: 24px 0;
  padding: 0 24px;
  border-top: 0;
  border-left: 1px solid var(--border);
}
.admin-metric-summary > .account-metrics {
  border-top: 0;
}
.admin-view .account-metric > .hint {
  line-height: 1.7;
}
.admin-view .financial-summary {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.admin-view .financial-metric {
  padding: 24px;
}
.admin-view .financial-result {
  border-radius: 0;
}
.admin-view .financial-footer {
  padding: 16px 24px;
}
.admin-view .financial-empty {
  padding: 24px;
}
.admin-operation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-operation {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: inherit;
  font: inherit;
  text-align: left;
}
.admin-operation + .admin-operation {
  border-left: 1px solid var(--border);
}
.admin-operation h3,
.admin-operation-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
}
.admin-operation .icon {
  color: var(--muted);
}
.admin-operation .mini-stats {
  margin-top: auto;
}
button.admin-operation:hover {
  background: var(--surface-2);
}
button.admin-operation:focus-visible {
  outline-offset: -3px;
}
.admin-form > .card-header p {
  color: var(--muted);
  line-height: 1.65;
}
.admin-page-intro {
  margin-bottom: 24px;
}
.admin-page-intro h1 {
  margin-bottom: 8px;
  font-size: 26px;
}
.admin-page-intro p {
  color: var(--muted);
}
.admin-preferences {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin-section-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 24px;
}
.admin-section-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.admin-section-tab:hover,
.admin-section-tab[aria-selected='true'] {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.admin-section-tab[aria-selected='true'] {
  font-weight: 600;
}
.admin-section-content,
.admin-settings-panel {
  min-width: 0;
}
.admin-settings-panel > .alert {
  margin: 0;
}
.admin-settings-panel .admin-settings-sections {
  grid-template-columns: minmax(0, 1fr);
}
.admin-settings-panel .admin-settings-sections > section + section {
  border-left: 0;
  border-top: 1px solid var(--border);
}
@media (max-width: 1000px) {
  .admin-preferences {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .admin-section-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-section-tab {
    padding: 10px 12px;
  }
}
.admin-form-body {
  padding: 24px;
  gap: 20px;
}
.admin-form-body > .form-actions {
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.admin-default-settings {
  grid-column: 1 / -1;
}
.admin-settings-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-settings-sections > section {
  min-width: 0;
  padding: 24px;
  gap: 20px;
}
.admin-settings-sections > section + section {
  border-left: 1px solid var(--border);
  background: var(--bg);
}
.admin-form-footer {
  margin: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.admin-view .integration-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-view .incoming-panels > .card > .card-header + div,
.admin-view .portal-section-header + .card-body {
  padding-top: 24px;
}
@media (max-width: 1180px) {
  .admin-view .account-metrics-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-view .account-metrics-3 > .account-metric:nth-child(n) {
    border-top: 0;
    border-left: 1px solid var(--border);
  }
  .admin-view .account-metrics-3 > .account-metric:first-child {
    border-left: 0;
  }
  .admin-view .account-metrics-4 > .account-metric:nth-child(odd) {
    border-left: 0;
  }
  .admin-operation-grid,
  .admin-view .integration-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-operation + .admin-operation {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 760px) {
  .admin-balance,
  .admin-settings-sections {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-balance .balance-details {
    margin: 0 24px 24px;
    padding: 20px 0 0;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .admin-settings-sections > section + section {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 640px) {
  .admin-view .account-metrics-3,
  .admin-view .account-metrics-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-view .account-metrics > .account-metric:nth-child(n) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .admin-view .account-metrics > .account-metric:first-child {
    border-top: 0;
  }
  .admin-view .financial-metric,
  .admin-view .financial-empty,
  .admin-form-body,
  .admin-operation,
  .admin-settings-sections > section {
    padding: 20px 16px;
  }
  .admin-form-footer,
  .admin-view .financial-footer {
    padding: 16px;
  }
  .admin-balance .balance-details {
    margin-left: 16px;
    margin-right: 16px;
  }
}

.docs-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.docs-content section,
.docs-section,
.docs-content .page-header {
  scroll-margin-top: 88px;
}
.docs-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
}
.docs-intro > div {
  min-width: 0;
  padding: 24px;
}
.docs-intro > div + div {
  border-left: 1px solid var(--border);
  background: var(--bg);
}
.docs-caption {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--faint);
}
.docs-intro strong,
.docs-intro code {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.docs-intro p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.65;
}
.docs-body {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 13px;
  line-height: 1.75;
}
.docs-body p {
  overflow-wrap: anywhere;
}
.docs-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--text-2);
}
.docs-code {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}
.docs-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.docs-code-header strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.docs-code pre {
  border: 0;
  border-radius: 0;
  padding: 16px;
  font-size: 12px;
  line-height: 1.8;
  word-break: normal;
  overflow-wrap: anywhere;
}
.docs-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.docs-callout > .icon {
  margin-top: 4px;
  color: var(--faint);
}
.docs-body table th,
.docs-body table td {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .docs-intro {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-intro > div + div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 640px) {
  .docs-intro > div,
  .docs-body {
    padding: 20px 16px;
  }
}
@media (max-width: 1180px) {
  .account-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-metric:nth-child(odd) {
    border-left: 0;
  }
  .account-metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
  .withdrawal-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .withdrawal-workspace .withdrawal-guide {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 640px) {
  .portal-section-header,
  .account-balance,
  .portal-receipts > .card-body,
  .withdrawal-workspace > form,
  .withdrawal-workspace .withdrawal-guide,
  .portal-fees .fee-card {
    padding: 20px 16px;
  }
  .account-balance-main {
    gap: 12px;
  }
  .account-balance > .btn {
    width: 100%;
  }
  .account-metric {
    padding: 18px 16px;
  }
  .account-metric .kpi-label {
    align-items: flex-start;
    line-height: 1.5;
  }
  .portal-list > .toolbar,
  .portal-list .pagination,
  .portal-panel-footnote {
    padding-left: 16px;
    padding-right: 16px;
  }
  .portal-list .empty {
    margin: 16px;
  }
  .withdrawal-workspace .withdrawal-fields,
  .notification-guide {
    grid-template-columns: minmax(0, 1fr);
  }
  .withdrawal-workspace .withdrawal-footer .form-actions,
  .withdrawal-composer > .portal-section-header .available {
    width: 100%;
  }
  .notification-guide {
    gap: 16px;
    padding: 20px 16px;
  }
  .notification-guide > div:nth-child(n) {
    align-items: flex-start;
    text-align: left;
  }
}
/* Comprovante: a arte branca permanece legível em qualquer tema e na impressão. */
dialog.withdrawal-receipt-dialog {
  width: min(560px, calc(100vw - 24px));
}
.withdrawal-receipt-dialog .receipt-preview {
  background: #fff;
  padding: 24px;
}
.receipt-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}
.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
@media (max-width: 540px) {
  .withdrawal-receipt-dialog .receipt-preview {
    padding: 10px;
  }
  .receipt-actions > .btn {
    width: 100%;
  }
}
@media print {
  body.printing-withdrawal-receipt > :not(#withdrawal-receipt-dialog) {
    display: none !important;
  }
  body.printing-withdrawal-receipt {
    background: white;
    margin: 0;
    min-height: 0;
    overflow: visible;
  }
  body.printing-withdrawal-receipt #withdrawal-receipt-dialog {
    clip-path: none !important;
    filter: none !important;
    opacity: 1;
    position: static !important;
    display: block !important;
    overflow: visible !important;
    width: 130mm;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin: 0 auto;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  body.printing-withdrawal-receipt #withdrawal-receipt-dialog::backdrop {
    background: transparent;
  }
  body.printing-withdrawal-receipt #withdrawal-receipt-dialog::before {
    display: none;
  }
  body.printing-withdrawal-receipt .withdrawal-receipt-dialog > :not(.receipt-preview) {
    display: none;
  }
  body.printing-withdrawal-receipt .withdrawal-receipt-dialog .receipt-preview {
    display: block;
    overflow: visible;
    padding: 0;
    background: white;
    max-height: none;
  }
  body.printing-withdrawal-receipt .receipt-preview img {
    box-shadow: none;
    border-radius: 0;
    max-height: 260mm;
    object-fit: contain;
    object-position: top;
  }
}

#med-history p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 42rem;
}
#med-default-fee {
  white-space: nowrap;
}
