﻿.form-card {
    max-width: 760px;
    margin: 2rem auto;
    padding: 2rem 2.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.08);
}

    .form-card h1 {
        margin: 0 0 1.5rem;
        font-size: 1.6rem;
        font-weight: 700;
        color: #111827;
    }

.form-grid {
    display: grid;
    /* minmax(0, …) : une liste déroulante au texte long ne fait plus déborder la colonne hors de la carte */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

    .field select.input {
        width: 100%;
        min-width: 0;
        text-overflow: ellipsis;
    }

    .field.full {
        grid-column: 1 / -1;
    }

    .field.checks {
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }

    .field label {
        font-size: 0.85rem;
        font-weight: 500;
        color: #475569;
    }

.input {
    height: 2.4rem;
    padding: 0 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

    .input:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }

.form-error {
    margin-top: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.5rem;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    height: 2.4rem;
    padding: 0 1.1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    border: 1px solid #2563eb;
    color: #fff;
}

    .btn-primary:disabled {
        opacity: 0.6;
        cursor: default;
    }

.btn-secondary {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

/* action définitive (ex. annuler un bon de commande) */
.btn-danger {
    display: inline-flex;
    align-items: center;
    height: 2.4rem;
    padding: 0 1.1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

    .btn-danger:hover {
        background: #fef2f2;
    }

    .btn-danger:disabled {
        opacity: 0.6;
        cursor: default;
    }

/* ===== Formulaire large avec lignes (ex. bon de commande) ===== */
.form-card.wide {
    max-width: 1400px;
}

.form-section-title {
    margin: 1.75rem 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #111827;
}

.lines-table .input {
    width: 100%;
    min-width: 0;
    height: 2.1rem;
    padding: 0 0.4rem;
    font-size: 0.9rem;
}

.lines-table td {
    vertical-align: middle;
}

.lines-table .num {
    text-align: right;
    white-space: nowrap;
}

.lines-tools {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.lines-total {
    margin-top: 0.75rem;
    text-align: right;
    font-weight: 600;
}

/* petit texte d'aide sous un champ (ex. « 4 no d'inventaire ») */
.hint {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

/* message de succès (ex. « Réception enregistrée ») */
.form-success {
    margin-top: 1rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.9rem;
}

/* numéros d'inventaire sous une ligne de réception */
.inventory-table {
    width: auto;
    min-width: 32rem;
}

    .inventory-table .btn-secondary {
        padding: 0.2rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

/* regroupe des champs (ex. pour les désactiver d'un coup) sans changer l'apparence */
.plain-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

/* icône dans un bouton (imprimer, PDF, ajouter, rechercher…) : un peu d'espace avant le texte */
.btn-primary > .bi,
.btn-secondary > .bi,
.btn-danger > .bi {
    margin-right: 0.45rem;
}

    /* bouton du logo : l'espace vient déjà de son « gap » */
    .btn-secondary.logo-upload > .bi {
        margin-right: 0;
    }

/* ===== Rôles et permissions ===== */
.permission-grid th.center,
.permission-grid td.center {
    text-align: center;
    width: 4.5rem;
}

.permission-grid th.role-head {
    border-left: 2px solid #e2e8f0;
}

.permission-grid td .hint {
    font-weight: 400;
}

.permission-grid input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

    .permission-grid input[type="checkbox"]:disabled {
        cursor: default;
    }

/* ===== Recherche d'inventaire ===== */
.search-hint {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: #475569;
}

.search-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
    .search-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.search-criteria {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

.search-criteria-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.search-chip {
    padding: 0.2rem 0.65rem;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    font-size: 0.82rem;
    color: #1e3a8a;
}

    .search-chip.muted {
        border-color: #e2e8f0;
        background: #f8fafc;
        color: #64748b;
    }

/* quantité d'un mouvement : entrée en vert, sortie en rouge */
.qty-in {
    color: #166534;
}

.qty-out {
    color: #b91c1c;
}

.search-truncated {
    margin-left: 1rem;
    color: #b45309;
}

/* message placé en haut du formulaire (composant TopMessage) */
.form-error.form-top,
.form-success.form-top {
    margin: 0 0 1rem;
}

/* ===== Encadré « créer un nouvel élément » (ex. page Étiquettes) ===== */
.create-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding: 1.1rem 1.25rem;
    border: 2px dashed #93c5fd;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}

.create-box-icon {
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.create-box-body {
    flex: 1;
    min-width: 0;
}

.create-box-title {
    margin: 0.1rem 0 0.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3a8a;
}

.create-box-hint {
    margin: 0 0 0.8rem;
    font-size: 0.85rem;
    color: #475569;
}

.create-box-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

    .create-box-row .field {
        min-width: 14rem;
    }

/* ===== Logo de la compagnie (page Profil) ===== */
.logo-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

.logo-frame {
    flex: 0 0 auto;
    width: 9rem;
    height: 9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.10);
    overflow: hidden;
}

    .logo-frame img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .logo-frame i {
        font-size: 3.5rem;
        color: #cbd5e1;
    }

.logo-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.logo-company {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    overflow-wrap: anywhere;
}

.logo-hint {
    font-size: 0.8rem;
    color: #64748b;
}

.logo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.logo-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

    .logo-upload.disabled {
        opacity: 0.6;
        pointer-events: none;
    }

@media (max-width: 640.98px) {
    .logo-card {
        flex-direction: column;
        text-align: center;
    }

    .logo-actions {
        justify-content: center;
    }
}


/* ---------- ComboBox : liste déroulante où l'on peut écrire ---------- */
.combo {
    position: relative;
}

    .combo .combo-input {
        width: 100%;
    }

.combo-list {
    position: fixed;          /* top / left posés par ComboBox : pas coupée par un tableau qui défile */
    z-index: 1050;
    max-height: 16rem;
    overflow-y: auto;
    margin: 2px 0 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.15);
    font-size: 0.9rem;
}

    .combo-list li {
        padding: 0.35rem 0.75rem;
        cursor: pointer;
        white-space: nowrap;
    }

        .combo-list li:hover,
        .combo-list li.active {
            background: #eff6ff;
        }

        .combo-list li.selected {
            font-weight: 600;
        }

        .combo-list li.empty {
            color: #94a3b8;
            cursor: default;
        }