* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: Arial, sans-serif; background: #bbdefb; color: #333; min-height: 100vh; }

.header { background: #0277bd; padding: 12px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.header-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { padding: 5px 15px; background: linear-gradient(135deg, #ff6600, #e55a00); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: 14px; white-space: nowrap; }
.logo-img { height: 40px; }

.header { color: #fff; }
nav a { padding: 12px 14px; color: #fff !important; text-decoration: none; font-weight: 600; font-size: 16px; white-space: nowrap; }
nav a:hover { color: #ff6600 !important; }
nav a.active { color: #ff6600 !important; }
nav a.sair { color: #fff; }
nav a[href="#"] { cursor: pointer; }

.dropdown { position: relative; display: inline-block; }
.dropbtn { padding: 12px 14px; color: #fff !important; font-weight: 600; font-size: 16px; cursor: pointer; white-space: nowrap; }
.dropbtn:hover { color: #ff6600 !important; }
.dropdown-content { display: none; position: absolute; background: #0277bd; min-width: 220px; box-shadow: 0 8px 16px rgba(0,0,0,0.3); border-radius: 0 0 8px 8px; z-index: 1000; }
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a { display: block; padding: 12px 18px; color: #fff !important; text-decoration: none; font-size: 15px; font-weight: 500; border-bottom: 1px solid rgba(255,255,255,0.1); }
.dropdown-content a:hover { background: #01579b; color: #ff6600 !important; }
.dropdown-content a.active { color: #ff6600 !important; }
.dropdown-content.show { display: block; }

.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

h1 { font-size: 24px; margin-bottom: 25px; color: #01579b; }
h3 { font-size: 18px; margin-bottom: 15px; color: #01579b; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 30px; }
.stat { background: #e1f5fe; padding: 25px; border-radius: 10px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.stat-num { font-size: 28px; font-weight: 700; color: #ff6600; }
.stat-label { font-size: 13px; color: #666; margin-top: 5px; }
.stat.positivo { border-left: 4px solid #00a854; }
.stat.negativo { border-left: 4px solid #dc3545; }

.form { background: #01579b; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.15); color: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.full, .field-full { grid-column: 1 / -1; }
.field-row { display: flex; flex-direction: column; }
.field-row label { font-weight: 600; color: #01579b; margin-bottom: 5px; }
.form label { color: #fff !important; }
.form-grid > label { color: #fff !important; }
.filtro-form label { color: #01579b; }
.field-row input, .field-row select, .field-row textarea,
.form-grid > input, .form-grid > select, .form-grid > textarea { 
    padding: 10px; border: 2px solid #0277bd; border-radius: 6px; font-size: 14px; background: #e1f5fe; color: #333; width: 100%; 
}
.field-row input:focus, .field-row select:focus, .field-row textarea:focus { border-color: #ff6600; outline: none; }
.field-row input[type="radio"] { width: auto; margin-right: 5px; }

fieldset { border: 1px solid #0277bd; border-radius: 8px; padding: 20px; margin-bottom: 20px; background: #0277bd; }
fieldset legend { font-weight: 600; color: #fff; padding: 0 10px; }

.btn-primary { padding: 12px 30px; background: linear-gradient(135deg, #ff6600, #e55a00); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; margin-top: 20px; }
.btn-primary:hover { background: linear-gradient(135deg, #e55a00, #cc5200); }
.btn-secundario { display: inline-block; padding: 10px 20px; background: #666; color: #fff; text-decoration: none; border-radius: 8px; font-weight: 500; }
.btn-secundario:hover { background: #555; }
.btn-export { display: inline-block; padding: 10px 20px; background: #27a745; color: #fff; text-decoration: none; border-radius: 8px; font-weight: 500; }
.btn-export:hover { background: #218838; }

.msg { padding: 15px; background: #d4edda; color: #155724; border-radius: 8px; margin-bottom: 20px; }

h1 { color: #01579b; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h1 { margin-bottom: 0; color: #01579b; }
.btn-voltar { display: inline-block; padding: 8px 15px; background: #f0f0f0; color: #333; text-decoration: none; border-radius: 6px; font-size: 14px; }
.btn-voltar:hover { background: #e0e0e0; }

/* Tabs */
.tabs { display: flex; gap: 10px; margin-bottom: 25px; }
.tabs a { padding: 12px 25px; background: #e1f5fe; border-radius: 8px; text-decoration: none; color: #01579b; font-weight: 500; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.tabs a:hover { color: #ff6600; }
.tabs a.active { background: #ff6600; color: #fff; }

/* Tabela */
.data-table { width: 100%; background: #01579b; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.15); color: #fff; }
.data-table th { background: #0277bd; color: #fff; padding: 15px; text-align: left; font-weight: 600; }
.data-table td { padding: 12px 15px; border-bottom: 1px solid #0277bd; }
.data-table tr:hover { background: #0277bd; }

.badge { padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.ativo, .badge.conferido, .badge.receita { background: #e6f7ed; color: #00a854; }
.badge.inativo, .badge.pendente, .badge.despesa { background: #fff1f0; color: #dc3545; }
.badge.espera, .badge.cancelado { background: #fff7e6; color: #fa8c16; }
.badge.encerrado, .badge.planejamento { background: #f0f0f0; color: #666; }
.badge.em_andamento { background: #e6f7ff; color: #1890ff; }
.badge.concluida { background: #e6f7ed; color: #00a854; }
.badge.funcao-admin { background: #f0f0ff; color: #6666ff; }
.badge.funcao-gestor { background: #e6f7ed; color: #00a854; }
.badge.funcao-cadastro { background: #fff7e6; color: #fa8c16; }
.badge.funcao-financeiro { background: #e6f7ff; color: #1890ff; }

/* Busca */
.busca { display: flex; gap: 10px; margin-bottom: 20px; background: #e1f5fe; padding: 15px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.busca input, .busca select { padding: 10px; border: 2px solid #e8e8e8; border-radius: 8px; }
.busca button { padding: 10px 20px; background: #ff6600; color: #fff; border: none; border-radius: 8px; cursor: pointer; }

/* Grid 2 colunas */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

/* Resumo Financeiro */
.resumo-fin { display: flex; gap: 20px; margin-bottom: 20px; }
.resumo-fin div { padding: 15px 25px; background: #e1f5fe; border-radius: 10px; font-weight: 600; }
.resumo-fin .positivo { color: #00a854; }
.resumo-fin .negativo { color: #dc3545; }

/* Relatorio */
.relatorio-bloco { background: #e1f5fe; padding: 25px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }

/* Login */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #e3f2fd; }
.login-box { background: #01579b; padding: 50px; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); text-align: center; width: 100%; max-width: 400px; color: #fff; }
.login-box .logo { padding: 15px 25px; background: #ff6600; border-radius: 10px; display: inline-block; margin: 0 auto 20px; color: #fff; font-weight: bold; }
.login-box h1 { font-size: 24px; margin-bottom: 5px; color: #fff; }
.login-box p { color: #e1f5fe; margin-bottom: 30px; }
.login-box input { width: 100%; padding: 14px; border: 2px solid #0277bd; border-radius: 10px; margin-bottom: 15px; background: #e1f5fe; color: #333; }
.login-box button { width: 100%; padding: 14px; background: linear-gradient(135deg, #ff6600, #e55a00); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; }
.login-box button:hover { background: linear-gradient(135deg, #e55a00, #cc5200); }

.positivo { color: #00a854 !important; }
.negativo { color: #dc3545 !important; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: #e1f5fe; padding: 25px; border-radius: 10px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.stat-label { font-size: 13px; color: #666; margin-bottom: 10px; }
.stat-value { font-size: 24px; font-weight: 700; color: #333; }
.stat-value.positivo { color: #00a854; }
.stat-value.negativo { color: #dc3545; }

.transparencia-section { background: #e1f5fe; padding: 25px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.transparencia-section h2 { font-size: 18px; margin-bottom: 20px; color: #333; }

.relatorios-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.relatorio-card { background: #e1f5fe; padding: 25px; border-radius: 10px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: transform 0.2s; }
.relatorio-card:hover { transform: translateY(-3px); }
.relatorio-card h3 { font-size: 18px; color: #ff6600; margin-bottom: 10px; }
.relatorio-card p { color: #666; font-size: 14px; }
.relatorio-card .btn-export { margin-top: 15px; }

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 15px; }
    .grid-2 { grid-template-columns: 1fr; }
    .tabs { flex-wrap: wrap; }
    .resumo-fin { flex-direction: column; }
}

.paginacao { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; margin-top: 20px; background: #e1f5fe; border-radius: 8px; }
.paginacao .info { padding: 0 20px; color: #666; font-size: 14px; }
.paginacao .botoes { display: flex; gap: 10px; padding: 0 20px; }
.btn-pag { padding: 8px 16px; background: #0277bd; color: #fff; text-decoration: none; border-radius: 6px; font-size: 14px; }
.btn-pag:hover { background: #01579b; }

.data-erro { border-color: #dc3545 !important; }
.erro-msg { color: #dc3545; font-size: 12px; margin-top: 5px; }

.rodape { text-align: center; padding: 20px; color: #666; font-size: 12px; margin-top: 40px; border-top: 1px solid #ccc; }

.sort-header { color: #01579b; text-decoration: none; }
.sort-header:hover { color: #ff6600; }
.filtro-form select { padding: 8px; border: 1px solid #0277bd; border-radius: 4px; background: #fff; }

@media (max-width: 1024px) {
    .header-inner { flex-wrap: wrap; }
    nav { display: flex; flex-wrap: wrap; gap: 5px; }
    .logo-img { height: 35px; }
    .container { padding: 0 10px; margin: 15px auto; }
    .form-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 4px; }
}

@media (max-width: 768px) {
    .header { padding: 10px 0; }
    .header-inner { flex-direction: column; gap: 10px; }
    .logo-img { height: 30px; }
    nav { justify-content: center; width: 100%; display: none; flex-wrap: wrap; }
    nav.mobile-open { display: flex; }
    .menu-toggle { display: block; }
    .menu-toggle a { font-size: 20px; padding: 10px; cursor: pointer; }
    nav a, .dropbtn { font-size: 11px; padding: 8px 6px; }
    .dropdown { position: static; }
    .dropdown-content { position: static; min-width: 100%; }
    .container { margin: 10px auto; padding: 0 5px; }
    h1 { font-size: 18px; }
    h3 { font-size: 14px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat { padding: 15px 8px; }
    .stat-num { font-size: 18px; }
    .stat-label { font-size: 10px; }
    .form { padding: 15px; }
    .form-grid { gap: 10px; }
    .btn-primary { padding: 10px 20px; font-size: 14px; }
    .data-table { font-size: 10px; }
    .data-table th, .data-table td { padding: 6px 3px; }
    .page-header { flex-direction: column; gap: 10px; }
    .page-header h1 { font-size: 16px; }
    .filtro-form { flex-direction: column; gap: 8px; }
    .filtro-form label, .filtro-form select { width: 100%; }
    .paginacao { flex-direction: column; gap: 10px; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .stat { padding: 12px; }
    .stat-num { font-size: 22px; }
    nav a, .dropbtn { font-size: 10px; padding: 6px 4px; }
    .data-table { font-size: 9px; }
    .data-table th, .data-table td { padding: 4px 2px; }
    .form input, .form select, .form textarea { font-size: 12px; }
    .btn-primary { width: 100%; padding: 12px; }
}

.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 24px; margin-bottom: 0; }
.menu-toggle { display: none; color: #fff; font-size: 22px; cursor: pointer; }

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    nav { display: none; }
    nav.mobile-open { display: flex; flex-direction: column; width: 100%; }
}

@media print {
    body { background: #fff; color: #000; }
    .header, .menu-toggle, nav, .btn-primary, .btn-export, .btn-secundario, .btn-voltar, .btn-pag, .busca, .form, .msg, .paginacao, .tabs, .rodape, footer { display: none !important; }
    .container { max-width: 100%; margin: 0; padding: 10px; }
    h1 { color: #000; font-size: 20px; }
    h2 { color: #000; font-size: 16px; }
    .transparencia-section, .relatorio-bloco, .stat-card, .stats-grid { background: #fff; box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .data-table { border: 2px solid #000; }
    .data-table th { background: #eee !important; color: #000; border: 1px solid #000; }
    .data-table td { border: 1px solid #ccc; color: #000; }
    .stat-value { color: #000; }
    a[href]:after { content: none; }
    .page-header { border-bottom: 2px solid #000; padding-bottom: 10px; }
}

/* Dark Mode */
body.tema-escuro { background: #1a1a1a; color: #e0e0e0; }
body.tema-escuro .header { background: #0d47a1; }
body.tema-escuro .header-inner { background: #0d47a1; }
body.tema-escuro h1, body.tema-escuro h3 { color: #90caf9; }
body.tema-escuro .form { background: #263238; }
body.tema-escuro .stat { background: #263238; }
body.tema-escuro .form-grid > input, body.tema-escuro .form-grid > select, body.tema-escuro .form-grid > textarea { background: #37474f; border-color: #1565c0; color: #e0e0e0; }
body.tema-escuro fieldset { background: #263238; border-color: #1565c0; }
body.tema-escuro .data-table th { background: #263238; color: #e0e0e0; }
body.tema-escuro .data-table td { border-color: #455a64; color: #e0e0e0; }
body.tema-escuro .rodape { background: #263238; color: #90caf9; }

/* Notificações */
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: 0; right: -5px; background: #e53935; color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 50%; }
.notif-panel { display: none; position: absolute; right: 10px; top: 60px; background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); padding: 15px; width: 300px; z-index: 1000; color: #333; }
.notif-panel.show { display: block; }
.notif-panel h4 { margin-bottom: 10px; color: #01579b; }
.notif-item { padding: 10px; border-bottom: 1px solid #eee; }
.notif-item.nova { background: #e3f2fd; }
.notif-item small { color: #999; }

@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    nav { display: none; width: 100%; }
    nav.mobile-open { display: block; }
    .notif-panel { right: 5px; width: 250px; }
}

/* DRE - Demonstração de Resultados */
.dre-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.dre-card { background: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center; }
.dre-card.receita { border-left: 4px solid #28a745; }
.dre-card.despesa { border-left: 4px solid #dc3545; }
.dre-card.resultado { border-left: 4px solid #007bff; }
.dre-card.resultado.positivo { border-left-color: #28a745; }
.dre-card.resultado.negativo { border-left-color: #dc3545; }
.dre-label { font-size: 14px; color: #666; }
.dre-value { font-size: 28px; font-weight: bold; }
.dre-table th, .dre-table td { text-align: right; }
.dre-table th:first-child, .dre-table td:first-child { text-align: left; }
.dre-table .receita { color: #28a745; }
.dre-table .despesa { color: #dc3545; }
.dre-table .resultado.positivo { color: #28a745; font-weight: bold; }
.dre-table .resultado.negativo { color: #dc3545; font-weight: bold; }
.dre-table .total-row { background: #e9ecef; font-weight: bold; }
.dre-table .filters { background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.dre-table .form-inline { display: flex; gap: 20px; align-items: center; }
.dre-table .form-inline label { display: flex; align-items: center; gap: 5px; }
.dre-table .form-inline select { padding: 8px; border: 1px solid #dee2e6; border-radius: 4px; }