/*
 * Socle visuel commun (revue UI 2026-11, lot 4) : chargé en dernier (templates/base.html.twig), il aligne les écrans
 * construits à des moments différents sans toucher à leur structure.
 *  - Onglets : une seule barre segmentée de 44 px (sorders, cond, labels, users, plan du paletier, sites) ;
 *  - compteurs gris neutre dans les onglets ;
 *  - recherche / scan : même hauteur, même rayon, bouton accolé ;
 *  - retour : « ← page parente », même style partout ;
 *  - titres h1 24 px, en-têtes de tableau 13,5 px en gras ;
 *  - états standard : vide (.sorders-empty, .cond-empty), chargement (.is-loading), désactivé (layout.css) ;
 *  - largeur de contenu commune (1280 px) pour les écrans métier.
 * Couleurs des actions : layout.css (vert = mouvement de stock / valider, bleu = neutre, jaune plein = signal).
 */
:root {
    --ui-ink: #212529;
    --ui-muted: #5f6b78;
    --ui-line: #dee2e6;
    --ui-soft: #eef1f4;
    --ui-blue: #0062cc;
    --ui-navy: #0b3a6e;
    --ui-radius: 10px;
}

/* ---------- Onglets ---------- */
.sorders-tabs, .cond-tabs, .labels-tabs, .users-tabs, .site-filters, .rk-switch, .rk-aisles {
    display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin: 4px 0 12px;
    border-radius: var(--ui-radius); background: var(--ui-soft);
}
.page a.sorders-tabs__tab, .page a.cond-tabs__tab, .page a.labels-tabs__tab, .page a.users-tabs__tab, .page .site-filters a,
.rk-switch button, .rk-aisles button {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px;
    border: 0; border-radius: 8px; background: transparent; color: var(--ui-ink); font-weight: 600; font-size: .95rem;
    line-height: 1.2; white-space: nowrap; text-decoration: none; box-shadow: none;
}
.page a.sorders-tabs__tab:hover, .page a.cond-tabs__tab:hover, .page a.labels-tabs__tab:hover, .page a.users-tabs__tab:hover, .page .site-filters a:hover,
.rk-switch button:hover, .rk-aisles button:hover { background: rgba(255, 255, 255, .6); color: var(--ui-ink); text-decoration: none; }
.page a.sorders-tabs__tab.is-active, .page a.cond-tabs__tab.is-active, .page a.labels-tabs__tab.is-active, .page a.users-tabs__tab.is-active,
.page .site-filters a.is-active, .rk-switch button.is-active, .rk-aisles button.is-active {
    background: #fff; color: var(--ui-navy); box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
}
/* Compteurs des onglets : gris neutre (la couleur reste réservée aux signaux) */
.page a.cond-tabs__tab span, .page a.sorders-tabs__tab .sorders-muted, .users-tabs__count {
    margin: 0; padding: 1px 8px; border-radius: 10px; background: rgba(0, 0, 0, .07); color: var(--ui-muted); font-size: .82rem; font-weight: 600;
}
.page a.cond-tabs__tab.is-active span, .page a.sorders-tabs__tab.is-active .sorders-muted { background: #e3ebf5; color: var(--ui-navy); }

/* ---------- Recherche / scan ---------- */
.zones-search, .cond-scan, .labels-filters__search, .users-filters__search { display: flex; align-items: stretch; gap: 6px; }
.zones-search > .form-control, .cond-scan > .form-control, .sorders-filters .form-control, .labels-filters .form-control {
    min-height: 44px; border-radius: 8px; font-size: 1rem;
}
.zones-search > .btn, .cond-scan > .btn { min-height: 44px; min-width: 48px; border-radius: 8px; }

/* ---------- Retour à la page parente ---------- */
.page a.sorders-back, .page a.cond-back {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-bottom: 10px;
    color: var(--ui-blue); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.page a.sorders-back:hover, .page a.cond-back:hover { text-decoration: underline; }

/* ---------- Titres et tableaux ---------- */
.sorders-head__title, .cond h1, .page h1.page-title { font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: var(--ui-ink); }
.sorders-table thead th, .cond-table thead th, .inv-table thead th {
    font-size: .845rem; font-weight: 700; color: #343a40; text-transform: none; letter-spacing: 0; border-bottom: 2px solid var(--ui-line);
}

/* ---------- Pastilles d'état : une forme ---------- */
.sorders-badge, .sorders-status, .cond-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; line-height: 1.5;
}

/* ---------- États standard ---------- */
.sorders-empty, .cond-empty {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; border: 1px dashed var(--ui-line);
    border-radius: var(--ui-radius); background: #fafbfc; color: var(--ui-muted); text-align: center;
}
.sorders-empty i, .cond-empty i { font-size: 2rem; color: #adb5bd; opacity: 1; }
.sorders-empty p { margin: 0; max-width: 560px; }
.is-loading { position: relative; pointer-events: none; opacity: .65; }
.is-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
    border: 3px solid var(--ui-blue); border-right-color: transparent; border-radius: 50%; animation: ui-spin .7s linear infinite;
}
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* ---------- Largeur commune des écrans métier ---------- */
.sorders, .cond, .zones, .inv { max-width: 1280px; }

/* ---------- Menu latéral en tiroir (petits écrans et tablettes) : par-dessus la page, fond assombri ---------- */
@media (max-width: 1199.98px), (min-width: 1200px) and (max-width: 1400px) and (pointer: coarse) {
    .sidenav.show {
        position: fixed; top: 64px; left: 0; bottom: 0; z-index: 1045; display: block !important;
        width: 320px; max-width: 86vw; max-height: none; margin: 0; border-radius: 0 12px 12px 0;
        overflow-y: auto; box-shadow: 4px 0 24px rgba(0, 0, 0, .35);
    }
    .drawer-backdrop { position: fixed; inset: 64px 0 0 0; z-index: 1040; background: rgba(0, 0, 0, .45); }
    body.drawer-open { overflow: hidden; }
}
