/* Application DA — feuille de style principale */
:root {
  --da-bleu: #1f3a5f;
  --da-bleu-clair: #e8eef5;
  --da-ajout: #1e7e34;
  --da-ajout-fond: #d1f2dc;
  --da-annul: #b42318;
  --da-annul-fond: #f9d6d5;
  --da-gris: #6b7280;
  --sidebar-l: 240px;
}

body { background: #f4f6f9; font-size: .925rem; }

/* ---- Barre latérale ---- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-l);
  background: var(--da-bleu); color: #fff; overflow-y: auto; z-index: 1030;
}
.sidebar .marque { padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .marque .titre { font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; }
.sidebar .marque .sous-titre { font-size: .75rem; opacity: .7; }
.sidebar .section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; padding: 1rem 1.25rem .35rem; }
.sidebar a.nav-link { color: rgba(255,255,255,.85); padding: .5rem 1.25rem; display: flex; align-items: center; gap: .6rem; border-left: 3px solid transparent; }
.sidebar a.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.nav-link.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #7fb3ff; font-weight: 600; }
.sidebar .nav-link .badge { margin-left: auto; }
.contenu { margin-left: var(--sidebar-l); min-height: 100vh; }
.entete { background: #fff; border-bottom: 1px solid #e5e7eb; padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.entete .utilisateur { margin-left: auto; font-size: .85rem; color: var(--da-gris); }
main { padding: 1.5rem; }
@media (max-width: 991px) {
  .sidebar { position: static; width: 100%; }
  .contenu { margin-left: 0; }
}

h1.page { font-size: 1.4rem; font-weight: 700; color: var(--da-bleu); margin-bottom: 0; }
.sous-titre-page { color: var(--da-gris); font-size: .9rem; }
.card { border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-header { background: #fff; font-weight: 600; }
.table { font-size: .875rem; }
.table thead th { background: var(--da-bleu-clair); color: var(--da-bleu); font-weight: 600; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }

/* ---- Grandes actions du tableau de bord ---- */
.action-tuile { display: block; text-decoration: none; color: inherit; border-radius: .6rem; padding: 1.1rem; background: #fff; border: 1px solid #e5e7eb; transition: all .15s; height: 100%; }
.action-tuile:hover { border-color: var(--da-bleu); box-shadow: 0 4px 14px rgba(31,58,95,.12); transform: translateY(-1px); }
.action-tuile .icone { font-size: 1.7rem; color: var(--da-bleu); }
.action-tuile .etape { font-size: .7rem; font-weight: 700; color: #fff; background: var(--da-bleu); border-radius: 999px; padding: .1rem .55rem; }
.action-tuile .titre { font-weight: 700; margin-top: .4rem; }
.action-tuile .aide { font-size: .8rem; color: var(--da-gris); }

/* ---- Ajouts / annulations : repérage visuel ---- */
.badge-ajout { background: var(--da-ajout); color: #fff; }
.badge-annulation { background: var(--da-annul); color: #fff; }
.badge-supprimee { background: #374151; color: #fff; }
tr.ligne-ajout > td { background: var(--da-ajout-fond) !important; }
tr.ligne-annulation > td { background: var(--da-annul-fond) !important; }
tr.ligne-annulee-totale > td { text-decoration: line-through; color: #7f1d1d; }
.qte-ajout { color: var(--da-ajout); font-weight: 700; }
.qte-annul { color: var(--da-annul); font-weight: 700; }
.qte-finale { font-weight: 700; }
.bandeau-modifs { border-radius: .5rem; padding: .85rem 1.1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.bandeau-modifs.avec { background: #fff7e6; border: 2px solid #f59e0b; }
.bandeau-supprimee { background: #f3f4f6; border: 2px dashed #6b7280; border-radius: .5rem; padding: .85rem 1.1rem; }
.categorie-ligne > td { background: #f1f5f9 !important; font-weight: 700; color: var(--da-bleu); text-transform: uppercase; font-size: .78rem; letter-spacing: .04em; }

.formset-table td { vertical-align: top; }
.formset-table .form-control-sm { min-width: 90px; }
.saisie-article { min-width: 170px; }
.errorlist { color: var(--da-annul); font-size: .8rem; list-style: none; padding: 0; margin: .2rem 0 0; }

.page-connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f3a5f 0%, #2f5d8f 100%); }
.page-connexion .card { width: 100%; max-width: 400px; }

