:root {
  --bg: #ffffff;
  --card: #f8fafc;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #3d9cf5;
  --accent-d: #256bb5;
  --danger: #e85d5d;
  --ok: #4ade80;
  --border: #e2e8f0;
  --radius: 12px;
  /* Referência UI: card branco sobre fundo branco */
  --ref-border: #e5e7eb;
  --ref-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --ref-radius: 12px;
  --ref-input-radius: 8px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

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

.page-public {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.card-shell {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--ref-border);
  border-radius: var(--ref-radius);
  padding: 2rem;
  box-shadow: var(--ref-shadow);
}
.card-shell.wide { max-width: 640px; }

.logo-wrap {
  text-align: center;
  margin-bottom: 1.25rem;
}
.logo-wrap img {
  max-height: 72px;
  max-width: 100%;
  object-fit: contain;
}

h1 { font-size: 1.5rem; margin: 0 0 .5rem; font-weight: 600; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .75rem; color: #334155; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }

.muted { color: var(--muted); font-size: .95rem; }
.small { font-size: .85rem; }

.form-stack label {
  display: block;
  margin-bottom: 1rem;
  font-size: .9rem;
  color: var(--muted);
}
.form-stack input,
.form-inline input,
.form-inline select,
select {
  width: 100%;
  max-width: 280px;
  margin-top: .35rem;
  padding: .65rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.form-inline.wrap { align-items: flex-end; }
.form-inline.tight input { max-width: 140px; }
.form-inline label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }

.btn {
  display: inline-block;
  padding: .65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-size: .95rem;
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-d));
  border-color: #4fa8ff;
  color: #ffffff;
  font-weight: 600;
}
.btn.ghost { background: transparent; }
.btn.danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn.small { padding: .4rem .65rem; font-size: .8rem; }

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.table thead th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}
.table th, .table td {
  padding: .6rem .5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table .right { text-align: right; }
.table tfoot th { border-top: 2px solid var(--border); }

.qr-block { margin-top: 1.5rem; text-align: center; }
.qr-img { max-width: 260px; height: auto; border-radius: 8px; background: #fff; padding: .5rem; }
.qr-emv-host { display: inline-block; margin: 0 auto; }
.qr-emv-host img, .qr-emv-host canvas { max-width: 260px; height: auto !important; border-radius: 8px; background: #fff; padding: .5rem; }

.pix-copy-block { margin-top: 1.25rem; text-align: left; max-width: 100%; }
.pix-copy-label { margin-bottom: .35rem; }
.pix-copy-row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.pix-copy-input {
  flex: 1;
  min-width: 0;
  padding: .55rem .65rem;
  border-radius: var(--ref-input-radius);
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: .72rem;
  font-family: ui-monospace, monospace;
  color: var(--text);
}

.actions { margin-top: 1rem; }

/* Portal de Custas — /pagamento.php */
.page-pagamento-portal {
  background: #f5f6f8;
}
.page-pagamento-portal .card-shell.portal-pagamento {
  max-width: 720px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 1.75rem 1.25rem 2.5rem;
}
.portal-pagamento__header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.portal-pagamento__logo {
  max-height: 72px;
  max-width: min(100%, 320px);
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.75rem;
}
.portal-pagamento__subtitle {
  margin: 0;
  font-size: 1rem;
  color: #64748b;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.portal-pagamento__rule {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1.25rem 0 0;
}

.portal-info-box {
  background: #e8eef5;
  border-radius: 10px;
  border: 1px solid #d1dae6;
  border-left: 4px solid #2563eb;
  padding: 0;
  overflow: hidden;
  margin-bottom: 2rem;
}
.portal-info-box__title {
  margin: 0;
  padding: 1rem 1.25rem 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
  text-align: center;
}
.portal-info-rows {
  margin: 0;
  padding: 0 1rem 0.5rem;
}
.portal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid #cfd8e6;
  font-size: 0.95rem;
}
.portal-info-row:last-child {
  border-bottom: none;
}
.portal-info-row dt {
  margin: 0;
  font-weight: 600;
  color: #475569;
  flex: 0 0 auto;
}
.portal-info-row dd {
  margin: 0;
  text-align: right;
  color: #1e293b;
  word-break: break-word;
}
.portal-info-row--receber dd {
  color: #15803d;
  font-weight: 600;
}
.portal-info-row--total dd {
  color: #b91c1c;
  font-weight: 700;
  font-size: 1.15rem;
}

.portal-qr-section {
  text-align: center;
  margin-top: 0.5rem;
}
.portal-qr-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}
.portal-qr-section__hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #64748b;
}
.portal-qr-wrap {
  display: flex;
  justify-content: center;
  min-height: 2rem;
}
.portal-qr-section__notice {
  margin: 0.75rem auto 0;
  max-width: 38rem;
  line-height: 1.45;
  font-size: 0.88rem;
  color: #334155;
  text-align: left;
}
.portal-qr-section__notice-attention {
  color: #b91c1c;
  font-weight: 700;
}
.portal-pay-wait:not([hidden]) + .portal-qr-section__notice {
  margin-top: 0.65rem;
}
/* QR sem “caixa” branca — alinha ao fundo da página */
.page-pagamento-portal .portal-qr-wrap .qr-img,
.page-pagamento-portal .portal-qr-wrap .qr-emv-host canvas {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0;
  box-shadow: none;
}
.page-pagamento-portal .portal-qr-wrap .qr-emv-host {
  background: transparent;
  padding: 0;
  line-height: 0;
}

.portal-qr-section .tx-status-line {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
  min-height: 1.2em;
}

.portal-pix-block {
  margin-top: 1rem;
  width: 100%;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.portal-pix-block__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.portal-pix-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  flex-wrap: nowrap;
}
.portal-pix-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-pix-copy.btn {
  flex-shrink: 0;
  align-self: stretch;
  background: linear-gradient(180deg, #3b9eff, #2563eb);
  border-color: #1d4ed8;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.portal-pix-copy.btn:hover {
  filter: brightness(1.05);
}
.portal-actions-muted {
  margin-top: 1rem;
  text-align: center;
}
.portal-empty-msg {
  padding: 1rem;
  text-align: center;
  color: #64748b;
}
.portal-pay-wait {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ca8a04;
}
.portal-pay-fail {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  text-align: center;
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
  border-radius: 8px;
}

/* Modal — pagamento confirmado */
.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}
.portal-modal[hidden] {
  display: none !important;
}
.portal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
.portal-modal__dialog {
  position: relative;
  z-index: 1;
  max-width: 22rem;
  width: 100%;
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.portal-modal__logo {
  display: block;
  margin: 0 auto 1rem;
  width: auto;
  max-width: 10.5rem;
  max-height: 2.5rem;
  height: auto;
  object-fit: contain;
}
.portal-modal__headline {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.portal-modal__sub {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.45;
  min-height: 1.45em;
}
.portal-modal__spinner {
  margin: 1.25rem auto 0;
  width: 2rem;
  height: 2rem;
  border: 3px solid #e2e8f0;
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: portal-modal-spin 0.75s linear infinite;
}
.portal-modal__spinner[hidden] {
  display: none;
}
@keyframes portal-modal-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Admin — layout com sidebar */
.page-admin {
  min-height: 100vh;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.admin-sidebar {
  width: 15.5rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 16px rgba(15, 23, 42, 0.06);
}

.admin-sidebar-brand {
  padding: 1.35rem 1.25rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.admin-sidebar-brand-logo-link {
  display: block;
  line-height: 0;
  margin-bottom: 0.35rem;
}

.admin-sidebar-brand-img {
  display: block;
  max-height: 2.75rem;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.admin-sidebar-logo {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.admin-sidebar-tag {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 0.2rem;
}

.admin-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow-y: auto;
}

.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-sidebar-nav a:hover {
  color: var(--text);
  background: rgba(61, 156, 245, 0.08);
}

.admin-sidebar-nav a.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(61, 156, 245, 0.22) 0%, rgba(37, 107, 181, 0.12) 100%);
  border: 1px solid rgba(61, 156, 245, 0.35);
  box-shadow: 0 0 0 1px rgba(61, 156, 245, 0.08);
}

.admin-sidebar-ico {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.admin-sidebar-bottom {
  padding: 1rem 1rem 1.15rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.admin-sidebar-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent-d), var(--accent));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-sidebar-user-text {
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: #ffffff;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-sidebar-exit:hover {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}

.admin-main {
  flex: 1;
  min-width: 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.75rem 3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-page-head {
  margin-bottom: 1.75rem;
}

.admin-page-head h1 {
  margin-bottom: 0.35rem;
}

.admin-page-head .muted {
  margin: 0;
  font-size: 0.95rem;
}

/* Dashboard — cards KPI + painéis */
body.page-admin .tabular {
  font-variant-numeric: tabular-nums;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}

.dash-kpi {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  border-radius: var(--ref-radius);
  background: #ffffff;
  border: 1px solid var(--ref-border);
  box-shadow: var(--ref-shadow);
  position: relative;
  overflow: hidden;
}

.dash-kpi-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--ref-input-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--ref-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 1px 2px rgba(0, 0, 0, 0.05);
  color: #6b7280;
}

.dash-kpi-icon svg {
  width: 1.45rem;
  height: 1.45rem;
}

.dash-kpi--clients .dash-kpi-icon,
.dash-kpi--pix .dash-kpi-icon,
.dash-kpi--receber .dash-kpi-icon,
.dash-kpi--money .dash-kpi-icon {
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  color: #4b5563;
}

.dash-kpi-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dash-kpi-value {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

.dash-kpi-label {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.dash-panel {
  background: #ffffff;
  border: 1px solid var(--ref-border);
  border-radius: var(--ref-radius);
  box-shadow: var(--ref-shadow);
  overflow: hidden;
  min-width: 0;
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--ref-border);
  background: #ffffff;
}

.dash-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.dash-panel-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-d);
  text-decoration: none;
  white-space: nowrap;
}

.dash-panel-link:hover {
  text-decoration: underline;
}

.dash-panel-body {
  padding: 0;
}

.dash-empty {
  margin: 0;
  padding: 1.5rem 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.dash-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.dash-table th,
.dash-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--ref-border);
  vertical-align: middle;
}

.dash-table .right {
  text-align: right;
}

.dash-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fafafa;
  border-bottom: 1px solid var(--ref-border);
}

.dash-table tbody tr:last-child td {
  border-bottom: none;
}

.dash-table tbody tr:hover td {
  background: #fafafa;
}

.dash-col-date {
  white-space: nowrap;
  font-size: 0.82rem;
}

.dash-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #f1f5f9;
  color: #475569;
}

.dash-badge--ok {
  background: #ecfdf5;
  color: #047857;
}

.dash-badge--pending {
  background: #fffbeb;
  color: #b45309;
}

.dash-badge--fail {
  background: #fef2f2;
  color: #b91c1c;
}

@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
    min-height: 0;
  }

  .admin-sidebar {
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 50;
    max-height: none;
  }

  .admin-sidebar-brand {
    flex: 0 0 auto;
    width: 100%;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .admin-sidebar-nav {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding: 0.55rem 0.75rem;
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    min-height: 0;
  }

  .admin-sidebar-nav a {
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
    padding: 0.55rem 0.8rem;
    font-size: 0.82rem;
  }

  .admin-sidebar-nav a span {
    white-space: nowrap;
  }

  .admin-sidebar-bottom {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 0.85rem;
    gap: 0.65rem;
    border-top: 1px solid var(--border);
    flex-wrap: nowrap;
  }

  .admin-sidebar-user {
    flex: 1 1 auto;
    min-width: 0;
  }

  .admin-sidebar-exit {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .admin-main {
    padding: 1rem 0.85rem 2rem;
    overflow-x: auto;
  }

  body.page-admin .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-admin .form-inline label,
  body.page-admin .form-inline input,
  body.page-admin .form-inline select {
    max-width: 100%;
  }

  body.page-admin .form-inline .btn {
    align-self: flex-start;
  }

  /* Formulários compactos em células de tabela: manter em linha */
  body.page-admin td .form-inline.tight {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
  }

  body.page-admin td .form-inline.tight input {
    max-width: 140px;
  }

  .dashboard-kpis {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .dash-kpi {
    padding: 1.1rem 1.15rem;
  }
}

.panel {
  background: #ffffff;
  border: 1px solid var(--ref-border);
  border-radius: var(--ref-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--ref-shadow);
}
.panel h2 { margin-top: 0; }

.client-valor-row td {
  padding: 0;
  border-bottom: 1px solid var(--ref-border, #e5e7eb);
  background: #f8fafc;
}
.client-valor-card {
  margin: 0.5rem 0.75rem 1rem;
  padding: 1rem 1.1rem;
  background: #ffffff;
  border: 1px solid var(--ref-border, #e5e7eb);
  border-radius: var(--ref-radius, 12px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.client-valor-card__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}
.client-valor-form .client-valor-label select,
.client-valor-form .client-valor-label input {
  max-width: 200px;
}
.client-valor-form .client-valor-label input[type="text"] {
  max-width: 120px;
}
.client-novo-form .client-valor-card--novo {
  margin-top: 1rem;
}
.client-valor-hint {
  margin: 0 0 0.75rem;
  max-width: 42rem;
}
.client-novo-actions {
  margin: 1rem 0 0;
}

.client-novo-main {
  align-items: flex-end;
  margin-bottom: 0.25rem;
}
/* Novo cliente: CPF, nome, taxas e valores na mesma linha (estilo form-inline) */
.client-novo-one-row {
  align-items: flex-end;
  gap: 0.65rem;
}
.client-novo-one-row--spaced {
  margin-top: 1rem;
}
.client-inline-combo-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 14rem;
}
.client-picker {
  display: block;
  width: 100%;
  min-width: 9rem;
  margin-top: 0.35rem;
}
.client-picker-display {
  width: 100%;
  max-width: none;
  margin-top: 0;
  box-sizing: border-box;
  cursor: pointer;
  background: #ffffff;
}
.client-picker-display:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}
.client-picker-display:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}
.client-valores-receber-field {
  display: flex;
  flex-direction: column;
  max-width: 12rem;
}
.client-valores-receber-field .client-valores-receber-title {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #334155;
}
.client-novo-valor {
  max-width: 7.5rem;
}

/* Modal escolha taxa / a receber */
.client-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.client-picker-modal[hidden] {
  display: none !important;
}
.client-picker-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.client-picker-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  max-height: min(85vh, 32rem);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  padding: 1.1rem 1.15rem 1rem;
  border: 1px solid var(--ref-border, #e5e7eb);
}
.client-picker-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}
.client-picker-modal__search {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--ref-border, #e5e7eb);
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
  box-sizing: border-box;
}
.client-picker-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--ref-border, #e5e7eb);
  border-radius: 8px;
  background: #fafafa;
}
.client-picker-modal__list li {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}
.client-picker-modal__list li:last-child {
  border-bottom: none;
}
.client-picker-modal__list li:hover {
  background: #eff6ff;
  color: #1e40af;
}
.client-picker-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ref-border, #e5e7eb);
}
.client-taxas-details {
  margin-top: 0.5rem;
  border: 1px solid var(--ref-border, #e5e7eb);
  border-radius: var(--ref-radius, 12px);
  background: #f8fafc;
}
.client-taxas-details[open] {
  background: #ffffff;
}
.client-taxas-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #2563eb;
  user-select: none;
}
.client-taxas-summary::-webkit-details-marker {
  display: none;
}
.client-taxas-inner {
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid var(--ref-border, #e5e7eb);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-clientes {
  min-width: 720px;
}

.preview-logo { max-height: 80px; max-width: 240px; object-fit: contain; }
.nowrap { white-space: nowrap; }
code { font-size: .85em; background: #f1f5f9; color: #475569; padding: .1rem .35rem; border-radius: 4px; }

/* Login — fundo cinza claro, card cinza médio, campos CPF/data brancos (referência portal) */
body.page-login {
  margin: 0;
  min-height: 100vh;
  background: #f2f2f2;
  color: #1f2937;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, Helvetica, sans-serif;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2.5rem, 10vh, 5.5rem) 1rem 2rem;
  box-sizing: border-box;
}

body.page-login .login-layout {
  width: 100%;
  max-width: 16.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

body.page-login .login-page-brand {
  text-align: center;
  margin: 0;
  width: 100%;
  background: transparent;
}

body.page-login .login-logo-top {
  display: block;
  margin: 0 auto;
  max-width: min(100%, 260px);
  width: auto;
  height: auto;
  max-height: 3.25rem;
  object-fit: contain;
  background: transparent;
}

body.page-login .login-brand-extra {
  display: block;
  margin: 1rem auto 0;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 12rem;
  object-fit: contain;
}

body.page-login .login-card {
  width: 100%;
  max-width: 15.5rem;
  margin: 0 auto;
  background: #eaeaea;
  border: 1px solid #d4d4d4;
  border-radius: var(--ref-radius);
  padding: 1.25rem 1.15rem 1.4rem;
  text-align: center;
  box-shadow:
    0 3px 14px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.08);
}

body.page-login .login-fieldset-main {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

body.page-login .login-fieldset-main .titulo {
  display: block;
  margin: 0 0 1.1rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

body.page-login .login-alert {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--ref-input-radius);
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  margin: 0 0 1rem;
  text-align: center;
}

body.page-login .login-card-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
}

body.page-login .div-espaco {
  text-align: center;
  width: 100%;
  margin-bottom: 0.95rem;
}

body.page-login .usuario,
body.page-login .label-senha {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  color: #1a1a1a;
  margin-bottom: 0.4rem;
}

body.page-login .campo {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--ref-input-radius);
  background: #ffffff;
  color: #111827;
  font-size: 0.8125rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.page-login .campo::placeholder {
  color: #a0aec0;
}

body.page-login .campo:focus {
  outline: none;
  border-color: #c4c4c4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 0 2px rgba(255, 255, 255, 0.5);
}

body.page-login .btn-login {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.75rem;
  margin: 0.45rem 0 0;
  padding: 0.25rem 0 0;
  list-style: none;
}

body.page-login .btn-login li {
  margin: 0;
  padding: 0;
}

body.page-login .login-circle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: #4b5563;
}

body.page-login .login-circle-btn:hover .login-circle {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 4px 10px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.06);
  border-color: #d1d5db;
}

body.page-login .login-circle-btn:active .login-circle {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.05);
  transform: scale(0.98);
}

body.page-login .login-circle {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 2px 6px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

/* Entrar / Voltar: imagem ocupa todo o círculo */
body.page-login .btn-entrar .login-circle,
body.page-login .btn-voltar .login-circle {
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

body.page-login .btn-entrar .login-circle-icon-img,
body.page-login .btn-voltar .login-circle-icon-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}

body.page-login .login-circle-caption {
  font-size: 0.7rem;
  font-weight: 500;
  color: #4a4a4a;
}

/* Rodapé fixo (referência: barra cinza + filete vermelho) */
body.has-site-footer {
  padding-bottom: 3rem;
}

.site-footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #444444;
  border-top: 2px solid #8b0000;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.75rem;
  padding: 0.6rem 1rem 0.65rem;
  text-align: left;
  box-sizing: border-box;
}

.site-footer-bar__text {
  display: block;
  line-height: 1.45;
}

/* Modal carregamento login */
body.page-login .login-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(30, 30, 30, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.page-login .login-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

body.page-login .login-modal-box {
  width: 100%;
  max-width: 17.5rem;
  background: #ffffff;
  border: 1px solid var(--ref-border);
  border-radius: var(--ref-radius);
  padding: 1.35rem 1.25rem 1.5rem;
  text-align: center;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

body.page-login .login-modal-spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.85rem;
  border: 3px solid #c8c8c8;
  border-top-color: #424242;
  border-radius: 50%;
  animation: login-modal-spin 0.75s linear infinite;
}

@keyframes login-modal-spin {
  to {
    transform: rotate(360deg);
  }
}

body.page-login .login-modal-title {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #222;
}

body.page-login .login-modal-text {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #444;
  line-height: 1.4;
  min-height: 2.6em;
}
