/* ==============================
   M O D I F I C A Ç Õ E S   U I
   (Design Moderno e Responsivo)
============================== */

/* Reset e fontes */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }

body { background-color: #f8fafc; color: #334155; line-height: 1.6; }

/* Header e Navegação */
header { background: #1e293b; color: white; padding: 1.2rem 0; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1000px; margin: 0 auto 1.5rem; padding: 0 20px; flex-wrap: wrap; gap: 15px; }

.logo-container { display: flex; align-items: center; gap: 15px; }
.site-logo { max-height: 40px; max-width: 100%; object-fit: contain; }
.header-container h1 { margin: 0; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.5px; }

.btn-theme-toggle { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: all 0.2s; }
.btn-theme-toggle:hover { background: rgba(255,255,255,0.1); border-color: white; transform: translateY(-1px); }

nav { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 20px; }

button.tablink {
    background: transparent; color: #cbd5e1; border: none; padding: 10px 20px;
    cursor: pointer; border-radius: 8px; font-weight: 600; transition: all 0.2s;
    font-size: 0.95rem; border: 1px solid transparent;
}
button.tablink:hover { color: white; background: rgba(255,255,255,0.05); }
button.tablink.active { background: #3b82f6; color: white; border-color: #2563eb; box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3); }

/* Container principal */
main { max-width: 1000px; margin: 2.5rem auto; padding: 0 20px; }

/* Abas e Cards */
.tabcontent { background: white; padding: 30px; border-radius: 12px; 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 #e2e8f0; }
h2 { margin-bottom: 1.5rem; color: #0f172a; font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; }

/* Formulários */
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #475569; font-size: 0.95rem; }
input[type="text"], input[type="number"], input[type="password"], input[type="date"], select {
    width: 100%; padding: 12px 15px; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 1rem; transition: all 0.2s; background-color: #f8fafc; color: #334155;
}
input:focus, select:focus { border-color: #3b82f6; outline: none; background-color: white; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

/* Botões */
.btn { padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.95rem; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #64748b; color: white; }
.btn-secondary:hover { background: #475569; }
.btn-success { background: #10b981; color: white; width: 100%; margin-top: 10px; padding: 16px; font-size: 1.1rem; }
.btn-success:hover { background: #059669; }
.btn-whatsapp { background: #25d366; color: white; }
.btn-whatsapp:hover { background: #1da851; }
.btn-danger { background: #ef4444; color: white; padding: 8px 16px; font-size: 0.85rem; }
.btn-danger:hover { background: #dc2626; }

/* Tabelas */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid #e2e8f0; margin-top: 25px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.data-table th, .data-table td { padding: 16px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.data-table th { background-color: #f8fafc; color: #475569; font-weight: 600; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background-color: #f1f5f9; }
.data-table tfoot { background-color: #f8fafc; font-weight: 700; border-top: 2px solid #cbd5e1; }

/* Utilitários */
.mt-20 { margin-top: 20px; }
.card-resumo {
    background: #f0fdf4; border: 1px solid #bbf7d0;
    padding: 20px; margin: 25px 0; border-radius: 12px; font-size: 1.1rem; color: #064e3b;
}

/* Flex layouts e Ações */
.flex-row { display: flex; gap: 15px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 150px; }
#acoes-relatorio { display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 25px; background: #f8fafc; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; }

/* Login Box */
.auth-box {
    max-width: 90%; width: 420px; margin: 10vh auto; background: white;
    padding: 40px 30px; border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    text-align: center; border: 1px solid #e2e8f0;
}
.auth-box h2 { margin-bottom: 15px; color: #0f172a; border: none; }
.auth-box p { color: #64748b; margin-bottom: 25px; font-size: 1.05rem; }
#auth_senha { text-align: center; font-size: 2rem; letter-spacing: 8px; font-weight: 700; padding: 15px; height: 70px; }

/* Dropdown Ações (Três pontinhos) */
.dropdown { position: relative; display: inline-block; }
.dropbtn { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 18px; cursor: pointer; padding: 5px 12px; font-weight: bold; color: #64748b; transition: all 0.2s; }
.dropdown-content {
    display: none; position: absolute; right: 0; top: 100%; background-color: white;
    min-width: 140px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    z-index: 10; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; margin-top: 5px;
}
.dropdown-content button {
    color: #334155; padding: 12px 16px; text-decoration: none; display: flex; align-items: center; gap: 8px;
    width: 100%; text-align: left; background: none; border: none; cursor: pointer; font-size: 0.95rem; transition: background 0.2s;
}
.dropdown-content button:hover { background-color: #f8fafc; color: #0f172a; }
.dropdown:hover .dropdown-content { display: block; }
.dropdown:hover .dropbtn { background: #e2e8f0; color: #0f172a; }

/* Responsividade Mobile e Ajustes dos Prints */
@media (max-width: 600px) {
    .header-container { flex-direction: column; text-align: center; }
    .logo-container { flex-direction: column; gap: 10px; width: 100%; }
    .site-logo { max-height: 50px; max-width: 90%; }
    nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
    button.tablink { flex: 1; min-width: 120px; text-align: center; padding: 12px 10px; }
    
    .tabcontent { padding: 20px 15px; }
    
    /* Layouts lado a lado no mobile */
    .flex-row { flex-direction: row; flex-wrap: nowrap; }
    .flex-1 { min-width: 0; } /* Permite encolher lado a lado */
    
    #acoes-relatorio { padding: 15px; flex-direction: column; align-items: stretch; gap: 15px; }
    .filtros-data-container { display: flex; gap: 10px; width: 100%; } /* Container específico para as datas */
    .filtros-data-container > div { flex: 1; }
    
    /* Força botões de salvar/cancelar e de PDF a ficarem lado a lado mesmo em telas muito pequenas */
    .botoes-acao-container { display: flex; flex-direction: row !important; gap: 10px; width: 100%; }
    .botoes-acao-container .btn { flex: 1; padding: 12px 10px; font-size: 0.9rem; white-space: nowrap; }
}

/* =======================================================
   M O D O   H A C K E R   ( D A R K   M O D E )
======================================================= */
body.hacker-mode { background-color: #050505; color: #00ff41; font-family: 'Courier New', Courier, monospace; }
body.hacker-mode header { background: #0a0a0a; border-bottom: 1px solid #003b0f; box-shadow: 0 4px 15px rgba(0, 255, 65, 0.05); }
body.hacker-mode .btn-theme-toggle { background: transparent; color: #00ff41; border: 1px solid #00ff41; }
body.hacker-mode .btn-theme-toggle:hover { background: rgba(0, 255, 65, 0.1); box-shadow: 0 0 10px rgba(0, 255, 65, 0.2); }

body.hacker-mode .tabcontent { background: #0a0a0a; border: 1px solid #003b0f; box-shadow: 0 0 20px rgba(0, 255, 65, 0.05); }
body.hacker-mode h2 { color: #00ff41; border-color: #003b0f; }
body.hacker-mode label { color: #00cc33; }

body.hacker-mode button.tablink { color: #00cc33; border: 1px solid transparent; }
body.hacker-mode button.tablink:hover { background: rgba(0, 255, 65, 0.05); color: #00ff41; }
body.hacker-mode button.tablink.active { background: rgba(0, 255, 65, 0.1); color: #00ff41; border-color: #00ff41; box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.2); }

body.hacker-mode input[type="text"], body.hacker-mode input[type="number"], body.hacker-mode input[type="password"], body.hacker-mode input[type="date"], body.hacker-mode select { 
    background: #050505; color: #00ff41; border: 1px solid #005515; border-radius: 6px; 
}
body.hacker-mode input:focus, body.hacker-mode select:focus { border-color: #00ff41; box-shadow: 0 0 8px rgba(0, 255, 65, 0.3); background: #0a0a0a; }

body.hacker-mode .btn { border: 1px solid #00ff41; background: transparent; color: #00ff41; border-radius: 6px; }
body.hacker-mode .btn:hover { background: rgba(0, 255, 65, 0.1); box-shadow: 0 0 15px rgba(0, 255, 65, 0.2); }
body.hacker-mode .btn-danger { color: #ff3333; border-color: #ff3333; }
body.hacker-mode .btn-danger:hover { background: rgba(255, 51, 51, 0.1); box-shadow: 0 0 15px rgba(255, 51, 51, 0.2); }

body.hacker-mode .table-responsive { border-color: #003b0f; }
body.hacker-mode .data-table th { background: #050505; color: #00ff41; border-color: #003b0f; }
body.hacker-mode .data-table td { border-color: #003b0f; }
body.hacker-mode .data-table tbody tr:hover { background-color: #0a0a0a; }
body.hacker-mode tfoot { background: #050505; border-top-color: #00ff41; }

body.hacker-mode .dropbtn { background: transparent; border-color: #005515; color: #00ff41; }
body.hacker-mode .dropdown:hover .dropbtn { background: rgba(0, 255, 65, 0.1); border-color: #00ff41; }
body.hacker-mode .dropdown-content { background-color: #0a0a0a; border: 1px solid #00ff41; }
body.hacker-mode .dropdown-content button { color: #00cc33; }
body.hacker-mode .dropdown-content button:hover { background-color: rgba(0, 255, 65, 0.1); color: #00ff41; }

body.hacker-mode .card-resumo { background: #050505; border: 1px solid #00ff41; box-shadow: inset 0 0 15px rgba(0, 255, 65, 0.1); color: #00ff41; }
body.hacker-mode #acoes-relatorio { background: #050505; border-color: #003b0f; }

body.hacker-mode .auth-box { background: #0a0a0a; border: 1px solid #00ff41; box-shadow: 0 0 30px rgba(0, 255, 65, 0.15); }
body.hacker-mode .auth-box p { color: #00cc33; }

/* Cores inline JS override no hacker mode */
body.hacker-mode [style*="color:#2ecc71"], body.hacker-mode [style*="color: #27ae60"], body.hacker-mode [style*="color: #2ecc71"] { color: #00ff41 !important; text-shadow: 0 0 5px rgba(0,255,65,0.5); }
body.hacker-mode [style*="color: #e74c3c"] { color: #ff3333 !important; text-shadow: 0 0 5px rgba(255,51,51,0.5); }
body.hacker-mode [style*="color:#7f8c8d"] { color: #008822 !important; }
