/* css/admin.css - Painel CMS Completo com Dark Mode */
:root {
    --imposto-green: #00BF37; --imposto-dark: #00BF37; --accent-red: #D32F2F;
    --bg-body: #F0F2F5; --bg-card: #FFFFFF; --text-main: #1F2937; --border-light: #E5E7EB;
}
body { font-family: 'Inter', sans-serif; margin: 0; background: var(--bg-body); color: var(--text-main); }

/* FIX DE LOGIN */
.login-body { background-color: var(--bg-body); display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-container { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; margin: 20px; box-sizing: border-box; }
.login-logo { width: 120px !important; max-width: 100%; height: auto; display: block; margin: 0 auto 20px auto; object-fit: contain; }
.login-container h2 { margin: 0; color: var(--imposto-green); }
.login-subtitle { font-size: 0.9rem; color: #666; margin-bottom: 25px; }

/* LAYOUT ADMIN BASE */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 250px; background: var(--bg-card); border-right: 1px solid var(--border-light); padding: 20px; display: flex; flex-direction: column; }
.sidebar-header { margin-bottom: 40px; }
.sidebar-header h3 { color: var(--imposto-green); margin: 0 0 5px 0; font-size: 1.5rem; }
.status-badge { font-size: 0.8rem; font-weight: 600; color: var(--imposto-green); background: #dcfce7; padding: 4px 8px; border-radius: 12px; }

.admin-nav { display: flex; flex-direction: column; gap: 10px; }
.pill-btn { background: transparent; border: none; padding: 12px 20px; border-radius: 25px; text-align: left; font-size: 0.95rem; font-weight: 600; color: #6B7280; cursor: pointer; transition: all 0.2s; }
.pill-btn:hover { background: rgba(0, 102, 79, 0.05); color: var(--imposto-green); }
.pill-btn.active { background: var(--imposto-green); color: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.pill-btn.outline { border: 1px solid var(--border-light); text-align: center; margin-top: auto; color: var(--accent-red); }

.admin-content { flex: 1; padding: 40px; overflow-y: auto; }
.admin-section { display: none; animation: fadeIn 0.3s ease; }
.admin-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.admin-card { background: var(--bg-card); padding: 30px; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid var(--border-light); max-width: 900px; margin: 0 auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.input-group { margin-bottom: 15px; display: flex; flex-direction: column; gap: 6px; text-align: left;}
.input-group label { font-size: 0.85rem; font-weight: 600; }
.input-group input, .input-group select, .input-group textarea { padding: 12px; border: 1px solid #ccc; border-radius: 8px; font-family: inherit; font-size: 0.95rem; width: 100%; box-sizing: border-box;}
.btn-primary { background: var(--imposto-green); color: white; border: none; width: 100%; padding: 14px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.btn-primary:hover { background: var(--imposto-dark); }
.btn-secondary { background: #E5E7EB; color: var(--text-main); border: none; padding: 14px; border-radius: 8px; cursor: pointer; font-weight: 600; width: 100%; }
.btn-danger { background: transparent; color: var(--accent-red); border: 1px solid var(--accent-red); padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: 0.2s; }
.btn-danger:hover { background: var(--accent-red); color: white; }

/* GRID E CARDS DE CATEGORIA */
.cards-cargos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.cargo-card { background: var(--bg-card); border: 2px solid var(--border-light); border-radius: 12px; padding: 30px 20px; text-align: center; cursor: pointer; transition: 0.2s; font-weight: 700; font-size: 1.1rem; color: var(--imposto-dark); }
.cargo-card:hover { border-color: var(--imposto-green); transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0,0,0,0.05); }

.grid-politicos-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; margin-top: 20px; }
.admin-pol-card { border: 1px solid var(--border-light); border-radius: 8px; padding: 15px; text-align: center; cursor: pointer; transition: 0.2s; background: #fff; }
.admin-pol-card:hover { border-color: var(--imposto-green); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.admin-pol-card img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }
.card-add-novo { border: 2px dashed var(--imposto-green); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--imposto-green); font-weight: 700; background: #f0fdf4; }

/* MODAIS GERAIS */
.admin-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 9999; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; backdrop-filter: blur(5px);}
.admin-modal-box { background: #fff; width: 100%; max-width: 900px; max-height: 90vh; border-radius: 12px; overflow-y: auto; padding: 30px; position: relative; animation: fadeIn 0.3s ease; }
.close-admin-modal { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; background: rgba(255,255,255,0.1); border: none; cursor: pointer; color: #fff; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.close-admin-modal:hover { background: var(--accent-red); }
.custom-file-upload { display: flex; align-items: center; justify-content: center; padding: 15px; cursor: pointer; background: #f8fafc; border: 2px dashed var(--imposto-green); border-radius: 8px; color: var(--imposto-dark); font-weight: 600; width: 100%; box-sizing: border-box;}
.custom-file-upload.selected { background: #ecfdf5; border-style: solid; }

/* =========================================================
   DARK PANEL DO PARLAMENTAR (IGUAL AO FRONT-END)
   ========================================================= */
.dark-panel { background: #111827 !important; color: #F3F4F6 !important; border: 1px solid #374151; padding: 0 !important; overflow-x: hidden; }
.dark-panel .profile-header { display: flex; align-items: center; gap: 20px; padding: 30px; border-bottom: 1px solid #1F2937; flex-wrap: wrap; background: #0B0F19; }
.photo-wrapper { position: relative; cursor: pointer; border-radius: 50%; width: 100px; height: 100px; border: 3px solid #00E5FF; overflow: hidden; }
.photo-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.edit-photo-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.6); color: white; text-align: center; font-size: 0.8rem; padding: 5px 0; font-weight: bold; opacity: 0; transition: 0.2s; }
.photo-wrapper:hover .edit-photo-overlay { opacity: 1; }
.dark-panel .profile-info h2 { margin: 0 0 5px 0; display: flex; align-items: center; gap: 10px; font-size: 1.6rem; }
.edit-btn { background: rgba(255,255,255,0.1); border: none; border-radius: 4px; padding: 4px; cursor: pointer; font-size: 0.8rem; transition: 0.2s; color: #fff; }
.edit-btn:hover { background: #00E5FF; color: #000; }
.dark-panel .badge-partido { background: #004d3b; color: white; padding: 4px 10px; border-radius: 15px; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 8px; }
.dark-panel .total-acumulado { margin-left: auto; text-align: right; margin-right: 30px; }
.dark-panel .total-acumulado p { margin: 0; color: #9CA3AF; }
.dark-panel .total-acumulado .val { font-size: 1.8rem; font-weight: 700; color: #D32F2F; }

.dark-panel .modal-grid-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; padding: 30px; }
.dark-panel .modal-section-card { border: 1px solid #1F2937; border-radius: 8px; padding: 20px; background: #111827; }
.dark-panel .modal-section-title { color: #00E5FF; border-bottom: 1px dashed #374151; padding-bottom: 10px; margin-top: 0; margin-bottom: 15px; font-size: 1.1rem; }

/* Tabela Dark */
.dark-panel .filter-select { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #00E5FF; border-radius: 5px; background: transparent; color: #fff; font-size: 0.95rem; }
.dark-panel .filter-select option { background: #111827; color: #fff; }
.dark-panel .tabela-container { border: 1px solid #1F2937; border-radius: 6px; overflow: hidden; }
.dark-panel .tabela-header-total { padding: 12px 15px; background: rgba(0, 229, 255, 0.05); border-bottom: 1px solid #1F2937; font-size: 1.05rem; }
.dark-panel .table-responsive-wrapper { max-height: 300px; overflow-y: auto; }
.dark-panel .table-despesas { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.dark-panel .table-despesas th { background: #004d3b; color: white; padding: 12px; text-align: left; position: sticky; top: 0; white-space: nowrap;}
.dark-panel .table-despesas td { padding: 12px; border-bottom: 1px solid #1F2937; }

/* Badges e Ações na Tabela */
.badge-api { background: #374151; color: #D1D5DB; padding: 3px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; }
.badge-manual { background: #065F46; color: #A7F3D0; padding: 3px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; }
.action-icons { display: flex; gap: 5px; margin-top: 5px; }
.action-icons button { background: none; border: none; cursor: pointer; padding: 2px; font-size: 1rem; opacity: 0.7; transition: 0.2s;}
.action-icons button:hover { opacity: 1; transform: scale(1.1); }

/* Linhas e Cards de Adição */
.add-row-btn { text-align: center; font-weight: bold; color: #00E5FF !important; cursor: pointer; transition: 0.2s; background: rgba(0,229,255,0.05); }
.add-row-btn:hover { background: rgba(0,229,255,0.15); }

.list-propostas { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow-y: auto; }
.list-propostas li { padding: 12px; border-bottom: 1px solid #1F2937; }
.list-propostas strong { color: #00E5FF; display: block; margin-bottom: 5px; }
.list-propostas p { font-size: 0.85rem; color: #9CA3AF; margin: 0 0 8px 0; }
.add-card-btn { display: block; width: 100%; padding: 15px; border: 2px dashed #00E5FF; background: transparent; color: #00E5FF; font-weight: bold; font-size: 1rem; border-radius: 8px; cursor: pointer; margin-top: 10px; transition: 0.2s; }
.add-card-btn:hover { background: rgba(0,229,255,0.1); }

/* Footer de exclusão */
.dark-panel .admin-footer-actions { padding: 20px 30px; background: #0B0F19; border-top: 1px solid #1F2937; text-align: right; }