/* ==========================================================================
   CUSTOMIZAÇÕES GERAIS E DO DASHBOARD
   ========================================================================== */
.card-shadow { box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important; }
.bg-primary-soft { background-color: rgba(13, 110, 253, 0.12); }

.text-gray-300 { color: #dddfeb !important; }
.text-gray-800 { color: #5a5c69 !important; }
.smaller { font-size: 0.7rem; letter-spacing: 0.05em; }

/* Ajuste de badges de alerta (Dashboard) */
.text-danger.smaller { color: #eb4d4b !important; }
.text-success.smaller { color: #2ecc71 !important; }
.text-warning.smaller { color: #f1c40f !important; }

/* ==========================================================================
   FORMULÁRIOS E INPUTS
   ========================================================================== */
.form-control, .form-select { 
    background-color: #f8f9fa; 
    border: 1px solid #ced4da; 
    font-weight: 500; 
    border-radius: 0.375rem; 
}
.form-control:focus, .form-select:focus { 
    background-color: #fff; 
    border-color: #86b7fe; 
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25); 
}
.btn-white { background: #fff; color: #333; }

/* ==========================================================================
   TABELAS E LISTAGENS
   ========================================================================== */
.table th { 
    font-weight: 600; 
    text-transform: uppercase; 
    font-size: 0.8rem; 
    color: #6c757d; 
}
.table thead th { 
    font-size: 0.72rem; 
    text-transform: uppercase; 
    font-weight: 700; 
    color: #747d8c;
    letter-spacing: 1px;
    padding: 15px 10px;
}

/* Estilo Planilha Clean (Financeiro, Inadimplência e Fluxo de Caixa) */
.table-spreadsheet { font-size: 0.85rem; color: #495057; }
.table-spreadsheet th, .table-spreadsheet td { border: 1px solid #e9ecef; vertical-align: middle; }
.table-spreadsheet thead th { background-color: #f8f9fa; border-bottom: 2px solid #dee2e6; letter-spacing: 0.5px; color: #6c757d; font-weight: 600; }
.table-spreadsheet tbody tr:hover { background-color: #f1f3f5 !important; }

/* ==========================================================================
   BOTÕES DE AÇÃO EM TABELAS (ESTILO OUTLINE COLORIDO)
   ========================================================================== */
.action-buttons .btn {
    background-color: transparent !important;
    transition: all 0.2s ease-in-out;
}

/* Contorno e cor do botão de Editar (Azul/Info) */
.action-buttons .btn-edit {
    border: 1px solid #0dcaf0 !important; 
    color: #0dcaf0 !important;
}

/* Contorno e cor do botão de Excluir (Vermelho/Danger) */
.action-buttons .btn-delete {
    border: 1px solid #dc3545 !important; 
    color: #dc3545 !important;
}

/* Efeito Hover: Fundo cinza super clarinho para dar destaque sem ofuscar a cor */
.action-buttons .btn:hover {
    background-color: #f8f9fa !important; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    z-index: 1;
}

.action-buttons .btn i {
    opacity: 0.85;
    transition: opacity 0.2s;
}
.action-buttons .btn:hover i {
    opacity: 1;
}

/* ==========================================================================
   COMPONENTES E BADGES
   ========================================================================== */
.badge { font-weight: 500; letter-spacing: 0.5px; }

.badge-dot {
    background-color: transparent !important;
    border: 1px solid #dee2e6;
    color: #495057 !important;
    font-weight: 600;
    padding: 5px 10px;
}
.badge-dot::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    margin-right: 6px;
}

/* ==========================================================================
   NAVBAR E MENUS DO TOPO
   ========================================================================== */
.navbar-brand { font-weight: 700; letter-spacing: 1px; }
.navbar-brand img { max-height: 40px; width: auto; }

.btn-nav-custom {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-nav-custom:hover { 
    background-color: rgba(255, 255, 255, 0.25); 
    color: #ffffff; 
    border-color: rgba(255, 255, 255, 0.5); 
}

.dropdown-menu-dark-custom { background-color: #343a40; border: 1px solid #495057; }
.dropdown-menu-dark-custom .dropdown-item { color: #e9ecef; }
.dropdown-menu-dark-custom .dropdown-item:hover { background-color: #495057; color: #fff; }

@media (min-width: 992px) {
    .dropdown-menu-dark-custom {
        max-height: min(70vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
}

.nav-link.disabled-upgrade { color: #6c757d !important; cursor: not-allowed; opacity: 0.7; }
.nav-link.disabled-upgrade:hover { color: #adb5bd !important; }

/* ==========================================================================
   DESTAQUES FINANCEIROS E CARTÕES (FINANCE-CARDS)
   ========================================================================== */
.finance-card { border-left: 5px solid; transition: transform 0.2s; }
.border-left-primary { border-left-color: #4e73df !important; }
.border-left-success { border-left-color: #198754 !important; }
.border-left-warning { border-left-color: #ffc107 !important; }
.border-left-dark    { border-left-color: #212529 !important; }
.border-left-info    { border-left-color: #0dcaf0 !important; }
.border-left-danger  { border-left-color: #dc3545 !important; }

/* Destaques em Tabelas (Fluxo e Inadimplência) */
.col-destaque-lucro { background-color: #f6fdf8 !important; color: #198754 !important; font-weight: bold; }
.col-destaque-venda { background-color: #f4f9ff !important; border-left: 3px solid #0d6efd !important; }
.col-destaque       { background-color: #fffcf2 !important; }

/* Tooltip sublinhado */
.info-hover { cursor: help; border-bottom: 1px dashed #ced4da; padding-bottom: 1px; transition: all 0.2s; }
.info-hover:hover { border-bottom-color: #495057; opacity: 0.8; }
.group-hover-edit:hover .text-dark { color: #0d6efd !important; text-decoration: underline; }

/* ==========================================================================
   BOTÃO FLUTUANTE EXPANSÍVEL (SENTINELA DO CAIXA)
   ========================================================================== */
.caixa-floating-btn {
    background-color: #fdf3c6; 
    color: #664d03; 
    border: 2px solid #ffda6a;
    border-radius: 50px;
    height: 45px;
    width: 45px; 
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
    margin: 0 auto;
}
.caixa-floating-btn:hover { 
    width: 360px; 
    background-color: #ffecb5; 
    color: #4d3a00; 
}
.caixa-floating-icon { width: 41px; text-align: center; flex-shrink: 0; font-size: 1.1rem; }
.caixa-floating-text { font-weight: 700; font-size: 0.85rem; opacity: 0; transition: opacity 0.2s ease-in-out; padding-right: 15px; }
.caixa-floating-btn:hover .caixa-floating-text { opacity: 1; transition-delay: 0.15s; }

/* ==========================================================================
   ESTILOS DO RELATÓRIO CONTÁBIL E EXTRATOS (TELA)
   ========================================================================== */
.papel-a4 {
    background: white;
    max-width: 297mm;
    margin: 0 auto;
    padding: 15mm; 
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
    min-height: 210mm;
    border-radius: 5px;
}
.scroll-relatorio {
    max-height: 75vh; 
    overflow-y: auto; 
    background-color: #f1f3f5; 
    padding: 20px; 
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
.tabela-contabil {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin-bottom: 1.5rem;
}
.tabela-contabil th, .tabela-contabil td {
    border: 1px solid #dee2e6 !important;
    padding: 8px 10px; 
    vertical-align: middle;
    font-size: 0.75rem;
}
.tabela-contabil th { 
    background-color: #f8f9fa !important; 
    font-weight: 700;
    text-align: center;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.7rem; 
}
.tabela-contabil tbody tr:nth-child(even) { background-color: #fcfcfc; }
.tabela-menor th, .tabela-menor td { padding: 6px 10px; font-size: 0.75rem; }
.fonte-reduzida { font-size: 0.65rem !important; line-height: 1.2; }

.table-extrato { font-family: 'Segoe UI', Arial, sans-serif; }
.table-extrato th {
    background-color: #f1f3f5;
    color: #495057;
    font-weight: 700;
    border-bottom: 2px solid #ced4da;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 10px 12px;
}
.table-extrato td { vertical-align: middle; font-size: 0.8rem; padding: 8px 12px; }
.valor-entrada { color: #198754; font-weight: 700; }
.valor-saida { color: #dc3545; font-weight: 700; }
.valor-estornado { text-decoration: line-through; color: #adb5bd; }
.td-descritivo { font-size: 0.75rem; line-height: 1.2; }
.tfoot-totais td { background-color: #e9ecef; border-top: 2px solid #ced4da !important; font-size: 0.85rem; }

/* BARRA DE ROLAGEM COM CABEÇALHO FIXO E SCROLL ELEGANTE */
.scroll-tabela { max-height: 60vh; overflow-y: auto; scrollbar-width: thin; }
.scroll-tabela::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-tabela::-webkit-scrollbar-track { background: #f8f9fa; border-radius: 4px; }
.scroll-tabela::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
.scroll-tabela::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
.scroll-tabela thead th, .scroll-tabela thead td {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f1f3f5;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* ESTILO DO AUTOCOMPLETE */
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    z-index: 9999;
}

/* =========================================
   RADAR DE PRAZOS
========================================= */
.radar-scroll { max-height: 450px; overflow-y: auto; scrollbar-width: thin; }
.radar-scroll::-webkit-scrollbar { width: 6px; }
.radar-scroll::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.radar-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.radar-scroll::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* =========================================
   EFEITO "SALTO" NAS LISTAS E CARDS (HOVER)
========================================= */
.lembrete-item, .processo-item { transition: all 0.2s ease-in-out; cursor: default; position: relative; }
.lembrete-item:hover, .processo-item:hover {
    background-color: #ffffff;
    transform: translateY(-3px); 
    box-shadow: 0 0.3rem 0.8rem rgba(0,0,0,0.12) !important;
    z-index: 2; 
    border-color: #e2e8f0 !important;
}

.list-group-item { margin-bottom: 3px; border: 1px solid #f1f1f1 !important; border-radius: 6px !important; }
.card-financeiro { transition: transform 0.2s ease; }
.card-financeiro:hover { transform: translateY(-3px); }

.icon-box-primary { background-color: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.icon-box-danger { background-color: rgba(220, 53, 69, 0.1); color: #dc3545; }
.icon-box-warning { background-color: rgba(255, 193, 7, 0.15); color: #d39e00; }

.card-dashboard { transition: all 0.2s ease-in-out; cursor: pointer; }
.card-dashboard:hover { transform: translateY(-5px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important; }

/* --- AJUSTES DO SELECT2 E UTILITÁRIOS (TELA DE ORÇAMENTO E GERAL) --- */
.select2-container--bootstrap-5 .select2-selection { min-height: 38px; padding-top: 4px; }
.input-honorario-destaque { font-weight: bold; color: #198754; background-color: #f8fff9 !important; }
.bg-dark-custom { background-color: #212529 !important; }

.nav-tabs .nav-link { color: #6c757d; font-weight: 600; font-size: 0.9rem; }
.nav-tabs .nav-link.active { color: #198754; border-bottom: 3px solid #198754; }
.nav-tabs .nav-link:hover { border-color: transparent; color: #198754; }

/* ==========================================================================
   BLINDAGEM GERAL DE IMPRESSÃO BROWSER (Ctrl+P para todos os Relatórios)
   ========================================================================== */
.print-header { display: none; }

@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body { background: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    
    nav, .navbar, footer, form, .btn, .pagination, .toast-container, .d-print-none, .filtros-tela { 
        display: none !important; height: 0 !important; overflow: hidden !important; 
    }

    .container, .container-fluid { width: 100% !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
    .card { border: none !important; box-shadow: none !important; }
    .card-header { border-bottom: 2px solid #000 !important; background: white !important; padding-left: 0 !important; }
    
    /* Tabelas em Geral */
    .table-extrato th, .table-extrato td { padding: 6px 8px !important; font-size: 8pt !important; border: 1px solid #dee2e6 !important; }
    .custom-print-table { width: 100% !important; border-collapse: collapse; }
    .custom-print-table td { padding: 4px 2px !important; border-bottom: 1px solid #ccc !important; font-size: 0.9rem; }
    
    /* Balancete Contábil */
    .scroll-relatorio { max-height: none !important; overflow-y: visible !important; background: transparent !important; padding: 0 !important; border: none !important; }
    .papel-a4 { box-shadow: none !important; margin: 0 !important; max-width: 100% !important; padding: 0 !important; }
    .tabela-contabil th, .tabela-contabil td { padding: 6px !important; font-size: 7.5pt !important; border: 1px solid #444 !important; }
    .fonte-reduzida { font-size: 6.5pt !important; }
    .d-print-flex { display: flex !important; width: 100%; flex-wrap: nowrap !important; }
    .col-print-4 { flex: 0 0 33.3333%; max-width: 33.3333%; padding: 0 5px; }
    .text-nowrap-print { white-space: nowrap !important; }

    /* Extratos de Clientes */
    .cliente-container { page-break-inside: auto; border-bottom: 2px solid #000 !important; margin-bottom: 15px !important; }
    .badge, .bg-light { border: none !important; color: #000 !important; padding: 0 !important; font-weight: bold; }
    .resumo-geral { border: 2px solid #000 !important; background-color: #eee !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; page-break-inside: avoid; }
    .text-primary, .text-success, .text-danger, .text-muted { color: #000 !important; }

    /* Desativa rolagem e Sticky */
    .scroll-tabela { max-height: none !important; overflow-y: visible !important; }
    .scroll-tabela thead th, .scroll-tabela thead td { position: static !important; box-shadow: none !important; }

    /* Múltiplas Páginas Seguras */
    thead { display: table-header-group; } 
    tfoot { display: table-footer-group; } 
    tr { page-break-inside: avoid; } 
    .print-header { display: block !important; margin-bottom: 20px; }
}

/* =========================================
   KANBAN BOARD OPERACIONAL
   ========================================= */
.kanban-container {
    display: flex;
    overflow-x: auto;
    padding-bottom: 20px;
    align-items: flex-start;
    gap: 15px;
    scrollbar-width: thin;
}
.kanban-container::-webkit-scrollbar { height: 8px; }
.kanban-container::-webkit-scrollbar-track { background: #f1f3f5; border-radius: 4px; }
.kanban-container::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 4px; }
.kanban-container::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

.kanban-column {
    background-color: #f4f5f7;
    border-radius: 8px;
    min-width: 320px;
    width: 320px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 150px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.kanban-header {
    padding: 12px 15px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.kanban-cards {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
    min-height: 150px; 
}

.kanban-cards::-webkit-scrollbar { width: 4px; }
.kanban-cards::-webkit-scrollbar-track { background: transparent; }
.kanban-cards::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 4px; }

.kanban-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #ced4da;
    transition: transform 0.1s, box-shadow 0.1s;
}
.kanban-card:active {
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}
.kanban-card:hover { border-color: #aeb5bc; }

.border-SOLICITADO { border-left-color: #6c757d !important; }
.border-EM_ANALISE { border-left-color: #0dcaf0 !important; }
.border-PENDENTE   { border-left-color: #ffc107 !important; }
.border-FINALIZADO_DETRAN { border-left-color: #0d6efd !important; }
.border-APROVADO   { border-left-color: #198754 !important; }
.border-CANCELADO  { border-left-color: #dc3545 !important; }

.sortable-ghost {
    opacity: 0.4;
    background-color: #e9ecef;
}
.sortable-drag {
    background-color: #fff !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}

/* =========================================
   TIMELINE DO PROCESSO
========================================= */
.timeline-processo { position: relative; padding: 1rem 1rem 1rem 2.25rem; }
.timeline-processo::before {
    content: "";
    position: absolute;
    left: 1.55rem;
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    background: #e9ecef;
}
.timeline-item { position: relative; padding: 0 0 1rem 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute;
    left: -1.55rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    box-shadow: 0 0 0 4px #fff;
}
.timeline-content {
    background: #fff;
    border: 1px solid #edf0f2;
    border-radius: 8px;
    padding: 0.85rem;
}
