@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg-deep: #0a0e1a;
  --bg-base: #0f1729;
  --bg-card: #151d30;
  --bg-card-hover: #1a2540;
  --bg-elevated: #1e2a45;
  --accent: #f45419;
  --accent-hover: #d43e0f;
  --accent-pressed: #b83409;
  --accent-glow: rgba(244, 84, 25, 0.15);
  --accent-gradient: linear-gradient(135deg, #f45419 0%, #ff7a3d 100%);
  --text-primary: #f0f1f3;
  --text-secondary: #8892a6;
  --text-dim: #505a6e;
  --border: #1c2540;
  --border-light: #253050;
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Input tokens */
  --input-bg: var(--bg-card);
  --input-bg-disabled: var(--bg-deep);
  --input-border: var(--border-light);
  --input-border-focus: var(--accent);
  --input-border-error: var(--error);
  --input-border-success: var(--success);
  --input-text: var(--text-primary);
  --input-placeholder: var(--text-dim);
  --input-label: var(--text-secondary);
  --input-radius: var(--radius-sm);
  --input-height: 38px;
  --input-font-size: 13px;

  /* Mapeamento dash-canvas-v2 → tokens */
  --dcv2-bg-deep: var(--bg-deep);
  --dcv2-bg-base: var(--bg-base);
  --dcv2-bg-card: var(--bg-card);
  --dcv2-bg-card-hover: var(--bg-card-hover);
  --dcv2-bg-elevated: var(--bg-elevated);
  --dcv2-accent: var(--accent);
  --dcv2-accent-glow: var(--accent-glow);
  --dcv2-text-primary: var(--text-primary);
  --dcv2-text-secondary: var(--text-secondary);
  --dcv2-text-dim: var(--text-dim);
  --dcv2-border: var(--border);
  --dcv2-border-light: var(--border-light);
  --dcv2-success: var(--success);
  --dcv2-success-bg: var(--success-bg);
  --dcv2-error: var(--error);
  --dcv2-error-bg: var(--error-bg);
  --dcv2-warning: var(--warning);
  --dcv2-warning-bg: var(--warning-bg);
  --dcv2-info: var(--info);
  --dcv2-info-bg: var(--info-bg);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; height: 100vh; }

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ========== TOPBAR ========== */
.topbar {
  height: 48px;
  background: var(--bg-base);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.topbar::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--accent) 70%, transparent 100%);
  opacity: 0.2;
  pointer-events: none;
}

.topbar-seg {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 0.5px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
  height: 100%;
  position: relative;
}
.topbar-seg:last-child { border-right: none; }

.topbar-seg-grow {
  flex: 1;
  border-right: 0.5px solid var(--border);
}

.topbar-seg-logo {
  width: 260px;
  gap: 10px;
  padding: 0 16px;
  overflow: hidden;
  justify-content: flex-start;
}

.topbar-seg-logo--btn {
  background: none;
  border: none;
  border-right: 0.5px solid var(--border);
  color: inherit;
  font: inherit;
  cursor: pointer;
  height: 100%;
  transition: background 0.15s, width 0.2s ease;
}
.topbar-seg-logo--btn:hover {
  background: var(--bg-card);
}

.topbar-seg-logo--collapsed {
  width: 56px;
  padding: 0;
  justify-content: center;
  gap: 0;
}
.topbar-seg-logo--collapsed .topbar-brand {
  display: none;
}

.topbar-logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.topbar-brand-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1;
}

.topbar-brand-h {
  color: var(--text-primary);
}

.topbar-brand-pay {
  color: var(--accent);
}

.topbar-brand-sub {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-page-accent {
  width: 2px;
  height: 18px;
  background: linear-gradient(180deg, var(--accent), rgba(244, 84, 25, 0.2));
  border-radius: 1px;
  flex-shrink: 0;
}

.topbar-page-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-page-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.topbar-page-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
}

/* Botão theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover {
  color: var(--text-secondary);
  background: var(--bg-card);
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 260px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  transition: width 0.2s ease;
}

.sidebar--collapsed {
  width: 56px;
}

.sidebar--collapsed .sidebar-nav {
  padding: 12px 6px;
}

.sidebar--collapsed .sidebar-nav-section {
  display: none;
}

.sidebar--collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}

.sidebar--collapsed .sidebar-nav-label {
  display: none;
}

.sidebar--collapsed .sidebar-nav-group + .sidebar-nav-group {
  margin-top: 4px;
  padding-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

.sidebar-nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
}

.sidebar-nav-item .material-symbols-outlined {
  font-size: 20px;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.sidebar-nav-group + .sidebar-nav-group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.sidebar-nav-section {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-family: var(--font-sans);
  user-select: none;
}

.sidebar-nav-group--master {
  background: rgba(239, 68, 68, 0.04);
  border-left: 2px solid rgba(239, 68, 68, 0.6);
  padding-left: 4px;
}

.sidebar-nav-group--master .sidebar-nav-section {
  color: #dc2626;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-deep);
  padding: 28px 32px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-container {
  max-width: 1400px;
}

/* Título e subtítulo internos removidos — já exibidos no topbar */
.page-header-left,
.page-header > h1.page-title,
.page-header > p.page-subtitle,
.page-header > div:has(> h1.page-title) { display: none; }

/* Colapsa o page-header quando não restam botões de ação */
.page-header:not(:has(button, .btn)) { display: none; }

.page-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-title { display: none; }
.page-subtitle { display: none; }

/* ========== BUTTONS ========== */

/* Base — estrutura compartilhada */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn .material-symbols-outlined { font-size: 18px; }

/* Primary — ação principal */
.btn--primary,
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  background: var(--accent);
  color: #fff;
  line-height: 1;
}

.btn--primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }

.btn--primary:active:not(:disabled),
.btn-primary:active:not(:disabled) { background: var(--accent-pressed); transform: none; }

.btn--primary:disabled,
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--primary .material-symbols-outlined,
.btn-primary .material-symbols-outlined { font-size: 18px; }

/* Secondary — ação secundária */
.btn--secondary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  line-height: 1;
}

.btn--secondary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); border-color: var(--accent); }

.btn--secondary:disabled,
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--secondary .material-symbols-outlined,
.btn-secondary .material-symbols-outlined { font-size: 18px; }

/* Ghost — ação terciária / inline */
.btn--ghost,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  background: none;
  color: var(--text-secondary);
  line-height: 1;
}

.btn--ghost:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-card); }

.btn--ghost .material-symbols-outlined,
.btn-ghost .material-symbols-outlined { font-size: 16px; }

/* Danger — ação destrutiva */
.btn--danger {
  background: var(--error);
  color: #fff;
  border-color: transparent;
}

.btn--danger:hover:not(:disabled) { background: #dc2626; transform: translateY(-1px); }
.btn--danger:active:not(:disabled) { background: #b91c1c; transform: none; }

/* Success — ação positiva (ghost) */
.btn--success {
  color: var(--success);
  background: none;
}

.btn--success:hover:not(:disabled) { background: var(--success-bg); color: var(--success); }

/* Small */
.btn--sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn--sm .material-symbols-outlined { font-size: 16px; }

/* ========== FILTER BAR ========== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap .search-icon {
  position: absolute;
  left: 10px;
  font-size: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-wrap input {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  padding: 8px 12px 8px 34px;
  outline: none;
  transition: border-color 0.15s;
  min-width: 220px;
}

.search-wrap input::placeholder { color: var(--text-dim); }
.search-wrap input:focus { border-color: var(--accent); }

.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.filter-btn {
  padding: 5px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.filter-btn--active {
  background: var(--accent);
  color: #fff;
}

.filter-btn--active:hover { background: var(--accent-hover); color: #fff; }

/* ========== INPUTS ========== */
.input {
  display: block;
  width: 100%;
  height: var(--input-height);
  padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  color: var(--input-text);
  font-size: var(--input-font-size);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.input::placeholder {
  color: var(--input-placeholder);
}

.input:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input:disabled {
  background: var(--input-bg-disabled);
  color: var(--text-dim);
  cursor: not-allowed;
  opacity: 0.6;
}

.input--error {
  border-color: var(--input-border-error);
}

.input--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.input--success {
  border-color: var(--input-border-success);
}

select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23505a6e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

select.input option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

textarea.input {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

/* ========== FORM STRUCTURE ========== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--input-label);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-error {
  font-size: 12px;
  color: var(--error);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* Aliases para form-input / form-select / form-label usados nas pages */
.form-input,
.form-select {
  display: block;
  width: 100%;
  height: var(--input-height);
  padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  color: var(--input-text);
  font-size: var(--input-font-size);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--input-placeholder); }
.form-input:focus,
.form-select:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input:disabled,
.form-select:disabled { background: var(--input-bg-disabled); color: var(--text-dim); cursor: not-allowed; opacity: 0.6; }

textarea.form-input {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23505a6e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.form-select option { background: var(--bg-elevated); color: var(--text-primary); }

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--input-label);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 6px;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}

.tab-btn {
  padding: 5px 14px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.tab-btn--active {
  background: var(--accent);
  color: #fff;
}

.tab-btn--active:hover { background: var(--accent-hover); color: #fff; }

/* ========== STATES ========== */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text-primary);
  margin: 12px 0 6px;
}

.empty-state p { font-size: 13px; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ========== DASHBOARD ========== */
.dash {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Filtros de período */
.dash-period-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}

.dash-period-btn {
  padding: 6px 16px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.dash-period-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.dash-period-btn--active {
  background: var(--accent);
  color: #fff;
}

.dash-period-btn--active:hover { background: var(--accent-hover); }

/* Stat cards — 3 largos */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 28px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  transition: background 0.15s;
}

.dash-stat:last-child { border-right: none; }
.dash-stat:hover { background: var(--bg-card-hover); }

.dash-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dash-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.dash-stat-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

.dash-stat-change--up   { color: var(--success); }
.dash-stat-change--down { color: var(--error); }
.dash-stat-change--neutral { color: var(--text-dim); }

/* Grade principal */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* Sections */
.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.dash-section-header .material-symbols-outlined {
  font-size: 18px;
  color: var(--accent);
}

.dash-section-header h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.dash-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.dash-error {
  padding: 16px 20px;
  color: var(--error);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Providers */
.dash-providers {
  display: flex;
  flex-direction: column;
}

.dash-provider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.dash-provider:last-child { border-bottom: none; }
.dash-provider:hover { background: var(--bg-card-hover); }

.dash-provider-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-provider-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.dash-provider-latency {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ========== STAT CARD ========== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.stat-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.stat-card-icon .material-symbols-outlined { font-size: 18px; }

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-card-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}

.stat-card-change--up { color: var(--success); }
.stat-card-change--down { color: var(--error); }
.stat-card-change--neutral { color: var(--text-dim); }

.stat-card-change .material-symbols-outlined { font-size: 14px; }

/* ========== BADGE ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--green  { background: var(--success-bg);  color: var(--success); }
.badge--yellow { background: var(--warning-bg);  color: var(--warning); }
.badge--red    { background: var(--error-bg);    color: var(--error); }
.badge--blue   { background: var(--info-bg);     color: var(--info); }
.badge--gray   { background: rgba(80,90,110,0.15); color: var(--text-secondary); }

/* ========== TABLE ========== */
.data-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 0.5px solid var(--border);
}

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

.data-table tbody tr {
  transition: background 0.12s;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
  cursor: pointer;
}

.data-table tbody tr.clickable {
  cursor: pointer;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modal-fade-in 0.15s ease;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: modal-slide-in 0.18s ease;
  overflow: hidden;
}

@keyframes modal-slide-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.modal-close .material-symbols-outlined { font-size: 18px; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ========== GATEWAY ESPECÍFICOS ========== */

/* Grid de stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Badge de ambiente na topbar */
.env-badge {
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.env-badge--sandbox {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.env-badge--live {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ========== API KEY SETUP ========== */

.api-key-setup-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-deep, #0a0e1a);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.api-key-setup-card {
  background: var(--bg-card, #151d30);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 40px 36px;
  width: 420px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.api-key-setup-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.api-key-setup-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-h {
  color: var(--text-primary, #e2e8f0);
}

.brand-pay {
  color: var(--accent, #f45419);
}

.api-key-setup-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  margin: 0;
  letter-spacing: 0.02em;
}

.api-key-setup-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-key-setup-label {
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  font-weight: 500;
}

.api-key-setup-row {
  display: flex;
  gap: 8px;
}

.api-key-setup-input {
  flex: 1;
  background: var(--bg-elevated, #1e2a45);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-primary, #e2e8f0);
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.api-key-setup-input:focus {
  border-color: var(--accent, #f45419);
}

.api-key-setup-input--error {
  border-color: var(--error, #ef4444);
}

.api-key-setup-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.api-key-setup-btn:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.api-key-setup-btn:active:not(:disabled) { background: var(--accent-pressed); transform: none; }
.api-key-setup-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.api-key-setup-error {
  font-size: 12px;
  color: var(--error, #ef4444);
  margin: 0;
}

.api-key-setup-hint {
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
  margin: 0;
  opacity: 0.6;
}

/* Estados genéricos usados nas páginas */
.loading,
.error,
.empty {
  padding: 16px;
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  font-style: italic;
}

.error {
  color: var(--error, #ef4444);
}

/* ─── User Menu (Topbar dropdown) ────────────────────────────── */

.user-menu {
  position: relative;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: var(--text-secondary);
}
.user-avatar-btn:hover,
.user-avatar-btn--active {
  background: var(--bg-elevated);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.user-avatar-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.user-avatar-btn--active .user-avatar-chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 500;
  overflow: hidden;
  animation: dropdown-in 0.12s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}

.user-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-badge-row {
  padding: 0 14px 10px;
}

.user-dropdown-badge {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.user-dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.user-dropdown-item--danger {
  color: var(--error);
}
.user-dropdown-item--danger:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* ─── Login / Signup ──────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-back {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.2s;
  text-decoration: none;
}
.login-back:hover { background: var(--bg-elevated); color: var(--text-primary); }

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  text-align: center;
}

.login-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}

.login-logo-fallback {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-sans);
  align-items: center;
  justify-content: center;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0 0;
  font-family: var(--font-sans);
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Honeypot — invisível para humanos */
.login-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ─── Form ────────────────────────────────────────────────────── */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-sans);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 11px;
  color: var(--text-dim);
  pointer-events: none;
  flex-shrink: 0;
}

.form-input {
  width: 100%;
  height: var(--input-height);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--input-radius);
  color: var(--text-primary);
  font-size: var(--input-font-size);
  font-family: var(--font-sans);
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.form-input--icon {
  padding-left: 36px;
}

.input-icon-wrapper--password .form-input {
  padding-right: 38px;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input::placeholder {
  color: var(--input-placeholder);
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}
.btn-toggle-password:hover { color: var(--text-secondary); background: var(--bg-card-hover); }

.login-forgot {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  align-self: flex-end;
  margin-top: 2px;
  transition: opacity 0.15s;
}
.login-forgot:hover { opacity: 0.8; }

.login-error {
  font-size: 12px;
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0;
}

/* ─── Botão primário ──────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  padding: 0 20px;
  height: 40px;
}
.btn-primary:hover:not(:disabled) { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(244,84,25,0.3); }
.btn-primary:active:not(:disabled) { transform: none; opacity: 1; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary--login {
  width: 100%;
  height: 42px;
  font-size: 14px;
}

/* ─── Legal ───────────────────────────────────────────────────── */

.login-legal {
  font-size: 11px;
  color: var(--text-dim);
  margin: 0;
  text-align: center;
  line-height: 1.6;
}

.login-legal-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-secondary);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}
.login-legal-link:hover { color: var(--text-primary); }

/* ─── OAuth ───────────────────────────────────────────────────── */

.login-oauth-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  height: 38px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-oauth:hover { background: var(--bg-card-hover); border-color: var(--border-light); color: var(--text-primary); }

/* ─── Footer ──────────────────────────────────────────────────── */

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-toggle {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s;
}
.login-toggle:hover { opacity: 0.8; }

/* ─── Input com addon (prefixo/sufixo) ───────────────────────── */

.input-addon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-addon {
  position: absolute;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.input-addon--left  { left: 12px; }
.input-addon--right { right: 12px; }

.input-addon-field {
  width: 100%;
}
.input-addon-field--left  { padding-left: 36px !important; }
.input-addon-field--right { padding-right: 36px !important; }

/* Esconde as setas do input number */
.input-addon-field::-webkit-inner-spin-button,
.input-addon-field::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-addon-field[type=number] { -moz-appearance: textfield; }

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ─── Referências de mercado ──────────────────────────────────── */

.rate-refs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.rate-ref-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-elevated, #1e2a45);
  border: 1px solid var(--border-light, rgba(255,255,255,.06));
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color .15s, background .15s;
  text-align: left;
  width: 100%;
}
.rate-ref-btn:hover {
  border-color: var(--accent, #f45419);
  background: var(--bg-card-hover, #1a2540);
}

.rate-ref-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.rate-ref-values {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rate-ref-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(244,84,25,.12);
  color: var(--accent, #f45419);
}
.rate-ref-tag--dim {
  background: rgba(148,163,184,.1);
  color: var(--text-dim);
}

/* ─── Preview ao vivo ─────────────────────────────────────────── */

.rate-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--bg-elevated, #1e2a45);
  border: 1px solid var(--border-light, rgba(255,255,255,.06));
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
}

.rate-preview-settlement {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(148,163,184,.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ─── Banner informativo InfinitePay ─────────────────────────── */

.ip-cred-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.ip-cred-banner .material-symbols-outlined {
  color: #818cf8;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Provedores ──────────────────────────────────────────────── */

.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light, rgba(255,255,255,.07));
  border-radius: var(--radius, 10px);
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.provider-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent, #f45419);
  transform: translateY(-2px);
}

.provider-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.provider-card-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.provider-card-icon {
  font-size: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.provider-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-card-badges {
  flex-shrink: 0;
}

.provider-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.provider-latency {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Lista de taxas por método */
.provider-rates-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-light, rgba(255,255,255,.06));
}

.provider-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated, #1e2a45);
  font-size: 12px;
}
.provider-rate-row:first-child { border-radius: 5px 5px 0 0; }
.provider-rate-row:last-child  { border-radius: 0 0 5px 5px; }
.provider-rate-row:only-child  { border-radius: 5px; }

.provider-rate-method {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
}

.provider-rate-values {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.provider-rate-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(244,84,25,.1);
  color: var(--accent, #f45419);
  white-space: nowrap;
}
.provider-rate-tag--dim {
  background: rgba(148,163,184,.08);
  color: var(--text-dim);
  font-weight: 400;
}

.provider-rate-empty {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

.provider-card-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light, rgba(255,255,255,.06));
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.provider-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.provider-card:hover .provider-card-actions {
  opacity: 1;
}

.provider-action-btn {
  padding: 4px 6px !important;
  color: var(--text-dim) !important;
}
.provider-action-btn:hover {
  color: var(--text-primary) !important;
}
.provider-action-btn--danger:hover {
  color: var(--danger, #e53e3e) !important;
}

.provider-test-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 10px;
  animation: fadeIn .2s ease;
}
.provider-test-result--green {
  background: rgba(34,197,94,.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,.25);
}
.provider-test-result--yellow {
  background: rgba(234,179,8,.12);
  color: #facc15;
  border: 1px solid rgba(234,179,8,.25);
}
.provider-test-result--red {
  background: rgba(239,68,68,.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.25);
}
.provider-test-result--gray {
  background: rgba(148,163,184,.1);
  color: var(--text-secondary);
  border: 1px solid rgba(148,163,184,.2);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ─── Detail Modal ────────────────────────────────────────────── */

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-label {
  min-width: 90px;
  font-weight: 500;
  color: var(--text-dim);
}

/* Header do provedor no modal de detalhe */
.detail-provider-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,.07));
  margin-bottom: 16px;
}

.detail-provider-logo {
  width: 44px;
  height: 44px;
  background: var(--bg-elevated, #1e2a45);
  border: 1px solid var(--border-light, rgba(255,255,255,.07));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-provider-info {
  flex: 1;
  min-width: 0;
}

.detail-provider-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.detail-provider-id {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono, monospace);
}

.detail-provider-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.detail-latency-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Métodos aceitos */
.detail-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.detail-methods-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.detail-method-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated, #1e2a45);
  border: 1px solid var(--border-light, rgba(255,255,255,.07));
  border-radius: 20px;
  padding: 4px 10px;
}

/* Seção taxas */
.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* Grid de cards de taxa */
.detail-rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.detail-rate-card {
  background: var(--bg-elevated, #1e2a45);
  border: 1px solid var(--border-light, rgba(255,255,255,.07));
  border-radius: 8px;
  padding: 12px;
}

.detail-rate-card--empty {
  opacity: .6;
  border-style: dashed;
}

.detail-rate-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,.06));
}

.detail-rate-method-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-rate-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-rate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.detail-rate-item-label {
  color: var(--text-dim);
}

.detail-rate-item-value {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-rate-item-value--accent {
  color: var(--accent, #f45419);
}

.detail-rate-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(244,84,25,.07);
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 4px;
}

.detail-rate-preview strong {
  color: var(--text-secondary);
  font-size: 12px;
}

.detail-rate-empty-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 0;
  text-align: center;
}

/* ─── Simulação (WhatIfPage) ─────────────────────────────────────────────── */

.sim-page {
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.sim-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tabs */
.sim-tabs-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 12px;
  gap: 4px;
}

.sim-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sim-tab:hover:not(.sim-tab--active) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sim-tab--active {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent-pressed);
  font-weight: 600;
}

/* Cards */
.sim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.sim-card-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Você vende */
.sim-amount-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sim-currency {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.sim-amount-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 40px;
  font-weight: 700;
  color: var(--text-dim);
  font-family: var(--font-sans);
  line-height: 1;
  width: 100%;
  min-width: 0;
}

.sim-amount-input::placeholder { color: var(--text-dim); }

.sim-amount-input::-webkit-outer-spin-button,
.sim-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sim-amount-input[type=number] { -moz-appearance: textfield; }

/* Conector com seta */
.sim-connector {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 0;
  position: relative;
  z-index: 1;
  margin: -1px 0;
}

.sim-arrow-outer {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: 0;
}

.sim-arrow-inner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.sim-arrow-inner .material-symbols-outlined {
  font-size: 20px;
  font-weight: 600;
}

/* Você recebe */
.sim-receive-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.sim-meta {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  padding-top: 2px;
}

.sim-receive-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sim-provider-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.sim-receive-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.sim-taxa-efetiva {
  font-size: 12px;
  color: var(--text-secondary);
  padding-bottom: 4px;
}

/* Sua taxa atual */
.sim-taxa-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-taxa-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.sim-taxa-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  gap: 4px;
  min-width: 120px;
}

.sim-taxa-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-dim);
  font-size: 15px;
  font-family: var(--font-sans);
  width: 70px;
  text-align: right;
}

.sim-taxa-input::placeholder { color: var(--text-dim); }
.sim-taxa-input::-webkit-outer-spin-button,
.sim-taxa-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sim-taxa-input[type=number] { -moz-appearance: textfield; }

.sim-taxa-pct {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Comparativo */
.sim-comparison {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.sim-comparison-label {
  color: var(--text-secondary);
}

.sim-comparison-value {
  font-weight: 600;
  color: var(--text-primary);
}

.sim-comparison-diff {
  background: var(--success-bg);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Espaçamento entre cards com o conector no meio */
.sim-container .sim-card + .sim-connector { margin: 0; }
.sim-container .sim-connector + .sim-card { margin-top: 0; }
.sim-container .sim-card + .sim-card { margin-top: 12px; }

/* Card de seleção de provedor */
.sim-card--provider { margin-bottom: 12px; }

.sim-loading,
.sim-empty {
  font-size: 13px;
  color: var(--text-dim);
  padding: 8px 0;
}

.sim-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.sim-provider-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}

.sim-provider-btn:hover:not(.sim-provider-btn--active) {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
}

.sim-provider-btn--active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.sim-provider-btn-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.sim-provider-btn-fee {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

.sim-provider-btn-settle {
  font-size: 10px;
  color: var(--text-dim);
}

/* Badge de ambiente na seção de roteamento */
.routing-env-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.routing-env-badge--sandbox {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.routing-env-badge--live {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Aviso de modo live */
.routing-live-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
  color: var(--text-secondary);
}

.routing-live-notice .material-symbols-outlined {
  font-size: 20px;
  color: var(--info);
  flex-shrink: 0;
  margin-top: 1px;
}

.routing-live-notice strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
}

.routing-live-notice p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   Pagina Pagamentos (pay-*)
   ═══════════════════════════════════════════════════════════════════ */

/* Layout */
.pay-page { display: flex; justify-content: center; padding: 32px 16px; }
.pay-layout { width: 100%; max-width: 1100px; display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.pay-main { display: flex; flex-direction: column; gap: 0; }

/* Tabs (clone de sim-tabs-bar) */
.pay-tabs { display: flex; align-items: center; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 6px; margin-bottom: 16px; gap: 4px; }
.pay-tab { flex: 1; padding: 10px 12px; border: none; background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; border-radius: var(--radius); cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; font-family: var(--font-sans); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pay-tab:hover:not(.pay-tab--active) { background: var(--bg-elevated); color: var(--text-primary); }
.pay-tab--active { background: var(--accent); color: #fff; font-weight: 600; }
.pay-tab .material-symbols-outlined { font-size: 16px; }

/* Hub tabs (sub-routing visual: secondary nav above pay-* shells) */
.hub-page { display: flex; flex-direction: column; }
.hub-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 0 24px; margin: 0 0 -1px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}
.hub-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 16px; border: none; background: transparent;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; font-family: var(--font-sans);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.hub-tab:hover:not(.hub-tab--active) { color: var(--text-primary); }
.hub-tab--active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.hub-tab .material-symbols-outlined { font-size: 18px; }

/* Cards */
.pay-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 24px; }
.pay-card + .pay-card { margin-top: 12px; }
.pay-card-label { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; }

/* Form */
.pay-form-group { margin-bottom: 16px; }
.pay-form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.3px; }
.pay-form-input { width: 100%; padding: 10px 12px; background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; font-family: var(--font-sans); outline: none; transition: border-color 0.15s; }
.pay-form-input:focus { border-color: var(--accent); }
.pay-form-input:disabled { opacity: 0.6; cursor: not-allowed; }
.pay-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-form-stack { display: flex; flex-direction: column; gap: 16px; }
.pay-form-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--text-secondary); }
.pay-form-error { margin: 0 0 12px; font-size: 13px; color: var(--error); }

/* Options: checkboxes/radios dentro de pay-form-group */
.pay-form-options { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pay-form-options--inline { flex-direction: row; gap: 16px; }
.pay-form-option { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.pay-form-option input[type="checkbox"],
.pay-form-option input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.pay-form-option--disabled { cursor: not-allowed; opacity: 0.6; }

/* Alert inline (avisos dentro de modais/forms) */
.pay-alert { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12px; }
.pay-alert .material-symbols-outlined { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.pay-alert--warning { background: var(--warning-bg); color: var(--warning); }
.pay-alert--error { background: var(--error-bg); color: var(--error); }
.pay-alert--info { background: var(--info-bg); color: var(--info); }

/* Modal actions (footer padrão) */
.pay-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Confirm block (padrão dentro de modais de confirmação) */
.pay-confirm { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 8px 0; }
.pay-confirm-icon { font-size: 48px; }
.pay-confirm-icon--warning { color: var(--warning); }
.pay-confirm-icon--danger { color: var(--error); }
.pay-confirm-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.pay-confirm-list { text-align: left; font-size: 13px; color: var(--text-secondary); line-height: 1.8; list-style: none; padding: 0; margin: 0; }

/* Toggle */
.pay-toggle { width: 40px; height: 22px; border-radius: 11px; position: relative; cursor: pointer; border: none; transition: background 0.2s; flex-shrink: 0; }
.pay-toggle--on { background: var(--accent); }
.pay-toggle--off { background: var(--bg-elevated); }
.pay-toggle-dot { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; transition: left 0.2s; display: block; }
.pay-toggle--on .pay-toggle-dot { left: 21px; }
.pay-toggle--off .pay-toggle-dot { left: 3px; background: var(--text-dim); }

/* Toggle row (seguranca/auditoria) */
.pay-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-elevated); border-radius: var(--radius-sm); }
.pay-toggle-row + .pay-toggle-row { margin-top: 8px; }
.pay-toggle-row-label { font-size: 13px; font-weight: 500; }
.pay-toggle-row-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.pay-toggle-right { display: flex; align-items: center; gap: 8px; }

/* Badge */
.pay-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.pay-badge--green { background: var(--success-bg); color: var(--success); }
.pay-badge--gray { background: rgba(80, 90, 110, 0.2); color: var(--text-dim); }
.pay-badge--yellow { background: var(--warning-bg); color: var(--warning); }

/* Status cards (sidebar resumo) */
.pay-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-status-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 14px; }
.pay-status-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.pay-status-value { font-size: 15px; font-weight: 600; margin-top: 4px; }
.pay-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* Method cards */
.pay-method { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); transition: border-color 0.15s; }
.pay-method--active { border-color: rgba(244, 84, 25, 0.3); }
.pay-method--inactive { opacity: 0.7; }
.pay-method + .pay-method { margin-top: 8px; }
.pay-method-icon { width: 40px; height: 40px; background: var(--bg-elevated); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pay-method-icon .material-symbols-outlined { font-size: 20px; color: var(--accent); }
.pay-method-info { flex: 1; margin-left: 12px; }
.pay-method-name { font-size: 13px; font-weight: 600; }
.pay-method-desc { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.pay-method-right { display: flex; align-items: center; gap: 8px; }

/* Section label (Metodos ativos / disponiveis) */
.pay-section-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; font-weight: 600; }
.pay-section-label + .pay-section-label { margin-top: 20px; }

/* Preview sidebar */
.pay-preview { position: sticky; top: 24px; }
.pay-preview-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; }
.pay-preview-header { padding: 14px 20px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.pay-preview-title { font-size: 13px; font-weight: 600; }
.pay-preview-toggle { display: flex; background: var(--bg-elevated); border-radius: 6px; padding: 2px; gap: 2px; }
.pay-preview-toggle-btn { padding: 4px 10px; font-size: 10px; font-weight: 600; border: none; border-radius: 4px; cursor: pointer; font-family: var(--font-sans); transition: all 0.15s; background: transparent; color: var(--text-dim); }
.pay-preview-toggle-btn--active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.pay-preview-body { padding: 20px; background: #f8fafc; }

/* Checkout mock (dentro do preview) */
.pay-ck-title { text-align: center; font-size: 14px; font-weight: 600; color: #1e293b; }
.pay-ck-amount { text-align: center; font-size: 24px; font-weight: 700; color: #1e293b; margin-top: 4px; }
.pay-ck-tabs { display: flex; gap: 3px; background: #e2e8f0; border-radius: 8px; padding: 3px; margin: 16px 0; }
.pay-ck-tab { flex: 1; text-align: center; padding: 7px; border-radius: 6px; font-size: 11px; font-weight: 500; color: #64748b; }
.pay-ck-tab--active { font-weight: 600; color: #fff; }
.pay-ck-qr { background: #fff; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 20px; text-align: center; }
.pay-ck-qr-box { width: 100px; height: 100px; margin: 0 auto; background: repeating-conic-gradient(#1e293b 0% 25%, #fff 0% 50%) 50% / 10px 10px; border-radius: 4px; }
.pay-ck-qr-label { margin-top: 8px; font-size: 10px; color: #94a3b8; }
.pay-ck-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pay-ck-field { width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 11px; color: #94a3b8; background: #fff; }
.pay-ck-btn { width: 100%; padding: 10px; border: none; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 600; margin-top: 12px; cursor: default; }

/* Color picker */
.pay-color-row { display: flex; gap: 8px; align-items: center; }
.pay-color-swatch { width: 36px; height: 36px; border-radius: var(--radius-sm); border: none; cursor: pointer; }

/* Snippet */
.pay-snippet { background: var(--bg-elevated); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); overflow: auto; white-space: pre-wrap; word-break: break-all; }
.pay-snippet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* Button */
.pay-btn { padding: 10px 20px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-sans); display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s; }
.pay-btn--primary { background: var(--accent); color: #fff; }
.pay-btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.pay-btn--secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-light); }
.pay-btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.pay-btn--danger { background: var(--error); color: #fff; }
.pay-btn--danger:hover:not(:disabled) { background: #dc2626; }
.pay-btn--ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border);
}
.pay-btn .material-symbols-outlined { font-size: 16px; }
.pay-btn:disabled { cursor: default; opacity: 0.55; }

/* Layout full-width (aba Configurações de marca) */
.pay-layout--full { grid-template-columns: 1fr; max-width: 1200px; }

/* Configurações de marca */
.brand-grid { display: grid; grid-template-columns: 320px 1fr; gap: 0; }
.brand-elements { padding: 24px; border-right: 1px solid var(--border-light); }
.brand-preview { padding: 24px; background: var(--bg-card); }
@media (max-width: 900px) {
  .brand-grid { grid-template-columns: 1fr; }
  .brand-elements { border-right: none; border-bottom: 1px solid var(--border-light); }
}

/* Frame de navegador (preview de checkout) — animação mobile↔desktop suave */
.brand-browser-frame {
  width: 820px;
  max-width: 100%;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 22, 40, 0.12), 0 2px 6px rgba(15, 22, 40, 0.06);
  border: 1px solid rgba(15, 22, 40, 0.08);
  overflow: hidden;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              border-radius 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.45s ease;
}
.brand-browser-frame[data-device="mobile"] {
  width: 430px;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(15, 22, 40, 0.14), 0 3px 8px rgba(15, 22, 40, 0.06);
}

/* Viewport que centraliza o iframe do checkout na sua largura natural
   (evita esticar o conteúdo num frame largo). Usado só no modo Hospedado. */
.brand-browser-viewport {
  background: #f6f8fa;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 20px;
  transition: padding 0.45s ease;
}
.brand-browser-frame[data-device="mobile"] .brand-browser-viewport {
  padding: 0;
  background: #ffffff;
}
.brand-browser-viewport .brand-browser-iframe {
  width: 440px;
  max-width: 100%;
  height: 780px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: width 0.45s ease, height 0.45s ease;
}
.brand-browser-frame[data-device="mobile"] .brand-browser-viewport .brand-browser-iframe {
  width: 100%;
  height: 780px;
}

/* Sobrescreve regra base (height: 560px) para o modo hospedado, cujo iframe
   está dentro do viewport — evita regressão caso a base mude. */
.brand-browser-frame .brand-browser-viewport .brand-browser-iframe { height: 780px; }
.brand-browser-frame[data-device="mobile"] .brand-browser-viewport .brand-browser-iframe { height: 780px; }

.brand-browser-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f5f6f8;
  border-bottom: 1px solid rgba(15, 22, 40, 0.06);
  transition: padding 0.45s ease;
}
.brand-browser-frame[data-device="mobile"] .brand-browser-chrome {
  padding: 8px 14px;
  justify-content: center;
}

.brand-browser-dots { display: flex; gap: 6px; }
.brand-browser-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}

.brand-browser-url {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid rgba(15, 22, 40, 0.08);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px;
  color: #525f7f;
  font-family: var(--font-mono);
  max-width: 340px;
  margin: 0 auto;
  transition: max-width 0.45s ease;
}
.brand-browser-frame[data-device="mobile"] .brand-browser-url {
  max-width: 240px;
  font-size: 10px;
}

.brand-browser-iframe {
  width: 100%;
  height: 560px;
  border: none;
  background: #f8fafc;
  display: block;
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.brand-browser-frame[data-device="mobile"] .brand-browser-iframe {
  height: 640px;
}

/* Modo Integrado — site do merchant com checkout embutido */
.brand-merchant-site {
  background: #f8fafc;
  transition: padding 0.45s ease;
}

.brand-merchant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 22, 40, 0.06);
}
.brand-merchant-site[data-device="mobile"] .brand-merchant-header {
  padding: 10px 16px;
}

.brand-merchant-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  padding: 28px 32px;
}
.brand-merchant-body[data-device="mobile"] {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

.brand-merchant-summary {
  background: #ffffff;
  border: 1px solid rgba(15, 22, 40, 0.06);
  border-radius: 8px;
  padding: 16px 18px;
  height: fit-content;
}

/* Mount do checkout no modo Integrado — é o próprio container do
   PaymentGateway.init. Recebe o chrome visual (borda, sombra) sem
   precisar de um wrapper extra: dentro dele só existe #pg-wrapper. */
.brand-merchant-widget {
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
}
