/* =====================================================================
   RBytes Corretores — estilos globais (área logada + componentes comuns)
   Paleta: navy #0f2a44 (primária) · teal #14b8a6 (destaque) · cinza-azulado
   ===================================================================== */
:root {
    --rb-primaria: #0f2a44;
    --rb-primaria-escura: #0a1c2e;
    --rb-primaria-clara: #1f4e79;
    --rb-destaque: #14b8a6;
    --rb-destaque-escura: #0d9488;
    --rb-fundo: #f3f6fa;
    --rb-borda: #e2e8f0;
    --rb-texto: #1e293b;
    --rb-texto-suave: #64748b;
    --rb-sidebar-largura: 260px;
    --bs-primary: #0f2a44;
    --bs-primary-rgb: 15, 42, 68;
    --bs-link-color: #1f4e79;
    --bs-link-color-rgb: 31, 78, 121;
    --bs-link-hover-color: #0f2a44;
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body { font-family: var(--bs-body-font-family); color: var(--rb-texto); background: var(--rb-fundo); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

.btn-primary { --bs-btn-bg: var(--rb-primaria); --bs-btn-border-color: var(--rb-primaria); --bs-btn-hover-bg: var(--rb-primaria-clara); --bs-btn-hover-border-color: var(--rb-primaria-clara); --bs-btn-active-bg: var(--rb-primaria-escura); --bs-btn-active-border-color: var(--rb-primaria-escura); }
.btn-outline-primary { --bs-btn-color: var(--rb-primaria); --bs-btn-border-color: var(--rb-primaria); --bs-btn-hover-bg: var(--rb-primaria); --bs-btn-hover-border-color: var(--rb-primaria); --bs-btn-active-bg: var(--rb-primaria); --bs-btn-active-border-color: var(--rb-primaria); }
.btn-destaque { background: var(--rb-destaque); border-color: var(--rb-destaque); color: #fff; font-weight: 600; }
.btn-destaque:hover, .btn-destaque:focus { background: var(--rb-destaque-escura); border-color: var(--rb-destaque-escura); color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--rb-destaque); box-shadow: 0 0 0 .2rem rgba(20, 184, 166, .2); }
.text-primary { color: var(--rb-primaria) !important; }
.bg-primary { background-color: var(--rb-primaria) !important; }
.page-link { color: var(--rb-primaria); }
.page-item.active .page-link { background: var(--rb-primaria); border-color: var(--rb-primaria); }

/* ---------- Estrutura da área logada ---------- */
.rb-shell { display: flex; min-height: 100vh; }
.rb-sidebar {
    width: var(--rb-sidebar-largura); flex-shrink: 0; background: linear-gradient(180deg, var(--rb-primaria) 0%, var(--rb-primaria-escura) 100%);
    color: #cbd5e1; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 1030; transition: transform .25s ease;
}
.rb-sidebar::-webkit-scrollbar { width: 6px; }
.rb-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.rb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: #fff; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.rb-brand:hover { color: #fff; text-decoration: none; }
.rb-brand img { width: 34px; height: 34px; }
.rb-nav { padding: 12px 12px 90px; }
.rb-nav-titulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #7c93ad; padding: 16px 12px 6px; font-weight: 700; }
.rb-nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #cbd5e1; font-size: .9rem; margin-bottom: 2px; transition: background .15s, color .15s; }
.rb-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.rb-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.rb-nav-link.active { background: var(--rb-destaque); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(20,184,166,.35); }

.rb-main { flex: 1; margin-left: var(--rb-sidebar-largura); display: flex; flex-direction: column; min-width: 0; }
.rb-topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--rb-borda); display: flex; align-items: center; padding: 0 24px; gap: 14px; position: sticky; top: 0; z-index: 1020; }
.rb-topbar-titulo { font-weight: 700; font-size: 1.05rem; color: var(--rb-primaria); flex: 1; }
.rb-topbar-direita { display: flex; align-items: center; gap: 16px; }
.rb-tenant { font-size: .85rem; color: var(--rb-texto-suave); }
.rb-toggle-sidebar { display: none; font-size: 1.4rem; color: var(--rb-primaria); padding: 0; }
.rb-usuario { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rb-borda); border-radius: 30px; padding: 4px 12px 4px 4px; font-size: .9rem; background: #fff; }
.rb-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--rb-destaque); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.rb-conteudo { padding: 24px; flex: 1; }
.rb-rodape { padding: 14px 24px; font-size: .78rem; color: var(--rb-texto-suave); border-top: 1px solid var(--rb-borda); background: #fff; }

@media (max-width: 991.98px) {
    .rb-sidebar { transform: translateX(-100%); }
    .rb-sidebar.aberta { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .rb-main { margin-left: 0; }
    .rb-toggle-sidebar { display: inline-block; }
    .rb-conteudo { padding: 16px; }
}

/* ---------- Componentes ---------- */
.rb-card { border: 1px solid var(--rb-borda); border-radius: 14px; box-shadow: 0 4px 14px rgba(15,42,68,.05); }
.rb-card .card-header { background: #fff; border-bottom: 1px solid var(--rb-borda); font-weight: 700; color: var(--rb-primaria); border-radius: 14px 14px 0 0 !important; }
.rb-kpi { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--rb-borda); border-radius: 14px; padding: 16px 18px; color: inherit; transition: transform .15s, box-shadow .15s; height: 100%; }
.rb-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,42,68,.1); text-decoration: none; color: inherit; }
.rb-kpi-icone { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.rb-kpi small { display: block; color: var(--rb-texto-suave); font-size: .75rem; }
.rb-kpi strong { font-size: 1.35rem; color: var(--rb-primaria); line-height: 1.1; }
.rb-form-secao { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rb-texto-suave); border-bottom: 1px solid var(--rb-borda); padding-bottom: 6px; margin-bottom: 14px; font-weight: 700; }
.rb-alerta { border-radius: 12px; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rb-texto-suave); background: #f8fafc; border-bottom-width: 1px; }
.table-hover tbody tr:hover { background: #f1f5f9; }
.rb-filtros { background: #fff; border: 1px solid var(--rb-borda); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.rb-vazio { text-align: center; padding: 48px 16px; color: var(--rb-texto-suave); }
.rb-vazio i { font-size: 2.6rem; display: block; margin-bottom: 10px; opacity: .5; }

/* Kanban */
.rb-kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.rb-kanban-coluna { flex: 0 0 280px; background: #e9eef5; border-radius: 14px; padding: 12px; min-height: 420px; }
.rb-kanban-coluna h6 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rb-primaria); display: flex; justify-content: space-between; margin-bottom: 10px; }
.rb-kanban-cartao { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--rb-borda); cursor: grab; font-size: .85rem; box-shadow: 0 2px 6px rgba(15,42,68,.05); }
.rb-kanban-cartao.arrastando { opacity: .5; }
.rb-kanban-coluna.sobre { outline: 2px dashed var(--rb-destaque); }

/* ---------- Loading temático ---------- */
.rb-loading { position: fixed; inset: 0; background: rgba(15, 42, 68, .78); backdrop-filter: blur(3px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
.rb-loading.ativo { opacity: 1; visibility: visible; }
.rb-loading-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; }
.rb-loading-ring { position: absolute; top: -22px; width: 124px; height: 124px; border-radius: 50%; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--rb-destaque); border-right-color: var(--rb-destaque); animation: rb-girar 1s linear infinite; }
.rb-loading-icones { width: 80px; height: 80px; position: relative; }
.rb-loading-icones i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; opacity: 0; animation: rb-alternar 2.4s infinite; color: #fff; }
.rb-loading-icones i:nth-child(2) { animation-delay: .8s; color: var(--rb-destaque); }
.rb-loading-icones i:nth-child(3) { animation-delay: 1.6s; }
.rb-loading-marca { font-size: 1.1rem; letter-spacing: .5px; margin-top: 14px; }
.rb-loading-marca strong { color: var(--rb-destaque); }
.rb-loading-texto { font-size: .85rem; color: #cbd5e1; }
.rb-dots span { animation: rb-piscar 1.2s infinite; }
.rb-dots span:nth-child(2) { animation-delay: .2s; }
.rb-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes rb-girar { to { transform: rotate(360deg); } }
@keyframes rb-alternar { 0%, 28% { opacity: 1; transform: scale(1); } 33%, 100% { opacity: 0; transform: scale(.7); } }
@keyframes rb-piscar { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* ---------- WhatsApp flutuante ---------- */
.rb-whatsapp-flutuante { position: fixed; right: 22px; bottom: 22px; z-index: 1500; display: flex; align-items: center; gap: 8px; background: #25d366; color: #fff; border-radius: 30px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(37,211,102,.45); font-weight: 600; transition: transform .15s, box-shadow .15s; }
.rb-whatsapp-flutuante i { font-size: 1.6rem; line-height: 1; }
.rb-whatsapp-flutuante:hover { transform: translateY(-3px) scale(1.03); color: #fff; text-decoration: none; box-shadow: 0 12px 30px rgba(37,211,102,.55); }
.rb-whatsapp-texto { font-size: .9rem; }
/* Versão somente ícone (área logada): botão circular */
.rb-whatsapp-flutuante.rb-whatsapp-icone { width: 58px; height: 58px; padding: 0; border-radius: 50%; justify-content: center; }
@media (max-width: 575.98px) { .rb-whatsapp-texto { display: none; } .rb-whatsapp-flutuante { padding: 12px; border-radius: 50%; } }

/* ---------- Utilidades ---------- */
.rb-truncar { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-cursor { cursor: pointer; }
.rb-foto-mini { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; }
.rb-timeline { list-style: none; padding-left: 0; }
.rb-timeline li { position: relative; padding-left: 28px; padding-bottom: 16px; border-left: 2px solid var(--rb-borda); margin-left: 8px; }
.rb-timeline li::before { content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--rb-destaque); }
