/**
 * Widget de recherche d'entreprise — styles neutres.
 *
 * Le widget vit aussi bien dans l'administration que dans la caisse (tablette tactile) :
 * les tailles de cible respectent l'usage au doigt, et rien n'impose de couleur de
 * marque pour ne pas jurer selon le contexte d'accueil.
 */

.wddp-entreprise-widget {
    margin: 0 0 1em;
}

.wddp-entreprise-widget .wddp-ent-q {
    width: 100%;
    max-width: 34em;
    min-height: 2.6em;
    padding: 0.5em 0.7em;
    font-size: 1em;
    box-sizing: border-box;
}

.wddp-entreprise-widget .wddp-ent-aide {
    margin: 0.35em 0 0;
    font-size: 0.85em;
    opacity: 0.7;
}

.wddp-ent-res {
    margin-top: 0.6em;
    max-width: 44em;
}

.wddp-ent-res:empty {
    display: none;
}

/*
 * Un résultat = un bouton pleine largeur.
 *
 * L'ancien affichage juxtaposait un petit bouton « Remplir » et une ligne de texte : au
 * doigt, sur tablette, la cible était trop petite et le texte cliquable ne l'était pas.
 */
.wddp-ent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8em;
    width: 100%;
    margin: 0 0 0.4em;
    padding: 0.7em 0.9em;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    font: inherit;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.wddp-ent-item:hover,
.wddp-ent-item:focus-visible {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.wddp-ent-infos {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    min-width: 0;
}

.wddp-ent-nom {
    font-weight: 700;
}

.wddp-ent-alias {
    font-weight: 400;
    opacity: 0.85;
}

.wddp-ent-meta {
    font-size: 0.85em;
    opacity: 0.75;
}

.wddp-ent-badge {
    display: inline-block;
    margin-left: 0.5em;
    padding: 0.05em 0.45em;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.18);
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* Établissement fermé : l'information doit sauter aux yeux avant le clic. */
.wddp-ent-badge--ko {
    background: #fee2e2;
    color: #b91c1c;
}

/* Cible tactile confortable : le POS s'utilise au doigt sur tablette. */
.wddp-ent-cta {
    flex: 0 0 auto;
    padding: 0.45em 1em;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 0.9em;
    font-weight: 700;
    white-space: nowrap;
}

.wddp-ent-statut {
    margin: 0.5em 0 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.wddp-ent-statut:empty {
    display: none;
}

.wddp-ent-statut.is-ok {
    color: #15803d;
}

/* « Attente » et « info » restent sobres : rien d'anormal ne s'est produit. */
.wddp-ent-statut.is-attente,
.wddp-ent-statut.is-info {
    opacity: 0.8;
}

.wddp-ent-actions {
    margin-top: 0.4em;
}

.wddp-ent-actions:empty {
    display: none;
}

.wddp-ent-forcer {
    min-height: 2.4em;
    padding: 0.4em 1em;
    cursor: pointer;
}

/* ─── Bouton « Chercher le n° », sous le champ de TVA ───
   Posé à côté du champ plutôt que dans le widget : c'est là qu'on le cherche. Discret —
   ce n'est pas l'action principale de la fiche. */
.wddp-tva-ligne {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0.4em 0 0;
}

.wddp-tva-btn {
    flex-shrink: 0;
    cursor: pointer;
}

.wddp-tva-note {
    font-size: 12px;
    line-height: 1.35;
    color: #64748b;
}

.wddp-tva-note.is-ok {
    color: #047857;
}

.wddp-tva-note.is-attente {
    color: #92400e;
}
