*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #6366f1; --primary-dark: #4f46e5; --primary-light: #a5b4fc;
    --success: #10b981; --warning: #f59e0b; --danger: #ef4444;
    --bg: #f8fafc; --surface: #ffffff; --text: #1e293b; --text-muted: #64748b;
    --border: #e2e8f0; --radius: 12px; --shadow: 0 1px 3px rgba(0,0,0,.1);
}
body { font-family: 'Nunito', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
h1,h2,h3,h4 { font-family: 'Baloo 2', cursive; }

.app-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 1.5rem; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.app-header .logo { font-family: 'Baloo 2', cursive; font-size: 1.5rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.app-header nav { display: flex; gap: 1rem; align-items: center; }
.app-header nav a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: .9rem; padding: .5rem .75rem; border-radius: 8px; transition: all .15s; }
.app-header nav a:hover, .app-header nav a.active { color: var(--primary); background: #eef2ff; }

.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.2rem; border: none; border-radius: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; transition: all .15s; text-decoration: none; font-family: 'Nunito', sans-serif; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .35rem; color: var(--text-muted); }
.form-control { width: 100%; padding: .6rem .8rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: .9rem; font-family: 'Nunito', sans-serif; transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
select.form-control { appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") no-repeat right .75rem center var(--surface); padding-right: 2rem; }

.flash-messages { margin-bottom: 1rem; }
.flash { padding: .75rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: .5rem; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }

.badge { display: inline-flex; padding: .2rem .6rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-primary { background: #eef2ff; color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.cost-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: .25rem; }
.cost-bar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.cost-bar-fill.ok { background: var(--success); }
.cost-bar-fill.warning { background: var(--warning); }
.cost-bar-fill.danger { background: var(--danger); }

.cost-widget { background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%); border: 1px solid var(--primary-light); border-radius: var(--radius); padding: 1.25rem; }
.cost-widget .cost-amount { font-size: 2rem; font-weight: 700; color: var(--primary-dark); font-family: 'Baloo 2', cursive; }
.cost-widget .cost-label { font-size: .8rem; color: var(--text-muted); }
.cost-widget .cost-per-couvert { font-size: 1.1rem; color: var(--text); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
tr:hover { background: #f8fafc; }

.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state .emoji { font-size: 3rem; margin-bottom: 1rem; }

.tab-nav { display: flex; gap: .5rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-nav a { padding: .75rem 1rem; text-decoration: none; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.tab-nav a:hover, .tab-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

.day-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.day-editor h4 { text-transform: capitalize; color: var(--primary); margin-bottom: .75rem; }
.day-editor .meal-row { display: flex; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.day-editor .meal-label { width: 100px; font-size: .8rem; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.day-editor .meal-input { flex: 1; }

.auth-page { max-width: 420px; margin: 4rem auto; }
.auth-page h1 { text-align: center; margin-bottom: 2rem; color: var(--primary); }
