/* SISTEMA DE DISEÑO DE FINANZAS FAMILIA VITA */

:root {
    /* Paleta de Colores HSL Tailored */
    --bg-main: #09080e;
    --bg-sidebar: #0f0d1a;
    --bg-card: rgba(22, 19, 38, 0.7);
    --bg-card-hover: rgba(30, 26, 51, 0.85);
    --border-color: rgba(139, 92, 246, 0.15);
    --border-color-focus: rgba(139, 92, 246, 0.5);
    
    --primary: #8b5cf6;       /* Violeta Eléctrico (Acento Familiar) */
    --primary-glow: rgba(139, 92, 246, 0.3);
    
    --success: #10b981;       /* Esmeralda brillante (Ingresos / Ahorro) */
    --success-glow: rgba(16, 185, 129, 0.25);
    
    --danger: #ef4444;        /* Coral / Rojo vibrante (Gastos/Alertas) */
    --danger-glow: rgba(239, 68, 68, 0.25);
    
    --warning: #f97316;       /* Naranja vibrante (Gastos Circunstanciales) */
    --warning-glow: rgba(249, 115, 22, 0.25);

    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    
    /* Fuentes */
    --font-header: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transiciones y Sombras */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* 1. RESET Y ESTILOS BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-header);
    font-weight: 700;
    letter-spacing: -0.02em;
}

code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary);
}

/* Utilidades */
.hidden {
    display: none !important;
}

.w-100 {
    width: 100% !important;
}

.badge {
    background: var(--primary-glow);
    color: var(--text-primary);
    border: 1px solid var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

/* 2. TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 350px;
    width: 100%;
}

.toast {
    background: rgba(15, 13, 26, 0.95);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    backdrop-filter: blur(10px);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 3. PANTALLA DE AUTENTICACIÓN (LOGIN) */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 10% 20%, rgba(22, 19, 38, 0.8) 0%, var(--bg-main) 90.1%);
}

.auth-card-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    max-width: 960px;
    width: 100%;
    min-height: 560px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.auth-image-side {
    background-size: cover;
    background-position: center;
    padding: 40px;
    display: flex;
    align-items: flex-end;
    position: relative;
}

.auth-family-message {
    z-index: 2;
}

.auth-family-message .badge {
    margin-bottom: 16px;
}

.auth-family-message h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.auth-family-message p {
    color: #d1d5db;
    font-size: 0.95rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

.auth-form-side {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-header {
    margin-bottom: 32px;
}

.logo-circle {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    box-shadow: var(--shadow-glow);
}

.auth-form-header h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.auth-form-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grupos de Input */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group input, 
.input-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
}

.input-group input:focus, 
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(255, 255, 255, 0.08);
}

.input-group select option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}


/* Botones Premium */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #fca5a5;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.demo-trigger-wrapper {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.demo-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* 4. ESQUEMA DE PANTALLA PRINCIPAL (DASHBOARD) */
.app-screen {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar de Navegación */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.family-avatar-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 16px;
}

.family-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-glow);
}

.status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--bg-sidebar);
}

.status-dot.online { background-color: var(--success); box-shadow: 0 0 10px var(--success); }
.status-dot.demo { background-color: var(--warning); box-shadow: 0 0 10px var(--warning); }

.sidebar-title h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.user-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.bubble-ariel { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid #3b82f6; }
.bubble-sara { background: rgba(236, 72, 153, 0.2); color: #fbcfe8; border: 1px solid #ec4899; }
.bubble-violeta { background: rgba(139, 92, 246, 0.2); color: #ddd6fe; border: 1px solid #8b5cf6; }

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: var(--font-header);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    text-align: left;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: white;
    background: var(--primary-glow);
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-header);
    font-size: 0.9rem;
    width: 100%;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* Contenido Principal */
.main-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
    max-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 24px;
}

.header-welcome h1 {
    font-size: 2.25rem;
    margin-bottom: 4px;
}

.header-welcome p {
    color: var(--text-muted);
}

/* Selector Rápido de Miembros */
.member-selector {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.selector-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.member-buttons {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.member-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.member-btn:hover {
    color: var(--text-primary);
}

.member-btn.active {
    color: white;
}

#user-ariel.member-btn.active { background: #3b82f6; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }
#user-sara.member-btn.active { background: #ec4899; box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4); }
#user-violeta.member-btn.active { background: #8b5cf6; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4); }

/* 5. DISEÑO DE MÓDULOS DEL DASHBOARD */
.tab-content-container {
    flex-grow: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tarjetas de Métricas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

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

.metric-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-info h2 {
    font-size: 1.6rem;
    margin-top: 4px;
}

/* Clases específicas de métricas */
.metric-card.balance .metric-icon { background: rgba(139, 92, 246, 0.15); color: var(--primary); }
.metric-card.income .metric-icon { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.metric-card.income h2 { color: var(--success); }
.metric-card.fixed-expense .metric-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.metric-card.circumstantial-expense .metric-icon { background: rgba(249, 115, 22, 0.15); color: var(--warning); }
.metric-card.circumstantial-expense h2 { color: var(--warning); }

/* Fila de análisis y gráficos */
.dashboard-analysis-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-soft);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tarjeta Presupuesto */
.budget-gauge-wrapper {
    margin-bottom: 16px;
}

.gauge-bar-outer {
    width: 100%;
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.gauge-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 70%, var(--warning) 100%);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.budget-limits {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.budget-alert {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid var(--warning);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #fed7aa;
}

.budget-alert i {
    font-size: 1.4rem;
    color: var(--warning);
}

.budget-alert h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.budget-alert p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tarjeta Gráficos */
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: center;
    min-height: 150px;
}

.custom-progress-ring {
    height: 20px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    overflow: hidden;
}

.ring-segment {
    height: 100%;
    transition: width 0.8s ease;
}

.ring-segment.fixed { background-color: #3b82f6; }
.ring-segment.circumstantial { background-color: var(--warning); }

.chart-legends {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.fixed { background-color: #3b82f6; }
.legend-dot.circumstantial { background-color: var(--warning); }

.legend-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-item strong {
    font-size: 1.1rem;
    font-family: var(--font-header);
}

/* Actividad Reciente */
.btn-text-action {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font-header);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-text-action:hover {
    color: white;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.activity-user-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.activity-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.activity-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.activity-badge.fixed { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.activity-badge.circumstantial { background: rgba(249, 115, 22, 0.15); color: #fed7aa; }
.activity-badge.ingreso { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; }

.activity-value {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.1rem;
}

.activity-value.expense { color: var(--text-primary); }
.activity-value.income { color: var(--success); }

/* 6. DISEÑO DE FORMULARIO DE INGRESO */
.form-card {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.form-row-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.switch-btn {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.switch-btn.expense.active {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: var(--danger);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.switch-btn.income.active {
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    border-color: var(--success);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.form-grid .full-width {
    grid-column: span 2;
}

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.currency-symbol {
    position: absolute;
    left: 16px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
}

.amount-input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 40px !important;
    font-size: 1.6rem !important;
    font-weight: 700;
    color: var(--success) !important;
    font-family: var(--font-header);
}

.custom-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px !important;
}

.btn-large {
    padding: 18px 24px;
    font-size: 1.1rem;
}

/* 7. DISEÑO DE PESTAÑA HISTORIAL Y TABLA */
.history-card {
    width: 100%;
}

.flex-column-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.filters-container {
    display: flex;
    gap: 12px;
}

.filter-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-header);
    font-size: 0.85rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th, 
.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    font-family: var(--font-header);
    font-weight: 600;
    color: var(--text-muted);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.btn-delete-row {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-delete-row:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* 8. PESTAÑA DE AJUSTES */
.settings-card {
    margin-bottom: 24px;
}

.settings-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.description-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.guide-box {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.guide-box h4 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: #c084fc;
}

.guide-box ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: #e9d5ff;
}

.guide-box a {
    color: #c084fc;
    text-decoration: underline;
}

.actions-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Banner Familiar Inspiracional en Dashboard */
.family-hero-banner {
    width: 100%;
    height: 180px;
    border-radius: 20px;
    background-image: linear-gradient(rgba(13, 11, 20, 0.25), rgba(13, 11, 20, 0.85)), url('family.jpg');
    background-size: cover;
    background-position: center 30%;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    margin-bottom: 12px;
    overflow: hidden;
}

.banner-content {
    z-index: 2;
}

.banner-content h2 {
    font-size: 1.60rem;
    margin-top: 8px;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.banner-content p {
    color: #e5e7eb;
    font-size: 0.90rem;
    font-style: italic;
    text-shadow: 0 1px 5px rgba(0,0,0,0.7);
}

/* BARRA DE NAVEGACIÓN MÓVIL (Por defecto oculta en escritorio) */
.mobile-nav {
    display: none;
}

/* RESPONSIVE DESIGN (MOBILE ADAPTABILITY) */
@media (max-width: 900px) {
    /* Login adaptado para celulares: Apilar foto arriba y formulario abajo con nitidez */
    .auth-screen {
        background: radial-gradient(circle at 10% 20%, rgba(22, 19, 38, 0.85) 0%, var(--bg-main) 95%);
    }

    .auth-card-wrapper {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
        max-width: 420px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        min-height: auto;
    }
    
    .auth-image-side {
        display: flex !important;
        height: 190px;
        padding: 24px;
        align-items: flex-end;
        border-bottom: 1px solid rgba(139, 92, 246, 0.15);
        background-position: center 30%;
    }

    .auth-family-message h1 {
        font-size: 1.25rem !important;
        margin-bottom: 4px;
    }

    .auth-family-message p {
        font-size: 0.72rem !important;
    }

    .auth-form-side {
        padding: 32px 24px;
    }
    
    .app-screen {
        grid-template-columns: 1fr;
        padding-bottom: 74px; /* Espacio para el menú móvil inferior */
    }

    /* Ajustar tamaño del banner familiar en móviles */
    .family-hero-banner {
        height: 140px !important;
        padding: 16px !important;
        margin-bottom: 12px !important;
        background-position: center 25% !important;
    }

    .family-hero-banner h2 {
        font-size: 1.3rem !important;
    }

    .family-hero-banner p {
        font-size: 0.78rem !important;
    }
    
    .sidebar {
        display: none; /* Se oculta sidebar clásico */
    }
    
    /* Mostrar barra de navegación inferior en móviles */
    .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(15, 13, 26, 0.96);
        border-top: 1px solid rgba(139, 92, 246, 0.2);
        backdrop-filter: blur(16px);
        z-index: 1000;
        padding: 0 8px;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
    }

    .mobile-nav-item {
        background: transparent;
        border: none;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-family: var(--font-header);
        font-size: 0.65rem;
        font-weight: 500;
        cursor: pointer;
        flex-grow: 1;
        transition: var(--transition);
        padding: 6px 0;
    }

    .mobile-nav-item i {
        font-size: 1.3rem;
    }

    .mobile-nav-item.active {
        color: var(--primary);
        font-weight: 700;
        transform: translateY(-2px);
    }
    
    .main-content {
        padding: 20px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .member-selector {
        align-items: flex-start;
        width: 100%;
    }
    
    .member-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .member-btn {
        justify-content: center;
    }
    
    .dashboard-analysis-row {
        grid-template-columns: 1fr;
    }
    
    .flex-column-mobile {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters-container {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid .full-width {
        grid-column: span 1;
    }

    /* Reducir y limpiar textos descriptivos de cabeceras en móviles */
    .card-header p,
    .header-welcome p,
    .content-header p,
    .description-text {
        font-size: 0.78rem !important;
        line-height: 1.45 !important;
        margin-top: 4px !important;
        color: var(--text-muted) !important;
        font-weight: 400 !important;
    }
    
    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        margin-bottom: 18px !important;
    }

    .card-header h3 {
        font-size: 1.15rem !important;
        margin: 0 !important;
    }

    .header-welcome h1 {
        font-size: 1.8rem !important;
    }
}
