/* ------------------------------------------------------------
   STYLE.CSS - Finance Dashboard
   Versão: 4.7.1
   Descrição: Estilos complementares (Correções visuais de Boxes e Reset de Botões).
   ------------------------------------------------------------ */

/* ---------------------------------------------------------
   1. IMPORTAÇÃO E BASE
--------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;   /* blue-600 */
    --primary-hover: #1d4ed8; /* blue-700 */
    --bg-app: #f8fafc;    /* slate-50 */
    --text-main: #1e293b; /* slate-800 */
    --border-color: #e2e8f0; /* slate-200 */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-app);
    overflow-x: hidden; /* Evita scroll horizontal indesejado */
}

/* ---------------------------------------------------------
   2. SCROLLBARS PERSONALIZADAS
--------------------------------------------------------- */

/* Webkit (Chrome, Safari, Edge) */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1; /* slate-300 */
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: content-box;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8; /* slate-400 */
}

/* Classe utilitária de fallback */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ---------------------------------------------------------
   3. ESTILIZAÇÃO DA PÁGINA DE LOGIN DO WORDPRESS
--------------------------------------------------------- */
body.login {
    background-color: var(--bg-app);
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

/* Logo Personalizado */
body.login h1 a {
    background-image: none !important;
    width: auto !important;
    height: auto !important;
    text-indent: 0 !important;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    text-decoration: none;
}

body.login h1 a::before {
    content: "\f555"; 
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
    font-weight: 900;
    margin-right: 12px;
    font-size: 28px;
}

body.login h1 a:after {
    content: "Financeiro Pro";
}

/* Container do Formulário */
body.login #login {
    width: 100%;
    max-width: 420px;
    padding: 0 20px;
}

body.login form {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 40px;
    margin-top: 0;
}

body.login label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b; 
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

body.login input[type="text"],
body.login input[type="password"] {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 24px;
    box-shadow: none;
    width: 100%;
    transition: all 0.2s ease;
    font-weight: 500;
}

body.login input[type="text"]:focus,
body.login input[type="password"]:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Botão de Login */
body.login .button.button-primary {
    background: var(--primary);
    border-color: var(--primary);
    text-shadow: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    font-weight: 700;
    border-radius: 8px;
    width: 100%;
    padding: 14px 0;
    height: auto;
    font-size: 16px;
    margin-top: 10px;
    transition: all 0.2s;
    float: none;
}

body.login .button.button-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.4);
}

/* Links do Rodapé */
body.login .forgetmenot {
    float: none;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

body.login input[type="checkbox"] {
    border-radius: 4px;
    border-color: #cbd5e1;
}

body.login input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

body.login .nav, 
body.login #backtoblog {
    text-align: center;
    padding: 0;
    margin-top: 24px;
}

body.login .nav a, 
body.login #backtoblog a {
    color: #94a3b8;
    font-size: 13px;
    transition: color 0.2s;
    text-decoration: none;
}

body.login .nav a:hover, 
body.login #backtoblog a:hover {
    color: var(--primary);
}

body.login #login_error, 
body.login .message, 
body.login .success {
    border-left: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

body.login #login_error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ---------------------------------------------------------
   4. ESTILOS DO DASHBOARD (APP)
--------------------------------------------------------- */

/* Animação de Entrada de Conteúdo */
@keyframes fadeInSlide {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

#app-content > div {
    animation: fadeInSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Wrapper Geral */
#fd-wrapper {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ajustes de Gráfico */
canvas {
    max-width: 100%;
}

/* Sidebar Overlay em Mobile */
#mobile-overlay {
    backdrop-filter: blur(2px);
}

/* Tabela Responsiva */
.table-responsive-wrapper {
    -webkit-overflow-scrolling: touch;
}

input[type="date"] {
    -webkit-appearance: none;
    position: relative;
}

#global-modal {
    z-index: 99999;
}

#loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

@media (max-width: 640px) {
    th, td {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ---------------------------------------------------------
   5. LAYOUT E ESTRUTURA
--------------------------------------------------------- */

/* Fix para o Sidebar */
#fd-sidebar {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 260px; /* Largura padrão */
    z-index: 50;
    overflow-y: auto;
}

/* Comportamento responsivo do Sidebar */
@media (max-width: 768px) {
    #fd-sidebar {
        transform: translateX(-100%);
    }
    #fd-sidebar.translate-x-0 {
        transform: translateX(0);
    }
}

/* Fix para Admin do WordPress */
#wpcontent {
    padding-left: 0 !important;
}

/* Fix para body quando modal/menu está aberto */
body.overflow-hidden {
    overflow: hidden !important;
}

/* Estilo para notificações Toastify */
.toastify {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ---------------------------------------------------------
   6. CORREÇÕES DE UI (BOXES E BOTÕES)
--------------------------------------------------------- */

/* RESET DE BOTÕES E INPUTS (Remove linhas/anéis padrão) */
button:focus, 
input:focus, 
select:focus, 
textarea:focus {
    --tw-ring-color: transparent !important;
    --tw-ring-shadow: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-color: #e2e8f0 !important; /* Mantém cor da borda suave ao focar */
}

/* Remove bordas extras de botões que devem ser limpos */
button:not(.border) {
    border: none !important;
}

/* CORREÇÃO GLOBAL DE BOXES (CARDS) */
/* Garante que todo container branco tenha borda sutil e estrutura definida */
.bg-white.rounded-lg,
.bg-white.rounded-xl,
.bg-white.rounded-md {
    border: 1px solid var(--border-color); /* Adiciona borda onde faltar */
}

/* Exceção: Remove borda dupla se o elemento pai já tiver ou se for o wrapper principal */
#app-content > div.bg-white {
    border: 1px solid var(--border-color);
}

/* Garante padding mínimo em inputs para não ficarem colados */
input, select {
    padding-left: 0.75rem !important; /* px-3 */
    padding-right: 0.75rem !important;
}