:root { --bg-dark: #0f172a; --bg-light: #f8fafc; --sidebar-bg: #1e293b; --primary: #3b82f6; --text-main: #334155; --border: #e2e8f0; --success: #10b981; --danger: #ef4444; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-light); color: var(--text-main); height: 100vh; overflow: hidden; }

/* LOGIN STYLES */
.login-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #e2e8f0; display: flex; justify-content: center; align-items: center; z-index: 9999; }
.login-box { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 350px; text-align: center; }
.input-group { text-align: left; margin-bottom: 15px; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; }
.input-group input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; }
.full-width { width: 100%; margin-top: 10px; }
.error-msg { color: var(--danger); font-size: 0.8rem; margin-bottom: 10px; }
.blur-bg { filter: blur(5px); pointer-events: none; } /* Efecto cuando no hay login */

/* DASHBOARD LAYOUT */
.dashboard-wrapper { display: flex; height: 100%; transition: 0.3s; }
.sidebar { width: 260px; background-color: var(--sidebar-bg); color: white; padding: 20px; display: flex; flex-direction: column; }
.logo-area { font-size: 1.4rem; font-weight: 700; margin-bottom: 40px; color: white; }
.highlight { color: var(--primary); }
.nav-links { list-style: none; }
.nav-links a { text-decoration: none; color: #94a3b8; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; transition: 0.2s; cursor: pointer; }
.nav-links li.active a { background-color: rgba(255,255,255,0.1); color: white; }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.top-bar { background: white; padding: 15px 30px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; height: 70px; }
.btn-primary { background-color: var(--primary); color: white; padding: 10px 20px; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; }
.btn-secondary { background-color: white; border: 1px solid var(--border); color: var(--text-main); padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.btn-sm { font-size: 0.8rem; }

/* MODAL STYLES */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; justify-content: center; align-items: center; }
.modal-content { background: white; width: 500px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); overflow: hidden; }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg-light); }
.modal-body { padding: 20px; }
.modal-footer { padding: 20px; background: var(--bg-light); text-align: right; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; resize: vertical; }
.row { display: flex; gap: 15px; }
.col { flex: 1; }

.hidden { display: none !important; }
.dashboard-grid { padding: 30px; overflow-y: auto; height: calc(100vh - 70px); }

/* TABLAS Y KPIs */
.kpi-section { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.kpi-card { background: white; padding: 20px; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.highlight-card { border-left: 4px solid var(--primary); background: #eff6ff; }
.kpi-value { font-size: 1.8rem; font-weight: 700; margin: 10px 0; }
.positive { color: var(--text-main); }
.negative { color: var(--text-main); }
.charts-section { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 30px; }
.chart-container { background: white; padding: 20px; border-radius: 10px; border: 1px solid var(--border); height: 350px; }
.financial-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.financial-table th { background: #f1f5f9; padding: 12px; text-align: left; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.financial-table td { padding: 12px; border-bottom: 1px solid var(--border); cursor: pointer; transition: 0.2s; }
.financial-table tr:hover td { background-color: #e0f2fe; } /* Hover effect */
.text-right { text-align: right; } .text-center { text-align: center; }
.edit-icon { color: var(--primary); }

/* UPLOAD OVERLAY */
.upload-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); z-index: 10; display: flex; justify-content: center; align-items: center; }
.upload-box { text-align: center; }
.spinner { border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }