/* 
 * Прикорм MVP - Стили
 * Тёплый, заботливый дизайн для родителей
 */

:root {
    /* Цветовая палитра */
    --primary: #7C9885;
    --primary-light: #A8C5B0;
    --primary-dark: #5A7462;
    --secondary: #E8D5B7;
    --secondary-light: #F5EDE0;
    --accent: #D4A574;
    --accent-hover: #C49464;

    /* Нейтральные */
    --bg: #FDFBF7;
    --bg-card: #FFFFFF;
    --text: #3D3D3D;
    --text-light: #6B6B6B;
    --text-muted: #9B9B9B;
    --border: #E8E4DE;
    --border-light: #F0EDE8;

    /* Статусы */
    --success: #7C9885;
    --warning: #E5B567;
    --danger: #D4736C;
    --info: #6B9AC4;
    --new-food: #E8A87C;

    /* Размеры */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);

    /* Переходы */
    --transition: 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Основной лейаут */
.app {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
}

.child-info {
    margin-top: 12px;
    padding: 12px;
    background: var(--secondary-light);
    border-radius: var(--radius-sm);
}

.child-name {
    font-weight: 600;
    color: var(--primary-dark);
}

.child-age {
    font-size: 13px;
    color: var(--text-light);
}

/* Навигация */
.nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--secondary-light);
}

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

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

.sidebar-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-close:hover {
    background: var(--secondary-light);
    color: var(--text);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Версии плана */
.version-selector {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    position: relative;
}

.version-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--secondary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    transition: var(--transition);
}

.version-btn:hover {
    border-color: var(--primary);
}

.version-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 16px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 150;
}

.version-dropdown.open {
    display: inline-table;
}

.version-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.version-option:last-child {
    border-bottom: none;
}

.version-option:hover {
    background: var(--secondary-light);
}

.version-option.active {
    background: var(--primary);
    color: white;
}

/* Основной контент */
.main {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.header-title {
    font-size: 24px;
    font-weight: 600;
}

.header-date {
    color: var(--text-light);
    white-space: nowrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.menu-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-version-selector {
    display: none;
    position: relative;
}

.mobile-version-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--secondary-light);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.mobile-version-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.mobile-version-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 240px;
}

.content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    width: 100%;
}

/* Календарь */
.calendar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.calendar-nav-btn:hover {
    background: var(--secondary-light);
    border-color: var(--primary);
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
}

.calendar-today-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

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

/* Сетка недели */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.week-day {
    border-right: 1px solid var(--border-light);
    min-height: 180px;
}

.week-day:last-child {
    border-right: none;
}

.week-day-header {
    padding: 12px;
    background: var(--secondary-light);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.week-day-labels {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.week-day-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.week-day-date {
    font-size: 20px;
    font-weight: 600;
    margin-top: 4px;
}

.week-day.selected {
    background: rgba(124, 152, 133, 0.08);
}

.week-day.has-new .week-day-header {
    border-bottom-color: var(--new-food);
}

.week-day-new-icon {
    font-size: 18px;
    line-height: 1;
}

.week-day.today .week-day-header {
    background: var(--primary);
    color: white;
}

.week-day.today .week-day-name {
    color: rgba(255, 255, 255, 0.8);
}

.week-day.no-plan .week-day-header {
    opacity: 0.5;
}

.week-day-content {
    padding: 8px;
}

/* Приём пищи в календаре */
.meal-mini {
    padding: 8px;
    margin-bottom: 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.meal-mini:hover {
    background: var(--secondary-light);
}

.meal-mini.new-food {
    border-left-color: var(--new-food);
    background: rgba(232, 168, 124, 0.1);
}

.meal-mini-time {
    font-weight: 600;
    color: var(--text-light);
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.meal-mini-product {
    color: var(--text);
    line-height: 1.3;
}

.meal-mini-volume {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

/* Детальный вид дня */
.day-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-top: 24px;
}

/* Чеклист продуктов */
.checklist-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-top: 24px;
    padding: 24px;
}

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

.checklist-title {
    font-size: 18px;
    font-weight: 600;
}

.checklist-count {
    font-size: 13px;
    color: var(--text-light);
    background: var(--secondary-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    align-items: flex-start;
}

.checklist-item.completed {
    border-color: var(--success);
    background: rgba(124, 152, 133, 0.08);
}

.checklist-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--secondary-light);
    color: var(--text);
}

.checklist-item.completed .checklist-icon {
    background: var(--success);
    color: white;
}

.checklist-product {
    font-weight: 600;
    margin-bottom: 4px;
}

.checklist-date {
    font-size: 12px;
    color: var(--text-muted);
}

.checklist-empty {
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.day-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-detail-title {
    font-size: 20px;
    font-weight: 600;
}

.day-detail-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-day {
    background: var(--secondary);
    color: var(--text);
}

.day-detail-meals {
    padding: 24px;
    display: grid;
    gap: 20px;
}

/* Карточка приёма пищи */
.meal-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.meal-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.meal-card.new-food {
    border-color: var(--new-food);
    background: linear-gradient(to right, rgba(232, 168, 124, 0.1), var(--bg));
}

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

.meal-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meal-time-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.meal-time-icon.morning {
    background: #FFF3E0;
}

.meal-time-icon.day {
    background: #E3F2FD;
}

.meal-time-icon.evening {
    background: #F3E5F5;
}

.meal-time-label {
    font-weight: 600;
    font-size: 14px;
}

.meal-new-badge {
    background: var(--new-food);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.meal-product {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.meal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.meal-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.meal-notes {
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

/* Чат панель */
.chat-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
}

.chat-panel.open {
    transform: translateX(0);
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-close:hover {
    background: var(--secondary-light);
}

/* Список чатов */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.chat-list-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-list-item:hover {
    background: var(--secondary-light);
}

.chat-list-item.active {
    background: var(--primary);
    color: white;
}

.chat-list-title {
    font-size: 14px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-date {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-list-item.active .chat-list-date {
    color: rgba(255, 255, 255, 0.7);
}

.chat-list-delete {
    opacity: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: var(--transition);
}

.chat-list-item:hover .chat-list-delete {
    opacity: 1;
}

.chat-list-delete:hover {
    color: var(--danger);
}

.chat-new-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    transition: var(--transition);
}

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

.chat-tip {
    padding: 12px;
    background: var(--secondary-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-light);
    margin-top: 12px;
}

/* Сообщения чата */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.5;
    font-size: 14px;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: var(--secondary-light);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.message {
    word-break: break-word;
}

.message p,
.message ul,
.message ol,
.message pre,
.message blockquote {
    margin: 0 0 8px 0;
}

.message p:last-child,
.message ul:last-child,
.message ol:last-child,
.message pre:last-child,
.message blockquote:last-child {
    margin-bottom: 0;
}

.message ul,
.message ol {
    padding-left: 18px;
}

.message li+li {
    margin-top: 4px;
}

.message pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    overflow-x: auto;
}

.message code {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.message blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    color: var(--text-light);
}

.message a {
    color: var(--primary-dark);
    text-decoration: underline;
}

.message h1,
.message h2,
.message h3,
.message h4,
.message h5,
.message h6 {
    margin: 0 0 8px 0;
    font-weight: 600;
}

.message h1 {
    font-size: 20px;
}

.message h2 {
    font-size: 18px;
}

.message h3 {
    font-size: 16px;
}

.message h4 {
    font-size: 15px;
}

.message h5,
.message h6 {
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

/* Форма ввода чата */
.chat-input-container {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.chat-input-form {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    resize: none;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.chat-send-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
}

/* Кнопка открытия чата */
.chat-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--transition);
    z-index: 150;
}

.chat-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.chat-panel.open~.chat-toggle {
    display: none;
}

/* Генерация плана */
.generate-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: 24px;
}

.generate-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.generate-form {
    display: flex;
    gap: 12px;
}

.generate-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.generate-input:focus {
    border-color: var(--primary);
}

.generate-btn {
    padding: 14px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.generate-btn:hover {
    background: var(--accent-hover);
}

.generate-btn:disabled {
    background: var(--border);
    cursor: wait;
}

.job-status {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--secondary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    gap: 12px;
    align-items: center;
}

.job-status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--info);
    animation: job-pulse 1.5s infinite ease-in-out;
}

.job-status[data-status="pending"] .job-status-indicator {
    background: var(--warning);
}

.job-status[data-status="processing"] .job-status-indicator {
    background: var(--info);
}

.job-status[data-status="failed"] .job-status-indicator {
    background: var(--danger);
    animation: none;
}

.job-status[data-status="completed"] .job-status-indicator {
    background: var(--success);
    animation: none;
}

.job-status-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.job-status-meta {
    font-size: 13px;
    color: var(--text-muted);
}

@keyframes job-pulse {
    0% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }
}

/* Лоадер */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Уведомления */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    background: var(--text);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .chat-panel {
        width: 360px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .chat-panel {
        width: 100%;
    }

    .sidebar-close {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .mobile-version-selector {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-overlay {
        display: block;
    }
}

@media (max-width: 768px) {
    .week-grid {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding: 12px 16px 16px;
        scroll-snap-type: x mandatory;
    }

    .week-day {
        border: 1px solid var(--border-light);
        border-radius: var(--radius-lg);
        min-width: 220px;
        scroll-snap-align: start;
    }

    .week-day-header {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .week-day-content {
        padding: 12px;
    }

    .header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 8px;
    }

    .content {
        padding: 16px;
    }

    .day-detail-meals {
        padding: 16px;
    }
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 200;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    border-radius: var(--radius-sm);
    min-width: 64px;
}

.bottom-nav-item:hover,
.bottom-nav-item:active {
    background: var(--secondary-light);
}

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

.bottom-nav-icon {
    font-size: 22px;
    line-height: 1;
}

.bottom-nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* More Menu (Mobile) */
.more-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 250;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.more-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.more-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 260;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.more-menu.open {
    transform: translateY(0);
}

.more-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.more-menu-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.more-menu-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--secondary-light);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.more-menu-close:hover {
    background: var(--border);
}

.more-menu-content {
    padding: 16px 20px;
}

.more-menu-section {
    margin-bottom: 20px;
}

.more-menu-section:last-child {
    margin-bottom: 0;
}

.more-menu-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.more-menu-versions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.more-menu-version-item {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.more-menu-version-item:hover,
.more-menu-version-item:active {
    border-color: var(--primary);
    background: var(--secondary-light);
}

.more-menu-version-item.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.more-menu-version-item strong {
    display: block;
    margin-bottom: 4px;
}

.more-menu-version-item small {
    font-size: 12px;
    opacity: 0.8;
}

.more-menu-child-info {
    padding: 16px;
    background: var(--secondary-light);
    border-radius: var(--radius);
    text-align: center;
}

.more-menu-child-info .child-name {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.more-menu-child-info .child-age {
    font-size: 13px;
    color: var(--text-light);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    .chat-toggle {
        display: none;
    }

    .menu-toggle {
        display: none;
    }

    .content {
        padding: 16px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .toast {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .chat-panel {
        bottom: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .header {
        padding: 12px 16px;
    }

    .header-title {
        font-size: 18px;
    }

    .calendar-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .calendar-title {
        font-size: 14px;
        order: 1;
        flex: 1;
    }

    .calendar-nav {
        order: 0;
    }

    .calendar-today-btn {
        order: 2;
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Улучшенные шрифты для мобильной версии */
    body {
        font-size: 16px;
    }

    .week-day {
        min-width: 280px;
    }

    .week-day-name {
        font-size: 13px;
    }

    .week-day-date {
        font-size: 24px;
    }

    .meal-mini {
        padding: 12px;
        margin-bottom: 8px;
    }

    .meal-mini-time {
        font-size: 12px;
    }

    .meal-mini-product {
        font-size: 15px;
        line-height: 1.4;
    }

    .meal-mini-volume {
        font-size: 13px;
    }

    .day-detail-title {
        font-size: 18px;
    }

    .meal-card {
        padding: 16px;
    }

    .meal-product {
        font-size: 17px;
    }

    .meal-meta-item {
        font-size: 14px;
    }

    .meal-notes {
        font-size: 15px;
        line-height: 1.6;
    }

    .checklist-title {
        font-size: 16px;
    }

    .checklist-product {
        font-size: 15px;
    }

    .checklist-date {
        font-size: 13px;
    }

    .generate-title {
        font-size: 16px;
    }

    .generate-input {
        font-size: 16px;
        padding: 14px;
    }

    .bottom-nav-label {
        font-size: 12px;
    }

    .bottom-nav-icon {
        font-size: 24px;
    }
}

/* Hide sidebar completely on mobile since we have bottom nav */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }
}