:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #059669;
    --bg-app: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    padding-bottom: 100px;
    -webkit-tap-highlight-color: transparent;
}

header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.trimestre-badge {
    background: #eff6ff;
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

main {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.card h2 {
    margin-top: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--bg-app);
    padding-bottom: 0.75rem;
}

/* Navigation Basse Tactile */
nav.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0.5rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    z-index: 1000;
}

nav.app-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    padding: 0.5rem;
    border-radius: 10px;
    transition: 0.2s;
}

nav.app-nav a.active {
    color: var(--primary);
    background: #eff6ff;
}

/* Boutons & Formulaires tactiles */
button, .btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    transition: background 0.2s;
}

button:active {
    background: var(--primary-hover);
    transform: scale(0.99);
}

select, input {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
    margin-top: 0.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Grilles de convives tactiles */
.convives-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1rem;
}

.convive-chip {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    background: var(--bg-app);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.convive-chip input {
    display: none;
}

.convive-chip.selected {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* Résultats sous forme de cartes modernes */
.aliment-result-block {
    background: var(--bg-app);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.aliment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.aliment-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.person-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.95rem;
}

.person-row:last-child {
    border-bottom: none;
}

.total-global-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.05rem;
}