/********** CSS Original do LeadRadar — preservado integralmente **********/

:root {
    --primary:   #08536E;
    --secondary: #36b17A;
    --light:     #FAFAFB;
    --dark:      #12141D;
}

/* overlay, boxFlutuante */
.overlay { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.5); z-index:999; }

/* Tamanhos de texto */
.text-tiny  { font-size:10px !important; }
.text-small { font-size:13px !important; }
.text-big   { font-size:18px !important; }
.text-huge  { font-size:22px !important; }

/* Espaçamentos extras */
.my-6 { margin-top:4rem!important; margin-bottom:4rem!important; }
.py-6 { padding-top:4rem!important; padding-bottom:4rem!important; }

/*** Spinner ***/
#spinner { opacity:0; visibility:hidden; transition: opacity .5s ease-in-out; }
#spinner.show { visibility:visible; opacity:1; }

/*** Buttons ***/
.btn { font-weight:500; transition:.5s; }
.btn-square    { width:38px; height:38px; padding:0; display:inline-flex; align-items:center; justify-content:center; }
.btn-sm-square { width:32px; height:32px; padding:0; display:inline-flex; align-items:center; justify-content:center; }
.btn-lg-square { width:48px; height:48px; padding:0; display:inline-flex; align-items:center; justify-content:center; }

/*** Navbar legada (mantida por compatibilidade) ***/
.navbar .navbar-nav .nav-link { padding:20px 15px; color:var(--dark); font-size:18px; font-weight:600; }
.navbar .navbar-nav .nav-link:hover { color:var(--primary); }

/*** SweetAlert customizado ***/
.swal-button { background:#ED7F00; min-width:140px; border-radius:4px; }
.swal-text   { text-align:center; }

/*** Utilitários legados ***/
.agendas { margin-top:45px; }
@media (max-width:768px) { .agendas { margin-top:20px; } }
input { text-align:left; }

/* Scrollbar customizada (legada) */
::-webkit-scrollbar       { width:6px; }
::-webkit-scrollbar-track { background:#f1f1f1; }
::-webkit-scrollbar-thumb { background:#c1c1c1; border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:#a8a8a8; }


/* ═══════════════════════════════════════════════════════════════════
   REDESIGN LEADRADAR — estilos novos (não conflitam com os acima)
   Todos os seletores usam o prefixo  .lr-  para evitar colisões
   com Bootstrap 5 ou regras legadas.
═══════════════════════════════════════════════════════════════════ */

/* ── Variáveis do redesign ── */
:root {
    --lr-dark:        #0c313d;
    --lr-dark-hover:  #0a2730;
    --lr-bg:          #fafbfc;
    --lr-border:      #e2e8f0;
    --lr-text:        #334155;
    --lr-muted:       #64748b;
    --lr-light:       #94a3b8;
    --lr-sidebar-w:   240px;
    --lr-topbar-h:    0px;   /* desktop: sem topbar visível */
}

/* ── Reset mínimo para o layout ── */
body {
    background: var(--lr-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── OVERLAY mobile ── */
.lr-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
}
.lr-overlay.show { display: block; }

/* ═══════════════════
   SIDEBAR
═══════════════════ */
.lr-sidebar {
    width: var(--lr-sidebar-w);
    background: var(--lr-dark);
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform .25s ease;
}

.lr-sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 24px 16px;
}

/* Brand */
.lr-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 22px;
    padding-left: 2px;
    letter-spacing: -.3px;
    text-decoration: none;
}
.lr-logo { width: 30px; height: 30px; flex-shrink: 0; }

/* Perfil */
.lr-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    background: rgba(255,255,255,.05);
    border-radius: 8px;
    margin-bottom: 24px;
}
.lr-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.12);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .82rem;
    flex-shrink: 0;
}
.lr-profile-name  { font-weight: 600; font-size: .88rem; color: #fff; display: block; }
.lr-profile-email { font-size: .72rem; color: #64748b; display: block; }

/* Navegação */
.lr-nav { flex: 1; }

.lr-menu-list {
    list-style: none;
    padding: 0; margin: 0;
}

.lr-menu-section {
    font-size: .68rem;
    font-weight: 700;
    color: rgba(255,255,255,.3);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 14px 10px 4px;
}

.lr-menu-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background .15s, color .15s;
    position: relative;
}
.lr-menu-item a:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.lr-menu-item.active a {
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 600;
}

.lr-menu-icon {
    width: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.lr-badge {
    margin-left: auto;
    background: #fff;
    color: var(--lr-dark);
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

/* Sair — destaque sutil */
.lr-menu-logout a {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,.07);
    padding-top: 14px;
    color: rgba(255,255,255,.4);
}
.lr-menu-logout a:hover { color: #fff; background: rgba(255,255,255,.05); }

/* ═══════════════════
   TOPBAR (mobile)
═══════════════════ */
.lr-topbar {
    display: none; /* escondida no desktop */
    align-items: center;
    gap: 12px;
    background: var(--lr-dark);
    padding: 0 16px;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.lr-hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
}
.lr-hamburger:hover { background: rgba(255,255,255,.1); }

.lr-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}
.lr-logo-sm { width: 26px; height: 26px; }

/* ═══════════════════
   CONTEÚDO PRINCIPAL
═══════════════════ */
.lr-main {
    margin-left: var(--lr-sidebar-w);
    min-height: 100vh;
    background: var(--lr-bg);
    display: flex;
    flex-direction: column;
}

/* ── Cabeçalho de página ── */
.lr-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 36px 0;
}
.lr-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}
.lr-page-header .lr-page-sub {
    font-size: .88rem;
    font-weight: 400;
    color: var(--lr-light);
    margin-left: 8px;
}

/* ── Área de conteúdo ── */
.lr-content {
    padding: 24px 36px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* ── Cards de métricas ── */
.lr-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--lr-border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.lr-metric {
    padding: 20px 16px;
    text-align: center;
    position: relative;
}
.lr-metric:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0; top: 20%;
    height: 60%; width: 1px;
    background: var(--lr-border);
}
.lr-metric-label { font-size: .8rem; font-weight: 500; color: var(--lr-muted); }
.lr-metric-value { font-size: 1.8rem; font-weight: 700; color: var(--lr-dark); margin-top: 6px; }
.lr-metric-sub   { font-size: .74rem; color: var(--lr-light); margin-top: 3px; }
.lr-metric-sub.positive { color: #0f6e56; font-weight: 600; }

/* ── Grid central (2 colunas) ── */
.lr-grid-2 {
    display: grid;
    grid-template-columns: 1.22fr .78fr;
    gap: 20px;
}

/* ── Card / Box genérico ── */
.lr-box {
    background: #fff;
    border: 1px solid var(--lr-border);
    border-radius: 8px;
    padding: 22px;
}
.lr-box-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 18px;
}

/* ── Linha de lead ── */
.lr-lead-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.lr-lead-row:last-child { border-bottom: none; }
.lr-lead-info  { display: flex; align-items: center; gap: 8px; }
.lr-lead-idx   { color: var(--lr-light); font-weight: 500; font-size: .88rem; min-width: 22px; }
.lr-lead-name  { font-weight: 500; color: var(--lr-text); font-size: .92rem; }
.lr-lead-phone { color: var(--lr-muted); font-size: .82rem; margin-left: 6px; }

/* ── Botões de ação outline ── */
.lr-actions { display: flex; gap: 8px; }

.lr-btn {
    width: 36px; height: 36px;
    border-radius: 6px;
    border: 1.5px solid var(--lr-dark);
    background: #fff;
    color: var(--lr-dark);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.lr-btn:hover {
    background: var(--lr-dark);
    color: #fff;
}

/* ── Filtro de data ── */
.lr-date-filter {
    background: #fff;
    border: 1px solid var(--lr-border);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: .84rem;
    font-weight: 500;
    color: var(--lr-text);
    cursor: pointer;
    transition: border-color .15s;
}
.lr-date-filter:hover { border-color: var(--lr-dark); }

/* ── Botão primário ── */
.lr-btn-primary {
    background: var(--lr-dark);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lr-btn-primary:hover { background: var(--lr-dark-hover); color: #fff; }

/* ── Barra de pesquisa ── */
.lr-search {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--lr-border);
    border-radius: 6px;
    padding: 8px 12px;
    background: #fff;
}
.lr-search i { color: var(--lr-light); font-size: .9rem; }
.lr-search input {
    border: none;
    outline: none;
    font-size: .88rem;
    flex: 1;
    color: var(--lr-text);
    background: transparent;
    text-align: left;
}
.lr-search input::placeholder { color: #cbd5e1; }

/* ── Tabela de leads ── */
.lr-table { background: #fff; border: 1px solid var(--lr-border); border-radius: 8px; overflow: hidden; }
.lr-table-head {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--lr-border);
}
.lr-table-head span { font-size: .72rem; font-weight: 700; color: var(--lr-muted); text-transform: uppercase; letter-spacing: .05em; }
.lr-table-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    transition: background .1s;
}
.lr-table-row:last-child { border-bottom: none; }
.lr-table-row:hover { background: #f8fafc; }

/* ── Formulário ── */
.lr-form-label { font-size: .8rem; font-weight: 600; color: var(--lr-muted); display: block; margin-bottom: 4px; }
.lr-form-input {
    width: 100%;
    border: 1px solid var(--lr-border);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: .88rem;
    color: var(--lr-text);
    background: #fff;
    outline: none;
    transition: border-color .15s;
    text-align: left;
}
.lr-form-input:focus { border-color: var(--lr-dark); }
.lr-form-hint { font-size: .74rem; color: var(--lr-light); margin-top: 5px; }

/* ── Drop zone upload ── */
.lr-dropzone {
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    padding: 32px 16px;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .15s;
}
.lr-dropzone:hover { border-color: var(--lr-dark); }
.lr-dropzone i { font-size: 2rem; color: #cbd5e1; display: block; margin-bottom: 8px; }
.lr-dropzone p { font-size: .88rem; color: var(--lr-muted); }

/* ── Pills de status ── */
.lr-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
}
.lr-pill-green { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.lr-pill-amber { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.lr-pill-dot   { width: 6px; height: 6px; border-radius: 50%; }

/* ── Alerta/aviso amarelo ── */
.lr-alert-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: .82rem;
    color: #92400e;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.lr-alert-warn i { color: #b45309; flex-shrink: 0; margin-top: 2px; }

/* ── Seção label (WA config) ── */
.lr-section-label {
    font-size: .7rem;
    font-weight: 700;
    color: var(--lr-light);
    text-transform: uppercase;
    letter-spacing: .07em;
    display: block;
    margin: 14px 0 8px;
}

/* ── Tabs (WA Meta / QR Code) ── */
.lr-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.lr-tab {
    flex: 1;
    border: 1.5px solid var(--lr-border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    transition: border-color .15s;
}
.lr-tab:hover   { border-color: var(--lr-dark); }
.lr-tab.active  { border-color: var(--lr-dark); background: #f0f9ff; }
.lr-tab i       { font-size: 1rem; color: var(--lr-dark); }
.lr-tab-title   { font-size: .84rem; font-weight: 600; color: var(--lr-text); }
.lr-tab-sub     { font-size: .72rem; color: var(--lr-light); }

/* ── QR zone ── */
.lr-qr-zone {
    border: 1px solid var(--lr-border);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    margin-bottom: 12px;
}
.lr-qr-zone i { font-size: 2rem; color: #cbd5e1; display: block; margin-bottom: 8px; }
.lr-qr-zone p { font-size: .84rem; color: var(--lr-muted); }

/* ── Empty state ── */
.lr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 10px;
    color: var(--lr-light);
    text-align: center;
}
.lr-empty i      { font-size: 2.5rem; color: #e2e8f0; }
.lr-empty strong { font-size: .95rem; color: var(--lr-text); font-weight: 600; }
.lr-empty p      { font-size: .85rem; }

/* ═══════════════════
   RESPONSIVO MOBILE
═══════════════════ */
@media (max-width: 768px) {

    /* Sidebar vira drawer */
    .lr-sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
    }
    .lr-sidebar.open { transform: translateX(0); }

    /* Topbar aparece no mobile */
    .lr-topbar { display: flex; }

    /* Conteúdo ocupa tela toda */
    .lr-main { margin-left: 0; }

    /* Padding reduzido */
    .lr-page-header { padding: 16px 20px 0; }
    .lr-content      { padding: 16px 20px 28px; }

    /* Métricas 2 colunas */
    .lr-metrics { grid-template-columns: repeat(2, 1fr); }
    .lr-metric:nth-child(2)::after { display: none; }

    /* Grid central 1 coluna */
    .lr-grid-2 { grid-template-columns: 1fr; }

    /* Oculta telefone na listagem para ganhar espaço */
    .lr-lead-phone { display: none; }
}
