* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #222;
}

body {
    min-height: 100vh;
}


/* ========================================
   STRUCTURE
   ======================================== */

.app {
    display: flex;
    min-height: 100vh;
}


/* ========================================
   MENU LATÉRAL
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 230px;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    background: #20252b;
    color: #fff;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    padding: 10px 12px 25px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #d9dde2;
    padding: 12px 14px;
    border-radius: 6px;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-item:hover {
    background: #30363d;
    color: #fff;
}

.menu-item.active {
    background: #3b82f6;
    color: #fff;
}


/* Séparateur et sous-menu "Gestion" */

.menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: rgba(255, 255, 255, 0.1);
}

.menu-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    border: 0;
    background: transparent;
    color: #9aa1ab;
    padding: 10px 14px;
    border-radius: 6px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-group-toggle:hover {
    background: #30363d;
    color: #fff;
}

.menu-group-label {
    flex: 1;
}

.menu-group-chevron {
    font-size: 11px;
    transition: transform 0.15s ease;
}

.menu-group-toggle.is-open .menu-group-chevron {
    transform: rotate(90deg);
}

.menu-submenu {
    display: grid;
    grid-template-rows: 0fr;

    overflow: hidden;

    transition: grid-template-rows 0.18s ease;
}

.menu-submenu > * {
    min-height: 0;
}

.menu-submenu.is-open {
    grid-template-rows: 1fr;
}

.menu-submenu-inner {
    display: flex;
    flex-direction: column;
    gap: 5px;

    padding-top: 5px;
}

.menu-subitem {
    padding-left: 30px;
    font-size: 14px;
}


/* ========================================
   CONTENU
   ======================================== */

.main-content {
    flex: 1;
    min-width: 0;
    padding: 22px;
    margin-left: 230px;
}


/* ========================================
   EN-TÊTE DE PAGE
   ======================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    max-width: 1100px;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
}

.page-header p {
    margin: 0;
    color: #6b7280;
}


/* ========================================
   CARTES
   ======================================== */

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 1100px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}


/* ========================================
   BOUTONS
   ======================================== */

.btn {
    border: 0;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}


/* ========================================
   TABLEAUX
   ======================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8fafc;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #edf0f2;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.actions-column {
    width: 120px;
    text-align: right !important;
}

.actions {
    text-align: right;
    white-space: nowrap;
}


/* ========================================
   BOUTONS ICONES
   ======================================== */

.btn-icon {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    margin-left: 4px;
    transition: background 0.15s ease;
}

.btn-icon:hover {
    background: #eef2f7;
}


/* ========================================
   FORMULAIRES
   ======================================== */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.required {
    color: #dc2626;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.form-group textarea {
    resize: vertical;
}


/* ========================================
   MODALE
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.45);
}

.modal {
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 18px;

    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 19px;
}

.modal-close {
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    color: #111827;
}

.modal form {
    padding: 16px 18px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}


/* ========================================
   MESSAGES
   ======================================== */

.loading {
    text-align: center;
    color: #6b7280;
    padding: 30px !important;
}

.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 40px !important;
}

.muted {
    color: #9ca3af;
}

.error {
    color: #dc2626;
    padding: 20px !important;
}

.form-error {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 5px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 700px) {

    .app {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 10px;
    }

    .logo {
        padding: 8px 10px 12px;
    }

    .menu {
        flex-direction: row;
    }

    .menu-item {
        flex: 1;
        text-align: center;
    }

    .main-content {
        margin-left: 0;
        padding: 20px 12px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header .btn {
        width: 100%;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

}

/* ========================================
   LISTE DE COURSES
   ======================================== */

.shopping-list-container {
    padding: 10px 0;
}

.shopping-category {
    margin-bottom: 18px;
}

.shopping-category:last-child {
    margin-bottom: 0;
}

.shopping-category-title {
    margin: 0;
    padding: 10px 18px;

    font-size: 15px;
    font-weight: 700;

    color: #1f2933;
    background: var(--category-color, #f8fafc);

    border-bottom: 1px solid #e5e7eb;

    cursor: pointer;
    list-style: none;

    display: flex;
    align-items: center;
    gap: 8px;
}

.shopping-category-title::-webkit-details-marker {
    display: none;
}

.shopping-category-title::before {
    content: '▸';

    font-size: 12px;

    transition: transform 0.15s ease;
}

.shopping-category[open] > .shopping-category-title::before {
    transform: rotate(90deg);
}

.shopping-category-count {
    font-size: 12px;
    font-weight: 600;

    color: #1f2933;
    background: rgba(255, 255, 255, 0.55);

    padding: 1px 8px;
    border-radius: 999px;
}

.shopping-items {
    display: flex;
    flex-direction: column;
}

.shopping-item {
    display: grid;
    grid-template-columns: 24px 1fr 180px 220px 70px;

    align-items: center;

    gap: 12px;

    padding: 9px 18px;

    border-bottom: 1px solid #edf0f2;
}

.shopping-item:last-child {
    border-bottom: 0;
}

.shopping-item:hover {
    background: #fafafa;
}

.shopping-item-name {
    display: block;

    font-weight: 600;
    color: #1f2937;

    text-decoration: none;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopping-item-name:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.shopping-item-comment {
    min-width: 0;

    font-size: 12px;
    font-style: italic;
    color: #9ca3af;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopping-item-quantity {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.shopping-item-quantity input {
    width: 85px;
    flex: 0 0 auto;

    padding: 5px 8px;

    border: 1px solid #e5e7eb;
    border-radius: 4px;

    background: #fafafa;
    color: #6b7280;

    font-family: inherit;
    font-size: 13px;
    text-align: right;

    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.shopping-item-quantity input:focus {
    outline: none;

    background: #fff;
    color: #1f2937;
    border-color: #3b82f6;

    box-shadow:
        0 0 0 2px
        rgba(59, 130, 246, 0.12);
}

.shopping-unit {
    flex: 0 0 auto;
    min-width: 65px;

    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
}

.shopping-item-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.form-help {
    display: block;

    margin-top: 6px;

    color: #6b7280;

    font-size: 12px;
}


/* ========================================
   RESPONSIVE - LISTE DE COURSES
   ======================================== */

/* ========================================
   LISTE DE COURSES - CHECKED
   ======================================== */

.shopping-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 14px;
}

.shopping-select-all {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
    color: #374151;
}

.shopping-select-all input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}


/* Bouton d'achat (icône) */

.shopping-item-check {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Case de sélection (actions groupées) */

.shopping-item-select {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shopping-select-checkbox {
    width: 16px;
    height: 16px;

    cursor: pointer;
}

.shopping-category-select {
    width: 16px;
    height: 16px;

    margin-right: 4px;
    vertical-align: middle;

    cursor: pointer;
}


/* Nouvelle structure de ligne */

.shopping-item {
    display: grid;

    grid-template-columns:
        24px
        30px
        1fr
        180px
        220px
        70px;

    align-items: center;

    gap: 12px;

    padding: 9px 18px;

    border-bottom: 1px solid #edf0f2;
}


/* ========================================
   RESPONSIVE - LISTE DE COURSES
   ======================================== */

@media (max-width: 700px) {

    .shopping-item {
        grid-template-columns: 24px 30px 1fr 70px;

        grid-template-areas:
            "select check name    actions"
            "select check qty     actions"
            "select check comment actions";

        row-gap: 4px;
        gap: 8px;
    }

    .shopping-item-select {
        grid-area: select;
    }

    .shopping-item-check {
        grid-area: check;
    }

    .shopping-item-info {
        grid-area: name;
        min-width: 0;
    }

    .shopping-item-quantity {
        grid-area: qty;
        justify-content: flex-start;
    }

    .shopping-item-comment {
        grid-area: comment;
    }

    .shopping-item-comment:empty {
        display: none;
    }

    .shopping-item-actions {
        grid-area: actions;
    }

}


/* Produit acheté */

.shopping-item-checked {
    opacity: 0.55;
}

.shopping-item-checked
.shopping-item-name {
    text-decoration: line-through;
    color: #6b7280;
}

.shopping-item-checked
.shopping-item-quantity input {
    text-decoration: line-through;
}


/* Responsive */

@media (max-width: 700px) {

    .shopping-toolbar {
        justify-content: stretch;
    }

    .shopping-toolbar .btn {
        width: 100%;
    }

}

/* ========================================
   UNITÉS
   ======================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 9px 14px;

    text-align: left;

    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    font-size: 13px;
    font-weight: 700;

    color: #4b5563;

    background: #f8fafc;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.actions-column {
    width: 120px;
    text-align: right !important;
}

.text-muted {
    color: #9ca3af;
}

.status-active,
.status-inactive {
    display: inline-block;

    padding: 4px 8px;

    border-radius: 4px;

    font-size: 12px;
    font-weight: 600;
}

.status-active {
    color: #166534;
    background: #dcfce7;
}

.status-inactive {
    color: #6b7280;
    background: #f3f4f6;
}


/* Modale */

.modal-container {
    position: relative;
}

.form-error {
    margin-top: 10px;
    padding: 10px;

    color: #991b1b;
    background: #fee2e2;

    border-radius: 5px;

    font-size: 13px;
}


/* Responsive */

@media (max-width: 700px) {

    .actions-column {
        width: 90px;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table td:nth-child(2),
    .data-table th:nth-child(2) {
        min-width: 110px;
    }

    /*
     * Épingle la case à cocher et le nom pendant le défilement
     * horizontal, pour qu'ils restent toujours visibles
     */
    .data-table th.checkbox-column,
    .data-table td.checkbox-column {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #f8fafc;
    }

    .data-table td.checkbox-column {
        background: #fff;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        position: sticky;
        left: 40px;
        z-index: 1;
        background: #f8fafc;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
    }

    .data-table td:nth-child(2) {
        background: #fff;
    }

}

/* ========================================
   PAGE DE CONNEXION
   ======================================== */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #20252b;
}

.login-wrapper {
    width: 100%;
    max-width: 380px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 30px 26px;
}

.login-logo {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 24px;
}

.login-submit {
    width: 100%;
    margin-top: 6px;
}

.login-error {
    display: none;
    color: #dc2626;
    font-size: 13px;
    margin: -8px 0 14px;
}

.login-error.visible {
    display: block;
}


/* ========================================
   BOUTON DE DECONNEXION
   ======================================== */

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
}

.logout-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #d9dde2;
    padding: 12px 14px;
    border-radius: 6px;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.logout-button:hover {
    background: #30363d;
    color: #fff;
}


/* ========================================
   LIEN PRODUIT (RECHERCHE CARREFOUR)
   ======================================== */

.product-name-link {
    color: inherit;
    text-decoration: none;
}

.product-name-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.product-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
    min-width: 160px;
}

.btn-add-shopping {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;
    flex-shrink: 0;

    border: 0;
    border-radius: 50%;

    background: #3b82f6;
    color: #fff;

    font-size: 16px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-add-shopping:hover {
    background: #2563eb;
    transform: scale(1.08);
}


/* ========================================
   PRODUITS REGROUPES PAR CATEGORIE
   ======================================== */

.product-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;

    padding: 10px 18px;

    border-bottom: 1px solid #edf0f2;
}

.product-item:hover {
    background: #fafafa;
}

.product-item-select {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.product-item-description {
    flex: 1 1 180px;
    min-width: 140px;

    color: #6b7280;
    font-size: 13px;
}

.product-item-status {
    flex: 0 0 auto;
}

.product-item-shopping {
    flex: 0 0 auto;
    min-width: 90px;
}

.product-item-actions {
    flex: 0 0 auto;
    margin-left: auto;

    display: flex;
    align-items: center;
}

@media (max-width: 700px) {

    .product-item {
        padding: 10px 16px;
    }

    .product-item-actions {
        margin-left: 0;
    }

}


/* ========================================
   PRESENCE DANS LA LISTE DE COURSES
   ======================================== */

.shopping-entries-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.shopping-entry-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    background: #dbeafe;
    white-space: nowrap;
}

.shopping-entry-badge.shopping-entry-checked {
    color: #6b7280;
    background: #f3f4f6;
    text-decoration: line-through;
}


/* ========================================
   BADGE DE CATEGORIE
   ======================================== */

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2933;
    background: var(--category-color, #DBDBDB);
}


/* ========================================
   SELECTEUR DE COULEUR
   ======================================== */

.category-color-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.color-option {
    cursor: pointer;
    padding: 3px;
}

.color-option input {
    display: none;
}

.color-preview {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: .15s;
}

.custom-color-preview {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 6px !important;
    border: 2px solid transparent;
    transition: .15s;
}

.color-option input:checked + .color-preview {
    border-color: #3b82f6;
    transform: scale(1.15);
}


/* ========================================
   MODALE DE CONFIRMATION
   ======================================== */

.modal-confirm-body {
    padding: 18px;
}

.modal-confirm-body p {
    margin: 0;
    color: #374151;
    line-height: 1.5;
}

.modal-confirm-body .modal-footer {
    margin-top: 20px;
}


/* ========================================
   ICONE ACTIVER / DESACTIVER
   ======================================== */

.btn-toggle-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin-left: 4px;

    border: 0;
    border-radius: 50%;

    font-size: 15px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;

    vertical-align: middle;

    transition: background 0.15s ease, filter 0.15s ease;
}

.btn-toggle-status.is-active {
    color: #166534;
    background: #dcfce7;
}

.btn-toggle-status.is-active:hover {
    background: #bbf7d0;
}

.btn-toggle-status.is-inactive {
    color: #b91c1c;
    background: #fee2e2;
}

.btn-toggle-status.is-inactive:hover {
    background: #fecaca;
}


/* ========================================
   NOTIFICATIONS
   ======================================== */

#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;

    display: flex;
    flex-direction: column;
    gap: 10px;

    max-width: 360px;
}

.notification {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 12px 14px;
    border-radius: 8px;

    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border-left: 4px solid #3b82f6;

    font-size: 14px;
    color: #1f2933;

    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-visible {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left-color: #16a34a;
}

.notification-error {
    border-left-color: #dc2626;
}

.notification-info {
    border-left-color: #3b82f6;
}

.notification-icon {
    flex-shrink: 0;
    font-weight: 700;
}

.notification-success .notification-icon {
    color: #16a34a;
}

.notification-error .notification-icon {
    color: #dc2626;
}

.notification-info .notification-icon {
    color: #3b82f6;
}

.notification-message {
    flex: 1;
    line-height: 1.4;
}

.notification-close {
    flex-shrink: 0;

    background: none;
    border: 0;

    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #9ca3af;
}

.notification-close:hover {
    color: #374151;
}

@media (max-width: 700px) {

    #notification-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

}


/* ========================================
   BOUTONS DE DEFILEMENT HAUT / BAS
   ======================================== */

.scroll-buttons {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1500;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scroll-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;

    background: #20252b;
    color: #fff;

    font-size: 18px;
    line-height: 1;
    cursor: pointer;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.scroll-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-btn:hover {
    background: #3b82f6;
}

@media (max-width: 700px) {

    .scroll-buttons {
        right: 16px;
        bottom: 16px;
    }

}


/* ========================================
   ACTIONS GROUPEES
   ======================================== */

.checkbox-column {
    width: 40px;
    text-align: center !important;
}

.row-checkbox,
.select-all-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.bulk-confirm-list {
    margin: 12px 0 0;
    padding: 0 0 0 20px;

    color: #374151;
    font-size: 14px;
    line-height: 1.7;
}

.bulk-action-bar {
    position: fixed;
    left: 230px;
    right: 0;
    bottom: 0;
    z-index: 1400;

    background: #20252b;
    color: #fff;

    padding: 14px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.2);
}

.bulk-action-count {
    font-size: 14px;
    font-weight: 600;
}

.bulk-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bulk-action-buttons .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.bulk-bar-open .scroll-buttons {
    bottom: 90px;
}

@media (max-width: 700px) {

    .bulk-action-bar {
        left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .bulk-action-buttons {
        flex-wrap: wrap;
    }

    body.bulk-bar-open .scroll-buttons {
        bottom: 140px;
    }

}


/* ========================================
   AJOUT EN MASSE A LA LISTE DE COURSES
   ======================================== */

.modal-bulk-shopping {
    max-width: 560px;
}

.bulk-shopping-list {
    max-height: 340px;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding-right: 4px;
}

.bulk-shopping-row {
    display: grid;
    grid-template-columns: 1fr 70px 150px;
    align-items: center;
    gap: 10px;
}

.bulk-shopping-row-name {
    font-size: 14px;
    color: #1f2937;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bulk-shopping-quantity,
.bulk-shopping-unit {
    width: 100%;

    padding: 6px 8px;

    border: 1px solid #d1d5db;
    border-radius: 5px;

    font-family: inherit;
    font-size: 13px;

    background: #fff;
}

.bulk-shopping-quantity {
    text-align: right;
}

.bulk-shopping-quantity:focus,
.bulk-shopping-unit:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

@keyframes input-error-blink {

    0%, 100% {
        border-color: #d1d5db;
        box-shadow: none;
    }

    50% {
        border-color: #dc2626;
        box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
    }

}

.input-error-blink {
    animation: input-error-blink 0.5s ease;
    border-color: #dc2626;
}

@media (max-width: 700px) {

    .bulk-shopping-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

}


/* ========================================
   BARRE DE RECHERCHE
   ======================================== */

/* ========================================
   MENU DEROULANT "FILTRES"
   ======================================== */

.filters-bar {
    margin-bottom: 12px;
    max-width: 1100px;
}

.filters-dropdown {
    position: relative;
    display: inline-block;
}

.filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filters-toggle-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.filters-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;

    width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

    padding: 16px;
}

.filters-panel.is-open {
    display: block;
}

.filter-group {
    margin-bottom: 14px;
}

.filter-group:last-of-type {
    margin-bottom: 0;
}

.filter-group-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    margin-bottom: 8px;
}

.filter-checkbox-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.filter-checkbox-item input {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.filter-select-all {
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

.filter-select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}

.filters-panel-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.filters-panel-footer .btn {
    width: 100%;
}


/* ========================================
   BARRE DE RECHERCHE
   ======================================== */

.search-bar {
    position: relative;
    margin-bottom: 16px;
    max-width: 1100px;
}

.search-input {
    width: 100%;

    padding: 9px 36px 9px 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    font-family: inherit;
    font-size: 14px;

    background: #fff;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
    outline: none;

    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.search-clear {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);

    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;
    background: transparent;

    color: #9ca3af;
    font-size: 16px;
    line-height: 1;

    cursor: pointer;

    transition: background 0.15s ease, color 0.15s ease;
}

.search-clear:hover {
    background: #f3f4f6;
    color: #374151;
}
