/* ============================================
   DietLoop - Estilos principales
   ============================================ */

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #10B981;
    --secondary-light: #34D399;
    --accent: #F59E0B;
    --danger: #EF4444;
    --success: #22C55E;
    
    --bg-dark: #0F172A;
    --bg-card: #1E293B;
    --bg-hover: #334155;
    --bg-input: #374151;
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ocultar por completo las apps cuando no están activas (evita que flex/grid anule [hidden]) */
[hidden] {
    display: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Página inicial: solo selector de perfiles, sin scroll ni contenido residual */
body.profile-selector-active {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    width: 100%;
}
body.profile-selector-active #profile-selector-view {
    position: relative;
    z-index: 2;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
body.profile-selector-active #papa-app,
body.profile-selector-active #bechita-app {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

/* ============================================
   Layout
   ============================================ */

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    font-size: 32px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-primary);
}

.nav-icon {
    font-size: 20px;
}

/* User Stats */
.user-stats {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-card {
    background: var(--bg-hover);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    overflow-y: auto;
}

/* ============================================
   Views
   ============================================ */

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

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

.view-header h2 {
    font-size: 28px;
    font-weight: 700;
}

/* Month Selector */
.month-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius);
}

.btn-month {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-month:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

#current-month-display,
#cal-month-display,
#diet-month-display,
#ex-month-display {
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.card.full-width {
    grid-column: 1 / -1;
}

/* ============================================
   Dashboard
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Progress Card */
.progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-ring-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 24px;
}

.progress-ring-container canvas {
    width: 100%;
    height: 100%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--secondary);
    display: block;
}

.progress-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.detail:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
}

/* Chart Card */
.chart-card {
    min-height: 300px;
}

.chart-card canvas {
    max-height: 250px;
}

/* Today Card */
.today-card .today-date {
    color: var(--primary-light);
    font-size: 16px;
    margin-bottom: 16px;
}

.today-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.today-section h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.meal-item, .exercise-item {
    background: var(--bg-hover);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.meal-item .meal-type {
    font-weight: 600;
    color: var(--accent);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.meal-item .meal-content {
    color: var(--text-primary);
}

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

.exercise-icon {
    font-size: 24px;
}

.exercise-info {
    flex: 1;
}

.exercise-type {
    font-weight: 600;
}

.exercise-duration {
    font-size: 14px;
    color: var(--text-secondary);
}

.no-exercise {
    color: var(--text-muted);
    font-style: italic;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.quick-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.qs-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.qs-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ============================================
   Calendar
   ============================================ */

.calendar-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.calendar-header span {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
    min-height: 80px;
}

.calendar-day:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.calendar-day.selected {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.calendar-day.today {
    border: 2px solid var(--secondary);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
}

.day-number {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.day-indicators {
    display: flex;
    gap: 4px;
}

.day-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.day-indicator.meal {
    background: var(--accent);
}

.day-indicator.exercise {
    background: var(--secondary);
}

/* Day Detail */
.day-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.day-detail h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.day-meals, .day-exercises {
    margin-bottom: 24px;
}

.day-meals h4, .day-exercises h4 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ============================================
   Diet & Exercise Views
   ============================================ */

.diet-info, .exercise-info {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.diet-params, .exercise-params {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.param {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.param-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-light);
}

/* Week Selector */
.week-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.week-btn {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.week-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.week-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Diet Week Content */
.diet-week-content, .exercise-week-content {
    display: grid;
    gap: 16px;
}

.day-plan {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.day-plan-header {
    background: var(--primary);
    padding: 16px 24px;
    font-weight: 600;
    font-size: 18px;
}

.day-plan-content {
    padding: 24px;
}

.meal-row {
    display: grid;
    grid-template-columns: 120px 1fr 150px;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.meal-row:last-child {
    border-bottom: none;
}

.meal-name {
    font-weight: 600;
    color: var(--accent);
}

.meal-description {
    color: var(--text-primary);
}

.meal-quantity {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Exercise Plan */
.exercise-block {
    padding: 16px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.exercise-block:last-child {
    margin-bottom: 0;
}

.exercise-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.exercise-block-title {
    font-weight: 600;
    color: var(--primary-light);
}

.exercise-block-duration {
    color: var(--text-secondary);
    font-size: 14px;
}

.exercise-list {
    list-style: none;
}

.exercise-list li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.exercise-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--secondary);
}

/* ============================================
   Progress View
   ============================================ */

.progress-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.progress-charts .card.full-width {
    grid-column: 1 / -1;
}

.progress-charts canvas {
    max-height: 300px;
}

/* Weight Table */
.progress-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.progress-table h3 {
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

td {
    color: var(--text-primary);
}

tr:hover td {
    background: var(--bg-hover);
}

.diff-positive {
    color: var(--danger);
}

.diff-negative {
    color: var(--success);
}

.diff-neutral {
    color: var(--text-secondary);
}

/* Weight Input */
.weight-input-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.weight-input-section h3 {
    margin-bottom: 20px;
}

.weight-input-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* ============================================
   History View
   ============================================ */

.history-timeline {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.history-month {
    min-width: 200px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.history-month:hover {
    border-color: var(--primary);
}

.history-month.active {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.history-month.current {
    border-color: var(--secondary);
}

.history-month h4 {
    font-size: 18px;
    margin-bottom: 12px;
}

.history-month .month-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-month .month-stat {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.history-month .month-stat .label {
    color: var(--text-secondary);
}

.history-month .month-stat .value {
    font-weight: 600;
}

.history-month .month-stat .value.success {
    color: var(--success);
}

.history-month .month-stat .value.warning {
    color: var(--accent);
}

.history-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* ============================================
   Mobile Header
   ============================================ */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
}

.menu-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
}

.hamburger {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    position: relative;
    transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.menu-toggle.active .hamburger {
    background: transparent;
}

.menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-logo .logo-icon {
    font-size: 24px;
}

.mobile-logo h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-weight {
    background: var(--bg-hover);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--secondary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.close-sidebar {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.close-sidebar:hover {
    color: var(--text-primary);
}

/* ============================================
   Responsive - Tablet (768px - 992px)
   ============================================ */

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-charts {
        grid-template-columns: 1fr;
    }
    
    .shopping-categories {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
        padding: 24px;
    }
    
    .calendar-day {
        min-height: 70px;
    }
    
    .day-number {
        font-size: 16px;
    }
}

/* ============================================
   Responsive - Mobile (< 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }
    
    .close-sidebar {
        display: block;
    }
    
    /* Sidebar as overlay */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        padding-top: 60px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar .logo {
        display: none;
    }
    
    /* Main content adjustments */
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 76px; /* Space for mobile header */
    }
    
    /* View headers */
    .view-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .view-header h2 {
        font-size: 22px;
    }
    
    .month-selector {
        align-self: flex-start;
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card h3 {
        font-size: 16px;
    }
    
    .progress-ring-container {
        width: 150px;
        height: 150px;
    }
    
    .progress-value {
        font-size: 28px;
    }
    
    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .quick-stat {
        padding: 12px 8px;
    }
    
    .qs-value {
        font-size: 24px;
    }
    
    .qs-label {
        font-size: 10px;
    }
    
    /* Calendar */
    .calendar-container {
        padding: 12px;
        overflow-x: auto;
    }
    
    .calendar-header span {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .calendar-grid {
        min-width: 320px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 4px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .day-indicator {
        width: 6px;
        height: 6px;
    }
    
    .day-detail {
        padding: 16px;
    }
    
    /* Diet & Exercise */
    .diet-info, .exercise-info {
        padding: 16px;
    }
    
    .diet-params, .exercise-params {
        gap: 16px;
    }
    
    .param-value {
        font-size: 16px;
    }
    
    .week-selector {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .week-btn {
        padding: 10px 16px;
        font-size: 14px;
        flex: 1;
        min-width: calc(50% - 4px);
        text-align: center;
    }
    
    .day-plan-header {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .day-plan-content {
        padding: 16px;
    }
    
    .meal-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 0;
    }
    
    .meal-name {
        font-size: 12px;
    }
    
    .meal-description {
        font-size: 14px;
    }
    
    .meal-quantity {
        font-size: 12px;
    }
    
    .exercise-block {
        padding: 12px;
    }
    
    .exercise-list li {
        font-size: 14px;
        padding: 6px 0;
    }
    
    /* Progress */
    .progress-charts {
        gap: 16px;
    }
    
    .progress-charts canvas {
        max-height: 250px;
    }
    
    .progress-table {
        padding: 16px;
        overflow-x: auto;
    }
    
    .progress-table table {
        min-width: 500px;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .weight-input-section {
        padding: 16px;
    }
    
    .weight-input-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .form-group input {
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        padding: 14px;
    }
    
    /* History */
    .history-timeline {
        flex-direction: column;
    }
    
    .history-month {
        min-width: 100%;
    }
    
    /* Shopping */
    .shopping-info {
        padding: 16px;
    }
    
    .shopping-header-info {
        flex-direction: column;
        gap: 16px;
    }
    
    .shopping-forbidden {
        padding: 16px;
    }
    
    .forbidden-list {
        gap: 6px;
    }
    
    .forbidden-item {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .shopping-categories {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .category-header {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .category-items {
        padding: 12px 16px;
    }
    
    .shopping-item {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    
    .item-notes {
        grid-column: 1 / -1;
    }
    
    .shopping-tips {
        padding: 16px;
    }
    
    .shopping-tips li {
        font-size: 14px;
        padding: 8px 0;
    }
    
    /* User Stats in Sidebar */
    .user-stats {
        padding-top: 16px;
    }
    
    .stat-card {
        padding: 10px 12px;
    }
    
    .stat-value {
        font-size: 16px;
    }
}

/* ============================================
   Responsive - Small Mobile (< 480px)
   ============================================ */

@media (max-width: 480px) {
    .mobile-header {
        padding: 0 12px;
    }
    
    .mobile-logo h1 {
        font-size: 18px;
    }
    
    .mobile-weight {
        padding: 4px 10px;
        font-size: 13px;
    }
    
    .main-content {
        padding: 12px;
        padding-top: 72px;
    }
    
    .view-header h2 {
        font-size: 20px;
    }
    
    .month-selector {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .quick-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
    }
    
    .qs-value {
        font-size: 20px;
        margin-bottom: 0;
    }
    
    .qs-label {
        font-size: 12px;
        text-align: left;
    }
    
    .calendar-header span {
        font-size: 10px;
    }
    
    .calendar-day {
        min-height: 45px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .week-btn {
        min-width: 100%;
    }
    
    .today-content {
        gap: 16px;
    }
    
    .meal-item, .exercise-item {
        padding: 10px 12px;
    }
    
    .progress-ring-container {
        width: 130px;
        height: 130px;
    }
    
    .progress-value {
        font-size: 24px;
    }
}

/* ============================================
   Shopping List View
   ============================================ */

.shopping-info {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.shopping-header-info {
    display: flex;
    gap: 48px;
}

.shopping-forbidden {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.shopping-forbidden h3 {
    color: var(--danger);
    margin-bottom: 16px;
}

.forbidden-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.forbidden-item {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.shopping-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.shopping-category {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.category-header {
    background: var(--primary);
    padding: 16px 24px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    font-size: 24px;
}

.category-items {
    padding: 16px 24px;
}

.shopping-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.shopping-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
}

.item-quantity {
    color: var(--text-secondary);
    font-size: 14px;
}

.item-notes {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.shopping-tips {
    margin-top: 24px;
}

.shopping-tips h3 {
    margin-bottom: 16px;
}

.shopping-tips ul {
    list-style: none;
    padding: 0;
}

.shopping-tips li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.shopping-tips li:last-child {
    border-bottom: none;
}

.shopping-tips li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* ============================================
   Selector de perfil (página inicial)
   ============================================ */

.profile-selector-view {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-dark);
    box-sizing: border-box;
}

.profile-selector-view.hidden {
    display: none;
}

.profile-selector-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

.profile-selector-header {
    margin-bottom: 48px;
}

.profile-selector-header .logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.profile-selector-header h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.profile-selector-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
}

.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    justify-items: center;
}

.profile-card {
    width: 100%;
    max-width: 280px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: var(--text-primary);
    font-family: inherit;
}

.profile-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.profile-card:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.profile-card-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.profile-card h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.profile-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.profile-card-coming {
    opacity: 0.7;
    cursor: not-allowed;
}

.profile-card-coming:hover {
    transform: none;
    border-color: var(--border);
}

/* ============================================
   App Bechita - Menú comedor
   ============================================ */

.bechita-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.bechita-app.hidden {
    display: none;
}

.bechita-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.btn-back-profile {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 16px;
    min-height: 44px;
    min-width: 44px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-back-profile:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.bechita-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bechita-title .logo-icon {
    font-size: 28px;
}

.bechita-title h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bechita-menu-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.bechita-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.comedor-info {
    margin-bottom: 20px;
}

.comedor-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

.comedor-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.comedor-controls .btn-month {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
}

.comedor-controls .btn-month:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

#comedor-month-display {
    font-weight: 600;
    min-width: 120px;
    text-align: center;
}

.comedor-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.comedor-calendar-day {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.comedor-calendar-day:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.comedor-calendar-day.selected {
    border-color: var(--primary);
    background: var(--primary);
}

.comedor-calendar-day.has-menu {
    border-color: var(--secondary);
}

.comedor-calendar-day .comedor-day-num {
    font-weight: 700;
    font-size: 18px;
}

.comedor-calendar-day .comedor-day-week {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.comedor-day-detail {
    padding: 24px;
}

.comedor-day-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.comedor-day-detail h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.comedor-menu-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.comedor-menu-item:last-child {
    border-bottom: none;
}

.comedor-menu-item .comedor-menu-label {
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.comedor-menu-item .comedor-menu-value {
    color: var(--text-primary);
}

/* ============================================
   Responsive - Selector de perfil y Bechita en móvil
   ============================================ */

@media (max-width: 768px) {
    .profile-selector-view {
        padding: 16px 12px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        align-items: flex-start;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .profile-selector-content {
        width: 100%;
        padding-top: 8px;
    }
    .profile-selector-header {
        margin-bottom: 28px;
    }
    .profile-selector-header .logo-icon {
        font-size: 40px;
        margin-bottom: 8px;
    }
    .profile-selector-header h1 {
        font-size: 28px;
    }
    .profile-selector-subtitle {
        font-size: 16px;
    }
    .profile-cards {
        grid-template-columns: 1fr;
        gap: 16px;
        justify-items: stretch;
    }
    .profile-card {
        max-width: none;
        padding: 24px 20px;
        min-height: 72px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        text-align: left;
    }
    .profile-card-icon {
        font-size: 36px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .profile-card h2 {
        font-size: 20px;
        margin-bottom: 2px;
    }
    .profile-card p {
        font-size: 13px;
        margin: 0;
    }
    .profile-card-coming {
        opacity: 0.6;
    }
    /* Bechita móvil */
    .bechita-header {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
        gap: 8px;
    }
    .btn-back-profile {
        order: 1;
        padding: 8px 12px;
        font-size: 13px;
    }
    .bechita-title {
        order: 2;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    .bechita-title h1 {
        font-size: 16px;
    }
    .bechita-title .logo-icon {
        font-size: 22px;
    }
    .bechita-menu-label {
        order: 3;
        width: 100%;
        text-align: center;
        font-size: 12px;
    }
    .bechita-main {
        padding: 16px 12px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .comedor-info {
        margin-bottom: 12px;
    }
    .comedor-desc {
        font-size: 13px;
    }
    .comedor-controls {
        margin-bottom: 16px;
        gap: 12px;
    }
    .comedor-controls .btn-month {
        padding: 10px 14px;
    }
    #comedor-month-display {
        font-size: 14px;
        min-width: 100px;
    }
    .comedor-calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        margin-bottom: 16px;
    }
    .comedor-calendar-day {
        min-height: 44px;
        padding: 6px 4px;
    }
    .comedor-calendar-day .comedor-day-num {
        font-size: 13px;
    }
    .comedor-calendar-day .comedor-day-week {
        font-size: 9px;
        display: none;
    }
    .comedor-day-detail {
        padding: 16px;
    }
    .comedor-day-detail h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    .comedor-menu-item {
        padding: 10px 0;
    }
    .comedor-menu-item .comedor-menu-label {
        font-size: 11px;
    }
    .comedor-menu-item .comedor-menu-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .profile-selector-view {
        padding: 12px 10px;
    }
    .profile-selector-header .logo-icon {
        font-size: 36px;
    }
    .profile-selector-header h1 {
        font-size: 24px;
    }
    .profile-selector-subtitle {
        font-size: 14px;
    }
    .profile-card {
        padding: 20px 16px;
        gap: 12px;
    }
    .profile-card-icon {
        font-size: 32px;
    }
    .profile-card h2 {
        font-size: 18px;
    }
    .profile-card p {
        font-size: 12px;
    }
    .bechita-title h1 {
        font-size: 15px;
    }
    .comedor-calendar-day {
        min-height: 40px;
    }
    .comedor-calendar-day .comedor-day-num {
        font-size: 12px;
    }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
