/* Container centré */
.container {
    padding: 15px;
}

/* Carte */
.card {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Groupe champ */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

/* Labels */
.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
}

/* Inputs */
.form-group input {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
}

/* Boutons */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Bouton principal */
.btn-primary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #007bff;
    color: white;
    font-size: 16px;
}

/* Bouton annuler */
.btn-cancel {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #ccc;
}

/* Responsive iPhone */
@media (max-width: 600px) {
    .form-actions {
        flex-direction: column;
    }

    .form-buttons {
        flex-direction: row;
    }
}


/* =======================
   1. Variables / palette
======================= */
:root {
    --bg-page: #f4f7ff;
    --bg-card: #ffffff;
    --border-light: #dbe6ff;

    --text-main: #1f2a44;
    --text-muted: #6b7280;

    --blue: #1a73e8;
    --blue-dark: #1669c1;
    --blue-light: #e9f2ff;

    --red: #ff3b30;
    --red-dark: #d92c23;

    --gray-btn: #e0e0e0;
    --gray-btn-dark: #d5d5d5;
    --gray-soft: #eef1f5;

    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

/* =======================
   2. Reset / base
======================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    background: var(--bg-page);
    color: var(--text-main);
    overflow-x: hidden;
}

.container {
    max-width: 95%;
    margin: 20px auto 90px auto;
    padding: 0 10px;
}

p,
li {
    margin: 6px 0;
    font-size: 1em;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 10px;
    color: var(--text-main);
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3,
h4 {
    font-size: 18px;
}

a {
    text-decoration: none;
}

/* =======================
   3. Cartes
======================= */
.card {
    background: var(--bg-card);
    padding: 18px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card p:last-child {
    margin-bottom: 0;
}

.card-header,
.card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    /* espace entre éléments */
}

/* =======================
   4. Boutons généraux
======================= */
button,
.add-button,
.form-inline button,
.btn-create,
.btn-primary,
.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Bouton par défaut */
button {
    background: var(--blue);
    color: #fff;
}

button:hover {
    background: var(--blue-dark);
}

/* Bouton principal */
.btn-primary {
    background: var(--blue);
    color: #fff;
}

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

.btn-create {
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    min-height: 78px;
    padding: 50px 8px 6px;
    border: none;
    background: transparent url('../img/btn_cree.png') center top/42px 42px no-repeat;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.btn-create:hover {
    background: transparent url('../img/btn_cree.png') center top/42px 42px no-repeat;
}

/* Bouton annuler */
.btn-cancel {
    display: inline-flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    min-width: 120px;
    min-height: 78px;
    padding: 50px 8px 6px;
    border: none;
    background: transparent url('../img/btn_annuler.png') center top/42px 42px no-repeat;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    margin-left: 8px;
    flex: 0 0 auto;
    width: auto;
    text-decoration: none;
    text-align: center;
}

.btn-cancel:hover {
    background: transparent url('../img/btn_annuler.png') center top/42px 42px no-repeat;
}

/* =======================
   5. Boutons d’action
======================= */
.card-actions {
    display: flex;
    justify-content: flex-start;
}

.card-actions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-actions.back-fixed {
    margin-top: -6px;
    margin-bottom: 12px;
}

.page-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    max-width: 95%;
    margin: 12px auto 8px;
    padding: 0 10px;
}

.page-topbar-user {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    min-width: 0;
    min-height: 35px;
    padding: 6px 9px;
    border: 1px solid var(--sand-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(31, 42, 68, 0.08);
    white-space: nowrap;
}

.page-topbar-user-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 20px;
}

.page-topbar-user-name {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.add-button {
    flex-direction: column;
    min-width: 110px;
    padding: 12px 18px;
    background: var(--blue);
    color: #fff;
    box-shadow: var(--shadow);
}

.add-button:hover {
    background: var(--blue-dark);
}

.add-button .icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.add-button .label {
    font-size: 14px;
    font-weight: bold;
}

/*.btn-add {
    padding: 14px 16px;
    font-size: 18px;
}*/

.btn-add {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3B82F6, #1E40AF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.btn-add:active {
    transform: scale(0.95);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.btn-back-arrow {
    display: inline-block;
    font-size: 22px;
    line-height: 1;
    transform: translateY(-1px);
    font-weight: 400;
}

.btn-back:hover {
    background: #000;
    color: #fff;
}

/* =======================
   6. Formulaires
======================= */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.form-inline input,
.form-inline select,
.form-inline button,
.login-card input {
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #cfd8e3;
    border-radius: var(--radius-sm);
}

.form-inline input,
.form-inline select {
    background: #fff;
    color: var(--text-main);
}

/* =======================
   7. Login
======================= */
.login-page {
    padding: 20px;
}

.login-container {
    max-width: 95%;
    margin: 20px auto 90px auto;
    padding: 0 10px;
}

.login-card {
    max-width: 400px;
    margin: 60px auto;
    padding: 24px 28px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.login-logo {
    display: block;
    margin: 0 auto 16px;
    height: auto;
}

.login-title {
    display: block;
    width: 100%;
    margin: 0 0 8px 0;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
}

.login-subtitle {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.login-form-group {
    margin-bottom: 14px;
}

.login-label {
    display: block;
    margin: 0 0 5px 0;
    font-weight: bold;
    text-align: left;
    color: var(--text-main);
}

.login-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.login-button {
    width: 100%;
    margin-top: 20px;
}

.login-error {
    margin-bottom: 15px;
    padding: 10px;
    font-size: 14px;
    color: #fff;
    background: var(--red);
    border-radius: 8px;
    text-align: center;
}

.login-card .login-title {
    text-align: center;
}

/* =======================
   8. Tableaux
======================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

th,
td {
    padding: 10px;
    text-align: left;
}

.table-depenses {
    margin-top: 10px;
    font-family: Arial, sans-serif;
}

.table-depenses th,
.table-depenses td {
    border: 1px solid #d6deea;
}

.table-depenses thead th {
    background: var(--blue-dark);
    color: #fff;
}

.table-depenses tbody tr:nth-child(even) {
    background: #f7faff;
}

.table-depenses tbody tr:last-child {
    font-weight: bold;
    color: #fff;
    background: #1f2a44;
}

.table-etapes {
    margin-top: 10px;
    font-family: Arial, sans-serif;
}

.table-etapes th,
.table-etapes td {
    border: 1px solid #d6deea;
}

.table-etapes thead th {
    background: var(--blue-dark);
    color: #fff;
}

.table-etapes thead th,
.week-edit-table thead th,
.table-etapes tbody th,
.week-edit-table tbody th {
    background: #374151;
    color: #fff;
}

.table-etapes tbody tr:nth-child(2) td,
.week-edit-table tbody tr:nth-child(2) td {
    background: #e5e7eb;
}

.table-etapes thead th.is-current-day {
    background: #b91c1c;
    color: #fff;
}

.table-etapes tbody td.is-current-day {
    background: #fee2e2;
    border-color: #fca5a5;
}

.table-etapes tbody tr:nth-child(2) td.is-current-day {
    background: #fecaca;
}

.table-etapes thead th a,
.table-depenses thead th a {
    display: inline-block;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}

.table-etapes thead th a:hover,
.table-depenses thead th a:hover {
    color: #fff !important;
    text-decoration: underline;
}

.table-etapes thead th a:visited,
.table-etapes thead th a:focus,
.table-etapes thead th a:active,
.table-depenses thead th a:visited,
.table-depenses thead th a:focus,
.table-depenses thead th a:active {
    color: #fff !important;
}

.table-etapes tbody tr:nth-child(even) {
    background: #f7faff;
}

.day-label-mobile {
    display: none;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.table-scroll table {
    min-width: 1100px;
}

.shopping-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.shopping-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.shopping-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.shopping-title-row h3 {
    margin: 0;
    white-space: nowrap;
}

.shopping-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.shopping-toggle-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.shopping-toggle[aria-expanded="true"] .shopping-toggle-arrow {
    transform: rotate(180deg);
}

.shopping-content {
    margin-top: 8px;
}

.shopping-trigger,
.shopping-trigger-cancel {
    flex: 0 0 auto;
    min-width: 140px;
}

.shopping-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shopping-trigger-cancel {
    min-height: auto;
    padding: 10px 14px;
    background-position: 10px center;
    background-size: 28px 28px;
    padding-left: 44px;
    margin-left: 0;
}

.shopping-item {
    padding: 12px 14px;
    background: #f7faff;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.shopping-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.shopping-quantity {
    font-weight: 700;
    color: var(--blue-dark);
}

.shopping-name {
    font-weight: 600;
}

.shopping-details {
    margin-top: 6px;
    font-size: 0.92em;
    color: var(--text-muted);
}

.shopping-meta {
    margin-top: 12px;
    font-size: 0.92em;
    color: var(--text-muted);
}

.mobile-week-view {
    display: none;
}

.week-view-toggle-row {
    display: none;
}

.mobile-day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 14px;
    gap: 10px;
}

.mobile-day-arrow {
    width: 42px;
    height: 42px;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #fff;
    color: var(--blue-dark);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.mobile-day-arrow:disabled {
    opacity: 0.45;
}

.mobile-day-current {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--blue-dark);
    border-radius: 999px;
    background: var(--blue-dark);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.mobile-day-panel {
    display: none;
}

.mobile-day-panel.is-active {
    display: block;
}

.mobile-day-title {
    margin-bottom: 10px;
    font-size: 17px;
}

.mobile-edit-week-view {
    margin-top: 14px;
}

.meal-slot-group {
    margin-bottom: 6px;
    padding-top: 6px;
    border-top: 1px solid #d6deea;
}

.meal-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.meal-slot-label {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--blue-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.meal-slot-toggle {
    flex: 0 0 auto;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #fff;
    color: var(--blue-dark);
    font-size: 15px;
    line-height: 1;
}

.meal-slot-toggle:hover {
    background: var(--blue-light);
}

.meal-slot-group.is-collapsed .meal-slot-fields {
    display: none;
}

.meal-slot-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    margin-bottom: 5px;
    padding: 6px 8px;
    border: 1px solid #d6deea;
    border-radius: 8px;
    background: #f7faff;
}

.meal-slot-selected-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meal-slot-edit {
    flex: 0 0 auto;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #fff;
    color: var(--blue-dark);
    font-size: 15px;
    line-height: 1;
}

.meal-slot-edit:hover {
    background: var(--blue-light);
}

.meal-slot-group.has-selected-plat:not(.is-editing) .meal-slot-select-fields {
    display: none;
}

.meal-slot-group.is-editing .meal-slot-selected {
    display: none;
}

.meal-slot-select {
    width: 100%;
    min-height: 34px;
    margin-bottom: 5px;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.2;
}

.meal-slot-select-secondary {
    margin-bottom: 2px;
}

.week-edit-table th,
.week-edit-table td {
    padding: 8px 6px;
}

.week-edit-cell {
    min-width: 220px;
}

.week-edit-count {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

.week-edit-participants {
    padding-top: 5px;
    border-top: 1px solid #eee;
    font-size: 13px;
}

.week-edit-participant-item {
    display: block;
    margin-bottom: 3px;
}

.participants-toggle {
    margin-top: 8px;
}

.semaine-participants-toggle {
    margin-bottom: 20px;
}

.participants-toggle summary {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #fff;
    color: var(--blue-dark);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.participants-toggle summary::marker,
.participants-toggle summary::-webkit-details-marker {
    display: none;
}

.participants-toggle summary::after {
    content: "+";
    margin-left: 8px;
    font-size: 15px;
    line-height: 1;
}

.participants-toggle[open] summary::after {
    content: "-";
}

.participants-toggle-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.participants-toggle-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #f7faff;
    font-size: 14px;
}

.mobile-edit-meal-card {
    padding: 14px;
    margin-bottom: 12px;
    background: #f7faff;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.mobile-edit-meal-summary {
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-main);
}

.mobile-edit-meal-recipe {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-muted);
}

.mobile-edit-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #d6deea;
}

.mobile-edit-participant {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d6deea;
    font-size: 14px;
}

.mobile-meal-card {
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #f7faff;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.mobile-meal-label {
    margin-bottom: 6px;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-meal-name {
    font-size: 16px;
    font-weight: 700;
}

.mobile-meal-recipe {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-muted);
}

.mobile-meal-empty {
    color: var(--text-muted);
    font-style: italic;
}

.vote-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.vote-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f7faff;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.vote-row label {
    min-width: 110px;
    font-weight: 600;
}

.vote-row select {
    min-width: 130px;
}

.votes-list {
    margin: 10px 0 0;
    padding-left: 18px;
}



/* =======================
   9. Participants (compact)
======================= */

.participants-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Ligne */
.participant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    /* ↓ réduit */
    border-bottom: none;
}

/* Texte */
.participant-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* ↓ réduit */
    font-size: 15px;
}

/* Nom */
.participant-nom {
    font-weight: 500;
}

/* alias */
.participant-alias {
    color: var(--text-muted);
    font-size: 13px;
}

/* Surnom */
.participant-surnom {
    font-weight: 600;
}

.participant-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;

    background: #e7f0ff;
    /* bleu très clair */
    color: #1a73e8;
    /* bleu doux */
    font-size: 18px;
    margin-left: 10px;
    /* espace spécifique */
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.participant-action:hover {
    background: #d6e6ff;
}

.semaine-title-text {
    display: inline-block;
    min-width: 0;
}

/* =======================
   10. Toggle
======================= */
.toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent url('../img/btn_plus.png') center/contain no-repeat;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    vertical-align: middle;
}

.toggle-button:hover {
    transform: none;
}

/* =======================
   11. Popup
======================= */
.popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.popup-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    padding: 20px;
    text-align: center;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.popup-box h3 {
    margin-bottom: 8px;
}

.popup-box button {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
}

.popup-box .edit {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 54px;
    background: #a3c9fc url('../img/btn_modifier.png') 12px center/32px 32px no-repeat;
    color: #0146a0;

    min-height: 54px;
}

.popup-box .edit:hover {
    background: #7db2f8;
    background: #4e9bff url('../img/btn_modifier.png') 12px center/32px 32px no-repeat;
}

.popup-box .delete {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 54px;
    background: #fff5f5 url('../img/btn_supprimer.png') 12px center/32px 32px no-repeat;
    color: var(--red-dark);

    min-height: 54px;
}

.popup-box .delete:hover {
    background: #ffe9e7 url('../img/btn_supprimer.png') 12px center/32px 32px no-repeat;
    color: var(--red-dark);
}

.popup-box .cancel {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 54px;
    background: #b4b4b4 url('../img/btn_annuler.png') 12px center/32px 32px no-repeat;
    color: var(--text-main);
    min-height: 54px;
}

.popup-box .cancel:hover {
    background: #5c5c5c url('../img/btn_annuler.png') 12px center/32px 32px no-repeat;

}

/* =======================
   12. Menu fixe bas
======================= */
.menu-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2px 0;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 35%),
        linear-gradient(to right, transparent 0, transparent 22px, rgba(233, 76, 91, 0.55) 22px, rgba(233, 76, 91, 0.55) 24px, transparent 24px),
        repeating-linear-gradient(to bottom,
            #fffdf3 0,
            #fffdf3 26px,
            #cfe3ff 26px,
            #cfe3ff 28px);
    border-top: 2px solid #d7e7ff;
    box-shadow: 0 -4px 14px rgba(76, 104, 140, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-container,
.mobile-menu-overlay {
    display: none;
}

.current-user-badge {
    position: absolute;
    top: 22px;
    right: 12px;
    left: auto;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    padding: 8px 12px;
    background: transparent;
    color: var(--text-main);
    border-radius: 999px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-align: right;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.current-user-badge-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 20px;
}

.current-user-badge span {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-portal-stack {
    grid-column: 3;
    justify-self: end;
    display: grid;
    gap: 3px;
    width: 146px;
}

.user-portal-stack .current-user-badge {
    position: static;
    justify-content: flex-end;
    max-width: none;
    padding: 7px 10px;
    border: 1px solid var(--sand-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(31, 42, 68, 0.08);
}

.portal-return-card {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    min-width: 132px;
    min-height: 38px;
    padding: 4px 7px;
    border: 1px solid var(--sand-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(31, 42, 68, 0.08);
}

.portal-return-card:hover,
.portal-return-card:visited {
    color: var(--text-main);
}

.portal-return-label {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    white-space: nowrap;
}

.portal-return-label strong {
    font-size: 14px;
    line-height: 1.1;
}

.portal-return-icon {
    width: 31px;
    height: 31px;
    object-fit: contain;
    flex: 0 0 31px;
}

.menu {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0 6px;
    min-width: max-content;
}

.menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: bold;
    color: #1f2a44;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.menu-icon {
    display: block;
    width: 56px;
    height: 56px;
    margin-bottom: 6px;
    object-fit: contain;
}

.menu a:hover {
    color: #0f4fa8;
}

.mobile-menu {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #d6deea;
    box-shadow: 0 -8px 24px rgba(31, 42, 68, 0.12);
}

.mobile-menu-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 64px;
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.mobile-menu-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.mobile-menu-more {
    cursor: pointer;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.32);
}

.mobile-menu-sheet {
    width: 100%;
    max-width: 420px;
    padding: 16px;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 30px rgba(17, 24, 39, 0.2);
}

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

.mobile-menu-close {
    width: auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--text-main);
    font-size: 13px;
}

.mobile-menu-sheet-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-menu-sheet-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #d6deea;
    border-radius: 12px;
    background: #f7faff;
    color: var(--text-main);
    font-weight: 700;
}

.mobile-menu-sheet-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* =======================
   13. Responsive
======================= */
@media (max-width: 600px) {
    body {
        font-size: 17px;
    }

    .container {
        padding: 0 8px;
    }

    .page-topbar {
        margin: 10px auto 6px;
        padding: 0 8px;
    }

    .page-topbar-user-name {
        max-width: 96px;
    }

    .card {
        padding: 16px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 19px;
    }

    .form-inline {
        flex-direction: column;
    }

    .day-label-desktop {
        display: none;
    }

    .day-label-mobile {
        display: inline;
    }

    .mobile-week-view {
        display: block;
    }

    .mobile-week-view.is-hidden-on-mobile {
        display: none;
    }

    .table-scroll {
        display: none;
    }

    .table-scroll.is-visible-on-mobile {
        display: block;
    }

    .week-view-toggle-row {
        display: flex;
        justify-content: flex-end;
        margin: 0 0 10px;
    }

    .week-view-toggle {
        width: auto;
        min-width: 130px;
    }

    .week-edit-desktop {
        display: none;
    }

    .form-inline input,
    .form-inline select,
    .form-inline button,
    button {
        width: 100%;
    }

    .mobile-day-arrow {
        width: 44px;
        min-width: 44px;
    }

    .card-actions.back-fixed {
        margin-top: -10px;
    }

    .card h2 {
        align-items: flex-start;
    }

    .participant-action {
        width: 34px;
        height: 34px;
        margin-left: 0;
        flex: 0 0 34px;
    }

    .semaine-title-text {
        flex: 1 1 auto;
    }

    .shopping-header {
        align-items: center;
    }

    .shopping-title-row {
        width: auto;
        flex-wrap: nowrap;
    }

    .shopping-header-actions {
        width: 100%;
    }

    .shopping-toggle {
        flex: 0 0 36px;
        width: 36px;
        min-width: 36px;
        height: 36px;
    }

    .mobile-edit-week-view select {
        width: 100%;
    }

    .meal-slot-select {
        min-height: 34px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .meal-slot-label {
        min-height: 22px;
        padding: 2px 9px;
        font-size: 10px;
    }

    .form-buttons button,
    .form-buttons .btn-cancel,
    .form-buttons .btn-create {
        width: auto;
    }

    .login-card {
        margin: 40px 20px;
        padding: 20px;
    }

    .menu a {
        font-size: 12px;
        min-width: 74px;
    }

    .current-user-badge {
        top: 16px;
        right: 8px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .current-user-badge span {
        max-width: 96px;
    }

    .menu-icon {
        width: 40px;
        height: 40px;
    }

    .menu-container {
        display: none;
    }

    .mobile-menu-container {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        display: block;
    }

    .btn-cancel {
        margin-left: 0;
    }
}

.lock-icon {
    color: #666;
    font-size: 0.9em;
    margin-left: 6px;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 250px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;

    opacity: 0;
    transform: translateY(-20px);
    animation: fadeIn 0.3s forwards;
}

.toast.success {
    background: #2ecc71;
}

.toast.error {
    background: #e74c3c;
}

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