/* 
   Style.css - Advpersonal CRM
   Design Premium, Responsivo, Tema Escuro (Dark Mode)
*/

:root {
    /* Paleta de Cores - Premium Dark Mode */
    --bg-dark: #0f172a;
    /* Fundo Principal */
    --bg-card: rgba(30, 41, 59, 0.7);
    /* Fundo Cards com leve transparência */
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-sidebar: #1e293b;
    /* Fundo Menu Lateral */

    /* Cores de Destaque */
    --primary: #3b82f6;
    /* Azul principal */
    --primary-hover: #2563eb;
    --secondary: #8b5cf6;
    /* Roxo para áreas secundárias/processos */
    --accent: #10b981;
    /* Verde para sucesso/positivos */
    --danger: #ef4444;
    /* Vermelho para alertas/cancelamentos */
    --warning: #f59e0b;
    /* Laranja para pendências/prazos */

    /* Textos */
    --text-main: #f8fafc;
    /* Texto Principal Claro */
    --text-muted: #94a3b8;
    /* Texto Secundário Mudo */

    /* Bordas e Elementos Visuais */
    --border: rgba(255, 255, 255, 0.1);

    /* Tipografia */
    --font-family: 'Inter', sans-serif;

    /* Efeitos de Sombreamento e Vidro (Glassmorphism) */
    --glass-blur: blur(12px);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.3);
    
    --stat-gradient: linear-gradient(135deg, #fff, #cbd5e1);

    /* Transições Suaves */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* Skeleton Loader Premium */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.03) 25%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 4px;
    display: inline-block;
}

.skeleton-card {
    height: 160px;
    width: 100%;
    border-radius: 16px;
    background-color: var(--bg-card);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Staggered Entry Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(10px);
    animation: staggerFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* TEMA CLARO (Overrides) */
:root.light-theme {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #ffffff;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    --border: rgba(0, 0, 0, 0.08);
    
    --primary: #2563eb;
    --secondary: #7c3aed;
    
    /* Melhoria de contraste para gradientes e valores */
    --stat-gradient: linear-gradient(135deg, #1e293b, #475569);
}

:root.light-theme body {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

:root.light-theme .sidebar {
    background-color: var(--bg-sidebar);
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

:root.light-theme .main-content {
    background: #f1f5f9;
}

:root.light-theme .card {
    background-color: var(--bg-card);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

:root.light-theme .top-header {
    background-color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border);
}

:root.light-theme .form-control {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

:root.light-theme .modal-content {
    background-color: #ffffff;
    color: #1e293b;
}

:root.light-theme .nav-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

:root.light-theme .user-profile {
    background-color: #f8fafc;
}

:root.light-theme .sidebar-header {
    border-bottom: 1px solid var(--border);
}

:root.light-theme input::placeholder {
    color: #94a3b8;
}

:root.light-theme .stat-value {
    background: var(--stat-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

:root.light-theme .card h3 {
    color: var(--text-main) !important;
}

:root.light-theme .text-muted {
    color: var(--text-muted) !important;
}

:root.light-theme .search-bar input {
    color: var(--text-main);
}

:root.light-theme .notification-btn {
    color: var(--text-main);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    /* Evita rolagem na janela inteira, as áreas internas vão rolar */
    -webkit-font-smoothing: antialiased;
}

/* ========================================================
   Layout Base
======================================================== */
#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ========================================================
   Sidebar (Menu Lateral)
======================================================== */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    z-index: 100;
}

.sidebar-header {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.logo i {
    font-size: 1.6rem;
    color: var(--primary);
}

/* Botões de Toggle Mobile */
.mobile-toggle,
.sidebar-toggle-mobile {
    display: none;
    /* Escondido no Desktop */
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: var(--shadow-glow);
}

.nav-item.active:hover {
    transform: none;
}

.user-profile {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.1);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================================
   Área Principal de Conteúdo
======================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at top right, rgba(30, 41, 59, 1) 0%, rgba(15, 23, 42, 1) 100%);
}

.top-header {
    height: 70px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

#page-title {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 8px;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-main);
    font-family: var(--font-family);
    outline: none;
    width: 250px;
    font-size: 0.9rem;
    transition: width var(--transition-normal);
}

.search-bar input:focus {
    width: 300px;
}

.notification-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.notification-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg-dark);
}

/* ========================================================
   Container das Vistas (Views)
======================================================== */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    scroll-behavior: smooth;
    position: relative;
}

/* Custom Scrollbar Premium */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Animações de Entrada das Telas */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================
   Componentes Utilitários (Cards, Botões)
======================================================== */
.card {
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
    /* background-color: var(--bg-card-hover); */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Grids utilitários */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 8px;
    background: var(--stat-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-box {
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box i {
    font-size: 1.5rem;
}

.text-success {
    color: var(--accent);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-primary {
    color: var(--primary);
}

/* ========================================================
   Responsividade (Mobile)
======================================================== */
@media (max-width: 1024px) {
    .search-bar input {
        width: 180px;
    }

    .search-bar input:focus {
        width: 220px;
    }
}

@media (max-width: 768px) {

    /* Esconde barra lateral fora da tela */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    /* Classe adicionada via JS para exibir */
    .sidebar.open {
        transform: translateX(0);
    }

    /* Mostra toggle buttons */
    .sidebar-toggle-mobile,
    .mobile-toggle {
        display: block;
    }

    .header-left {
        gap: 12px;
    }

    #page-title {
        font-size: 1.2rem;
    }

    /* Busca mobile: garante que ela fique visível e oupe 100% da largura se flex-wrapped */
    .search-bar {
        display: flex !important;
        width: 100%;
        margin-top: 8px;
    }

    .search-bar input {
        width: 100% !important;
    }

    .view-container {
        padding: 20px;
    }
}



/* ========================================================
   Formulários e Inputs Customizados
======================================================== */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: rgba(15, 23, 42, 0.8);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 0.65em auto;
}

/* ========================================================
   Janelas Modais (Dialogs Premium)
======================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeInModal 0.2s ease-out forwards;
}

.modal-content {
    background-color: #161f31;
    /* Levemente mais claro q fundo puro */
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(59, 130, 246, 0.1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* Scrollbar para modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========================================================
   Estilos de Listas Customizadas
======================================================== */
.list-item-hover:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--primary);
    padding-left: 22px !important;
    /* Compensa o border */
}

.btn-close-modal:hover {
    color: var(--danger) !important;
    transform: rotate(90deg);
}

/* ========================================================
   Filtros e Botões Específicos
   ======================================================== */
.btn-filter {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-filter:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-filter.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.clickable-kpi {
    transition: all var(--transition-fast) !important;
}

.clickable-kpi:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
    border-color: var(--primary) !important;
}

.clickable-kpi:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Document Generation Tabs */
.btn-doc-tab {
    transition: all var(--transition-fast);
}

.btn-doc-tab:hover {
    background: rgba(59, 130, 246, 0.05);
}

.doc-tab-content {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================================
   Toast Notifications — Sistema de Notificações Não-Bloqueantes
======================================================== */
#toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    font-family: var(--font-family);
    pointer-events: all;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: 1px solid rgba(255,255,255,0.12);
    position: relative;
    overflow: hidden;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: toastProgress 4s linear forwards;
    border-radius: 0 0 12px 12px;
}

.toast.success { background: rgba(16, 185, 129, 0.15); }
.toast.success::after { background: var(--accent); }
.toast.error { background: rgba(239, 68, 68, 0.15); }
.toast.error::after { background: var(--danger); }
.toast.warning { background: rgba(245, 158, 11, 0.15); }
.toast.warning::after { background: var(--warning); }
.toast.info { background: rgba(59, 130, 246, 0.15); }
.toast.info::after { background: var(--primary); }

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--primary); }

.toast-body {
    flex: 1;
    line-height: 1.4;
    color: var(--text-main);
}

.toast-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
}

.toast-msg {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.toast.hide {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(60%) scale(0.9); }
}

@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ========================================================
   Deadline / Prazo Badges — Contador de Dias nos Processos
======================================================== */
.prazo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.prazo-badge.hoje {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: prazo-pulse 1.5s infinite;
}

.prazo-badge.urgente {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.prazo-badge.vencido {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.prazo-badge.normal {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

@keyframes prazo-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* ========================================================
   Status Financeiro Badges — Inadimplência em Clientes
======================================================== */
.fin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.fin-status-badge.em-dia {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.fin-status-badge.inadimplente {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.fin-status-badge.proximo {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.fin-status-badge.sem-lancamentos {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* ========================================================
   Filtro de Área — Processos
======================================================== */
.area-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.area-filter-pill:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
}

.area-filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

/* ========================================================
   Agenda da Semana — Dashboard Widget
======================================================== */
.agenda-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.agenda-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
}

.agenda-day-box {
    min-width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.agenda-day-box .day-num {
    font-size: 1.2rem;
    line-height: 1;
}

.agenda-day-box .day-mon {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Botão Pago Rápido */
.btn-pago-rapido {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-pago-rapido:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-pago-rapido.revert {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.btn-pago-rapido.revert:hover {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-main);
    box-shadow: none;
}

/* ========================================================
   9. ESTILOS DE IMPRESSÃO
   ======================================================== */
@media print {
    .sidebar, .top-header, .toolbar, .mobile-toggle, .notification-btn, #auth-container, 
    .mobile-search-btn, #btn-theme-toggle, #btn-notificacoes, .btn, .action-icon, 
    aside, header, #modal-leitura-intimacao .btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .view-container {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

    /* Ajuste para que o modal apareça corretamente na impressão caso esteja aberto */
    .modal-overlay {
        position: relative !important;
        background: white !important;
        display: block !important;
    }

    .modal-content {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Animações Premium */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in { animation: fadeIn 0.3s ease-out forwards; }
.slide-up { animation: slideUp 0.4s ease-out forwards; }

/* Ajuste Global de Modais para evitar cortes em telas pequenas */
.modal-content {
    max-height: 95vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* Painel IA Flutuante (Nova Abordagem) */
.ai-floating-window {
    position: fixed;
    top: 60px;
    right: 30px;
    width: 420px;
    max-height: calc(100vh - 120px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 24px;
    z-index: 999999;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(59, 130, 246, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-floating-header {
    padding: 20px 24px;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.1), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-floating-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.ai-floating-content::-webkit-scrollbar { width: 4px; }
.ai-floating-content::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

.ai-floating-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0,0,0,0.2);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* Utilitários para os botões da Janela IA */
.ai-floating-window .btn {
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ai-floating-window .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ai-floating-window #btn-studio-ia-intim {
    position: relative;
    overflow: hidden;
}

.ai-floating-window #btn-studio-ia-intim::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: 0.5s;
    pointer-events: none;
}

.ai-floating-window #btn-studio-ia-intim:hover::after {
    left: 120%;
}

/* ========================================================= */
/* ESTILOS PREMIUM PARA O CALENDÁRIO (FULLCALENDAR)          */
/* ========================================================= */

.fc {
    font-family: var(--font-family) !important;
    background: transparent !important;
}

.fc-theme-standard td, 
.fc-theme-standard th, 
.fc-theme-standard .fc-scrollgrid {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.fc-col-header-cell {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 0 !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05) !important;
}

.fc-daygrid-day {
    transition: background-color 0.2s ease;
}

.fc-daygrid-day:hover {
    background: rgba(255, 255, 255, 0.02);
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: rgba(59, 130, 246, 0.05) !important;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background: var(--primary);
    color: white !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 4px;
}

.fc-daygrid-day-number {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    padding: 8px !important;
}

.fc-event {
    border-radius: 6px !important;
    border: none !important;
    padding: 3px 6px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    margin: 2px 4px !important;
    box-shadow: var(--shadow-sm);
    cursor: pointer !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.fc-event:hover {
    transform: translateY(-1px);
    opacity: 0.9;
    box-shadow: var(--shadow-md);
}

.fc-event-main {
    color: white !important;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    text-transform: capitalize;
}

.fc .fc-button-primary {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-muted) !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    text-transform: capitalize !important;
    padding: 6px 16px !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.fc .fc-button-primary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.fc .fc-prev-button, .fc .fc-next-button {
    padding: 6px 12px !important;
}

/* ========================================================= */
/* ESTILOS RESPONSIVOS (MOBILE & TABLET)                     */
/* ========================================================= */

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
        background-color: var(--bg-sidebar);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle,
    .sidebar-toggle-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .top-header {
        padding: 0 16px;
        height: 60px;
        min-height: 60px;
    }

    #page-title {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-right {
        gap: 12px;
    }

    .grid-cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
        gap: 12px !important;
    }
}

@media (max-width: 768px) {
    /* Central de Mensagens Responsiva */
    .fade-in[style*="calc(100vh - 120px)"] {
        height: calc(100vh - 80px) !important;
    }

    #wa-sidebar {
        width: 100% !important;
        border-right: none !important;
    }

    #wa-chat-window {
        width: 100% !important;
    }

    #wa-contact-actions {
        width: 100%;
        margin-top: 8px;
        justify-content: flex-start !important;
        gap: 6px !important;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    #wa-contact-actions::-webkit-scrollbar {
        display: none;
    }

    #btn-toggle-bot {
        font-size: 0.78rem !important;
        padding: 6px 10px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .hide-mobile {
        display: none !important;
    }

    /* Kanban Board Responsivo */
    #kanban-board-container {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px !important;
        gap: 14px !important;
    }

    .kanban-column {
        scroll-snap-align: start !important;
        min-width: 82vw !important;
        width: 82vw !important;
        max-width: 320px !important;
    }

    /* Modais Responsivos */
    .modal-content {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: 10px auto !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .ai-floating-window {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-height: calc(100vh - 20px) !important;
    }
}