/* Estilos Customizados e Transições Suaves */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ========================================================= */
/* ROLAGEM SUAVE E BARRAS DE ROLAGEM MODERNAS (V & H)        */
/* ========================================================= */
html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #64748b #e2e8f0;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Chrome, Edge, Safari WebKit Scrollbars Globais */
::-webkit-scrollbar {
    width: 10px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

::-webkit-scrollbar-thumb:active {
    background: #4f46e5;
}

::-webkit-scrollbar-corner {
    background: #e2e8f0;
}

/* Scrollbar ultra-fina e elegante para o menu lateral escuro (Sidebar) */
.sidebar-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
    -webkit-overflow-scrolling: touch;
}

.sidebar-scrollbar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.sidebar-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 9999px;
    transition: background 0.2s ease;
}

.sidebar-scrollbar:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
}

.sidebar-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

/* Scrollbar dedicada de ALTO CONTRASTE e SEMPRE VISÍVEL para tabelas e rolagem horizontal */
.custom-scrollbar,
.overflow-x-auto,
.table-responsive,
div[class*="overflow-x"] {
    scrollbar-width: auto !important;
    scrollbar-color: #64748b #e2e8f0 !important;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Exceção estrita: Container de monitoramento de certificados usa barra flutuante inferior dedicada (sem duplicação) */
#tabela-logs-container,
div#tabela-logs-container,
div[class*="overflow-x"]#tabela-logs-container {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

#tabela-logs-container::-webkit-scrollbar,
div#tabela-logs-container::-webkit-scrollbar,
div[class*="overflow-x"]#tabela-logs-container::-webkit-scrollbar {
    width: 0px !important;
    height: 0px !important;
    display: none !important;
}

.custom-scrollbar::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
div[class*="overflow-x"]::-webkit-scrollbar {
    width: 10px !important;
    height: 12px !important;
}

.custom-scrollbar::-webkit-scrollbar-track,
.overflow-x-auto::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
div[class*="overflow-x"]::-webkit-scrollbar-track {
    background: #e2e8f0 !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
div[class*="overflow-x"]::-webkit-scrollbar-thumb {
    background: #64748b !important;
    border-radius: 6px !important;
    border: 2px solid #e2e8f0 !important;
    cursor: grab;
    transition: background-color 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.overflow-x-auto::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
div[class*="overflow-x"]::-webkit-scrollbar-thumb:hover {
    background: #4f46e5 !important; /* Destaque Indigo no hover */
}

.custom-scrollbar::-webkit-scrollbar-thumb:active,
.overflow-x-auto::-webkit-scrollbar-thumb:active,
.table-responsive::-webkit-scrollbar-thumb:active,
div[class*="overflow-x"]::-webkit-scrollbar-thumb:active {
    background: #3730a3 !important; /* Indigo escuro ao arrastar */
    cursor: grabbing;
}

/* Estilo do Cabeçalho Fixo ao Rolar Verticalmente */
.sticky-table-header th,
.table-scroll-container thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #f1f5f9;
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Coluna de Ações Fixa (Sticky Right) */
.sticky-col-actions-header,
.table-scroll-container thead th.sticky-col-actions-header {
    position: sticky;
    top: 0;
    right: 0;
    z-index: 30;
    background-color: #e2e8f0 !important;
    box-shadow: -4px 0 8px -3px rgba(0, 0, 0, 0.06);
}

.sticky-col-actions-cell,
.table-scroll-container tbody td.sticky-col-actions-cell {
    position: sticky;
    right: 0;
    z-index: 10;
    background-color: #ffffff;
    box-shadow: -4px 0 8px -3px rgba(0, 0, 0, 0.06);
}

tr:hover .sticky-col-actions-cell {
    background-color: #f8fafc !important;
}

/* Transições do Menu Lateral e Modais */
.sidebar-transition {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop-blur {
    backdrop-filter: blur(4px);
}

/* Cards com hover sutil */
.stat-card {
    transition: all 0.2s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

/* Tabela Responsiva */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========================================================= */
/* EFEITO DE BORDA CIANO/AZUL AO SELECIONAR INPUTS (FOCUS)   */
/* ========================================================= */
/* ========================================================= */
/* ALTO CONTRASTE E DEFINIÇÃO PARA INPUTS NO TEMA CLARO      */
/* ========================================================= */
body:not(.auth-page) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not(.auth-input),
body:not(.auth-page) select:not(.auth-input),
body:not(.auth-page) textarea:not(.auth-input) {
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

body:not(.auth-page) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not(.auth-input):hover:not(:focus):not(:disabled),
body:not(.auth-page) select:not(.auth-input):hover:not(:focus):not(:disabled),
body:not(.auth-page) textarea:not(.auth-input):hover:not(:focus):not(:disabled) {
    border-color: #94a3b8;
}

body:not(.auth-page) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not(.auth-input):focus,
body:not(.auth-page) input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not(.auth-input):focus-visible,
body:not(.auth-page) select:not(.auth-input):focus,
body:not(.auth-page) select:not(.auth-input):focus-visible,
body:not(.auth-page) textarea:not(.auth-input):focus,
body:not(.auth-page) textarea:not(.auth-input):focus-visible {
    border-color: #4f46e5 !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    outline: none !important;
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.2), 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* ========================================================= */
/* INPUTS EM TEMA ESCURO (Login / Recuperação / Redefinição) */
/* ========================================================= */
.auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
.auth-input,
.dark-theme-input {
    border: 1px solid #334155 !important; /* border-slate-700 */
    background-color: rgba(15, 23, 42, 0.8) !important; /* bg-slate-900/80 */
    color: #ffffff !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25) !important;
    transition: all 0.15s ease-in-out !important;
}

.auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):hover:not(:focus),
.auth-input:hover:not(:focus),
.dark-theme-input:hover:not(:focus) {
    border-color: #475569 !important;
}

.auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus,
.auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus-visible,
.auth-input:focus,
.dark-theme-input:focus {
    border-color: #38bdf8 !important; /* sky-400 */
    background-color: rgba(15, 23, 42, 0.95) !important;
    color: #ffffff !important;
    outline: none !important;
    box-shadow: 0 0 0 3.5px rgba(56, 189, 248, 0.35) !important;
}

.auth-page input::placeholder,
.auth-input::placeholder,
.dark-theme-input::placeholder {
    color: #64748b !important;
}

/* ========================================================= */
/* BORDAS ARREDONDADAS E ESTILO DO LISTBOX / SELECT OPTIONS  */
/* ========================================================= */
select {
    border-radius: 0.75rem !important; /* 12px */
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

/* Estilização dos itens (Options / Listbox) */
select option {
    padding: 7px 12px !important;
    margin: 1px 0 !important;
    border-radius: 6px !important;
    background-color: #ffffff;
    color: #1e293b;
    font-size: 13px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.15s ease-in-out;
}

select optgroup {
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-weight: 700;
    color: #64748b;
}

select option:checked {
    background-color: #0284c7 !important;
    background-image: linear-gradient(135deg, #0284c7, #0369a1) !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 8px !important;
}

select option:hover,
select option:focus {
    background-color: #f0f9ff !important;
    color: #0369a1 !important;
    border-radius: 8px !important;
}

/* ========================================================= */
/* ANIMAÇÃO DE SURGIMENTO SUAVE E ELEGANTE (MODERN SLOW POPUP) */
/* ========================================================= */
@keyframes modalEmergirSuave {
    0% {
        opacity: 0;
        transform: scale(0.72) translateY(50px);
        filter: blur(4px);
    }
    65% {
        opacity: 1;
        transform: scale(1.015) translateY(-3px);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
}

.modal-anim-surgindo {
    animation: modalEmergirSuave 0.65s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    will-change: transform, opacity, filter;
}

@keyframes iconFloatingHalo {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.icon-halo-pulse {
    animation: iconFloatingHalo 3s ease-in-out infinite;
}

/* ========================================================= */
/* PADRONIZAÇÃO DE CARDS, TABELAS E PAINÉIS (TEMA CLARO)     */
/* ========================================================= */

/* Cards e Contêineres Padrão de Alto Contraste */
.card-padrao,
.card-standard,
.bg-white.rounded-2xl,
.bg-white.rounded-3xl,
.bg-white.rounded-xl {
    border-color: #cbd5e1;
}

/* Barra de Filtros e Pesquisas */
.filter-bar-padrao {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

/* Cabeçalho de Cards e Seções Internas */
.card-header-padrao {
    background-color: rgba(241, 245, 249, 0.9);
    border-bottom: 1px solid #e2e8f0;
}

/* Tabelas Padronizadas com Alto Contraste */
.table-padrao {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-padrao thead th,
table.table-padrao thead th,
.table-responsive table thead th {
    background-color: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
}

.table-padrao tbody tr,
table.table-padrao tbody tr,
.table-responsive table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.15s ease-in-out;
}

.table-padrao tbody tr:hover,
table.table-padrao tbody tr:hover,
.table-responsive table tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.9);
}

.table-padrao tbody td,
table.table-padrao tbody td,
.table-responsive table tbody td {
    padding: 12px 16px;
    color: #334155;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
}

/* Modais Padronizados de Alto Contraste */
.modal-padrao-box {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-padrao-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

.modal-padrao-footer {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

/* Badges de Ícones Padrão no Topo de Seções */
.icon-badge-indigo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    background-color: #eef2ff;
    border: 1px solid rgba(199, 210, 254, 0.8);
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

/* REMOVE SPINNERS NATIVOS DE NÚMERO PARA INPUTS COM SUFIXOS */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ========================================================= */
/* COMPONENTE SELECT CUSTOMIZADO (LISTBOX FLUTUANTE)         */
/* ========================================================= */
.custom-select-wrapper {
    position: relative;
}
.custom-select-menu {
    z-index: 9999 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}
.custom-select-trigger.custom-select-active {
    border-color: #0284c7 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15) !important;
}

/* ========================================================= */
/* CAMPO DE BUSCA DISCRETO: CINZA DEGRADÊ & FILETE VERDE     */
/* ========================================================= */
.custom-select-search-neon-container {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.custom-select-search-neon {
    border: 1px solid #10b981 !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
    transition: all 0.15s ease-in-out !important;
}

.custom-select-search-neon:focus,
.custom-select-search-neon:focus-visible,
.custom-select-search-neon:active {
    border-color: #10b981 !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25) !important;
    outline: none !important;
}

.custom-select-search-neon::placeholder,
.custom-select-search-neon::-webkit-input-placeholder,
.custom-select-search-neon::-moz-placeholder,
.custom-select-search-neon:-ms-input-placeholder {
    color: #0f172a !important;
    opacity: 0.85 !important;
    font-weight: 500 !important;
    -webkit-text-fill-color: #0f172a !important;
}

.custom-select-search-icon-black {
    color: #0f172a !important;
    text-shadow: none !important;
}

.custom-select-search-clear-neon {
    color: #64748b !important;
    transition: all 0.15s ease !important;
}

.custom-select-search-clear-neon:hover {
    color: #0f172a !important;
}

/* ========================================================= */
/* PADRÃO GLOBAL DE MODAIS (STICKY HEADER, SCROLL & FOOTER) */
/* ========================================================= */
.modal-standard-card {
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.modal-standard-header {
    flex-shrink: 0 !important;
}

.modal-standard-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.modal-standard-body::-webkit-scrollbar {
    width: 6px;
}

.modal-standard-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 9999px;
}

.modal-standard-body::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 9999px;
}

.modal-standard-body::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

.modal-standard-footer {
    flex-shrink: 0 !important;
}




