:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; transition: all 0.2s ease; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg); color: var(--text-main); line-height: 1.6; }

/* Navbar */
.navbar { background: var(--card-bg); padding: 1.2rem 10%; display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); }
.nav-right { display: flex; gap: 20px; align-items: center; }
.user-badge { font-size: 0.8rem; font-weight: 600; color: var(--success); background: rgba(16, 185, 129, 0.1); padding: 4px 12px; border-radius: 20px; }
.theme-btn { background: var(--bg); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; cursor: pointer; color: var(--text-main); }

/* Layout */
.main-wrapper { max-width: 1100px; margin: 60px auto; padding: 0 25px; }
.hero { text-align: center; margin-bottom: 50px; }
.hero h1 { font-size: 2.8rem; font-weight: 800; letter-spacing: -1px; }

.grid-container { display: grid; grid-template-columns: 1fr 320px; gap: 40px; }
.calculator-card { background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }

/* Inputs */
.input-group { margin-bottom: 25px; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.custom-select, .input-with-icon { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text-main); font-size: 1rem; }
.input-with-icon { display: flex; align-items: center; padding: 0 16px; }
.input-with-icon input { border: none; background: transparent; color: var(--text-main); width: 100%; padding: 14px 10px; font-size: 1.1rem; outline: none; }

button#btn-calc { width: 100%; padding: 18px; background: var(--primary); color: white; border: none; border-radius: 14px; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; }

/* REPORTE Y RESULTADOS */
.result-box { margin-top: 40px; padding: 30px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); }
.report-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px solid var(--border); }
.report-title h3 { font-size: 0.8rem; letter-spacing: 1px; color: var(--text-muted); }
#report-folio { font-family: monospace; font-size: 0.85rem; color: var(--primary); font-weight: bold; }

.result-content { display: flex; gap: 30px; align-items: center; margin-bottom: 30px; flex-wrap: wrap; }
.stats { flex: 1; min-width: 250px; }
.chart-container { width: 180px; }

/* Barras de Progreso */
.result-item-pro { margin-bottom: 15px; }
.item-info { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.9rem; font-weight: 600; }
.progress-bar { height: 6px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; transition: width 1.2s ease-out; }
.progress-fill.primary { background: var(--primary); }
.progress-fill.success { background: var(--success); }

/* Card de Total */
.total-pro-card { background: var(--primary); padding: 25px; border-radius: 16px; color: white; text-align: center; margin-top: 25px; }
.total-label { display: block; font-size: 0.7rem; font-weight: 700; opacity: 0.8; }
.total-val { font-size: 2rem; font-weight: 800; }

/* Tabla */
.breakdown-table { margin-top: 30px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--card-bg); }
th { background: var(--bg); padding: 12px; text-align: left; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); }
td { padding: 12px; border-top: 1px solid var(--border); font-size: 0.9rem; }

/* Sidebar & FAQ */
.ad-placeholder-sidebar { height: 250px; background: var(--card-bg); border: 2px dashed var(--border); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); margin-bottom: 20px; }
details { background: var(--card-bg); padding: 15px; border-radius: 12px; margin-bottom: 10px; border: 1px solid var(--border); cursor: pointer; }

/* Loader & Skeleton */
.loader-spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-line { height: 15px; background: var(--border); margin: 10px 0; border-radius: 4px; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

@media (max-width: 900px) { .grid-container { grid-template-columns: 1fr; } .hero h1 { font-size: 2rem; } }