:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-1: #07101d;
  --bg-2: #030712;
  --panel: rgba(11, 19, 35, 0.88);
  --panel-2: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.16);
  --text: #ecf4ff;
  --muted: #93a4bf;
  --accent: #60a5fa;
  --accent-2: #a855f7;
  --danger: #fb7185;
  --warn: #fbbf24;
  --success: #34d399;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

body {
  padding: 18px 0 36px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.secondary,
.primary {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

button:hover,
.secondary:hover,
.primary:hover {
  transform: translateY(-1px);
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1400px, calc(100% - 24px));
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel), rgba(8, 15, 29, 0.82));
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(18px);
}

.auth-shell {
  width: min(560px, 100%);
  margin: 10vh auto 0;
  padding: 28px;
  display: grid;
  gap: 20px;
}

.auth-form,
.dashboard-shell,
.side-stack,
.alerts-list,
.mini-list,
.records {
  display: grid;
  gap: 14px;
}

.mobile-nav,
.mobile-records {
  display: none;
}

.collapsed-mobile {
  display: grid;
}

.expanded-mobile {
  display: grid;
}

.mobile-hidden-section {
  display: none !important;
}

.section-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.month-filter {
  width: auto;
  min-width: 150px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.section-toggle-title {
  margin: 0;
  font-size: 1rem;
}

.section-toggle-title.small-title {
  font-size: 0.92rem;
}

.affiliate-report-toggle {
  margin-top: 16px;
}

.section-toggle-btn {
  min-width: 92px;
}

.hero,
.form-panel,
.settings-panel,
.expense-panel,
.alerts-panel,
.highlights-panel,
.affiliate-panel,
.queue-panel,
.list-panel {
  padding: 22px;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(96, 165, 250, 0.22), transparent 22%),
    radial-gradient(circle at 82% 10%, rgba(168, 85, 247, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(10, 18, 34, 0.96), rgba(8, 14, 28, 0.84));
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
}

.hero::before {
  width: 240px;
  height: 240px;
  right: -60px;
  top: -70px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.16), transparent 70%);
}

.hero::after {
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192, 219, 255, 0.28), transparent);
}

.hero-top,
.brand,
.panel-head,
.toolbar,
.mini-item,
.alert-item,
.table-actions,
.stacked-pills {
  display: flex;
}

.hero-top,
.panel-head,
.mini-item,
.alert-item {
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bulk-status {
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
  font-weight: 500;
}

.brand {
  align-items: center;
  gap: 16px;
}

.hero-actions,
.form-actions,
.filter-tabs,
.table-actions,
.stacked-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.22), rgba(168, 85, 247, 0.28));
  border: 1px solid rgba(196, 181, 253, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 40px rgba(96, 165, 250, 0.14);
  color: white;
}

.hero-logo-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 8px 16px rgba(96, 165, 250, 0.16));
}

.eyebrow {
  margin: 0 0 6px;
  color: #8fb7ff;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

h2 {
  font-size: 1.08rem;
}

.lead,
.inline-message,
.table-sub,
.mini-item p,
.alert-item p,
.empty {
  color: var(--muted);
}

.lead {
  margin-top: 12px;
  max-width: 78ch;
  line-height: 1.6;
}

.hero-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-platform-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-size: 0.84rem;
  font-weight: 700;
}

.hero-platform-chip .tab-platform-mark {
  margin-right: 8px;
}

.hero-platform-chip .tab-platform-mark svg {
  width: 0.92rem;
  height: 0.92rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.platform-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.platform-summary-card {
  padding: 16px 18px;
}

.platform-summary-card span,
.platform-summary-card small {
  display: block;
}

.summary-platform-name {
  display: inline-flex !important;
  align-items: center;
}

.platform-summary-card small {
  color: var(--muted);
  margin-top: 6px;
}

.platform-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.monthly-card {
  padding: 18px 20px;
}

.monthly-card span,
.monthly-card small {
  display: block;
  color: var(--muted);
}

.monthly-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 1.5rem;
}

.monthly-card.wide {
  grid-column: span 1;
}

.platform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.platform-chip,
.empty-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: #dbeafe;
}

.platform-chip .platform-mark,
.summary-platform-name .platform-mark,
.compact-customer .platform-mark,
.queue-item .platform-mark {
  margin-right: 6px;
}

.stat {
  padding: 18px 20px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.toolbar {
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar > * {
  flex: 1 1 180px;
  min-width: 0;
}

.field-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.receipt-field,
.receipt-preview-box {
  min-height: 100%;
}

.receipt-preview-box {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(4, 9, 20, 0.5);
}

.receipt-preview-box > span {
  color: #8fb7ff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.receipt-history {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.receipt-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.expense-list {
  margin-top: 14px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(4, 9, 20, 0.94);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

#platform,
#platform option {
  text-transform: uppercase;
}

#chatgptPlanName,
#chatgptPlanName option,
#grokPlanName,
#grokPlanName option,
#flowPlanName,
#flowPlanName option {
  text-transform: uppercase;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(96, 165, 250, 0.64);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
}

.primary.small {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
}

.secondary {
  background: rgba(96, 165, 250, 0.12);
  color: #dbeafe;
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.secondary.small,
.danger-ghost {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.danger-ghost {
  background: rgba(251, 113, 133, 0.1);
  color: #ffd8df;
  border: 1px solid rgba(251, 113, 133, 0.2);
}

.whatsapp-web {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #f0fff4;
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.24);
  font-weight: 700;
  white-space: nowrap;
}

.whatsapp-web:hover {
  filter: brightness(1.04);
}

.wa-icon {
  width: 1rem;
  height: 1rem;
  margin-right: 6px;
  color: white;
  flex: 0 0 auto;
  vertical-align: -0.12em;
}

.compact {
  margin-bottom: 12px;
}

.alert-item,
.mini-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(4, 9, 20, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.settings-form {
  display: grid;
  gap: 12px;
}

.password-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.affiliate-reports,
.affiliate-metrics,
.affiliate-customer-list {
  display: grid;
  gap: 12px;
}

.affiliate-reports {
  margin-top: 16px;
}

.affiliate-report {
  padding: 16px;
}

.affiliate-report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.affiliate-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.metric-box {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(4, 9, 20, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.metric-box span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.compact-customer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.affiliate-client-hidden {
  display: none;
}

.affiliate-list-toggle {
  width: 100%;
  margin-top: 4px;
  justify-content: center;
}

.customer-money {
  display: grid;
  gap: 6px;
  text-align: right;
}

.queue-item {
  display: grid;
  gap: 12px;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions .whatsapp-web,
.queue-actions .whatsapp-web {
  order: -1;
}

/* PIX copia e cola field */
.pix-copy-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pix-copy-field input {
  flex: 1;
  min-width: 0;
}

.pix-copy-field .secondary {
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Billing image — settings preview */

.billing-image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  margin-top: 4px;
}

.billing-image-preview img {
  max-width: 120px;
  max-height: 80px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.billing-image-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Billing image — queue thumbnail */
.queue-billing-image {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 10px;
}

.queue-billing-thumb {
  max-width: 60px;
  max-height: 50px;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.alert-item.danger {
  border-color: rgba(251, 113, 133, 0.28);
}

.alert-item.warn {
  border-color: rgba(251, 191, 36, 0.28);
}

.alert-item.success {
  border-color: rgba(52, 211, 153, 0.26);
}

.filter-tabs {
  margin-bottom: 14px;
}

.platform-tabs {
  margin-top: -4px;
}

.tab {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #dbe7fb;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
}

.tab-platform-mark,
.platform-mark {
  display: inline-grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  margin-right: 8px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  line-height: 1;
}

.tab-platform-mark svg,
.platform-mark svg {
  width: 0.92rem;
  height: 0.92rem;
}

.tab.active {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.26);
}

.platform-chatgpt {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(34, 197, 94, 0.08));
}

.platform-grok {
  border-color: rgba(236, 72, 153, 0.3);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.14), rgba(168, 85, 247, 0.08));
}

.platform-flow {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(14, 165, 233, 0.08));
}

.platform-claude {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(251, 191, 36, 0.08));
}

.platform-neutral {
  border-color: rgba(148, 163, 184, 0.24);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(100, 116, 139, 0.06));
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.platform-badge .platform-mark {
  margin-right: 7px;
}

.client-title {
  display: inline-flex;
  align-items: center;
}

.client-title .platform-mark {
  margin-right: 7px;
}

.platform-group {
  padding: 16px;
}

.platform-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.record-card-mobile {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(7, 13, 24, 0.88);
  display: grid;
  gap: 12px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Borda colorida por plataforma */
.platform-left-platform-chatgpt { border-left: 3px solid rgba(16, 185, 129, 0.8); }
.platform-left-platform-grok    { border-left: 3px solid rgba(236, 72, 153, 0.8); }
.platform-left-platform-flow    { border-left: 3px solid rgba(59, 130, 246, 0.8); }
.platform-left-platform-claude  { border-left: 3px solid rgba(245, 158, 11, 0.8); }

/* Cabeçalho do card */
.rcm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.rcm-name strong {
  display: block;
  font-size: 1rem;
}

.rcm-phone {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Grid de informações 2x2 */
.rcm-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rcm-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rcm-info-item strong {
  font-size: 0.92rem;
}

.rcm-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Labels de status com cor */
.success-text { color: var(--success); }
.warn-text    { color: var(--warn); }
.danger-text  { color: var(--danger); }
.muted-text   { color: var(--muted); }

/* Seção de ações */
.rcm-actions {
  display: grid;
  gap: 7px;
}

/* Botão WhatsApp full-width */
.mobile-action-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #f0fff4;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.22);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.mobile-action-wa:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* Linha de 2 botões */
.rcm-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

/* Botão de ação secundário */
.rcm-btn {
  min-height: 46px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

.rcm-btn:hover { background: rgba(148, 163, 184, 0.14); transform: translateY(-1px); }

.rcm-btn.danger {
  background: rgba(251, 113, 133, 0.1);
  color: #ffd8df;
  border-color: rgba(251, 113, 133, 0.2);
}

.rcm-btn.danger:hover { background: rgba(251, 113, 133, 0.18); }


.record-platform-card,
.customer-platform-card {
  border-left: 3px solid transparent;
}

.record-platform-card.platform-chatgpt,
.customer-platform-card.platform-chatgpt,
.record-row.platform-chatgpt td:first-child {
  border-left-color: rgba(16, 185, 129, 0.9);
}

.record-platform-card.platform-grok,
.customer-platform-card.platform-grok,
.record-row.platform-grok td:first-child {
  border-left-color: rgba(236, 72, 153, 0.9);
}

.record-platform-card.platform-flow,
.customer-platform-card.platform-flow,
.record-row.platform-flow td:first-child {
  border-left-color: rgba(59, 130, 246, 0.9);
}

.record-platform-card.platform-claude,
.customer-platform-card.platform-claude,
.record-row.platform-claude td:first-child {
  border-left-color: rgba(245, 158, 11, 0.9);
}

.record-platform-card.platform-neutral,
.customer-platform-card.platform-neutral,
.record-row.platform-neutral td:first-child {
  border-left-color: rgba(148, 163, 184, 0.9);
}

.record-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.record-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card-label {
  display: block;
  margin-bottom: 4px;
  color: #8fb7ff;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(4, 9, 20, 0.5);
}

.records-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.records-table th,
.records-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: top;
}

.records-table th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fb7ff;
  background: rgba(255, 255, 255, 0.02);
}

.table-sub {
  margin-top: 4px;
  font-size: 0.82rem;
}

.receipt-link {
  width: fit-content;
}

.stacked-pills {
  align-items: flex-start;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  border: 1px solid transparent;
}

.pill.success {
  background: rgba(52, 211, 153, 0.12);
  color: #c7ffe8;
  border-color: rgba(52, 211, 153, 0.2);
}

.pill.warn {
  background: rgba(251, 191, 36, 0.12);
  color: #ffe8a3;
  border-color: rgba(251, 191, 36, 0.2);
}

.pill.danger {
  background: rgba(251, 113, 133, 0.12);
  color: #ffd4dc;
  border-color: rgba(251, 113, 133, 0.2);
}

.pill.neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #dde7f6;
  border-color: rgba(148, 163, 184, 0.18);
}

.pill.paused {
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.25);
  gap: 4px;
}

.paused-tab {
  color: #fcd34d !important;
}
.paused-tab.active {
  background: rgba(251, 191, 36, 0.15) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #fcd34d !important;
}

.record-card-mobile.is-paused,
tr.is-paused td {
  opacity: 0.65;
}

.pill.affiliate-pill {
  background: rgba(167, 139, 250, 0.15);
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.25);
}

.inline-message {
  min-height: 1.2em;
}

.inline-message.success {
  color: #9ef0cb;
}

.inline-message.danger {
  color: #ffc8d3;
}

.empty {
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  text-align: center;
}

@media (max-width: 1220px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .monthly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body.has-mobile-nav {
    padding-bottom: 110px;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 40;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.5);
  }

  .mobile-nav-tab {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 42px;
    padding: 10px 8px;
    background: rgba(148, 163, 184, 0.08);
    color: #dbe7fb;
    border: 1px solid rgba(148, 163, 184, 0.14);
    font-size: 0.84rem;
    font-weight: 700;
  }

  .mobile-nav-tab.active {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.28);
  }

  body[data-mobile-section="painel"] .mobile-nav-tab.active {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.36);
    color: #eff6ff;
  }

  body[data-mobile-section="cadastrar"] .mobile-nav-tab.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.36);
    color: #f5ecff;
  }

  body[data-mobile-section="afiliados"] .mobile-nav-tab.active {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.36);
    color: #fff6df;
  }

  body[data-mobile-section="clientes"] .mobile-nav-tab.active {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.36);
    color: #ecfdf3;
  }

  .mobile-nav-icon {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    line-height: 1;
  }

  .field-grid.two,
  .field-grid.three,
  .field-grid.four,
  .monthly-grid,
  .platform-summary-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hero-top,
  .panel-head,
  .toolbar,
  .brand,
  .affiliate-report-head,
  .compact-customer,
  .record-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar > * {
    width: 100%;
    flex-basis: auto;
  }

  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .filter-tabs .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .records-table {
    min-width: 960px;
  }

  .affiliate-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.has-mobile-nav {
    padding-bottom: 100px;
  }

  body {
    padding-top: 12px;
  }

  .app-shell {
    width: min(100%, calc(100% - 14px));
  }

  .hero,
  .form-panel,
  .settings-panel,
  .alerts-panel,
  .highlights-panel,
  .affiliate-panel,
  .queue-panel,
  .list-panel,
  .auth-shell {
    padding: 18px;
  }

  .card {
    border-radius: 20px;
  }

  .mobile-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .collapsed-mobile {
    display: none !important;
  }

  .expanded-mobile {
    display: grid !important;
    opacity: 1;
    max-height: 2400px;
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.2s ease;
  }

  .stat,
  .monthly-card,
  .platform-summary-card,
  .platform-group,
  .affiliate-report {
    padding: 14px;
  }

  .logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 1.1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .lead {
    font-size: 0.94rem;
  }

  /* Hero compacto no mobile */
  .hero-platforms {
    gap: 6px;
  }

  .lead {
    display: none;
  }

  .hero-platform-chip {
    width: calc(50% - 3px);
    justify-content: center;
  }

  input,
  textarea,
  select,
  .primary,
  .secondary {
    min-height: 44px;
  }

  textarea {
    min-height: 110px;
  }

  .field-grid,
  .stats-grid,
  .monthly-grid,
  .platform-summary-grid,
  .affiliate-metrics {
    gap: 10px;
  }

  .records-table,
  .records-table thead,
  .records-table tbody,
  .records-table tr,
  .records-table th,
  .records-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .records-table {
    min-width: 0;
  }

  .records-table thead {
    display: none;
  }

  .records-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .records-table tr {
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    background: rgba(7, 13, 24, 0.88);
    overflow: hidden;
  }

  .records-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    box-sizing: border-box;
    overflow: hidden;
  }

  .records-table td:last-child {
    border-bottom: 0;
  }

  .records-table td::before {
    display: block;
    margin-bottom: 6px;
    color: #8fb7ff;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: "";
  }

  .records-table td:nth-child(1)::before {
    content: "Cliente";
  }

  .records-table td:nth-child(2)::before {
    content: "Conta";
  }

  .records-table td:nth-child(3)::before {
    content: "Financeiro";
  }

  .records-table td:nth-child(4)::before {
    content: "Afiliado";
  }

  .records-table td:nth-child(5)::before {
    content: "Vencimento";
  }

  .records-table td:nth-child(6)::before {
    content: "Status";
  }

  .records-table td:nth-child(7)::before {
    content: "Acoes";
  }

  .table-wrap {
    display: none;
  }

  .mobile-records {
    display: grid;
    gap: 12px;
  }

  .record-card-grid {
    grid-template-columns: 1fr;
  }

  .table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .table-actions > * {
    width: 100%;
    margin: 0;
  }

  .table-actions .whatsapp-web,
  .queue-actions .whatsapp-web {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 46px;
    font-size: 0.92rem;
  }

  .table-actions,
  .queue-actions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Botao WhatsApp mais curto no mobile */
  .table-actions .whatsapp-web::after {
    content: "";
  }

  .table-actions .whatsapp-web {
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .queue-actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .queue-actions > *,
  .form-actions > *,
  .hero-actions > * {
    width: 100%;
  }

  .hero-actions .danger-ghost {
    grid-column: 1 / -1;
  }

  .stat.card {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .stat.card strong {
    font-size: 1.4rem;
  }

  .platform-group-head {
    margin-bottom: 10px;
  }

  .compact-customer,
  .mini-item,
  .alert-item {
    gap: 10px;
  }

  .customer-money {
    text-align: left;
  }
}

/* ─── Flow Accounts Distribution Panel ────────────────────────────────── */

.flow-accounts-panel {
  padding: 22px;
}

.flow-dist-subtitle {
  font-size: 0.82rem;
  margin: 2px 0 14px;
}

.flow-dist-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.flow-accounts-grid {
  display: grid;
  gap: 12px;
}

.flow-dist-card {
  background: rgba(11, 19, 38, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 16px;
  padding: 14px 16px;
  transition: border-color 0.2s ease;
}

.flow-dist-card:hover {
  border-color: rgba(96, 165, 250, 0.28);
}

.flow-dist-unknown {
  border-style: dashed;
  opacity: 0.75;
}

.flow-dist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.flow-dist-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.flow-dist-label {
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-dist-email {
  font-size: 0.75rem;
  color: var(--muted);
}

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

.flow-dist-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Progress bar */
.flow-dist-bar-wrap {
  height: 5px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.flow-dist-bar {
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
  transition: width 0.4s ease;
}

.flow-dist-bar.bar-ok {
  background: linear-gradient(90deg, var(--success), #6ee7b7);
}

.flow-dist-bar.bar-warn {
  background: linear-gradient(90deg, var(--warn), #fde68a);
}

.flow-dist-bar.bar-danger {
  background: linear-gradient(90deg, var(--danger), #fda4af);
}

/* Client list */
.flow-dist-clients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.flow-dist-client {
  display: grid;
  grid-template-columns: 10px 1fr auto auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.05);
  font-size: 0.8rem;
  transition: background 0.15s;
}

.flow-dist-client:hover {
  background: rgba(96, 165, 250, 0.08);
}

.flow-dist-client:hover .flow-dist-remove-btn {
  opacity: 1;
}

/* Touch devices: always show the button */
@media (hover: none) {
  .flow-dist-remove-btn {
    opacity: 0.55;
    font-size: 1.1rem;
    padding: 2px 6px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Status indicator dots */
.flow-dist-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.flow-dist-dot.dot-ok {
  background: var(--success);
  box-shadow: 0 0 5px rgba(52, 211, 153, 0.6);
}

.flow-dist-dot.dot-warn {
  background: var(--warn);
  box-shadow: 0 0 5px rgba(251, 191, 36, 0.6);
}

.flow-dist-dot.dot-danger {
  background: var(--danger);
  box-shadow: 0 0 5px rgba(251, 113, 133, 0.6);
}

.flow-dist-name {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-dist-plan {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.flow-dist-date {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.flow-dist-group-tag {
  font-size: 0.68rem;
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.flow-dist-more {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 4px 0 2px;
  letter-spacing: 0.02em;
}

.flow-dist-empty {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 4px 0 0;
}

.flow-dist-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-dist-report-btn {
  font-size: 0.72rem !important;
  padding: 3px 10px !important;
  border-radius: 10px !important;
  opacity: 0.85;
}

.flow-dist-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.flow-dist-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.flow-dist-remove-btn:hover {
  background: rgba(251, 113, 133, 0.15);
  opacity: 1;
}

/* ─── Flow Group Cards ────────────────────────────────────────────────── */

#flowGroupList {
  display: grid;
  gap: 12px;
}

.flow-group-card .flow-dist-header-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ─── Flow Report Modal ───────────────────────────────────────────────── */

.flow-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(2, 6, 18, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
  overflow-y: auto;
}

.flow-report-modal {
  width: min(1200px, 100%);
  background: linear-gradient(180deg, rgba(11, 19, 38, 0.98), rgba(7, 12, 26, 0.96));
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 28px;
  box-shadow: 0 40px 100px rgba(2, 6, 23, 0.7), 0 0 0 1px rgba(96, 165, 250, 0.08);
  overflow: hidden;
  animation: modalSlideIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.flow-report-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.06), rgba(168, 85, 247, 0.06));
}

.flow-report-subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.flow-report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.flow-report-body {
  padding: 20px 28px 28px;
  display: grid;
  gap: 24px;
}

/* Account section */
.flow-report-account {
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 18px;
  overflow: hidden;
}

.flow-report-account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.08), rgba(168, 85, 247, 0.06));
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.flow-report-account-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flow-report-account-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(168, 85, 247, 0.18));
  color: var(--accent);
  flex-shrink: 0;
}

.flow-report-account-icon svg {
  width: 20px;
  height: 20px;
}

.flow-report-account-info > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.flow-report-account-email {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Report table */
.flow-report-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.flow-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 860px;
}

.flow-report-table thead tr {
  background: rgba(148, 163, 184, 0.05);
}

.flow-report-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  white-space: nowrap;
}

.flow-report-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  vertical-align: middle;
  line-height: 1.4;
}

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

.flow-report-table tbody tr:hover td {
  background: rgba(96, 165, 250, 0.04);
}

/* Cell tone helpers */
.cell-ok    { color: var(--success); }
.cell-warn  { color: var(--warn); }
.cell-danger { color: var(--danger); }
.cell-neutral { color: var(--muted); }
.cell-muted { color: var(--muted); font-size: 0.75rem; }
.cell-sub   { font-size: 0.72rem; color: var(--muted); }

/* Chips */
.report-group-chip {
  display: inline-block;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c4b5fd;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.report-affiliate-chip {
  display: inline-block;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--warn);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.report-wa-link {
  color: var(--success);
  font-size: 0.78rem;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.report-wa-link:hover {
  opacity: 0.8;
}

.report-notes {
  font-size: 0.75rem;
  color: var(--muted);
  cursor: help;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Print styles for Flow Report */
@media print {
  .flow-report-overlay {
    position: static;
    background: white;
    backdrop-filter: none;
    padding: 0;
    color: #000;
  }

  .flow-report-modal {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: white;
    color: #000;
    width: 100%;
    animation: none;
  }

  .flow-report-modal-head {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
  }

  .flow-report-actions button,
  .flow-report-actions button:last-child {
    display: none;
  }

  .flow-report-account {
    border: 1px solid #ddd;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }

  .flow-report-account-head {
    background: #eef2ff;
  }

  .flow-report-table td,
  .flow-report-table th {
    color: #000;
    border-color: #ddd;
  }

  .flow-report-table tbody tr:hover td {
    background: none;
  }

  body > main, body > :not(.flow-report-overlay) {
    display: none !important;
  }

  .flow-report-overlay {
    display: block !important;
  }

  .cell-ok    { color: #16a34a; }
  .cell-warn  { color: #d97706; }
  .cell-danger { color: #dc2626; }
  .cell-neutral, .cell-muted { color: #6b7280; }
}

/* ── PIX copia e cola ───────────────────────────────── */
.pix-copy-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pix-copy-field input {
  flex: 1;
  min-width: 0;
}

.pix-copy-field button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ── Vínculo Afiliado ↔ Grupos WhatsApp ─────────────── */
.affiliate-groups-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.affiliate-groups-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.affiliate-group-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  align-items: center;
}

.affiliate-group-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}

.affiliate-group-check-label:hover {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.4);
}

.affiliate-group-check-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.affiliate-groups-empty {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

/* Pills de grupos na lista de afiliados */
.affiliate-groups-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.pill.affiliate-group-pill {
  background: rgba(96, 165, 250, 0.12);
  color: var(--accent);
  border: 1px solid rgba(96, 165, 250, 0.25);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Badge de afiliado nos cards de grupo */
.pill.affiliate-owner-pill {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(168, 85, 247, 0.25);
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.affiliate-no-owner {
  font-size: 0.75rem;
  opacity: 0.55;
}

.flow-dist-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Ordenacao de listas ────────────────────────────── */
.list-sort-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.list-sort-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.list-sort-select {
  background: var(--surface, #1a1f2e);
  border: 1px solid var(--line, rgba(148,163,184,0.12));
  border-radius: 8px;
  color: var(--text, #e2e8f0);
  font-size: 0.8125rem;
  font-family: inherit;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
  outline: none;
}

.list-sort-select:focus {
  border-color: var(--accent, #60a5fa);
}

/* ─── Affiliate Clients Modal ──────────────────────────────────────────────── */

/* Status pill badges (reused from afiliado.html inline styles) */
.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.pill-paid    { background: rgba(74,222,128,.14); color: #4ade80; border: 1px solid rgba(74,222,128,.35); }
.pill-overdue { background: rgba(248,113,113,.14); color: #f87171; border: 1px solid rgba(248,113,113,.35); }
.pill-pending { background: rgba(251,191,36,.14); color: #fbbf24; border: 1px solid rgba(251,191,36,.35); }


.aff-modal-client-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 14px;
  overflow: hidden;
}

.aff-modal-client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  transition: background 0.12s;
}

.aff-modal-client-row:last-child {
  border-bottom: none;
}

.aff-modal-client-row:hover {
  background: rgba(148, 163, 184, 0.04);
}

.aff-modal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.aff-modal-dot.dot-ok     { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.aff-modal-dot.dot-warn   { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.aff-modal-dot.dot-danger { background: #f87171; box-shadow: 0 0 6px #f87171; }
.aff-modal-dot.dot-muted  { background: #64748b; }

.aff-modal-client-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aff-modal-client-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aff-modal-client-plan {
  font-size: 0.75rem;
  color: var(--muted, #64748b);
}

.aff-modal-client-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.aff-modal-due {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.aff-modal-due-date {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.aff-modal-due-days {
  font-size: 0.68rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
}

.aff-modal-commission {
  font-size: 0.75rem;
  color: var(--accent, #60a5fa);
  font-weight: 600;
  white-space: nowrap;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  padding: 2px 8px;
  border-radius: 20px;
}

@media (max-width: 580px) {
  .aff-modal-commission { display: none; }
  .aff-modal-due { display: none; }
}

