/* 
 * PROJECT AURORA - SISTEMA DE DISEÑO VANGUARDISTA
 * -----------------------------------------------
 * Estética: Cyber-Tech / Space HUD
 * Colores: Profundos, neón, vibrantes y tecnológicos.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Space+Grotesk:wght@300;500;700&display=swap');

:root {
    /* Paleta Aurora Cyber-Tech */
    --bg-dark: #0a0a15;
    --bg-surface: #121225;
    
    --primary-color: #753572;
    --primary-light: #bd4f9a;
    --accent-pink: #ff007f;
    --accent-cyan: #00f2ff;
    
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    
    --success-color: #00ffaa;
    --danger-color: #ff3e3e;
    --warning-color: #ffaa00;

    /* Glassmorphism Alta Fidelidad */
    --glass-bg: rgba(18, 18, 35, 0.75);
    --glass-border: rgba(117, 53, 114, 0.35);
    --glass-glow: 0 0 20px rgba(117, 53, 114, 0.15);
    
    --font-main: 'Outfit', sans-serif;
    --font-tech: 'Space Grotesk', sans-serif;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(117, 53, 114, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(0, 242, 255, 0.05) 0%, transparent 40%);
}

.main-header {
    background: rgba(10, 10, 21, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand h1 {
    font-family: var(--font-tech);
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--primary-light), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 0, 127, 0.3));
}

/* --- BENTO GRID LAYOUT --- */
.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(160px, auto);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.bento-big { grid-column: span 2; grid-row: span 2; }
.bento-mid { grid-column: span 2; }
.bento-small { grid-column: span 1; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s;
    box-shadow: var(--glass-glow);
}

.glass-panel:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

/* Decoración Tech en esquinas */
.glass-panel::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(225deg, var(--primary-light) 0%, transparent 50%);
    opacity: 0.1;
}

/* --- COMPONENTES ESPECÍFICOS --- */
.summary-visual-grid {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.balance-cards-mini {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.b-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.b-card span { font-size: 0.75rem; color: var(--text-muted); }
.b-card h4 { font-family: var(--font-tech); font-size: 1rem; }

.category-chart-wrapper {
    width: 180px;
    height: 180px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.net-balance-dashboard {
    text-align: center;
    padding: 1.2rem;
    background: rgba(117, 53, 114, 0.08);
    border-radius: 16px;
    border: 1px dashed var(--glass-border);
}

.net-balance-dashboard span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.net-balance-dashboard .val {
    font-size: 2rem;
    font-family: var(--font-tech);
    margin-top: 0.5rem;
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.indicator-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.indicator-card:first-child { grid-column: span 2; }
.indicator-card .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.4rem; }
.indicator-card .val { font-family: var(--font-tech); font-size: 1.6rem; color: var(--accent-cyan); text-shadow: 0 0 12px rgba(0, 242, 255, 0.4); }

/* Afinidad Diaria (Salud Financiera) Centrada */
.daily-allowance-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 160px;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent);
}

#daily-allowance {
    font-family: var(--font-tech);
    font-size: 2.2rem;
    margin: 0.5rem 0;
    color: var(--success-color);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Pensión Card */
.pension-card {
    background: linear-gradient(145deg, rgba(117, 53, 114, 0.2), rgba(18, 18, 37, 0.8));
    border-left: 4px solid var(--accent-pink);
}

.pension-card h4 {
    font-family: var(--font-tech);
    font-size: 2rem;
    color: var(--accent-pink);
    text-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
}

.pension-status {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: bold;
}
.pension-status.unpaid { background: rgba(255, 62, 62, 0.2); color: var(--danger-color); }
.pension-status.paid { background: rgba(0, 255, 170, 0.2); color: var(--success-color); }

/* --- USD & DAILY ALLOWANCE --- */
#usd-subscriptions-list div {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.daily-allowance-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 140px;
}

#daily-allowance {
    font-family: var(--font-tech);
    font-size: 1.8rem;
    margin: 0.4rem 0;
}

/* --- MODALES AURORA --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(117, 53, 114, 0.2);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3, .modal-header h2 {
    font-family: var(--font-tech);
    color: var(--accent-pink);
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

/* --- BOTONES Y CONTROLES ADICIONALES --- */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-tech);
    font-weight: 600;
    text-transform: uppercase;
    transition: 0.3s;
    font-size: 0.75rem;
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-danger {
    background: rgba(255, 62, 62, 0.15);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

/* Form Styles */
.add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

input, select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    color: white;
    font-size: 0.85rem;
    outline: none;
}

input:focus, select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

/* --- BOTONES Y TABS --- */
.btn-aurora {
    width: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    border: none;
    color: white;
    padding: 0.7rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.btn-aurora:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(117, 53, 114, 0.4);
}

.tab-btn {
    font-family: var(--font-tech);
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active { color: var(--accent-cyan); position: relative; }
.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 20%;
    width: 60%;
    height: 3px;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* Scanline animation */
.tech-scan {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 242, 255, 0.05) 50%, transparent 100%);
    animation: scan 4s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* --- TABLAS --- */
.hud-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.hud-table th { font-family: var(--font-tech); color: var(--primary-light); text-transform: uppercase; font-size: 0.7rem; padding: 0.5rem 1rem; text-align: left; }
.hud-table tr { background: rgba(255, 255, 255, 0.02); transition: 0.2s; }
.hud-table tr:hover { background: rgba(255, 255, 255, 0.05); }
.hud-table td { padding: 1rem; font-size: 0.9rem; }
.hud-table tr td:first-child { border-radius: 12px 0 0 12px; }
.hud-table tr td:last-child { border-radius: 0 12px 12px 0; }

/* Responsive */
@media (max-width: 1000px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .bento-big, .bento-mid, .bento-small { grid-column: span 1; }
    .summary-visual-grid { grid-template-columns: 1fr; }
    .category-chart-wrapper { width: 100%; height: 200px; }
}