/* ════════════════════════════════════════════════════════════════════════
   RadioHost — tema azul/ciano, claro/escuro via [data-theme] no <html>
   ════════════════════════════════════════════════════════════════════════ */

:root,
:root[data-theme="light"] {
  --rh-primary: #0ea5e9;
  --rh-primary-dark: #0369a1;
  --rh-primary-light: #38bdf8;
  --rh-accent: #06b6d4;
  --rh-success: #10b981;
  --rh-danger: #ef4444;
  --rh-warning: #f59e0b;

  --rh-bg: #f2f6fb;
  --rh-surface: #ffffff;
  --rh-surface-2: #f7fafc;
  --rh-text: #0f172a;
  --rh-text-secondary: #5b6b83;
  --rh-border: #e3e9f2;
  --rh-hero-from: #082f49;
  --rh-hero-to: #0b1220;
  --rh-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --rh-scrollbar-thumb: #c9d4e3;
  --rh-scrollbar-track: transparent;

  --rh-sidebar-bg: #eef1f6;
  --rh-sidebar-text: #0f172a;
  --rh-sidebar-link: #55627a;
  --rh-sidebar-active-bg: #e0f2fe;
  --rh-sidebar-active-text: #0369a1;
}

:root[data-theme="dark"] {
  --rh-primary: #3b82f6;
  --rh-primary-dark: #2563eb;
  --rh-primary-light: #60a5fa;
  --rh-accent: #3b82f6;
  --rh-success: #34d399;
  --rh-danger: #f87171;
  --rh-warning: #fbbf24;

  --rh-bg: #080b14;
  --rh-surface: #101524;
  --rh-surface-2: #0c1120;
  --rh-text: #e6edf7;
  --rh-text-secondary: #8b96ab;
  --rh-border: #1e2740;
  --rh-hero-from: #080b14;
  --rh-hero-to: #030509;
  --rh-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  --rh-scrollbar-thumb: #263355;
  --rh-scrollbar-track: transparent;

  --rh-sidebar-bg: var(--rh-hero-to);
  --rh-sidebar-text: #fff;
  --rh-sidebar-link: #cbd5e1;
  --rh-sidebar-active-bg: rgba(56,189,248,.18);
  --rh-sidebar-active-text: #fff;
}

* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--rh-bg);
  color: var(--rh-text);
  transition: background-color .2s ease, color .2s ease;
}

img, svg, table, .table-responsive, pre { max-width: 100%; }

a { color: var(--rh-primary); text-decoration: none; }
a:hover { color: var(--rh-primary-dark); }
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration: none; }

/* Scrollbar discreta (não remove, só deixa elegante) */
* { scrollbar-width: thin; scrollbar-color: var(--rh-scrollbar-thumb) var(--rh-scrollbar-track); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--rh-scrollbar-thumb); border-radius: 8px; }

/* Scrollbar praticamente invisível (só aparece sutilmente ao passar o mouse) —
   usada no card de detalhes do cliente, que costuma rolar bastante, e em todo
   .modal-body do sistema (modais com modal-dialog-scrollable), para que a
   barra de rolagem não fique poluindo visualmente os modais. */
.rh-scroll-subtle,
.modal-body {
  scrollbar-color: transparent transparent;
}
.rh-scroll-subtle::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: transparent;
}
.rh-scroll-subtle:hover,
.modal-body:hover {
  scrollbar-color: var(--rh-scrollbar-thumb) transparent;
}
.rh-scroll-subtle:hover::-webkit-scrollbar-thumb,
.modal-body:hover::-webkit-scrollbar-thumb {
  background: var(--rh-scrollbar-thumb);
}

.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* ── Botões ───────────────────────────────────────────────────────────── */
.rh-btn-primary {
  background: var(--rh-accent);
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(6, 182, 212, .28);
  transition: filter .15s ease, transform .15s ease;
}
/* Precisa redeclarar o background aqui: a regra .btn:hover do Bootstrap
   (classe + pseudo-classe) é mais específica que .rh-btn-primary sozinha
   (só classe), então sem isso o hover cai para --bs-btn-hover-bg (não
   definida para esta classe) e o botão vira transparente/branco. */
.rh-btn-primary:hover { background: var(--rh-accent); color: #fff; filter: brightness(1.1); transform: translateY(-1px); }
.rh-btn-primary:disabled, .rh-btn-primary.disabled { opacity: .6; transform: none; }

/* Botões retangulares com cantos discretos (5px) em vez de "pill" — aplica-se
   apenas a botões reais (.btn), não a badges/avatares que também usam a
   utilidade .rounded-pill do Bootstrap. */
.btn.rounded-pill { border-radius: 5px !important; }

.rh-btn-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rh-border); background: var(--rh-surface); color: var(--rh-text-secondary);
  transition: all .15s ease;
}
.rh-btn-icon:hover { border-color: var(--rh-primary); color: var(--rh-primary); }

.rh-icon-btn {
  width: 40px !important; height: 40px !important; padding: 0 !important;
  border-radius: 5px !important;
  display: inline-flex !important; align-items: center; justify-content: center;
  font-size: 1.05rem;
}

/* Barra de ações do detalhe da fatura (admin): botões compactos para caber
   Editar/WhatsApp/Pagamento/"..."/Fechar numa única linha sem parecer pesado. */
.rh-invoice-actions .rh-icon-btn {
  width: 30px !important; height: 30px !important;
  font-size: .85rem;
}
.rh-invoice-actions .dropdown-toggle::after { display: none; }
.rh-invoice-actions .btn-success.rounded-pill,
.rh-invoice-actions .dropdown-toggle { height: 30px; display: inline-flex; align-items: center; font-size: .8rem; }

/* Botão de fechar (X) da visualização em split-view de faturas — menor que o
   padrão de 40px do .rh-icon-btn, já que fica ao lado das abas, não da barra
   de ações. */
.rh-icon-btn-sm { width: 26px !important; height: 26px !important; font-size: .75rem; }

/* Botões e form-controls em dark mode */
[data-theme="dark"] .btn-outline-secondary { color: var(--rh-text-secondary); border-color: var(--rh-border); }
[data-theme="dark"] .btn-outline-secondary:hover { background: var(--rh-surface-2); color: var(--rh-text); }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
  background-color: var(--rh-surface-2); color: var(--rh-text); border-color: var(--rh-border);
}
[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus {
  background-color: var(--rh-surface-2); color: var(--rh-text);
}
[data-theme="dark"] .form-control::placeholder { color: #64748b; }
[data-theme="dark"] .modal-content { background: var(--rh-surface); color: var(--rh-text); }
[data-theme="dark"] .dropdown-menu { background: var(--rh-surface); border-color: var(--rh-border); }
[data-theme="dark"] .dropdown-item { color: var(--rh-text); }
[data-theme="dark"] .dropdown-item:hover { background: var(--rh-surface-2); color: var(--rh-text); }
[data-theme="dark"] .table { color: var(--rh-text); }
[data-theme="dark"] .table-rh { border-color: var(--rh-border); }
[data-theme="dark"] .nav-pills .nav-link { color: var(--rh-text-secondary); }
[data-theme="dark"] hr { border-color: var(--rh-border); }

/* ── Landing page ─────────────────────────────────────────────────────── */
.rh-navbar {
  background: rgba(8, 15, 30, 0.85);
  backdrop-filter: blur(8px);
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
}
.rh-navbar .navbar-brand { font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.rh-navbar .nav-link { color: #cbd5e1 !important; font-weight: 500; }
.rh-navbar .nav-link:hover { color: #fff !important; }
.rh-navbar .navbar-toggler { border-color: rgba(255,255,255,.35); }
.rh-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-width='2.5' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
@media (max-width: 991.98px) {
  .rh-navbar .navbar-collapse {
    background: #0b1220; border-radius: 14px; padding: 16px; margin-top: 12px;
    border: 1px solid rgba(255,255,255,.08);
  }
}

/* Páginas simples (sem hero) que usam .rh-navbar fixa precisam desse respiro no topo,
   senão o conteúdo nasce escondido atrás da barra fixa. */
body.rh-simple-page { padding-top: 88px; }
@media (max-width: 575.98px) {
  body.rh-simple-page { padding-top: 76px; }
}

.rh-hero {
  background: radial-gradient(circle at 20% 20%, var(--rh-hero-from) 0%, var(--rh-hero-to) 65%, #000 100%);
  color: #fff;
  padding: 150px 0 90px;
  position: relative;
  overflow: hidden;
}
.rh-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(120deg, rgba(56,189,248,.06) 0 2px, transparent 2px 40px);
  pointer-events: none;
}
.rh-hero .badge-live { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.4); }
.rh-hero h1 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.rh-hero .lead { color: #cbd5e1; }
.rh-gradient-text {
  background: linear-gradient(90deg, var(--rh-accent), var(--rh-primary-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rh-hero-image {
  max-width: 100%; border-radius: 20px; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.rh-placeholder-img {
  width: 100%; aspect-ratio: 16/10; border-radius: 20px;
  background: linear-gradient(135deg, #0c2540, #0891b2);
  border: 2px dashed rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  color: rgba(255,255,255,.75); text-align: center; padding: 20px;
}

.rh-section-title { font-weight: 800; letter-spacing: -0.02em; color: var(--rh-text); }
.rh-section-sub { color: var(--rh-text-secondary); }
section { background: var(--rh-bg); }
.rh-section-alt { background: var(--rh-surface-2); }

.rh-feature-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rh-primary-dark), var(--rh-primary));
  color: #fff; font-size: 24px; flex-shrink: 0;
}
.rh-feature-card h5, .rh-feature-card p { color: var(--rh-text); }
.rh-feature-card p { color: var(--rh-text-secondary); }

/* ── Cards de plano (estilo tabela de preços com itens) ──────────────────── */
.rh-plan-card {
  border: 1px solid var(--rh-border);
  border-radius: 18px;
  transition: transform .18s ease, box-shadow .18s ease;
  background: var(--rh-surface);
  height: 100%;
  display: flex; flex-direction: column;
}
.rh-plan-card:hover { transform: translateY(-6px); box-shadow: var(--rh-shadow); }
.rh-plan-card.featured { border: 2px solid var(--rh-primary); position: relative; }
.rh-plan-card.featured::before {
  content: "MAIS POPULAR";
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--rh-primary-dark), var(--rh-primary));
  color: #fff; font-size: 11px; font-weight: 800;
  padding: 5px 16px; border-radius: 20px; letter-spacing: .06em; white-space: nowrap;
}
.rh-plan-badge {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  color: var(--rh-primary-dark); background: color-mix(in srgb, var(--rh-primary) 12%, transparent);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 10px;
}
[data-theme="dark"] .rh-plan-badge { color: var(--rh-primary-light); }

/* ── Miniatura de vídeo (lista de tutoriais) ─────────────────────────────
   YouTube tem uma URL de miniatura estática previsível (sem chamada de API);
   quando não há miniatura real (Vimeo, ou URL não reconhecida), mostra um
   bloco com gradiente e ícone de play como marcador simples. */
.rh-tutorial-cover {
  position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; cursor: pointer;
  background: linear-gradient(135deg, var(--rh-primary), var(--rh-primary-dark));
}
.rh-tutorial-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rh-tutorial-cover i {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 2.5rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.rh-tutorial-thumb {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 36px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(135deg, var(--rh-primary), var(--rh-primary-dark));
}
.rh-tutorial-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rh-tutorial-thumb i { position: absolute; font-size: 1.1rem; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.35); }
.rh-plan-name { color: var(--rh-text); font-weight: 800; }
.rh-plan-desc { color: var(--rh-text-secondary); min-height: 40px; }
.rh-plan-price { font-size: 2.4rem; font-weight: 800; color: var(--rh-text); }
.rh-plan-price small { font-size: 1rem; font-weight: 500; color: var(--rh-text-secondary); }
.rh-plan-card .feature-list { list-style: none; padding: 0; margin: 0 0 20px; flex-grow: 1; }
.rh-plan-card .feature-list li {
  padding: 8px 0; color: var(--rh-text-secondary); display: flex; align-items: flex-start; gap: 8px;
  border-bottom: 1px dashed var(--rh-border); font-size: .93rem;
}
.rh-plan-card .feature-list li:last-child { border-bottom: none; }
.rh-plan-card .feature-list li i { color: var(--rh-success); margin-top: 2px; }

/* ── Carrossel de planos (3 visíveis, swipe no mobile, setas no desktop) ── */
.rh-plan-carousel-wrap { display: flex; align-items: center; gap: 10px; }
.rh-plan-carousel {
  display: flex; gap: 20px; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; padding: 6px 2px 14px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.rh-plan-carousel::-webkit-scrollbar { display: none; }
.rh-plan-slide {
  flex: 0 0 calc((100% - 40px) / 3); max-width: 300px; min-width: 220px;
  scroll-snap-align: start;
}
@media (max-width: 991px) { .rh-plan-slide { flex: 0 0 70%; } }
@media (max-width: 575px) { .rh-plan-slide { flex: 0 0 84%; } }
.rh-carousel-arrow {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--rh-border); background: var(--rh-surface); color: var(--rh-text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.rh-carousel-arrow:hover:not(:disabled) { color: #fff; background: var(--rh-primary); border-color: var(--rh-primary); }
.rh-carousel-arrow:disabled { opacity: .3; cursor: default; }
@media (max-width: 767px) { .rh-carousel-arrow { display: none !important; } }

/* ── Listas com paginação/busca silenciosas ──────────────────────────────── */
.rh-ajax-list.rh-ajax-loading { opacity: .55; pointer-events: none; transition: opacity .15s ease; }

footer.rh-footer { background: var(--rh-hero-to); color: #94a3b8; }
footer.rh-footer a { color: #cbd5e1; text-decoration: none; }
footer.rh-footer a:hover { color: #fff; }

/* Modais com <form> envolvendo header/body/footer: sem isso, o <form> (display:block)
   quebra o flex do .modal-content e o rodapé (botões) fica cortado fora da área
   visível em modais .modal-dialog-scrollable com conteúdo alto. */
.modal-content > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-dialog-scrollable .modal-content > form .modal-body { overflow-y: auto; }

/* ── Modal de assinatura ──────────────────────────────────────────────── */
.rh-modal .modal-content { border-radius: 18px; border: none; background: var(--rh-surface); }
.rh-modal .modal-header {
  background: linear-gradient(135deg, var(--rh-hero-to), var(--rh-primary-dark));
  color: #fff; border-radius: 18px 18px 0 0; border-bottom: none;
}

/* ── Modal de pagamento Pix: sem fundo branco chapado, translúcido/"vidro"
   com os cantos arredondados recortando o conteúdo (cabeçalho verde incluso). */
.rh-pix-modal {
  background: color-mix(in srgb, var(--rh-surface) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: none;
  border-radius: 18px;
  overflow: hidden;
  color: var(--rh-text);
}

.rh-pix-box {
  background: color-mix(in srgb, var(--rh-success) 10%, var(--rh-surface));
  border: 1.5px solid var(--rh-success);
  border-radius: 14px;
  padding: 18px 20px;
}
.rh-pix-key {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem; font-weight: 700;
  color: var(--rh-success);
  letter-spacing: .03em;
  word-break: break-word;
}
.rh-pix-box-sm { padding: 8px 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rh-pix-box-sm .rh-pix-key { font-size: .85rem; letter-spacing: 0; }
.rh-bank-box { background: var(--rh-surface-2); border: 1px solid var(--rh-border); border-radius: 14px; }

.rh-client-avatar-wrap img, .rh-client-avatar-wrap > div { box-shadow: var(--rh-shadow); }
@media (max-width: 575.98px) {
  .rh-client-header { flex-direction: column; align-items: flex-start !important; }
}
.rh-bank-box .row div { padding: 4px 0; }

/* ── Documento de fatura (mesmo layout em admin/cliente/público/PDF) ────── */
.rh-invoice-doc-head {
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px;
  padding-bottom: 20px; margin-bottom: 20px; border-bottom: 2px solid var(--rh-primary);
}
.rh-invoice-doc-titlebox { text-align: right; }
.rh-invoice-doc-title { font-size: 1.5rem; font-weight: 800; color: var(--rh-primary); letter-spacing: .04em; margin-bottom: 8px; }
.rh-invoice-doc-customer-link { font-size: .95rem; font-weight: 600; }
.rh-invoice-doc-meta { margin-left: auto; border-collapse: collapse; }
.rh-invoice-doc-meta td { padding: 2px 0 2px 16px; font-size: .85rem; text-align: right; }
.rh-invoice-doc-meta td:first-child { color: var(--rh-text-secondary); padding-left: 0; }
.rh-invoice-doc-meta td:last-child { font-weight: 700; color: var(--rh-text); }
.rh-invoice-doc-parties { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 24px; }
.rh-invoice-doc-parties > div { flex: 1 1 220px; }
.rh-invoice-doc-parties .label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rh-primary); margin-bottom: 4px; }
.rh-invoice-doc-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.rh-invoice-doc-table thead th {
  background: var(--rh-primary); color: #fff; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 700; padding: 10px 14px; text-align: left;
}
.rh-invoice-doc-table thead th:first-child { border-radius: 8px 0 0 8px; }
.rh-invoice-doc-table thead th:last-child { border-radius: 0 8px 8px 0; }
.rh-invoice-doc-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--rh-border); }
.rh-invoice-doc-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; margin-bottom: 8px; }
.rh-invoice-doc-notes { flex: 1 1 220px; }
.rh-invoice-doc-notes .label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rh-text-secondary); }
.rh-invoice-doc-total { flex: 0 1 260px; min-width: 220px; margin-left: auto; }
.rh-invoice-doc-total > div { padding: 6px 0; color: var(--rh-text-secondary); }
.rh-invoice-doc-total-final { border-top: 2px solid var(--rh-border); margin-top: 4px; font-size: 1.15rem; color: var(--rh-text) !important; }
.rh-invoice-doc-total-final strong { color: var(--rh-primary); }

/* Mobile: informações do cliente (CPF, nome, cidade) ficam alinhadas à
   esquerda, cabeçalho empilha em vez de lado a lado. */
@media (max-width: 575.98px) {
  .rh-invoice-doc-head { flex-direction: column; }
  .rh-invoice-doc-titlebox { text-align: left; width: 100%; }
  .rh-invoice-doc-meta { margin-left: 0; }
  .rh-invoice-doc-meta td { text-align: left; padding: 2px 12px 2px 0; }
  .rh-invoice-doc-parties { flex-direction: column; gap: 16px; }
  .rh-invoice-doc-parties > div { flex-basis: auto; }
}

/* ── Bolhas de mensagem (tickets) ─────────────────────────────────────── */
.rh-msg-admin { background: color-mix(in srgb, var(--rh-primary) 12%, var(--rh-surface)); }
.rh-msg-customer { background: var(--rh-surface-2); border: 1px solid var(--rh-border); }

/* ── Painéis (admin/cliente) ──────────────────────────────────────────── */
.rh-app-shell { display: flex; min-height: 100vh; max-width: 100vw; }
.rh-app-main { flex: 1 1 auto; min-width: 0; }

.rh-app-sidebar {
  background: var(--rh-sidebar-bg);
  min-height: 100vh;
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--rh-border);
}
.rh-app-sidebar .brand { color: var(--rh-sidebar-text); font-weight: 800; }
.rh-app-sidebar a.nav-link { color: var(--rh-sidebar-link); border-radius: 10px; margin-bottom: 2px; font-weight: 500; }
.rh-app-sidebar a.nav-link:hover, .rh-app-sidebar a.nav-link.active { background: var(--rh-sidebar-active-bg); color: var(--rh-sidebar-active-text); }

.rh-app-topbar { background: var(--rh-surface); border-bottom: 1px solid var(--rh-border); }

.rh-stat-card { border-radius: 16px; border: 1px solid var(--rh-border); background: var(--rh-surface); padding: 20px; min-width: 0; }
.rh-stat-card-link { transition: transform .12s ease, box-shadow .12s ease; }
.rh-stat-card-link:hover { transform: translateY(-2px); box-shadow: var(--rh-shadow); border-color: var(--rh-primary); }
.rh-stat-card .icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0; }
.rh-stat-card small { color: var(--rh-text-secondary); }
.rh-stat-card strong { color: var(--rh-text); }
.rh-stat-card-text { min-width: 0; }

@media (max-width: 767.98px) {
  .rh-stat-card-highlight { padding: 26px 22px; }
  .rh-stat-card-highlight .icon { width: 58px; height: 58px; font-size: 26px; border-radius: 14px; }
  .rh-stat-card-highlight strong { font-size: 1.5rem !important; }
  .rh-stat-card-highlight small { font-size: .85rem; }
}

.rh-notif-bell { position: relative; cursor: pointer; color: var(--rh-text-secondary); }
.rh-notif-bell .dot {
  position: absolute; top: -8px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--rh-danger); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
/* Bootstrap's .dropdown-item é white-space:nowrap por padrão (feito para itens
   de menu de uma linha) — aqui cada item é um cartão de notificação com
   título+mensagem, então precisa quebrar linha em vez de vazar para fora do
   dropdown. */
.rh-notif-menu { max-width: calc(100vw - 24px); }
.rh-notif-menu .dropdown-item {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
.rh-notif-menu .dropdown-item.rh-notif-unread { background: var(--rh-surface-2); }

.rh-card { border-radius: 16px; border: 1px solid var(--rh-border); background: var(--rh-surface); color: var(--rh-text); }

/* flex-wrap:nowrap + overflow-x:auto faz a barra de abas rolar horizontalmente
   (arrastando o dedo) em vez de quebrar linha quando não cabe — importante no
   mobile, onde várias abas juntas (Fatura/Pagamentos/Fatura filha/Atividades/
   Notas etc.) não cabem na largura da tela. Mesmo tratamento vale para
   qualquer barra de "pills" de filtro (nav-pills) do sistema. */
.rh-settings-tabs, .nav-pills {
  border-bottom: 1px solid var(--rh-border);
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-pills { border-bottom: none; gap: 8px; }
.rh-settings-tabs::-webkit-scrollbar, .nav-pills::-webkit-scrollbar { display: none; }
.rh-settings-tabs .nav-item, .nav-pills .nav-item { flex-shrink: 0; }
.rh-settings-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--rh-text-secondary);
  font-weight: 600;
  font-size: .9rem;
  padding: 8px 4px;
  margin-right: 22px;
  background: transparent;
  white-space: nowrap;
}
.rh-settings-tabs .nav-link:hover { color: var(--rh-text); }
.rh-settings-tabs .nav-link.active { color: var(--rh-primary); border-bottom-color: var(--rh-primary); background: transparent; }

/* Setas < > para rolar a barra de abas/pills no desktop (injetadas via JS,
   assets/js/main.js) — no touch o gesto de arrastar já basta, então elas só
   aparecem quando o conteúdo realmente transborda a largura disponível. */
.rh-tabs-scroll-wrap { position: relative; display: flex; align-items: center; gap: 4px; }
.rh-tabs-scroll-wrap > .rh-settings-tabs,
.rh-tabs-scroll-wrap > .nav-pills { flex: 1 1 auto; min-width: 0; }
.rh-tabs-arrow {
  flex-shrink: 0; display: none; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rh-border);
  background: var(--rh-surface); color: var(--rh-text-secondary); cursor: pointer; z-index: 2;
}
.rh-tabs-arrow:hover { color: var(--rh-primary); border-color: var(--rh-primary); }
.rh-tabs-scroll-wrap.rh-tabs-overflow .rh-tabs-arrow { display: inline-flex; }

/* ── Campo de busca de clientes no topo do admin ─────────────────────── */
.rh-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1050;
  background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: 12px;
  box-shadow: var(--rh-shadow); max-height: 320px; overflow-y: auto; padding: 6px;
}
.rh-search-dropdown .rh-search-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--rh-text); font-size: .88rem;
}
.rh-search-dropdown .rh-search-item:hover { background: var(--rh-surface-2); }
.rh-search-dropdown .rh-search-item .rh-search-remove { color: var(--rh-text-secondary); flex-shrink: 0; }
.rh-search-dropdown .rh-search-item .rh-search-remove:hover { color: var(--rh-danger, #dc3545); }
.rh-search-dropdown .rh-search-empty { padding: 10px; font-size: .85rem; color: var(--rh-text-secondary); }

.table-rh { color: var(--rh-text); }
.table-rh thead th { color: var(--rh-text-secondary); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; border-bottom-width: 1px; white-space: nowrap; }
.table-responsive { border-radius: 10px; }

.rh-login-wrap { min-height: 100vh; background: radial-gradient(circle at 20% 20%, var(--rh-hero-from) 0%, var(--rh-hero-to) 60%, #000 100%); }
.rh-login-card { border-radius: 20px; border: none; background: var(--rh-surface); }

/* ── Dropdown de ações (faturas) ──────────────────────────────────────── */
.rh-actions-menu .dropdown-toggle::after { display: none; }
.rh-actions-menu .btn { width: 30px; height: 30px; padding: 0; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; }
.rh-actions-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: .9rem; }
.rh-actions-menu .dropdown-item i { width: 16px; text-align: center; color: var(--rh-text-secondary); }
.rh-actions-menu .dropdown-item.text-danger i { color: var(--rh-danger); }
.rh-actions-menu .dropdown-item.text-success i { color: var(--rh-success); }

/* ── Timeline de eventos da fatura ────────────────────────────────────── */
.rh-timeline { list-style: none; padding: 0; margin: 0; }
.rh-timeline li { position: relative; padding: 0 0 20px 28px; border-left: 2px solid var(--rh-border); margin-left: 8px; }
.rh-timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.rh-timeline li::before {
  content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--rh-primary); border: 2px solid var(--rh-surface);
}
.rh-timeline li.ev-blocked::before { background: var(--rh-danger); }
.rh-timeline li.ev-warned::before { background: var(--rh-warning); }
.rh-timeline li.ev-canceled::before { background: var(--rh-text-secondary); }
.rh-timeline li.ev-paid::before { background: var(--rh-success); }
.rh-timeline .ev-time { font-size: .78rem; color: var(--rh-text-secondary); }
.rh-timeline .ev-msg { font-size: .92rem; color: var(--rh-text); }

/* Aba "Atividades" da fatura: mostra ~5 eventos sem precisar rolar; o resto
   fica acessível pela barra de rolagem, em vez do card crescer sem limite. */
.rh-timeline-scroll { max-height: 300px; overflow-y: auto; padding-right: 6px; }

/* ── Impersonation banner ─────────────────────────────────────────────── */
.rh-impersonate-bar {
  background: linear-gradient(90deg, var(--rh-warning), #f97316);
  color: #1a1200; font-weight: 700; text-align: center; padding: 10px 16px; font-size: .9rem;
}
.rh-impersonate-bar a { color: #1a1200; text-decoration: underline; }

/* ── Toasts ───────────────────────────────────────────────────────────── */
.rh-toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px));
}
.rh-toast {
  background: var(--rh-surface); color: var(--rh-text); border: 1px solid var(--rh-border);
  border-left: 4px solid var(--rh-primary); border-radius: 10px; padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px; box-shadow: var(--rh-shadow);
  opacity: 0; transform: translateY(12px); transition: all .25s ease; font-size: .9rem;
}
.rh-toast.show { opacity: 1; transform: translateY(0); }
.rh-toast-success { border-left-color: var(--rh-success); }
.rh-toast-success i { color: var(--rh-success); }
.rh-toast-error { border-left-color: var(--rh-danger); }
.rh-toast-error i { color: var(--rh-danger); }
.rh-toast-warning { border-left-color: var(--rh-warning); }
.rh-toast-warning i { color: var(--rh-warning); }
.rh-toast-info i { color: var(--rh-primary); }
.rh-toast-msg { flex: 1; }
.rh-toast-close { background: none; border: none; color: var(--rh-text-secondary); font-size: 1.1rem; line-height: 1; cursor: pointer; }

.rh-confirm-modal .rh-confirm-icon { font-size: 2.6rem; color: var(--rh-warning); }
.rh-confirm-modal .rh-confirm-title { color: var(--rh-text); }

/* ── Lightbox de anexos de imagem (tickets) ──────────────────────────────── */
.rh-lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 1080;
  background: rgba(0,0,0,.82); align-items: center; justify-content: center; padding: 24px;
}
.rh-lightbox-overlay.show { display: flex; }
.rh-lightbox-overlay .rh-lightbox-img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.rh-lightbox-overlay .rh-lightbox-close {
  position: absolute; top: 18px; right: 24px; background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 1.8rem; line-height: 1; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
}
.rh-lightbox-overlay .rh-lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Utilidades responsivas ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .rh-app-sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 1040; transition: left .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .rh-app-sidebar.show { left: 0; }
  .rh-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1035; }
  .rh-sidebar-backdrop.show { display: block; }
  .rh-app-topbar .btn-text-label { display: none; }
}
@media (max-width: 575.98px) {
  .rh-hero { padding-top: 130px; }
  .rh-plan-price { font-size: 2rem; }
}

/* Formulário público de ticket embutido via <iframe> (ticket_new.php?embed=1):
   sem navbar fixa, então não precisa do respiro de topo de .rh-simple-page. */
body.rh-embed { padding-top: 24px !important; }

/* Editor de texto simples (negrito/itálico/sublinhado): a barra de formatação
   fica embutida no mesmo "campo" do textarea, como um mini editor (CKEditor-like),
   em vez de flutuar solta acima dele. */
.rh-richtext-wrap {
  border: 1px solid var(--rh-border);
  border-radius: 5px;
  overflow: hidden;
  background: var(--rh-surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rh-richtext-wrap:focus-within {
  border-color: var(--rh-primary);
  box-shadow: 0 0 0 .2rem rgba(14, 165, 233, .15);
}
.rh-richtext-toolbar {
  display: flex;
  gap: 2px;
  padding: 5px 6px;
  background: var(--rh-surface-2);
  border-bottom: 1px solid var(--rh-border);
}
.rh-richtext-btn {
  width: 28px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--rh-text-secondary);
}
.rh-richtext-btn:hover { background: var(--rh-border); color: var(--rh-text); }
.rh-richtext-btn.active { background: var(--rh-primary); color: #fff; }
.rh-richtext-editable {
  border: none;
  outline: none;
  margin: 0;
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  background: transparent;
  color: var(--rh-text);
  font-size: .95rem;
  line-height: 1.5;
  overflow-y: auto;
}
.rh-richtext-editable:empty:before {
  content: attr(data-placeholder);
  color: var(--rh-text-secondary);
  pointer-events: none;
}
.rh-richtext-editable strong { font-weight: 700; }
.rh-richtext-editable u { text-decoration: underline; }

/* Chips de preview das imagens inseridas no editor (com controles de
   alinhamento e tamanho) — ficam entre a barra e o textarea. */
.rh-richtext-img-previews:empty { display: none; }
.rh-richtext-img-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  background: var(--rh-surface-2);
  border-bottom: 1px solid var(--rh-border);
}
.rh-richtext-img-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: 8px;
  padding: 6px 8px;
}
.rh-richtext-img-chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.rh-richtext-img-chip .controls { display: flex; align-items: center; gap: 4px; }
.rh-richtext-img-chip .controls button {
  width: 24px; height: 24px; padding: 0; border: none; border-radius: 4px;
  background: transparent; color: var(--rh-text-secondary); display: inline-flex;
  align-items: center; justify-content: center;
}
.rh-richtext-img-chip .controls button:hover { background: var(--rh-border); color: var(--rh-text); }
.rh-richtext-img-chip .controls button.align-btn.active { background: var(--rh-primary); color: #fff; }
.rh-richtext-img-chip .controls button[title="Remover imagem"]:hover { background: var(--rh-danger); color: #fff; }
.rh-richtext-img-chip .controls input[type="range"] { width: 80px; }

/* Altura fixa para os gráficos (Chart.js com maintainAspectRatio:false), evitando
   que fiquem espremidos em telas estreitas onde a largura reduzida encolheria
   a altura proporcionalmente demais. */
.rh-chart-box { position: relative; height: 260px; }
@media (max-width: 575.98px) {
  .rh-chart-box { height: 220px; }
}

/* Botão flutuante de WhatsApp na landing page. */
.rh-whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  z-index: 1030;
  transition: transform .15s ease;
}
.rh-whatsapp-float:hover { color: #fff; transform: scale(1.08); }
