﻿:root {
    /* Color Palette - Vórtice Musical "Noche Suave" */
    --primary-color: #C9A05D; /* Matte Velvet Gold */
    --primary-dark: #A67C3D;
    --accent-color: #C9A05D;
    --success-color: #5DA67C; /* Muted emerald */
    --danger-color: #CD5C5C; /* Terracotta danger */

    /* Light Theme (Sophisticated Soft) */
    --text-primary: #E8E0D4; /* Warm parchment */
    --text-secondary: #8A92A1; /* Cloud gray */
    --bg-body: #121826; /* Deep navy blue */
    --bg-card: #1F293A; /* Blue-gray panels */
    --bg-sidebar: #0D1220; /* Deepest navy */
    --border-color: rgba(201, 160, 93, 0.12); /* Subtle gold border */
    --input-bg: #1A2332; /* Soft input wells */
    --glass-bg: rgba(31, 41, 58, 0.85);
    --glass-border: rgba(201, 160, 93, 0.15);

    /* Spacing / Density */
    --padding-card: 1.5rem;
    --padding-item: 0.7rem 1rem;
    --gap-grid: 1.5rem;
    --font-base: 1rem;
    --font-h1: 1.8rem;
    --font-h2: 1.5rem;
    --font-h3: 1.2rem;
    --sidebar-width: 280px;

    /* Shared */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.3), 0 2px 6px -1px rgba(0, 0, 0, 0.15);
    --transition: 0.2s ease-in-out;
    --border-radius: 12px;
}

/* Dark Theme (Noche Suave - Primary Identity) */
body.theme-dark {
    color-scheme: dark;
    --text-primary: #E8E0D4; /* Warm parchment */
    --text-secondary: #8A92A1; /* Cloud gray */
    --bg-body: #121826; /* Deep navy — NO pure black */
    --bg-card: #1F293A; /* Blue-gray panels */
    --bg-sidebar: #0D1220; /* Deepest navy */
    --border-color: rgba(201, 160, 93, 0.12);
    --input-bg: #1A2332;
    --glass-bg: rgba(31, 41, 58, 0.85);
    --glass-border: rgba(201, 160, 93, 0.15);

    /* Noche Suave Palette */
    --primary-color: #C9A05D;
    --primary-dark: #A67C3D;
    --accent-color: #C9A05D;
    --success-color: #5DA67C;
    --danger-color: #CD5C5C;
}

/* Component overrides for Dark Mode - Softening Everything (INTERFACE CONFIG) */
body.theme-dark .kpi-icon.income {
    background: rgba(93, 166, 124, 0.12);
    color: #5DA67C;
}

body.theme-dark .kpi-icon.expense {
    background: rgba(205, 92, 92, 0.12);
    color: #CD5C5C;
}

body.theme-dark .kpi-icon.balance {
    background: rgba(201, 160, 93, 0.12);
    color: var(--primary-color);
}

body.theme-dark .nav-item.active {
    background: rgba(201, 160, 93, 0.12);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
}

body.theme-dark .badge.completed {
    background: rgba(93, 166, 124, 0.15) !important;
    color: #5DA67C !important;
}

body.theme-dark .badge.planned {
    background: rgba(201, 160, 93, 0.15) !important;
    color: var(--primary-color) !important;
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3 {
    color: var(--primary-color) !important;
}

body.theme-dark .btn-primary {
    background: var(--primary-color) !important;
    color: #000 !important;
    font-weight: 700;
}

body.theme-dark #cloud-status-badge {
    background: rgba(201, 160, 93, 0.06) !important;
    border-color: rgba(201, 160, 93, 0.15) !important;
}

body.theme-dark #cloud-icon {
    color: var(--primary-color) !important;
    opacity: 0.8;
}

/* Density: Compact - CLONED FROM Vórtice Musical */
body.density-compact {
    --padding-card: 1rem;
    --padding-item: 0.5rem 0.8rem;
    --gap-grid: 1rem;
    --font-base: 0.9rem;
    --font-h1: 1.5rem;
    --font-h2: 1.3rem;
    --font-h3: 1.1rem;
    --border-radius: 8px;
}

body.density-compact .nav-item {
    padding-top: 4px;
    padding-bottom: 4px;
    margin-bottom: 2px;
}

body.density-compact .brand {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

/* Density: Comfortable (Default) - CLONED FROM Vórtice Musical */
body.density-comfortable {
    --padding-card: 1.5rem;
    --padding-item: 0.8rem 1rem;
    --gap-grid: 1.5rem;
}

/* Density: Elegant - CLONED FROM Vórtice Musical */
body.density-elegant {
    --padding-card: 2.5rem;
    --padding-item: 1.2rem 1.5rem;
    --gap-grid: 2.5rem;
    --font-base: 1.1rem;
    --font-h1: 2.5rem;
    --font-h2: 2rem;
    --font-h3: 1.5rem;
    --border-radius: 30px;
}

/* Global resets (INTERFACE CONFIG) */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar structure - CLONED FROM Vórtice Musical */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0.8rem;
    transition: var(--transition), width 0.3s;
    z-index: 10;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-resizer {
    width: 6px;
    height: 100vh;
    cursor: ew-resize;
    flex-shrink: 0;
    transition: background 0.3s;
    background: transparent;
    z-index: 100;
}

.sidebar-resizer:hover, .sidebar-resizer.resizing {
    background: var(--primary-color);
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.main-logo-img {
    height: auto;
    max-height: 40px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.nav-links { list-style: none; flex-grow: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: var(--padding-item);
    margin-bottom: 0.4rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.03); color: #fff; }

.nav-item.active {
    background: rgba(212, 175, 55, 0.1) !important;
    color: var(--primary-color) !important;
    border-left: 4px solid var(--primary-color) !important;
    border-radius: 0 8px 8px 0;
}

.nav-item i { width: 24px; text-align: center; font-size: 20px; }

/* Submenu structure - CLONED FROM Vórtice Musical */
.submenu {
    list-style: none;
    padding-left: 1.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu.open { max-height: 500px; opacity: 1; margin-bottom: 0.5rem; }

.submenu li {
    padding: 10px 12px;
    margin: 4px 0;
    color: #9ca3af;
    cursor: pointer;
    font-size: 13px;
    border-radius: 6px;
    border-left: 4px solid transparent;
}

.submenu li:hover { background: rgba(255, 255, 255, 0.03); color: #fff; }

.submenu li.active {
    background: rgba(212, 175, 55, 0.08) !important;
    color: var(--primary-color) !important;
    border-left: 4px solid var(--primary-color) !important;
}

.main-content {
    flex-grow: 1;
    padding: var(--padding-card);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-body);
    transition: var(--transition);
}

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }

.page-title h1 { font-size: var(--font-h1); font-weight: 700; color: var(--primary-color); }

/* Dashboard Grid cloned precisely */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-grid);
    margin-bottom: 2rem;
}

@media (max-width: 1024px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--padding-card);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.kpi-card:hover { transform: translateY(-2px); border-color: var(--primary-color); }

.kpi-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* Table cloned precisely */
.table-container { width: 100%; overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--border-radius); }
table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
th { background: #000; color: var(--primary-color); padding: var(--padding-item); border-bottom: 2px solid var(--border-color); text-transform: uppercase; font-size: 0.75rem; }
td { padding: var(--padding-item); border-bottom: 1px solid var(--border-color); }

/* Lock Screen structure cloned precisely */
.lock-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}

.lock-content {
    background: #0a0a0a; padding: 3rem; border-radius: 20px;
    border: 1px solid var(--primary-color); width: 350px; text-align: center;
}

.lock-logo { 
    height: auto; 
    max-height: 80px; 
    width: auto; 
    max-width: 250px; 
    margin-bottom: 2rem; 
    object-fit: contain;
}

.pin-inputs-container { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.pin-box {
    width: 45px; height: 55px; font-size: 1.5rem; text-align: center;
    border: 2px solid var(--border-color); border-radius: 8px; background: #111; color: var(--primary-color);
}

/* Modal cloned precisely */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-content { background: var(--bg-card); border: 1px solid var(--primary-color); padding: var(--padding-card); border-radius: var(--border-radius); }

/* Cloud status badge precisely */
.cloud-status-badge {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; color: #a0a0a0;
    background: rgba(212, 175, 55, 0.05); padding: 0.35rem 0.8rem; border-radius: 50px; border: 1px solid var(--border-color); width: fit-content;
}

/* FAB precisely */
.fab-container { position: fixed; bottom: 30px; right: 25px; z-index: 990; }
.fab-btn { width: 65px; height: 65px; border-radius: 50%; background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%); color: #000; border: none; font-size: 1.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }

/* Transitions and animations precisely */
.animate-up { animation: animateUp 0.4s ease-out; }
@keyframes animateUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Mobile Overlay precisely */
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 999; backdrop-filter: blur(4px); }
.sidebar.open + .sidebar-overlay { display: block; }

/* Dashboard Card Specifics precisely */
.glass-panel { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: var(--padding-card); }

/* ==== UTILITY CLASSES ==== */
.hidden { display: none !important; }

/* PWA Banner - constrain icon size */
.pwa-app-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}
