/* =====================================================================================
   PRD-2 — L'ATELIER.

   ⚠️⚠️ TOUT EST BORNÉ À `.atl-`, ET AUCUN SÉLECTEUR DE BALISE NUE.
      Ce dépôt a payé DEUX FOIS un style posé sur un conteneur partagé (T-UI : `.btn-filtres`,
      puis `.crud-toolbar-actions`) et UNE FOIS une classe partagée (`icon-btn-edit`, CAT) — à
      chaque fois sur des écrans que la tranche ne touchait même pas.
      ⭐ Et un préfixe protège les CLASSES, pas les BALISES : les composants partagés (PageHeader,
      TracabiliteLigne, Modal…) sont rendus DANS ces pages et hériteraient de tout sélecteur large.

   ⚠️ Aucune couleur en dur : tout vient des tokens `:root` du design system.
   ===================================================================================== */

/* ------------------------------------------------------------------ LA LISTE */
.atl-liste {
    max-width: 1280px;
    margin: 0 auto;
}

.atl-filtre {
    max-width: 190px;
}

/* Les trois statuts, chacun sa teinte pastel — ⚠️ le ROUGE n'est PAS utilisé : aucun des trois
   n'est un problème. Le rouge de ce dépôt signale un impayé ou un manque, et l'employer pour un
   état normal ferait cesser de le lire (leçon RG-LISTES). */
.atl-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.atl-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.atl-badge-plan  { background: var(--paper);      color: var(--slate); }
.atl-badge-cours { background: var(--amber-soft); color: var(--amber); }
.atl-badge-fini  { background: var(--teal-soft);  color: var(--teal-dark); }

/* ------------------------------------------------------------------ LE DOCUMENT */
.atl-doc {
    max-width: 1280px;
    margin: 0 auto;
}

.atl-vide {
    color: var(--slate);
    padding: 24px 0;
}

.atl-cartes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 14px 0;
}

@media (max-width: 900px) {
    .atl-cartes { grid-template-columns: 1fr; }
}

.atl-carte {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
}

.atl-carte-titre {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--slate);
    margin-bottom: 12px;
}

.atl-champ {
    margin-bottom: 12px;
}

.atl-champ label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--slate);
    margin-bottom: 4px;
}

.atl-verrou {
    display: inline-block;
    padding: 7px 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
}

.atl-enregistrer {
    margin-top: 4px;
}

.atl-op {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.atl-hint {
    font-size: 12px;
    color: var(--slate);
    margin: 8px 0 0;
}

/* ------------------------------------------------------------------ LES DEUX MODES */
.atl-bande {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 3px solid var(--teal);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.atl-bande-titre {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--slate);
    width: 100%;
}

.atl-sep {
    color: var(--slate);
    font-size: 13px;
    padding: 0 4px;
}

.atl-nom-select { max-width: 340px; }
.atl-qte        { max-width: 120px; }

@media (max-width: 768px) {
    .atl-bande { flex-direction: column; align-items: stretch; }
    .atl-nom-select, .atl-qte { max-width: none; }
}

/* ------------------------------------------------------------------ L'IMPORT */
.atl-import {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.atl-bp {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
}

.atl-bp-tete {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.atl-bp-prod {
    font-size: 12px;
    color: var(--slate);
    margin-left: auto;
}

.atl-bp-sans {
    margin-top: 6px;
    font-size: 12px;
    color: var(--amber);
}

/* ------------------------------------------------------------------ LES BLOCS */
.atl-bloc {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.atl-bloc-titre {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--slate);
    margin-bottom: 10px;
}

.atl-bloc-sub {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

/* ⚠️ Le tableau défile DANS SON PROPRE cadre — la PAGE ne déborde jamais (patron du dépôt). */
.atl-table {
    width: 100%;
}

.atl-manque {
    background: var(--amber-soft);
}

.atl-manque-tag {
    color: var(--amber);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.atl-ok {
    color: var(--teal-dark);
    font-weight: 600;
}

/* ------------------------------------------------------------------ LES CHARGES */
.atl-charge-groupe {
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 8px;
}

.atl-charge-tete {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}

.atl-charge {
    display: grid;
    grid-template-columns: 1fr 120px 120px 90px;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

@media (max-width: 768px) {
    .atl-charge { grid-template-columns: 1fr 1fr; }
}

.atl-charge-reel {
    max-width: 120px;
}

.atl-ecart {
    color: var(--amber);
    font-weight: 600;
}

/* ------------------------------------------------------------------ LES MESSAGES */
.atl-msg {
    border-radius: 10px;
    padding: 10px 14px;
    margin: 10px 0;
    font-size: 13.5px;
}

.atl-msg-ok   { background: var(--teal-soft);  color: var(--teal-dark); }
.atl-msg-err  { background: var(--red-soft);   color: var(--red); }
.atl-msg-warn { background: var(--amber-soft); color: var(--amber); }

/* ⚠️⚠️ LA PORTÉE — la phrase qui empêche de croire que le stock a bougé. Ton NEUTRE et non une
   alerte : ce n'est pas un problème, c'est le périmètre de la tranche. */
.atl-portee {
    background: var(--paper);
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--slate);
    margin-bottom: 20px;
}

/* PRD-6 — la note SOUS la case des charges. Ton neutre : elle dit ce que la case NE fait PAS
   (les coûts d'entrée ne s'impriment jamais), pas une alerte. Sans cette définition la classe
   serait FANTÔME et la note s'afficherait nue — le défaut que la garde CSS de T-GARDES attrape. */
.atl-print-note {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--slate);
}
