/* ==========================================================
   Mensalistas — Design System
   Dark-first premium dashboard, gold accent, glass surfaces.
   ========================================================== */

:root {
  --bg: #212643;
  --bg-2: #1b1f32;
  --surface: #283253;
  --surface-2: #35436e;
  --surface-hover: #3f5083;
  --border: #4c619e;
  --border-strong: #6e81b9;
  --text: #f5f5fd;
  --text-2: #96a7c1;
  --text-3: #5f7695;

  --accent: #2588e4;
  --accent-2: #155088;
  --accent-ink: #10182c;
  --accent-soft: rgba(37, 136, 228, 0.18);

  --green: #3ecf8e;
  --green-bg: rgba(62, 207, 142, 0.14);
  --amber: #f0b429;
  --amber-bg: rgba(240, 180, 41, 0.14);
  --red: #ff6b72;
  --red-bg: rgba(255, 107, 114, 0.14);
  --blue: #2588e4;
  --violet: #a78bfa;
  --violet-bg: rgba(167, 139, 250, 0.14);
  --teal: #09b4c1;
  --teal-bg: rgba(9, 180, 193, 0.16);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(37, 136, 228, 0.3), 0 8px 24px -8px rgba(37, 136, 228, 0.4);

  --font-display: 'Montserrat', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  color-scheme: dark;
  font-size: 16px;
}

:root[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-2: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #e2e8f0;
  --border: #e2e8f0;
  --border-strong: #c7d0dc;
  --text: #0d1b2a;
  --text-2: #334155;
  --text-3: #64748b;

  --accent: #1e3aba;
  --accent-2: #14277d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(30, 58, 186, 0.1);

  --green: #1a9a5c;
  --green-bg: #e1f6ea;
  --amber: #b7791f;
  --amber-bg: #fbf0da;
  --red: #c4242e;
  --red-bg: #fbe4e5;
  --blue: #1e3aba;
  --violet: #7c5cfc;
  --violet-bg: #efeafe;
  --teal: #09b4c1;
  --teal-bg: rgba(9, 180, 193, 0.12);

  --shadow-lg: 0 24px 60px -24px rgba(13, 27, 42, 0.18);
  --shadow-md: 0 10px 24px -12px rgba(13, 27, 42, 0.14);
  --shadow-glow: 0 0 0 1px rgba(30, 58, 186, 0.22), 0 10px 26px -10px rgba(30, 58, 186, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }

/* ---------- Barra de rolagem ---------- */
* { scrollbar-width: auto; scrollbar-color: var(--border-strong) var(--surface-2); }
*::-webkit-scrollbar { width: 14px; height: 14px; }
*::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 999px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--border-strong), var(--text-3));
  border-radius: 999px; border: 3px solid var(--surface-2); background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: var(--surface-2); }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 480px at 12% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(37, 136, 228, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  transition: background-color 260ms ease, color 260ms ease;
}

/* ---------- Topbar ---------- */
.topbar {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 16px clamp(20px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 180px; height: 76px; border-radius: 12px;
  background: linear-gradient(150deg, var(--accent), var(--teal));
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark--empty {
  background: var(--surface-2); box-shadow: none;
  border: 1.5px dashed var(--border-strong); color: var(--text-3);
}
.brand-mark-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.brand-mark-hint svg { width: 20px; height: 20px; }
.brand-mark-hint b { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.2px; }
.brand h1 { margin: 0; font-family: var(--font-display); font-size: 18.5px; font-weight: 700; letter-spacing: -0.2px; }
.brand p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.year-nav {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px;
}
.year-nav button {
  background: transparent; border: 0; color: var(--text-2);
  font-size: 18px; width: 30px; height: 30px; border-radius: 7px; cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.year-nav button:hover { background: var(--surface-hover); color: var(--text); }
.year-nav span {
  font-family: var(--font-display); font-weight: 700; font-size: 14.5px;
  min-width: 52px; text-align: center; color: var(--text);
}

.icon-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
.icon-toggle:hover { background: var(--surface-hover); color: var(--accent); }
.icon-toggle svg { width: 18px; height: 18px; }
.avatar-btn { padding: 0; overflow: hidden; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn .avatar-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}
.icon-toggle .ic-moon { display: none; }
:root[data-theme="light"] .icon-toggle .ic-sun { display: none; }
:root[data-theme="light"] .icon-toggle .ic-moon { display: block; }

/* Tooltip custom (substitui o title nativo do navegador) -- mesma tecnica do .pay-tooltip:
   um unico elemento position:fixed, posicionado via JS (getBoundingClientRect), fora da
   arvore de qualquer modal/card. Um data-tip dentro de container com overflow:auto/hidden
   (credit-history, grid de cards, etc.) NUNCA pode ser position:absolute local -- a caixa
   (mesmo so no hover) conta pro scroll/clip do ancestral e cria barra de rolagem fantasma
   ou corta o texto. position:fixed no <body> escapa disso por completo. */
.tip-bubble {
  position: fixed; z-index: 95;
  max-width: 240px; width: max-content;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 7px 11px; font-size: 12px; font-weight: 600; line-height: 1.4;
  text-align: center;
  pointer-events: none;
  animation: tipBubbleIn 110ms ease;
}
.tip-bubble[hidden] { display: none; }
@keyframes tipBubbleIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.tip-bubble::after {
  content: ''; position: absolute; width: 8px; height: 8px;
  background: var(--surface); border-left: 1px solid var(--border-strong); border-top: 1px solid var(--border-strong);
  left: var(--arrow-left, 50%); transform: translateX(-50%) rotate(45deg);
  bottom: -5px;
}
.tip-bubble.arrow-below::after { top: -5px; bottom: auto; transform: translateX(-50%) rotate(225deg); }

.alert-bell { position: relative; }
.alert-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; font-family: var(--font-display);
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface);
}
@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-12deg); }
  20%, 40% { transform: rotate(12deg); }
  50% { transform: rotate(0); }
}
.alert-bell.has-alerts svg { animation: bellRing 2.4s ease-in-out infinite; transform-origin: top center; }

.alerts-panel {
  position: fixed; z-index: 95;
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeIn 140ms ease;
}
.alerts-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-family: var(--font-display); font-weight: 700; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.alerts-list { max-height: 60vh; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.alerts-empty { text-align: center; color: var(--text-2); font-size: 13px; padding: 28px 12px; }

.alert-card {
  position: relative;
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm); padding: 10px 30px 10px 12px;
  animation: alertIn 220ms cubic-bezier(.16,1,.3,1);
}
.alert-card.overdue { border-left-color: var(--red); }
@keyframes alertIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.alert-icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--amber-bg); color: var(--amber); display: grid; place-items: center;
}
.alert-card.overdue .alert-icon { background: var(--red-bg); color: var(--red); }
.alert-icon svg { width: 15px; height: 15px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 700; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.alert-fields { margin-top: 5px; display: flex; flex-direction: column; gap: 2px; }
.alert-field-row { font-size: 11px; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-field-row b { color: var(--text-3); font-family: var(--font-body); font-weight: 600; }
.alert-countdown { display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); }
.alert-card.overdue .alert-countdown { background: var(--red-bg); color: var(--red); }
.alert-dismiss {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--text-3);
  display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.alert-dismiss:hover { background: var(--red-bg); color: var(--red); }

/* ---------- Layout ---------- */
main { max-width: 1800px; margin: 0 auto; padding: 24px clamp(20px, 3vw, 48px) 56px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.card {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-md);
  transition: transform 180ms cubic-bezier(.16,1,.3,1), border-color 180ms ease;
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.card-icon {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-3);
}
.card-icon svg { width: 16px; height: 16px; }
.card-ok .card-icon { background: var(--green-bg); color: var(--green); }
.card-bad .card-icon { background: var(--red-bg); color: var(--red); }
.card-bonus .card-icon { background: var(--accent-soft); color: var(--accent); }
.card-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; padding-right: 30px; }
.card-value { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -0.3px; }
.card-value.ok { color: var(--green); }
.card-value.bad { color: var(--red); }
.card-value-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-value-row .card-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-delta {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.card-delta.up { color: var(--green); background: var(--green-bg); }
.card-delta.down { color: var(--red); background: var(--red-bg); }
.card-value.bonus { color: var(--accent); }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-wrap {
  flex: 1; min-width: 220px; position: relative; display: flex; align-items: center;
}
.search-wrap svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search-wrap input { width: 100%; padding-left: 36px; }

input, select, textarea {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input, select {
  /* select's UA rendering is a few px shorter than input by default (no icon/spinner
     reserving height) -- pins it to the same floor so mixed input+select rows
     (ex.: form de creditos) don't align uneven boxes on align-items:flex-end. */
  min-height: 41px;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  font: inherit; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  border-color: transparent; color: var(--accent-ink); font-weight: 700;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  border-color: transparent; filter: brightness(1.08);
}
.btn-danger-ghost { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-danger { background: var(--red); border-color: transparent; color: #fff; }
.btn-danger:hover { background: var(--red); border-color: transparent; filter: brightness(1.08); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.logo-upload { display: flex; align-items: center; justify-content: center; gap: 12px; }
.logo-preview {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

/* Seletor de logo neutro, mesma linguagem visual dos ícones do header (icon-toggle) */
.logo-picker {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; overflow: hidden;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.logo-picker:hover { background: var(--surface-hover); color: var(--accent); border-color: var(--accent); }
.logo-picker svg { width: 18px; height: 18px; }
.logo-picker img { width: 100%; height: 100%; object-fit: contain; }
.logo-picker-card { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
.logo-picker-card svg { width: 15px; height: 15px; }
.modal .logo-picker { display: grid; place-items: center; }
.logo-picker.has-logo { background: transparent; border-color: transparent; cursor: pointer; }
.logo-picker.has-logo img { object-fit: cover; border-radius: inherit; }
.logo-picker.has-logo:hover { border-color: var(--accent); }
.logo-upload-actions { display: flex; gap: 8px; }

#settingsOverlay .modal { overflow-y: auto; }
#settingsForm { flex: none; overflow: visible; }

.settings-section { border-top: 1px solid var(--border); margin-top: 11px; padding-top: 10px; }
.settings-section.danger-zone { border-top-color: var(--red); }
.settings-section-title.danger-title { color: var(--red); }
.settings-section-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; margin-bottom: 5px; }
.settings-section-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section-inline .settings-section-title { margin-bottom: 0; }
.backups-auto-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; margin-top: 8px; }
.backups-auto-empty { font-size: 12px; color: var(--text-3); }
.backup-auto-row, .team-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.backup-auto-row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.team-row-actions { display: flex; align-items: center; gap: 6px; }
.team-row-actions button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; }
.team-row-actions button:hover { background: var(--surface-hover); color: var(--text); }
.team-badge-inativo { color: var(--text-3); font-weight: 600; }
.team-permissoes-checklist { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; font-size: 12px; color: var(--text-2); }
.team-permissoes-checklist label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.audit-log-row, .backfill-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.audit-log-row .audit-meta { color: var(--text-3); }
.backfill-row select { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; color: var(--text); font-size: 12px; }
.backfill-row button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; }
.backfill-row button:hover { background: var(--surface-hover); color: var(--text); }
.settings-actions-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.settings-actions-row .btn svg { width: 15px; height: 15px; }
.hint-block { font-size: 12px; color: var(--text-3); margin: 3px 0; line-height: 1.45; }
.hint-warning { color: var(--amber); }
.hint-warning strong { color: var(--red); }

#btnWhatsapp { position: relative; }
.new-template-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.disparo-row { display: flex; align-items: flex-end; gap: 12px; }
.disparo-row .row3 { flex: 1; min-width: 0; }
.template-form-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-icon { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; flex-shrink: 0; }
.btn-icon svg { width: 18px; height: 18px; }
@media (max-width: 700px) {
  .disparo-row { flex-direction: column; align-items: stretch; }
  .template-form-actions { justify-content: flex-end; }
}
.new-template-form textarea { font-family: inherit; resize: vertical; }
.var-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.var-chip-label { font-size: 11.5px; color: var(--text-3); margin-right: 2px; }
.var-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 600;
  padding: 3px 7px; border-radius: 999px; border: 1px dashed var(--border-strong);
  background: var(--surface-2); color: var(--accent); cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.var-chip:hover { background: var(--accent-soft); border-color: var(--accent); }

.var-chips-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; background: var(--surface-2); }
.var-chips-panel[open] { padding-bottom: 12px; }
.var-chips-panel summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 9px 0; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.var-chips-panel summary::-webkit-details-marker { display: none; }
.var-chips-panel summary::before {
  content: '›'; display: inline-block; font-size: 15px; line-height: 1;
  transition: transform 140ms ease; color: var(--text-3);
}
.var-chips-panel[open] summary::before { transform: rotate(90deg); }
.var-chips-badge {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 7px;
}
.var-chips-panel .hint-block { margin: 8px 0 0; }

.template-body-preview {
  font-size: 12px; color: var(--text-2); white-space: pre-wrap;
  max-height: 72px; overflow: hidden; margin: 6px 0 0;
}
.template-badge {
  font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.3px;
  padding: 2px 7px; border-radius: 999px; display: inline-block;
}
.template-badge.pagamento { background: var(--green-bg); color: var(--green); }
.template-badge.atraso { background: var(--red-bg); color: var(--red); }
.template-badge.outro { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.template-badge.auto { background: var(--accent-soft); color: var(--accent); text-transform: none; cursor: help; }
.template-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.log-table-wrap { max-height: 56vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.log-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.log-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-2); text-align: left; padding: 9px 12px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-3); font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.log-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.log-table tbody tr:hover { background: var(--surface-2); }
.log-table .log-usuario, .log-table .log-senha { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; }
.log-table .log-empty { text-align: center; color: var(--text-2); padding: 28px 12px; }
.log-status {
  font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 8px; border-radius: 999px; display: inline-block; white-space: nowrap;
}
.log-status.enviado { background: var(--green-bg); color: var(--green); }
.log-status.recebido { background: var(--accent-soft); color: var(--accent); }
.log-status.falha { background: var(--red-bg); color: var(--red); cursor: help; }

.ws-status-dot {
  position: absolute; top: -2px; right: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--surface); background: var(--text-3);
}
.ws-status-dot.on { background: var(--green); }
.ws-status-dot.connecting { background: var(--amber); animation: wsPulse 1.4s ease-in-out infinite; }
.ws-status-dot.error { background: var(--red); }
@keyframes wsPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ws-status-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.ws-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.ws-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.ws-dot.connecting { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); animation: wsPulse 1.4s ease-in-out infinite; }
.ws-dot.error { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.ws-status-label { font-weight: 700; font-size: 13.5px; }
.ws-status-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; font-variant-numeric: tabular-nums; }

.ws-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 4px; }
.ws-qr-box {
  width: 220px; height: 220px; padding: 12px;
  background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
}
.ws-qr-box img { width: 100%; height: 100%; object-fit: contain; }
.ws-qr-hint { font-size: 12.5px; color: var(--text-2); text-align: center; max-width: 260px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; width: 40px; height: 22px; border-radius: 999px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  transition: background 140ms ease, border-color 140ms ease;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--text-3);
  transition: transform 140ms ease, background 140ms ease;
}
.switch input:checked + .switch-track { background: var(--green-bg); border-color: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--green); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.modal label.switch { flex-direction: row; align-items: center; gap: 9px; }
.modal label.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-inline { align-self: end; padding-bottom: 8px; }
.switch-row { display: flex; flex-wrap: wrap; gap: 18px; margin: -6px 0 2px; }
.switch-bonus input:checked + .switch-track { background: var(--accent-soft); border-color: var(--accent); }
.switch-bonus input:checked + .switch-track::after { background: var(--accent); }
.switch-inline .switch-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }

.cards-compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cards-compact .card { padding: 12px 14px; }
.cards-compact .card-label { font-size: 11.5px; padding-right: 0; }
.cards-compact .card-value { font-size: 20px; }

.ns-field-sm { flex: 0 0 110px; }

.accounts-search { width: 100%; margin: 4px 0 10px; }

.account-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-height: 48vh; overflow-y: auto; }
.account-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.account-row .account-info { flex: 1 1 180px; min-width: 180px; }
.account-row .account-nome { font-weight: 700; font-size: 13.5px; }
.account-row .account-email { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.account-row.inativo { opacity: 0.55; }

/* ---------- Disparo em massa ---------- */
.bulk-status-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 10px 0 4px; }
.modal .bulk-status-checks label {
  display: inline-flex; flex-direction: row; align-items: center; gap: 7px; margin: 0;
  font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; cursor: pointer;
}
.modal .bulk-status-checks label input { width: auto; }
.bulk-filter-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }
.bulk-filter-row { margin-top: 12px; }
.bulk-msg-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 10px; }
.modal .bulk-msg-toggle label {
  display: inline-flex; flex-direction: row; align-items: center; gap: 7px; margin: 0;
  font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; cursor: pointer;
}
.modal .bulk-msg-toggle label input { width: auto; }
.modal .bulk-inline-check {
  display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0;
  font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; cursor: pointer;
}
.modal .bulk-inline-check input { width: auto; }
.bulk-two-col { display: flex; gap: 20px; align-items: flex-start; }
.bulk-col-clientes { flex: 1 1 50%; min-width: 0; }
.bulk-col-mensagem { flex: 1 1 50%; min-width: 0; }
#bs_texto_livre, #bulkSendPreview { font-size: 13px; line-height: 1.5; width: 100%; box-sizing: border-box; }
#bs_texto_livre { height: 120px; }
#bulkSendPreview { height: 150px; }
@media (max-width: 720px) {
  .bulk-two-col { flex-direction: column; }
}

.bulk-client-list {
  gap: 0; max-height: 320px; overflow-y: auto; margin-top: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  padding: 4px;
}
.modal .bulk-client-row {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding: 5px 6px; border-bottom: 1px solid var(--border); border-radius: 0;
  background: transparent; cursor: pointer; margin: 0;
}
.bulk-client-row:last-child { border-bottom: none; }
.bulk-client-row:hover { background: var(--surface-hover); }
.modal .bulk-client-row input[type="checkbox"] { flex-shrink: 0; margin: 0; width: auto; }
.bulk-client-nome {
  flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 12.5px; line-height: 1.2; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bulk-client-meta { flex: 0 0 auto; font-size: 11px; line-height: 1.2; color: var(--text-2); white-space: nowrap; }
.bulk-log-list { margin-top: 12px; max-height: 40vh; overflow-y: auto; }
.bulk-log-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bulk-log-table th, .bulk-log-table td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere;
}
.bulk-log-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-3); }
.bulk-log-table tr.falha td { color: var(--red); }
.account-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.account-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.account-badge {
  font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 7px; border-radius: 999px;
  background: var(--surface); color: var(--text-3); border: 1px solid var(--border);
  white-space: nowrap;
}
.account-badge.aviso { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.account-badge.ativo { background: rgba(16,185,129,0.15); color: #10b981; border-color: transparent; }
.account-badge.inativo { background: rgba(239,68,68,0.15); color: var(--red); }
.account-delete-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  display: inline-grid; place-items: center; flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.account-delete-btn svg { width: 14px; height: 14px; }
.account-delete-btn:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.icon-btn {
  background: transparent; border: 0; cursor: pointer;
  font-size: 15px; color: var(--text-2);
  width: 32px; height: 32px; border-radius: 8px;
  transition: background 120ms ease, color 120ms ease;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }

/* ---------- Matriz ---------- */
.grid-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}
#matrix { border-collapse: collapse; width: 100%; min-width: 1140px; font-size: 13px; }
thead th {
  position: sticky; top: 0;
  background: var(--bg-2); color: var(--text-2);
  font-family: var(--font-display); font-weight: 600; font-size: 11.5px;
  text-transform: lowercase; letter-spacing: 0.3px;
  padding: 11px 8px; text-align: center; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
thead th:first-child { text-align: left; padding-left: 16px; text-transform: none; font-size: 12.5px; }
thead th.col-info { text-transform: none; }
thead th.current { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

tbody td { border-top: 1px solid var(--border); padding: 8px 8px; text-align: center; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: var(--surface-2); }
td.cliente { text-align: left; padding-left: 16px; max-width: 260px; }
.cliente-nome {
  font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 244px;
}
.cliente-nome:hover { color: var(--accent); }
.cliente-nome-row { display: flex; align-items: center; gap: 4px; }
.cliente-nome-row .cliente-nome { max-width: 218px; }
.cliente-sub { font-size: 11.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }

.servidor-link { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--accent); }
.servidor-link:hover { border-bottom-style: solid; }

.obs-icon {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 15px; height: 15px; color: var(--accent); cursor: help;
}
.obs-icon svg { width: 15px; height: 15px; }

.app-missing-icon {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 15px; height: 15px; color: var(--amber); cursor: help;
}
.app-missing-icon svg { width: 15px; height: 15px; }

.pay-tooltip.obs { border-left-color: var(--accent); }
.pay-tooltip.obs .pay-tooltip-title { color: var(--accent); }
.pay-tooltip.obs .pay-tooltip-obs { margin-top: 0; font-style: normal; }
a.wa { color: var(--green); text-decoration: none; font-weight: 500; }
a.wa:hover { text-decoration: underline; }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
td.mescell { padding: 5px 3px; }
td.mescell.current { background: var(--accent-soft); }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 58px; padding: 4px 6px;
  border-radius: 8px; border: 0;
  font: inherit; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 100ms ease, filter 140ms ease;
}
.pill:hover { filter: brightness(1.1); }
.pill:active { transform: scale(0.94); }
.pill.pago { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.25); }
.pill.pendente { background: transparent; color: var(--text-3); border: 1px dashed var(--border-strong); font-weight: 500; }
.pill.pendente:hover { border-color: var(--green); color: var(--green); }
.pill.vencido { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.25); animation: pulseVencido 2.4s ease-in-out infinite; }
.pill.futuro { background: transparent; color: var(--text-3); border: 1px dashed var(--border); font-weight: 500; cursor: default; }
.pill.fora { background: transparent; color: var(--text-3); border: 0; cursor: default; opacity: 0.4; }
.pill.bonificado { background: var(--violet-bg); color: var(--violet); box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.3); }

@keyframes pulseVencido {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.25); }
  50% { box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.55), 0 0 0 3px var(--red-bg); }
}

.pay-tooltip {
  position: fixed; z-index: 95;
  min-width: 200px; max-width: 260px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  border-left: 3px solid var(--text-3);
  pointer-events: none;
  animation: payTooltipIn 120ms ease;
}
.pay-tooltip.pago { border-left-color: var(--green); }
.pay-tooltip.vencido { border-left-color: var(--red); }
.pay-tooltip.pendente, .pay-tooltip.futuro, .pay-tooltip.app-missing { border-left-color: var(--amber); }
.pay-tooltip.bonificado { border-left-color: var(--violet); }
@keyframes payTooltipIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

.pay-tooltip::after {
  content: ''; position: absolute; width: 9px; height: 9px;
  background: var(--surface); border-left: 1px solid var(--border-strong); border-top: 1px solid var(--border-strong);
  left: var(--arrow-left, 50%); transform: translateX(-50%) rotate(45deg);
  bottom: -6px;
}
.pay-tooltip.arrow-below::after { top: -6px; bottom: auto; transform: translateX(-50%) rotate(225deg); }

.pay-tooltip-title {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-transform: capitalize;
}
.pay-tooltip.pago .pay-tooltip-title { color: var(--green); }
.pay-tooltip.vencido .pay-tooltip-title { color: var(--red); }
.pay-tooltip.pendente .pay-tooltip-title, .pay-tooltip.futuro .pay-tooltip-title, .pay-tooltip.app-missing .pay-tooltip-title { color: var(--amber); }
.pay-tooltip.bonificado .pay-tooltip-title { color: var(--violet); }

.pay-tooltip.app-missing .pay-tooltip-obs { margin-top: 0; font-style: normal; }

.pay-tooltip-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 2px 0; }
.pay-tooltip-row span { color: var(--text-3); }
.pay-tooltip-row strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.pay-tooltip-obs { margin-top: 6px; font-size: 12px; color: var(--text-2); font-style: italic; }
.pay-tooltip-hint { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); text-align: center; }

td.total { font-weight: 700; color: var(--green); text-align: right; padding-right: 16px; font-variant-numeric: tabular-nums; }
tfoot td {
  border-top: 2px solid var(--border-strong);
  padding: 11px 8px; text-align: center;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px;
  background: var(--bg-2);
}
tfoot td:first-child { text-align: left; padding-left: 16px; }
tfoot td:last-child { text-align: right; padding-right: 16px; color: var(--green); }

.status-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  border-radius: 6px; padding: 2px 6px;
}
.status-badge svg, .template-badge svg { width: 10px; height: 10px; vertical-align: -1px; margin-right: 1px; }
.status-badge.ativo { background: var(--green-bg); color: var(--green); }
.status-badge.inativo { background: var(--surface-2); color: var(--text-3); }
.status-badge.suspenso { background: var(--amber-bg); color: var(--amber); }
.status-badge.bonificado { background: var(--accent-soft); color: var(--accent); }

/* ---------- Credenciais ---------- */
.cred-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  display: inline-grid; place-items: center; flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.cred-btn svg { width: 12px; height: 12px; }
.cred-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.status-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  display: inline-grid; place-items: center; flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.status-btn svg { width: 12px; height: 12px; }
.status-btn-amber:hover { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.status-btn-amber.is-active { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.status-btn-red:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.status-btn-red.is-active { background: var(--red-bg); color: var(--red); border-color: var(--red); }

/* ---------- Pagamento adiantado ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  min-width: 34px; height: 30px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.adv-pay-preview {
  font-size: 12.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 10px 0;
}

/* ---------- Bonificação de mês ---------- */
.bonus-hint {
  font-size: 12.5px; color: var(--violet); background: var(--violet-bg);
  border-radius: 8px; padding: 8px 10px; margin: 0 0 12px;
}

#ap_enviar_msg_wrap { justify-content: center; width: 100%; margin: 4px 0; }

.creds-pop {
  position: fixed; z-index: 90;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px; min-width: 260px; max-width: 340px;
}
.creds-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; }
.creds-row-title { padding: 2px 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.creds-client-name { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; color: var(--text); white-space: normal; }
.creds-label { font-size: 11px; color: var(--text-3); width: 52px; flex-shrink: 0; }
#syncBody .creds-label { width: 130px; white-space: normal; }
.creds-value { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creds-links { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.creds-link-row { display: flex; align-items: center; gap: 6px; }
.creds-link-row .creds-value { font-size: 11.5px; }
.mini-btn {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease; flex-shrink: 0;
}
.mini-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mini-btn-block { display: block; width: 100%; text-align: center; padding: 8px 10px; font-size: 12px; margin-top: 8px; }
.creds-empty-hint { font-size: 11.5px; color: var(--text-3); padding: 4px 6px 0; }

fieldset.creds {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 14px 11px; margin: 0;
}
fieldset.creds legend { font-size: 12px; color: var(--text-2); font-weight: 600; padding: 0 6px; }
.pass-field { position: relative; display: flex; }
.pass-field input { width: 100%; padding-right: 36px; }
.pass-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--text-3); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center;
}
.pass-eye:hover { color: var(--accent); background: var(--surface-hover); }
.pass-eye svg { width: 16px; height: 16px; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 14px; align-items: center; }
.legend .hint { margin-left: auto; color: var(--text-3); }
.legend .app-version { color: var(--text-3); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dot.pago { background: var(--green-bg); border: 1px solid var(--green); }
.dot.pendente { border: 1px dashed var(--border-strong); }
.dot.vencido { background: var(--red-bg); border: 1px solid var(--red); }
.dot.fora { border: 1px dashed var(--border); }

.empty { padding: 56px 24px; text-align: center; color: var(--text-2); }
.empty .btn { margin-top: 10px; }

/* ---------- Paginação ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--bg-2); font-size: 12.5px; color: var(--text-2);
}
.pager-size { display: flex; align-items: center; gap: 8px; }
.pager-size select { padding: 5px 8px; font-size: 12.5px; }
.pager-size input[type="number"] { width: 64px; padding: 5px 8px; font-size: 12.5px; }
.modal .pager { margin-top: 14px; border-radius: var(--radius-sm); }
.pager-info { color: var(--text-3); }
.pager-nav { display: flex; align-items: center; gap: 2px; }
.pager-nav .icon-btn { font-size: 13px; }
.pager-nav .icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pager-nav .icon-btn:disabled:hover { background: transparent; color: var(--text-2); }
.pager-pages { display: flex; align-items: center; gap: 2px; margin: 0 4px; }
.pager-pages button {
  min-width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.pager-pages button:hover { background: var(--surface-hover); color: var(--text); }
.pager-pages button.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

@media (max-width: 720px) {
  .pager { flex-direction: column; align-items: stretch; }
  .pager-nav { justify-content: center; }
}

/* ---------- Modais ---------- */
.overlay, .auth-view {
  position: fixed; inset: 0;
  background: rgba(6, 8, 14, 0.6);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 16px; z-index: 50;
  overflow-y: auto;
  animation: fadeIn 160ms ease;
}
.overlay > .modal, .auth-view > .modal { margin: auto; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.auth-view {
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(37, 136, 228, 0.16), transparent 60%),
    radial-gradient(900px 520px at 108% 110%, rgba(21, 80, 136, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  backdrop-filter: none;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 680px;
  max-height: 94vh;
  padding: 14px 22px 18px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms cubic-bezier(.16,1,.3,1);
  display: flex; flex-direction: column;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1080px; }
.relatorios-toolbar { display: flex; justify-content: flex-end; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.relatorios-toolbar label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.relatorios-custom-periodo { display: flex; gap: 12px; }
.relatorios-custom-periodo label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.relatorios-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.rstat { flex: 1; min-width: 140px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.rstat-label { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; }
.rstat-value { display: block; font-size: 18px; font-weight: 700; color: var(--text); }
.relatorios-chart-wrap { width: 100%; position: relative; }
.relatorios-chart-wrap canvas { width: 100%; height: auto; max-width: 900px; display: block; margin: 0 auto; cursor: crosshair; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -100%);
  white-space: nowrap;
  z-index: 5;
}
.chart-tooltip b { color: var(--accent); }

.modal .new-server-form { display: flex; flex-direction: row; gap: 10px; align-items: flex-end; margin-bottom: 14px; overflow: visible; flex: 0 0 auto; min-height: auto; }
.ns-field { flex: 1; }
/* div.ns-field: quando o campo agrupa varios sub-campos ja labelados individualmente (sem input
   direto no wrapper), usa <div> em vez de <label> pra nao aninhar label dentro de label (HTML
   invalido) -- repete aqui a mesma pinta que .modal label ja da pros <label class="ns-field">. */
.modal div.ns-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 500; }

.modal .new-app-form { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 6px; overflow: visible; flex: 0 0 auto; min-height: auto; }
.new-app-form .ns-field { flex: 1; min-width: 150px; }
.ni-tipo-field { flex: 0 0 110px !important; min-width: 110px !important; }
.ni-link-field { flex: 1 1 220px !important; min-width: 220px !important; }
.ni-form-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.modal .new-field-form { display: flex; flex-direction: row; gap: 10px; align-items: flex-end; margin: 12px 0; overflow: visible; flex: 0 0 auto; min-height: auto; }
.nf-tipo-field { flex: 0 0 118px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.nf-tipo-field select { width: 100%; }
.field-chip-tipo { font-size: 10px; text-transform: uppercase; color: var(--text-3); font-weight: 700; letter-spacing: 0.3px; }
.app-logo-field { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.logo-preview-sm { width: 42px; height: 42px; font-size: 16px; cursor: pointer; }
.logo-preview-sm img { width: 100%; height: 100%; object-fit: contain; }

.app-card-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-card-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.app-card-actions .icon-btn:first-child:hover { background: var(--accent-soft); color: var(--accent); }
.app-site-link { color: var(--accent); text-decoration: none; font-size: 12px; word-break: break-all; }
.app-site-link:hover { text-decoration: underline; }

/* Botão de ícone com destaque (ação primária), mesma linguagem visual dos ícones do header */
.icon-toggle-accent {
  background: var(--accent-soft); color: var(--accent); border-color: transparent;
}
.icon-toggle-accent:hover { background: var(--accent); color: var(--accent-ink); }

.servers-toolbar { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dns-status-toolbar { justify-content: space-between; }
.dns-status-toolbar .hint-block { margin: 0; }
.dns-status-table th:first-child, .dns-status-table td:first-child { width: 160px; }
.dns-status-table td:last-child { max-width: 320px; }
.dns-status-table .log-status { white-space: normal; }
.servers-toolbar .search-wrap { flex: 1; min-width: 220px; }
.servers-toolbar .search-wrap input { padding: 8px 11px 8px 36px; }
.apps-toolbar { display: flex; align-items: center; gap: 10px; }
.apps-toolbar .search-wrap { flex: 1; }

.view-toggle {
  display: flex; align-items: center; gap: 2px; margin-left: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px;
  flex-shrink: 0;
}
.view-toggle-btn {
  width: 32px; height: 30px; border-radius: 7px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-3);
  display: grid; place-items: center;
  transition: background 120ms ease, color 120ms ease;
}
.view-toggle-btn svg { width: 15px; height: 15px; }
.view-toggle-btn:hover { background: var(--surface-hover); color: var(--text); }
.view-toggle-btn.active { background: var(--accent-soft); color: var(--accent); }

.apps-table-wrap {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow-x: hidden; overflow-y: auto; max-height: 56vh; background: var(--surface);
}
.apps-table { table-layout: fixed; border-collapse: collapse; width: 100%; font-size: 13px; }
.apps-table thead th {
  position: sticky; top: 0; background: var(--bg-2); color: var(--text-2);
  font-family: var(--font-display); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.3px;
  padding: 10px 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid var(--border);
}
.apps-table th:nth-child(1) { width: 56px; }
.apps-table th:nth-child(2) { width: 16%; }
.apps-table th:nth-child(3) { width: 28%; }
.apps-table th:nth-child(4) { width: 19%; }
.apps-table th:nth-child(5) { width: 150px; }
.apps-table th:nth-child(6) { width: 112px; }
.apps-table tbody td { border-top: 1px solid var(--border); padding: 8px 12px; vertical-align: middle; overflow: hidden; }
.apps-table tbody td strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apps-table td.app-logo-cell { padding: 6px 10px; }
.apps-table td.app-actions-cell {
  display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding: 6px 6px;
}
.apps-table td.app-actions-cell .icon-btn { width: 28px; height: 28px; }
.apps-table tbody tr:hover { background: var(--surface-2); }
.apps-table td input { width: 100%; min-width: 0; box-sizing: border-box; font-size: 12.5px; padding: 6px 9px; }
.apps-table strong { font-family: var(--font-display); font-size: 13.5px; }

.servers-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 56vh; overflow-y: auto; padding: 2px;
}
/* Créditos e Servidores ainda usam grid */
#creditosList, #serversList {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.server-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px;
}
/* card de revenda: nome + acoes em linha no topo, info + servidores abaixo */
#revendasList .server-card { gap: 6px; }
#revendasList .server-card-head { flex-direction: row; justify-content: space-between; align-items: center; }
#revendasList .server-card-head strong { font-size: 14px; }
#revendasList .revenda-info-row { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-2); }
#revendasList .revenda-info-row b { color: var(--text); }
.server-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.server-card-head strong { font-family: var(--font-display); font-size: 15px; }
.server-card-head .icon-btn:hover { background: var(--red-bg); color: var(--red); }
.server-card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.server-card-actions button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 8px; padding: 5px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }
.server-card-actions button:hover { background: var(--surface-hover); color: var(--text); }
.revenda-servers { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.revenda-server-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.revenda-server-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.revenda-server-chip button { border: none; background: transparent; color: var(--text-3); cursor: pointer; font-size: 11px; line-height: 1; padding: 2px; border-radius: 50%; }
.revenda-server-chip button:hover { background: var(--red-bg); color: var(--red); }
.revenda-server-add { display: flex; gap: 6px; align-items: center; }
.revenda-server-add select { flex: 1; min-width: 140px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; color: var(--text); font-size: 12px; }
.revenda-server-add button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.revenda-server-add button:hover { background: var(--surface-hover); color: var(--text); }
.revendas-toolbar { margin: 6px 0 10px; }
.revendas-toolbar input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 13px; }
.revenda-badge-alerta { display: inline-flex; align-items: center; gap: 4px; background: var(--red-bg); color: var(--red); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; margin-left: 8px; }
.revenda-badge-inativa { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); color: var(--text-3); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; margin-left: 8px; }
.revenda-lancamentos-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.revenda-lancamentos-toolbar select, .revenda-lancamentos-toolbar a { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; color: var(--text); font-size: 12px; text-decoration: none; }
.revenda-lancamentos-toolbar a:hover { background: var(--surface-hover); color: var(--text); }
.rv-servers-checklist { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--surface-2); }
.rv-server-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rv-server-row label { display: flex; align-items: center; gap: 6px; flex: 1; cursor: pointer; }
.rv-server-row input[type="number"] { width: 90px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; color: var(--text); font-size: 12px; }
.rv-servers-empty { font-size: 12px; color: var(--text-3); }
.revenda-server-chip .chip-valor { opacity: 0.85; }
.revenda-server-chip input[type="number"] { width: 64px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 4px; color: var(--text); font-size: 11px; }

.server-field { display: flex; flex-direction: column; gap: 4px; }
.server-field-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); font-weight: 600; }
.server-field input { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; }
.app-custo-caption { font-size: 11px; color: var(--text-3); margin-top: -2px; }

.server-divider { border: 0; border-top: 1px solid var(--border); margin: 2px 0; }

.dns-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dns-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 6px 4px 10px; font-size: 11.5px; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--text-2);
  max-width: 100%;
}
.dns-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dns-chip button {
  background: transparent; border: 0; color: var(--text-3); cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; line-height: 1; flex-shrink: 0;
}
.dns-chip button:hover { background: var(--red-bg); color: var(--red); }
.dns-empty { font-size: 12px; color: var(--text-3); }
.modal .dns-add-form { display: flex; flex-direction: row; gap: 8px; }
.dns-add-form input { flex: 1; font-size: 12.5px; padding: 7px 10px; }
.dns-add-form .icon-toggle-accent { width: 34px; height: 34px; flex-shrink: 0; }
.dns-add-form .icon-toggle-accent svg { width: 14px; height: 14px; }
.servers-empty { grid-column: 1 / -1; text-align: center; color: var(--text-2); padding: 32px; font-size: 13.5px; }

/* Integracoes com paineis IPTV */
.integracao-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px;
}
.integracao-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.integracao-nome { font-weight: 700; font-family: var(--font-display); }
.integracao-tipo { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-3); }
.integracao-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Créditos por servidor */
.modal .new-credit-form { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; overflow: visible; flex: 0 0 auto; min-height: auto; }
.new-credit-form .ns-field { flex: 1; min-width: 130px; }
.credit-preview { font-size: 12px; color: var(--text-2); white-space: nowrap; padding-bottom: 9px; }
.credit-summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.credit-summary b { color: var(--text); }
.credit-history { display: flex; flex-direction: column; gap: 6px; max-height: 170px; overflow-y: auto; }
.credit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.credit-row-info { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.credit-row-info b { color: var(--text); }
.credit-row button {
  background: transparent; border: 0; color: var(--text-3); cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; line-height: 1; flex-shrink: 0;
}
.credit-row button:hover { background: var(--red-bg); color: var(--red); }
.credit-row-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.credit-row-actions button:first-child:hover { background: var(--surface-hover); color: var(--text); }
.credit-empty { font-size: 12px; color: var(--text-3); }

/* Relatórios: abas + tabela de margem */
.relatorios-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.rtab {
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: var(--font-display);
}
.rtab:hover { background: var(--surface-hover); }
.rtab.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.margem-warning {
  font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
}
.margem-subtabs { display: flex; gap: 6px; margin-bottom: 14px; }
.msub {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-display);
}
.msub:hover { background: var(--surface-hover); }
.msub.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.margem-table-wrap { max-height: 48vh; }
.dash-bar-track { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); min-width: 40px; }
.dash-bar-clientes { background: #6c8cff; height: 100%; }
.dash-bar-revendas { background: #ffb545; height: 100%; }
.data-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.data-table thead th {
  position: sticky; top: 0; background: var(--bg-2); color: var(--text-2);
  font-family: var(--font-display); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.3px;
  padding: 9px 11px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 8px 11px; border-top: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.margem-pos { color: var(--accent); }
.data-table td.margem-neg { color: var(--red); }
.data-table td.margem-muted { color: var(--text-3); }

/* ---------- Bot de atendimento ---------- */
.modal-bot { max-width: 1200px; }
/* .bot-layout nao e um <form> (o modal so tem .modal-head + .bot-layout), entao nao herda o
   scroll interno que .modal > form da aos outros modais. Sem isso, uma lista longa de opcoes
   empurra a altura do modal alem de 90vh e o conteudo vaza por baixo, sobre a tela de tras. */
.modal-bot .bot-layout {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; margin-right: -4px;
}
.bot-layout { display: grid; grid-template-columns: 200px 1fr 290px; gap: 16px; align-items: start; }
/* Itens de grid tem min-width:auto por padrao (= min-content do conteudo). Sem isso, selects e
   linhas de opcao no meio empurram a coluna 1fr alem da largura disponivel e a simulacao vaza
   pra fora do modal — o bug reportado em 2026-08-05. */
.bot-col-steps, .bot-col-editor, .bot-col-sim { min-width: 0; }
#botStepEditor .var-chips-panel { margin: 10px 0 14px; }
@media (max-width: 1180px) { .bot-layout { grid-template-columns: 180px 1fr 260px; gap: 12px; } }
@media (max-width: 1000px) { .bot-layout { grid-template-columns: 1fr; } }
.bot-col-title { margin: 0 0 10px; font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.bot-col-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.bot-col-editor-head .bot-col-title { margin: 0; }
.bot-step-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.col1-switch {
  flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 999px;
  padding: 5px 11px; cursor: pointer;
}
.col1-switch:hover { filter: brightness(1.08); }
.bot-var-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; font-weight: 600;
  padding: 3px 7px; border-radius: 999px; border: 1px dashed var(--border-strong);
  background: var(--surface-2); color: var(--accent); cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.bot-var-chip:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Simulação — mockup de telefone/chat */
.wa-out { --wa-out: #1f2937; --wa-in: #0b6b52; --wa-bg: #0c1418; }
:root { --wa-out: #1f2937; --wa-in: #0b6b52; --wa-bg: #0c1418; }
:root[data-theme="light"] { --wa-out: #ffffff; --wa-in: #d9fdd3; --wa-bg: #e9edf1; }
.bot-col-sim { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.phone { width: 100%; max-width: 300px; height: 480px; border-radius: 28px; background: #05070a; border: 1px solid #000; padding: 8px; box-shadow: var(--shadow-lg); }
.phone-screen { height: 100%; border-radius: 20px; overflow: hidden; background: var(--wa-bg); display: flex; flex-direction: column; }
.wa-head { background: #0b3d33; color: #eafff8; padding: 10px 12px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
:root[data-theme="light"] .wa-head { background: #075e54; }
.wa-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 11px; flex-shrink: 0; }
.wa-head-name { font-size: 12.5px; font-weight: 700; }
.wa-head-status { font-size: 10px; opacity: .8; }
.wa-log { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 84%; padding: 6px 9px; border-radius: 10px; font-size: 12px; line-height: 1.4; white-space: pre-wrap; }
.bubble.bot { align-self: flex-start; background: var(--wa-out); color: var(--text); border-top-left-radius: 3px; }
:root[data-theme="light"] .bubble.bot { color: #1a1e2e; }
.bubble.me { align-self: flex-end; background: var(--wa-in); color: #eafff5; border-top-right-radius: 3px; }
:root[data-theme="light"] .bubble.me { color: #05341f; }
.wa-options { display: flex; flex-direction: column; gap: 5px; padding: 2px 8px 8px; flex-shrink: 0; }
.wa-opt-btn { text-align: left; font-size: 11.5px; padding: 7px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--accent); cursor: pointer; font-weight: 600; }
.wa-opt-btn:hover { background: var(--accent-soft); }
.wa-input-row { flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; background: var(--wa-bg); }
.wa-input-row input { flex: 1; min-width: 0; font-size: 11.5px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 12px; }
.wa-send { width: 28px; height: 28px; border-radius: 50%; border: 0; flex-shrink: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.wa-send svg { width: 13px; height: 13px; }
.wa-restart { font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; cursor: pointer; }
.wa-restart:hover { color: var(--text); background: var(--surface-hover); }

/* Lista de passos */
.step-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 9px;
  padding: 8px 10px; cursor: pointer; text-align: left;
  font-size: 13px; color: var(--text-2); font-family: var(--font-display); font-weight: 600;
  transition: background 120ms ease, color 120ms ease;
}
.step-item:hover { background: var(--surface-hover); color: var(--text); }
.step-item.active { background: var(--accent-soft); color: var(--accent); }
.step-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.step-item.active .step-dot { background: var(--accent); }
.step-item .badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 7px; flex-shrink: 0;
}
.add-step {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: 9px;
  padding: 9px 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  font-family: var(--font-display);
}
.add-step:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); border-style: solid; }
.add-step svg { width: 14px; height: 14px; }

/* Editor de opções */
.options-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 8px; }
.options-head label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.opt-add {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: var(--font-display);
}
.opt-add:hover { filter: brightness(1.08); }
.opt-add svg { width: 12px; height: 12px; }
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: flex; align-items: flex-start; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.opt-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text-3); flex-shrink: 0; margin-top: 2px;
}
.opt-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt-fields input, .opt-fields select { width: 100%; }
.opt-type-row { display: flex; gap: 6px; }
.opt-type-row select, .opt-type-row input { flex: 1; min-width: 0; }
.opt-del {
  background: transparent; border: 0; color: var(--text-3); cursor: pointer; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 2px;
}
.opt-del svg { width: 13px; height: 13px; }
.opt-del:hover { background: var(--red-bg); color: var(--red); }
.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.editor-foot .hint { font-size: 12px; color: var(--text-3); }
.del-step {
  background: transparent; border: 1px solid var(--border); color: var(--red); border-radius: 8px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font-display);
}
.del-step:hover:not(:disabled) { background: var(--red-bg); border-color: transparent; }
.del-step:disabled { opacity: 0.4; cursor: not-allowed; }

/* Atalhos por palavra-chave */
.atalho-hint { font-size: 12px; color: var(--text-3); margin: 0 0 12px; line-height: 1.5; }
.atalho-list { display: flex; flex-direction: column; gap: 8px; }
.atalho-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.atalho-row input, .atalho-row select { flex: 1; min-width: 0; }
.atalho-empty { font-size: 12.5px; color: var(--text-3); padding: 10px 2px; }

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-shrink: 0; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.modal > form { display: flex; flex-direction: column; gap: 9px; overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 4px; margin-right: -4px; }
.modal > .modal-body { display: flex; flex-direction: column; gap: 9px; overflow-y: auto; flex: 1 1 auto; min-height: 0; padding-right: 4px; margin-right: -4px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.modal label input, .modal label select, .modal label textarea { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
.modal-foot {
  display: flex; gap: 8px; align-items: center; margin-top: 8px;
  position: sticky; bottom: -1px; background: var(--surface);
  padding-top: 10px; padding-bottom: 2px; flex-shrink: 0;
}
.spacer { flex: 1; }

.confirm-modal { align-items: center; text-align: center; }
.confirm-icon {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-bg); color: var(--red); margin-bottom: 4px;
}
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-modal h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.confirm-modal p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.confirm-foot { justify-content: center; width: 100%; margin-top: 18px; }

.pay-context { margin: 0; font-size: 13.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 11px 20px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: toastIn 200ms cubic-bezier(.16,1,.3,1);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 720px) {
  main { padding: 18px 14px 44px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .legend .hint { margin-left: 0; width: 100%; }
  .topbar { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* Alvo de toque WCAG 2.5.5 (44x44) so onde o dispositivo realmente usa toque -- mouse continua
   com a densidade atual (32/38px), que ja funciona bem pra ponteiro fino. */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .icon-toggle { width: 44px; height: 44px; }
}

.modal-title-count { font-weight: 500; color: var(--text-3); font-size: 15px; }
.modal > form.new-template-form { flex: 0 0 auto; min-height: auto; }
.modal-head-actions { display: flex; align-items: center; gap: 8px; }
.creditos-resumo-wrap { max-height: 60vh; overflow-y: auto; }
.credit-acessos { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.credit-acessos select { width: auto; padding: 2px 6px; }
.venc-completo { display: block; margin-top: 4px; font-size: 12px; color: var(--text-3); font-weight: 400; }
.venc-late { color: #dc2626; font-weight: 600; }
/* Central de Mensagens: o modal inteiro rola (formulário + lista), em vez de espremer a lista de modelos */
#messagesOverlay .modal { overflow-y: auto; }
#messagesOverlay .modal > * { flex-shrink: 0; }
#messagesOverlay .servers-list { max-height: none; overflow: visible; }

/* ---------- Menus do topo (Cadastros / WhatsApp / Conta) ---------- */
.nav-menu { position: relative; }
.nav-menu-btn {
  height: 38px; padding: 0 12px; border-radius: 10px; position: relative;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: 600 13.5px var(--font-display, inherit); white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.nav-menu-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-menu-btn .nav-caret { width: 14px; height: 14px; opacity: .6; transition: transform 160ms ease; }
.nav-menu-btn:hover, .nav-menu.open .nav-menu-btn { background: var(--surface-hover); color: var(--accent); border-color: var(--accent-soft, var(--border)); }
.nav-menu.open .nav-caret { transform: rotate(180deg); }
.nav-menu-list {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 270px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 6px; display: flex; flex-direction: column; gap: 2px;
  animation: navMenuIn 140ms ease-out;
}
.nav-menu-list[hidden] { display: none; }
.nav-menu-right .nav-menu-list { left: auto; right: 0; }
@keyframes navMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: var(--text); cursor: pointer;
}
.nav-item[hidden] { display: none; }
.nav-item:hover, .nav-item:focus-visible { background: var(--surface-2); outline: none; }
.nav-item > svg { width: 34px; height: 34px; padding: 8px; flex-shrink: 0; border-radius: 9px; background: var(--surface-2); color: var(--accent); }
.nav-item:hover > svg { background: var(--surface); }
.nav-item-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.nav-item-text b { font-size: 13.5px; font-weight: 600; }
.nav-item-text small { font-size: 12px; color: var(--text-3); }
.nav-item .ws-status-dot, .nav-item .alert-badge { position: static; margin-left: auto; flex-shrink: 0; box-shadow: none; }
.nav-menu-btn .nav-mirror-dot { top: -3px; right: -3px; }
.nav-menu-btn .nav-mirror-badge { top: -6px; right: -6px; }
.nav-item .ic-moon { display: none; }
:root[data-theme="light"] .nav-item .ic-sun { display: none; }
:root[data-theme="light"] .nav-item .ic-moon { display: block; }
@media (max-width: 720px) {
  .nav-menu-btn span { display: none; }
  .nav-menu-list { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; }
}
/* Relatórios: o modal inteiro rola, o gráfico não vaza pra fora */
#relatoriosOverlay .modal { overflow-y: auto; }
#relatoriosOverlay .modal > * { flex-shrink: 0; }
.bulk-publico { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.modal .bulk-publico label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.modal .bulk-publico input[type=radio] { width: auto; height: auto; margin: 0; }

/* ---------- Dashboard groups ---------- */
.dash-cards { display: flex; flex-direction: column; gap: 0; padding: 0; background: transparent; border: none; box-shadow: none; }
.dash-group { padding: 10px 0 4px; }
.dash-group + .dash-group { border-top: 1px solid var(--border); padding-top: 12px; }
.dash-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 8px; padding-left: 2px;
}
.dash-group-total .dash-group-label { color: var(--accent); }
.dash-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.dash-cards .card { padding: 12px 14px; }
.dash-cards .card-value { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-cards .card-label { font-size: 11.5px; }
.dash-cards .card-icon { width: 26px; height: 26px; top: 10px; right: 10px; }
.dash-cards .card-icon svg { width: 13px; height: 13px; }
@media (max-width: 720px) {
  .dash-group-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Resumo compacto (página principal) ---------- */
.dash-cards .card-link { cursor: pointer; font: inherit; text-align: left; color: inherit; }
.dash-cards .card-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.dash-cards .card-link .card-value { font-size: 14px; color: var(--accent); }
/* card "Recebido" sem truncar o valor: badge quebra para a linha de baixo se faltar espaço */
.dash-cards .card-value-row { flex-wrap: wrap; row-gap: 4px; justify-content: flex-start; }
.dash-cards .card-value-row .card-value { overflow: visible; text-overflow: clip; }
#summaryCards .dash-group-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
#summaryCards .card { padding: 14px 16px; }
#summaryCards .card-value { font-size: 20px; }
@media (max-width: 720px) {
  #summaryCards .dash-group-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   Tema estilo Rocket (Bootstrap 5 escuro): superfícies chapadas,
   cantos 6px, fonte do sistema, menu no topo com links simples.
   ========================================================== */
:root {
  --bg: #212529;
  --bg-2: #1a1d20;
  --surface: #2b3035;
  --surface-2: #343a40;
  --surface-hover: #3d444b;
  --border: #3f454b;
  --border-strong: #6c757d;
  --text: #f8f9fa;
  --text-2: #adb5bd;
  --text-3: #7c858d;
  --accent: #0d6efd;
  --accent-2: #0b5ed7;
  --accent-ink: #ffffff;
  --accent-soft: rgba(13, 110, 253, 0.22);
  --green: #75b798;
  --green-bg: rgba(25, 135, 84, 0.25);
  --amber: #ffda6a;
  --amber-bg: rgba(255, 193, 7, 0.2);
  --red: #ea868f;
  --red-bg: rgba(220, 53, 69, 0.25);
  --blue: #6ea8fe;
  --radius-sm: 6px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.35);
  --shadow-md: none;
  --shadow-glow: none;
  --font-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --nav-link: rgba(248, 249, 250, 0.65);
  --nav-link-hover: rgba(248, 249, 250, 0.9);
  --rk-title: #7c858d;
  --rk-head-text: rgba(255, 255, 255, 0.8);
}
:root[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-2: #e9ecef;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-hover: #e9ecef;
  --border: #dee2e6;
  --border-strong: #adb5bd;
  --text: #212529;
  --text-2: #495057;
  --text-3: #6c757d;
  --accent: #0d6efd;
  --accent-2: #0b5ed7;
  --accent-ink: #ffffff;
  --accent-soft: rgba(13, 110, 253, 0.15);
  --green: #198754;
  --green-bg: #d1e7dd;
  --amber: #997404;
  --amber-bg: #fff3cd;
  --red: #dc3545;
  --red-bg: #f8d7da;
  --blue: #0d6efd;
  --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --nav-link: rgba(33, 37, 41, 0.7);
  --nav-link-hover: #212529;
  --rk-title: #6c757d;
  --rk-head-text: #212529;
}

body { background: var(--bg); font-size: 16px; }
*::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: padding-box; }

/* Barra do topo */
.topbar { background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: none; padding: 8px clamp(12px, 2vw, 24px); }
.brand { gap: 10px; }
.brand h1 { font: 400 1.35rem var(--font-body); letter-spacing: 0; }
.brand p { display: none; }
.topbar-actions { gap: 4px; }
.nav-menu-btn {
  background: transparent; border: 0; border-radius: 6px; height: 40px; padding: 0 8px;
  color: var(--nav-link); font: 400 16px var(--font-body);
}
.nav-menu-btn svg { width: 16px; height: 16px; }
.nav-menu-btn .nav-caret { width: 12px; height: 12px; opacity: 1; }
.nav-menu-btn:hover, .nav-menu.open .nav-menu-btn { background: transparent; color: var(--nav-link-hover); border-color: transparent; }
.nav-menu-list { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 8px 0; gap: 0; min-width: 230px; animation: none; }
.nav-item { border-radius: 0; padding: 6px 16px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item-text small { display: none; }
.nav-item-text b { font-weight: 400; }
.nav-item > svg { width: 18px; height: 18px; padding: 0; border-radius: 0; background: transparent; color: var(--text-2); }
.year-nav, .icon-toggle { border-radius: 6px; background: transparent; }
/* menus logo após a marca, como no Rocket; alertas, conta e "Novo cliente" à direita */
.topbar-inner { justify-content: flex-start; gap: 24px; }
.topbar-actions { flex: 1; }
.topbar-actions .alert-bell { margin-left: auto; }

/* Botões */
.btn { border-radius: 6px; font-weight: 400; background: #6c757d; border-color: #6c757d; color: #fff; }
.btn:hover { background: #5c636a; border-color: #565e64; }
.btn-primary { background: #0d6efd; border-color: #0d6efd; color: #fff; font-weight: 400; box-shadow: none; }
.btn-primary:hover { background: #0b5ed7; border-color: #0a58ca; filter: none; }
.btn-danger { background: #dc3545; border-color: #dc3545; }
.btn-danger:hover { background: #bb2d3b; filter: none; }
.btn-danger-ghost { background: transparent; border-color: #dc3545; color: #ea868f; }
.btn-danger-ghost:hover { background: rgba(220, 53, 69, 0.2); }
:root[data-theme="light"] .btn-danger-ghost { color: #dc3545; }

/* Campos */
input, select, textarea { background: var(--bg); border-color: #495057; border-radius: 6px; }
:root[data-theme="light"] input, :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: #fff; border-color: #dee2e6; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: #86b7fe; box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); }

/* Cartões, tabela e janelas */
.card { background: var(--surface); box-shadow: none; }
.grid-wrap { background: var(--surface); border-radius: 6px; box-shadow: none; }
thead th { background: var(--surface); color: var(--text); font-family: var(--font-body); font-weight: 700; font-size: 12.5px; text-transform: none; letter-spacing: 0; border-bottom: 2px solid var(--border-strong); }
thead th:first-child { font-size: 13px; }
thead th.current { background: var(--accent-soft); color: var(--text); }
.status-badge { border-radius: 6px; font-weight: 700; }
.status-badge.ativo { background: #198754; color: #fff; }
.status-badge.inativo { background: #6c757d; color: #fff; }
.status-badge.suspenso { background: #ffc107; color: #000; }
.status-badge.bonificado { background: #0d6efd; color: #fff; }
.modal { background: var(--bg); border-radius: 8px; animation: none; }
:root[data-theme="light"] .modal { background: #fff; }

/* Painel inicial: Vencimentos / Faturamento / Lucro x Custo */
.rk-dash { margin: 0 auto 28px; max-width: 1340px; }
.rk-title { text-align: center; text-transform: uppercase; color: var(--rk-title); font: 600 28px var(--font-body); margin: 10px 0 8px; }
.rk-eye {
  display: grid; place-items: center; margin: 0 auto 14px; width: 48px; height: 42px; cursor: pointer;
  background: transparent; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--text-2);
}
.rk-eye:hover { color: var(--text); background: var(--surface-2); }
.rk-eye svg { width: 18px; height: 18px; }
.rk-venc { display: grid; grid-template-columns: repeat(4, minmax(0, 228px)); justify-content: space-between; row-gap: 38px; max-width: 1235px; margin: 0 auto 26px; }
.rk-venc .rk-card:nth-child(5) { grid-column: 2; }
.rk-venc .rk-card:nth-child(6) { grid-column: 3; }
.rk-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 0 auto 26px; }
.rk-card {
  display: block; width: 100%; padding: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  transition: border-color 120ms ease;
}
.rk-card:hover { border-color: var(--border-strong); }
.rk-static { cursor: default; }
.rk-static:hover { border-color: var(--border); }
.rk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 18px; font-size: 17px; color: var(--rk-head-text); }
.rk-head span { display: inline-flex; align-items: center; gap: 6px; }
.rk-head svg { width: 16px; height: 16px; }
.rk-head-center { justify-content: center; font-weight: 700; }
.rk-h-success { background: rgba(25, 135, 84, 0.55); }
.rk-h-danger { background: rgba(220, 53, 69, 0.55); }
.rk-h-danger2 { background: rgba(220, 53, 69, 0.28); }
.rk-h-warning { background: rgba(255, 193, 7, 0.5); }
.rk-h-warning2 { background: rgba(255, 193, 7, 0.28); }
.rk-h-primary { background: rgba(13, 110, 253, 0.55); }
.rk-h-info { background: rgba(13, 202, 240, 0.28); }
.rk-body { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 30px; font-size: 17px; }
.rk-body b { font-weight: 700; }
.rk-body .rk-money { color: var(--text-2); }
.rk-body-col { flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 16px 18px; }
.rk-legend { display: flex; justify-content: space-around; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-3); }
.rk-pair { display: flex; justify-content: space-around; text-align: center; gap: 8px; }
.rk-pair > div { flex: 1; min-width: 0; }
.rk-pair b { display: block; font-size: 17px; color: var(--text); white-space: nowrap; }
.rk-pair b.rk-ok { color: var(--green); }
.rk-pair b.rk-bad { color: var(--red); }
.rk-pair small { color: var(--text-2); font-size: 14px; }
.rk-hide .rk-money { filter: blur(7px); user-select: none; }
@media (max-width: 900px) {
  .rk-venc { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .rk-venc .rk-card:nth-child(5), .rk-venc .rk-card:nth-child(6) { grid-column: auto; }
  .rk-title { font-size: 22px; }
  .rk-head { font-size: 14px; padding: 10px 12px; }
  .rk-body { font-size: 15px; padding: 16px 12px 20px; }
}

/* Tela de revendas (estilo Rocket): Dashboard, Revendedores e Vendas de Créditos */
.rk-page { position: fixed; inset: 0; top: var(--rk-topbar-h, 72px); z-index: 35; background: var(--bg); overflow-y: auto; }
body.rk-page-open { overflow: hidden; }
.rk-page-inner { max-width: 1600px; margin: 0 auto; padding: 14px clamp(10px, 1.5vw, 20px) 40px; }
.rk-page-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.rk-page-tabs button { background: transparent; border: 1px solid var(--border); color: var(--text-2); border-radius: 6px; padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.rk-page-tabs button:hover { color: var(--text); background: var(--surface-2); }
.rk-page-tabs button.active { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.rk-page-tabs .rk-page-close { margin-left: auto; }
.rk-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 16px 18px; }
.rk-page-head h2 { margin: 0; font: 600 26px var(--font-body); color: var(--text-2); }
.rk-period { min-height: 38px; background: transparent; color: #6ea8fe; border-color: #0d6efd; }
.rk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-bottom: 20px; }
.rk-stat { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 22px 16px 26px; }
.rk-stat > div { display: flex; flex-direction: column; min-width: 0; }
.rk-stat-label { text-transform: uppercase; font-size: 14px; }
.rk-stat b { font-size: 20px; font-weight: 700; color: var(--text); }
.rk-stat small { font-size: 13px; color: var(--text-2); }
.rk-stat small.rk-up { color: #75b798; }
.rk-stat small.rk-down { color: #ea868f; }
.rk-stat-ic svg { width: 30px; height: 30px; }
.rk-c-blue { color: #3d8bfd; }
.rk-c-green { color: #20a36a; }
.rk-c-cyan { color: #3dd5f3; }
.rk-c-yellow { color: #ffc107; }
:root[data-theme="light"] .rk-c-cyan { color: #0aa2c0; }
.rk-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; }
.rk-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
.rk-panel h3 { margin: 0; text-align: center; font: 700 18px var(--font-body); color: var(--text); }
.rk-panel-sub { margin: 2px 0 10px; text-align: center; font-size: 13px; color: var(--text); }
.rk-svg { width: 100%; height: auto; display: block; }
.rk-bar { fill: #5470c6; }
.rk-bar:hover { fill: #6e8bdf; }
.rk-bar-val { font-size: 8.5px; fill: var(--text-2); }
.rk-bar-lbl, .rk-axis { font-size: 9px; fill: var(--text-2); text-anchor: middle; }
.rk-axis { text-anchor: end; }
.rk-grid-line { stroke: var(--border); stroke-width: 1; }
.rk-rank-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.rk-rank-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-rank-bar { height: 12px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.rk-rank-bar span { display: block; height: 100%; background: #5470c6; }
.rk-empty { text-align: center; color: var(--text-3); padding: 24px 8px; }
.rk-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rk-count { cursor: default; }
.rk-count b { background: #0dcaf0; color: #000; border-radius: 4px; padding: 0 6px; font-size: 12px; }
.rk-search { display: flex; margin-left: auto; min-width: min(360px, 100%); }
.rk-search input { flex: 1; border-radius: 6px 0 0 6px; min-width: 0; }
.rk-btn-outline { border: 1px solid #198754; background: transparent; color: #75b798; border-radius: 0 6px 6px 0; padding: 0 12px; font: inherit; font-size: 14px; cursor: pointer; }
.rk-btn-outline:hover { background: #198754; color: #fff; }
.rk-table-panel { padding: 16px 14px; }
.rk-table-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.rk-table-head h2 { margin: 0; font: 600 26px var(--font-body); color: var(--text); }
.rk-table-head label { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.rk-table-head select { min-height: 36px; padding: 4px 8px; }
.rk-table-wrap { overflow-x: auto; }
.rk-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rk-table th { position: static; background: transparent; text-align: left; font-weight: 700; font-size: 14.5px; color: var(--text); padding: 8px 8px; border-bottom: 2px solid var(--text-2); white-space: nowrap; cursor: default; }
.rk-table th[data-ord] { cursor: pointer; }
.rk-table th:first-child { padding-left: 8px; }
.rk-sort { color: var(--text-3); font-size: 11px; }
.rk-table td { text-align: left; padding: 9px 8px; border-top: 0; border-bottom: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.rk-table tbody tr:hover { background: var(--surface-2); }
.rk-table .rk-c { text-align: center; }
.rk-table td b { color: var(--text); }
.rk-table tr.rk-inativo td { opacity: 0.55; }
.rk-link { color: var(--text-2); text-decoration: underline; }
.rk-link:hover { color: var(--text); }
.rk-acoes { display: flex; gap: 6px; justify-content: center; }
.rk-ab { width: 28px; height: 26px; border: 0; border-radius: 4px; display: inline-grid; place-items: center; cursor: pointer; color: #fff; }
.rk-ab svg { width: 14px; height: 14px; }
.rk-ab-blue { background: #0d6efd; }
.rk-ab-green { background: #198754; }
.rk-ab-yellow { background: #ffc107; color: #000; }
.rk-ab-red { background: #dc3545; }
.rk-ab:hover { filter: brightness(1.12); }
.rk-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }
.rk-pager div { display: flex; align-items: center; gap: 4px; }
.rk-pager button { min-width: 32px; height: 32px; border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 6px; cursor: pointer; }
.rk-pager button:hover { background: var(--surface-2); }
.rk-pager b { padding: 0 8px; color: var(--text); }
#rvFormSlot .new-credit-form { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
#rvFormSlot .new-credit-form > button[type="submit"] { display: none; }
.rk-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 700px) {
  .rk-charts { grid-template-columns: 1fr; }
  .rk-search { margin-left: 0; width: 100%; }
}
#rvFormSlot .rv-servers-checklist { max-height: 260px; }
#rvFormSlot .rv-server-row label { flex-direction: row; align-items: center; justify-content: flex-start; font-size: 14px; color: var(--text); }
#rvFormSlot .rv-server-row input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: none; }
#rvFormSlot .rv-server-row input[type="number"] { min-height: 32px; width: 120px; }
.wa-btn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; background: #198754; color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wa-btn:hover { background: #157347; }
.wa-btn svg { width: 13px; height: 13px; }
/* Janelas: rodapé com o mesmo fundo da janela e rolagem quando o conteúdo passa da altura */
.modal { overflow-y: auto; }
.modal-foot { background: var(--bg); }
:root[data-theme="light"] .modal-foot { background: #fff; }
#rvFormSlot { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; margin-right: -4px; }
#rvFormOverlay .modal { overflow: hidden; }

/* Informações do Revendedor (estilo Rocket) */
#revTabDetalhe .rk-panel { margin-bottom: 18px; }
.rk-voltar { margin-bottom: 12px; }
.rk-det-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.rk-det-info { padding: 22px 28px; }
.rk-det-info h3 { margin: 0 0 12px; font: 600 26px var(--font-body); color: var(--text); text-align: left; }
.rk-det-info p { margin: 0 0 14px; font-size: 15px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rk-det-info p b { color: var(--text); }
.rk-det-acoes { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.rk-det-acoes .btn svg, .rk-table-head .btn svg { width: 15px; height: 15px; }
.rk-btn-yellow { background: #ffc107; border-color: #ffc107; color: #000; }
.rk-btn-yellow:hover { background: #ffca2c; border-color: #ffc720; color: #000; }
.rk-det-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 40px; padding: 26px 14px; }
.rk-tile { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface); }
.rk-tile-h { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 15px; background: rgba(25, 135, 84, 0.55); color: var(--rk-head-text); }
.rk-tile-h svg { width: 15px; height: 15px; flex: none; }
.rk-tile-b { padding: 18px 12px 20px; text-align: center; font-weight: 700; font-size: 15.5px; color: var(--text); }
.rk-scroll-y { max-height: 320px; overflow-y: auto; }
.rk-scroll-y thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.rk-srv { color: var(--text); text-decoration: underline; }
.rk-ext { color: #6ea8fe; display: inline-flex; vertical-align: -2px; }
.rk-ext svg { width: 15px; height: 15px; }
.rk-mostrando { margin: 0 0 10px 6px; font-size: 14px; color: var(--text-2); }
.rk-icon-btn { min-width: 38px; justify-content: center; font-size: 17px; }
.rk-pager-center { justify-content: center; }
.rk-pager-center div { gap: 0; }
.rk-pager-center button { border-radius: 0; margin-left: -1px; color: #6ea8fe; }
.rk-pager-center button:first-child { border-radius: 6px 0 0 6px; }
.rk-pager-center button:last-child { border-radius: 0 6px 6px 0; }
.rk-pager-center button.active { background: var(--surface-2); color: var(--text); }
#rvCompraForm label, #rvServForm label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
#rvCompraForm label.switch { flex-direction: row; justify-content: flex-start; align-items: center; }
@media (max-width: 1000px) {
  .rk-det-top { grid-template-columns: 1fr; }
  .rk-det-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}

/* Telas do Gerenciador (estilo Rocket) */
.rk-page-title { font-size: 15px; color: var(--text-2); align-self: center; }
.rk-btn-danger-outline { background: transparent; border-color: #dc3545; color: #ea868f; }
.rk-btn-danger-outline:hover { background: rgba(220, 53, 69, 0.2); border-color: #dc3545; }
:root[data-theme="light"] .rk-btn-danger-outline { color: #dc3545; }
.rk-toolbar .btn svg { width: 15px; height: 15px; }
.rk-sub { display: block; font-size: 12.5px; color: var(--text-3); white-space: normal; max-width: 220px; }
.rk-link-sub { color: var(--text-2); text-decoration: underline; }
.rk-table th svg, .rk-table td svg { width: 14px; height: 14px; vertical-align: -2px; }
.rk-ab-o-yellow, .rk-ab-o-red, .rk-ab-o-cyan, .rk-ab-o-green { background: transparent; border: 1px solid; }
.rk-ab-o-yellow { border-color: #ffc107; color: #ffc107; }
.rk-ab-o-red { border-color: #dc3545; color: #ea868f; }
.rk-ab-o-cyan { border-color: #0dcaf0; color: #3dd5f3; }
.rk-ab-o-green { border-color: #198754; color: #75b798; }
.rk-ab[disabled] { opacity: .4; cursor: not-allowed; }
.rk-table-head-bar { background: var(--surface-2); margin: -16px -14px 14px; padding: 12px 14px; border-radius: 6px 6px 0 0; }
.rk-table-head-bar h2 { font-size: 20px; font-weight: 500; color: var(--text-2); }
.rk-pag-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 12px; }
.rk-mini { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.rk-mini-h { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 9px; background: var(--surface-2); font-weight: 700; font-size: 15px; color: var(--text-2); }
.rk-mini-h svg { width: 15px; height: 15px; }
.rk-mini-b { display: flex; justify-content: space-around; padding: 18px 10px; font-size: 15px; }
.rk-up { color: #75b798; }
.rk-down { color: #ea868f; }
.rk-grp-head { display: none; }
.rk-table .rk-grp-cli { background: rgba(13, 110, 253, 0.10); }
.rk-ok-n { color: #75b798; font-weight: 700; }
.rk-bad-n { color: #ea868f; font-weight: 700; }
.rk-verde { color: #75b798 !important; }
.rk-srv-nome { color: var(--text); font-size: 15px; }
.rk-srv-nome > svg { color: #3d8bfd; width: 16px; height: 16px; }
.rk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.rk-card-item { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px 16px 18px; }
.rk-card-item h3 { margin: 0 0 12px; text-align: center; font: 500 20px var(--font-body); color: var(--text-2); }
.rk-card-item p { margin: 0 0 10px; font-size: 14.5px; color: var(--text-2); }
.rk-card-item p b { color: var(--text); }
.rk-card-2 { display: grid; grid-template-columns: 1fr 1fr; }
.rk-card-meta { font-size: 13px !important; color: var(--text-3) !important; display: flex; align-items: center; gap: 5px; }
.rk-card-meta svg { width: 13px; height: 13px; }
.rk-card-meta a { color: var(--text-2); }
.rk-card-acoes { display: flex; justify-content: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.rk-card-msg h3 { margin-bottom: 14px; }
.rk-card-msg .rk-card-meta { justify-content: center; }
.btn.rk-o-yellow, .btn.rk-o-red, .btn.rk-o-blue { background: transparent; }
.btn.rk-o-yellow { border-color: #ffc107; color: #ffc107; }
.btn.rk-o-red { border-color: #dc3545; color: #ea868f; }
.btn.rk-o-blue { border-color: #0d6efd; color: #6ea8fe; }
.btn.rk-o-yellow:hover { background: rgba(255, 193, 7, .15); }
.btn.rk-o-red:hover { background: rgba(220, 53, 69, .15); }
.btn.rk-o-blue:hover { background: rgba(13, 110, 253, .15); }
:root[data-theme="light"] .btn.rk-o-yellow { color: #997404; }
:root[data-theme="light"] .btn.rk-o-red { color: #dc3545; }
.rk-card-acoes .btn svg { width: 14px; height: 14px; }
/* janela de formulário genérica */
.g-form-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.g-form-body > * { grid-column: 1 / -1; }
.g-form-body > .g-meia { grid-column: auto; }
.g-form-body label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.g-form-body label.switch { flex-direction: row; justify-content: flex-start; align-items: center; }
.g-form-body select[multiple] { min-height: 110px; }
.g-info { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.g-info span { color: var(--text-2); }
.g-pre { white-space: pre-wrap; margin: 0; font: inherit; background: var(--surface-2); padding: 10px 12px; border-radius: 6px; color: var(--text); }
.g-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 13px; }
.g-tag { border: 0; background: #0d6efd; color: #fff; border-radius: 4px; padding: 2px 7px; font-size: 12px; cursor: pointer; }
.g-tag:hover { filter: brightness(1.15); }
/* WhatsApp */
.rk-wa-card { width: 262px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.rk-wa-img { height: 262px; background: #000; display: grid; place-items: center; }
.rk-wa-img img { width: 100%; height: 100%; object-fit: contain; }
.rk-wa-img span { font-size: 90px; font-weight: 800; color: #3d8bfd; }
.rk-wa-body { padding: 14px; }
.rk-wa-body h3 { margin: 0 0 10px; font: 500 19px var(--font-body); color: var(--text-2); }
.rk-wa-body p { margin: 0 0 6px; font-size: 14px; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.rk-wa-body p svg { width: 14px; height: 14px; }
.rk-wa-linha { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; color: var(--text-2); }
.rk-badge { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: #fff; }
.rk-badge-ok { background: #198754; }
.rk-badge-bad { background: #dc3545; }
.rk-wa-acoes { display: flex; gap: 6px; margin-top: 12px; }
/* Configurações em tela inteira, com seções em cartões (igual Rocket) */
#settingsOverlay.rk-full { top: var(--rk-topbar-h, 72px); background: var(--bg); backdrop-filter: none; align-items: flex-start; padding: 14px 12px 40px; z-index: 36; }
#settingsOverlay.rk-full > .modal { max-width: 1000px; max-height: none; overflow: visible; background: var(--surface); border-radius: 6px; padding: 0 0 18px; animation: none; box-shadow: none; }
#settingsOverlay.rk-full .modal-head { justify-content: center; position: relative; padding: 16px; background: var(--surface-2); border-radius: 6px 6px 0 0; margin-bottom: 14px; }
#settingsOverlay.rk-full .modal-head h2 { font-size: 22px; }
#settingsOverlay.rk-full .modal-head .icon-btn { position: absolute; right: 12px; }
#settingsOverlay.rk-full .modal > form, #settingsOverlay.rk-full .modal > .settings-section { margin: 0 14px 14px; border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; overflow: visible; background: var(--surface); }
#settingsOverlay.rk-full .modal > .settings-section > .settings-section-title { display: block; margin: -14px -16px 12px; padding: 10px 16px; background: var(--surface-2); border-radius: 6px 6px 0 0; font-size: 17px; font-weight: 600; color: var(--text); }
#settingsOverlay.rk-full .modal > form::before { content: 'Geral'; display: block; margin: -14px -16px 6px; padding: 10px 16px; background: var(--surface-2); border-radius: 6px 6px 0 0; font-size: 17px; font-weight: 600; }
.rk-cfg-msgs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; }
.rk-cfg-msgs label { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 700px) { .rk-cfg-msgs, .g-form-body { grid-template-columns: 1fr; } }
/* topo em telas de notebook: tudo numa linha só */
@media (max-width: 1500px) {
  .topbar-inner { gap: 12px; }
  .nav-menu-btn { padding: 0 6px; font-size: 15px; gap: 5px; }
  .nav-menu-btn > svg:first-child { display: none; }
  .topbar-actions { gap: 2px; }
}

/* Clientes (estilo Rocket) e início = Dashboard */
main:not(.view-grade) > .toolbar, main:not(.view-grade) > .grid-wrap, main:not(.view-grade) > .legend { display: none; }
main.view-grade > #rkDash { display: none; }
.brand { cursor: pointer; }
.nav-sep { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.rk-oculta { display: none; }
.rk-search-grande { flex: 1; max-width: 720px; }
.rk-filtros { margin-bottom: 12px; padding: 12px 14px; }
.rk-filtros > b { display: block; margin-bottom: 8px; font-size: 16px; }
.rk-filtros-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 28px; }
.rk-fr select { width: 100%; min-height: 36px; background: transparent; text-align: center; text-align-last: center; color: var(--text-2); font-size: 14px; }
.rk-limpar { margin-top: 10px; min-width: 200px; justify-content: center; }
.rk-st { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.rk-st-verde { background: #198754; }
.rk-st-azul { background: #0d6efd; }
.rk-st-vermelho { background: #dc3545; }
.rk-st-amarelo { background: #ffc107; color: #000; }
.rk-st-cinza { background: #6c757d; }
.rk-ab-purple { background: #6f42c1; }
.rk-acoes-cli { gap: 5px; }
.rk-acoes-cli .rk-ab { width: 32px; height: 30px; }
.rk-ab[disabled] { opacity: .35; cursor: not-allowed; }
@media (max-width: 1100px) { .rk-filtros-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .rk-filtros-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* gráficos da seção Dashboard */
.rk-dash-head { margin: 26px 0 14px; }
.rk-graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; }
.rk-rosca { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.rk-rosca svg { width: 180px; height: 180px; }
.rk-rosca ul { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.rk-rosca li { display: flex; align-items: center; gap: 6px; }
.rk-rosca li span { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.rk-rosca li b { color: var(--text); }
@media (max-width: 700px) { .rk-graficos { grid-template-columns: 1fr; } }

/* % do lucro x mês anterior até o mesmo dia */
.rk-var { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 10px; vertical-align: middle; }
.rk-var-up { color: #20c997; background: rgba(32, 201, 151, .14); }
.rk-var-down { color: #ea868f; background: rgba(220, 53, 69, .16); }
a.rk-srv:hover { color: #3d8bfd; }

/* cabeçalho: logo, ano, menus e ícones juntos no centro */
@media (min-width: 1200px) {
  .topbar-actions { flex-wrap: nowrap; }
  /* tudo junto no centro, com espaço nas laterais */
  .topbar-inner { justify-content: center; gap: 28px; }
  .topbar-actions { flex: 0 0 auto; gap: 10px; }
}
#confirmMessage { white-space: pre-line; }

/* Bot: controles e aba Conversas do bot */
.bot-ctrl { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 10px; flex-wrap: wrap; }
.rk-toolbar .bot-ctrl { margin-left: 0; }
.bot-ctrl .bot-on { background: #198754; border-color: #198754; color: #fff; }
.bot-ctrl .bot-off { background: #6c757d; border-color: #6c757d; color: #fff; }
.bot-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.bot-seg button { background: transparent; border: 0; color: var(--text-2); padding: 7px 12px; cursor: pointer; font: inherit; }
.bot-seg button.ativo { background: #0d6efd; color: #fff; }
.bot-conv { display: grid; grid-template-columns: 320px 1fr; gap: 12px; margin-top: 12px; min-height: 60vh; }
.bot-conv-lista { padding: 6px; overflow-y: auto; max-height: 72vh; }
.bot-conv-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--border); color: var(--text); padding: 10px 8px; cursor: pointer; font: inherit; border-radius: 4px; }
.bot-conv-item small { grid-column: 1 / -1; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-conv-item em { grid-column: 1 / -1; color: var(--text-3); font-style: normal; font-size: 12px; }
.bot-conv-item.ativo, .bot-conv-item:hover { background: var(--surface-2); }
.bot-conv-msgs { display: flex; flex-direction: column; max-height: 72vh; }
.bot-conv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.bot-conv-head #bcExcluir { margin-left: auto; }
.bot-conv-corpo { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bc-msg { max-width: 75%; padding: 8px 10px; border-radius: 8px; white-space: pre-line; }
.bc-msg p { margin: 0; }
.bc-msg small { display: block; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.bc-in { align-self: flex-start; background: var(--surface-2); }
.bc-out { align-self: flex-end; background: rgba(25, 135, 84, .25); }
@media (max-width: 800px) { .bot-conv { grid-template-columns: 1fr; } }

.bot-sim-modo { margin: 0 auto 10px; display: flex; width: fit-content; }
.bot-conv-head #bcIgnorar { margin-left: auto; }
.bot-conv-head #bcExcluir { margin-left: 0; }
/* formulário genérico abre por cima de outras janelas (ex.: Ignorados dentro do Bot) */
#gFormOverlay { z-index: 60; }
#confirmOverlay { z-index: 70; }

/* cadastro público / conta bloqueada / aviso de teste */
.auth-troca { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; color: var(--text-2); }
.btn-success { background: #198754; border-color: #198754; color: #fff; }
.auth-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.bloq-acoes { flex-wrap: wrap; gap: 8px; }
.aviso-teste { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; background: rgba(13, 110, 253, .15); border-bottom: 1px solid rgba(13, 110, 253, .35); color: var(--text); font-size: 14px; flex-wrap: wrap; }
.aviso-teste .btn { padding: 4px 12px; }
#assinaturaOverlay { z-index: 65; }

/* admin: revendas do gestor */
.cg-config { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; }
.cg-dias { display: flex; align-items: center; gap: 6px; }
.cg-dias input { width: 70px; }
.cg-chip.ativo { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.cg-senha { font-size: 16px; padding: 10px; background: var(--surface-2); border-radius: 6px; }
.cg-det p { margin: 6px 0; }
.cg-det h4 { margin: 14px 0 6px; }

.rk-wa-img img.rk-wa-foto { object-fit: cover; }

.formas-pag { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.formas-pag .new-credit-form { width: 100%; }
.cg-pix-pend { padding: 12px 16px; margin-bottom: 12px; border-color: rgba(25,135,84,.5); }
.cg-pix-pend .rk-acoes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.formas-pag .switch { margin-left: 0; margin-right: auto; justify-content: flex-start; }
.formas-pag .switch-inline { align-self: flex-start; padding-bottom: 0; }

.gw-linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gw-linha .switch-inline { align-self: center; padding-bottom: 0; margin-left: auto; }
.cg-pix { padding: 3px 10px; font-size: 12.5px; background: rgba(220,53,69,.15); border-color: rgba(220,53,69,.4); color: #ea868f; }
.cg-pix.cg-pix-on { background: rgba(25,135,84,.2); border-color: rgba(25,135,84,.5); color: #75b798; }
.bot-publico-tabs { display: flex; width: 100%; margin-bottom: 12px; } .bot-publico-tabs button { flex: 1; padding: 8px 6px; font-weight: 600; }
.gw-remover { padding: 2px 10px; font-size: 12px; }
