:root {
    --primary: #4CAF50;
    --primary-dark: #45a049;
    --secondary: #2196F3;
    --danger: #f44336;
    --bg: #f5f5f5;
    --card: #ffffff;
    --text: #333;
    --text-light: #666;
    --border: #ddd;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

header h1 {
    color: var(--primary);
    margin-bottom: 15px;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: var(--bg);
    color: var(--text);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-btn:hover, .nav-btn.active {
    background: var(--primary);
    color: white;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
}

.quick-actions {
    background: var(--card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.quick-actions h3 {
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #1976D2;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Lists */
.items-list {
    display: grid;
    gap: 15px;
}

.item-card {
    background: var(--card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.item-title {
    font-size: 18px;
    font-weight: bold;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-meta {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 10px;
}

.item-macros {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 14px;
}

.macro {
    background: var(--bg);
    padding: 5px 10px;
    border-radius: 5px;
}

.macro-calories { color: #FF9800; }
.macro-protein { color: #4CAF50; }
.macro-carbs { color: #2196F3; }
.macro-fat { color: #f44336; }

.favorite-badge {
    background: gold;
    color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar input[type="text"] {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    flex: 1;
    min-width: 200px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-lg {
    max-width: 700px;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
}

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

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Recipe/Menu ingredients list */
.recipe-ingredient-row,
.menu-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg);
    border-radius: 5px;
}

.menu-item-row {
    grid-template-columns: 1fr 2fr 1fr auto;
}

.recipe-totals,
.menu-totals {
    background: var(--bg);
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .recipe-ingredient-row,
    .menu-item-row {
        grid-template-columns: 1fr;
    }
    
    nav {
        justify-content: center;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== SUGERIDOR ===== */
.suggest-controls {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 500px;
}
.suggest-range-info {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    text-align: center;
}
.suggest-count {
    color: #555;
    margin-bottom: 16px;
    font-size: 14px;
}
.suggest-results { margin-top: 8px; }
.suggest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.suggest-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #4CAF50;
    transition: transform 0.15s, box-shadow 0.15s;
}
.suggest-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.suggest-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.suggest-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin: 0;
    flex: 1;
}
.cal-badge {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    font-size: 13px;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.macro-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
}
.macro-p { color: #1565c0; background: #e3f2fd; padding: 2px 8px; border-radius: 10px; }
.macro-c { color: #e65100; background: #fff3e0; padding: 2px 8px; border-radius: 10px; }
.macro-g { color: #6a1b9a; background: #f3e5f5; padding: 2px 8px; border-radius: 10px; }
.suggest-instructions {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;
}
.suggest-ingredients {
    font-size: 12px;
    color: #777;
    line-height: 1.5;
}
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 15px;
}
