/* ── WAMIE SQPP – Styles globaux ─────────────────────────────────── */

:root {
  --primary: #1a3a5c;
  --accent: #f0a500;
}

body { font-family: 'Segoe UI', sans-serif; font-size: 0.9rem; }

/* Cards */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-radius: 8px; }
.card-header {
  background: #111 !important;
  color: #fff !important;
  border-bottom: none;
  font-weight: 600;
}

/* Stat cards */
.stat-card { border-left: 4px solid var(--accent); }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }

/* Badges statut */
.badge-en_attente   { background: #ffc107; color: #000; }
.badge-en_cours     { background: #0d6efd; }
.badge-terminee, .badge-valide, .badge-payee { background: #198754; }
.badge-annulee, .badge-annule { background: #dc3545; }
.badge-en_retard    { background: #dc3545; }
.badge-planifie     { background: #6c757d; }
.badge-brouillon    { background: #adb5bd; color: #000; }
.badge-emise        { background: #0dcaf0; color: #000; }

/* ── Scroll wrappers injectés par JS autour de chaque tableau ──
   .table-scroll-wrap  → scroll horizontal uniquement
   .table-scroll-body  → scroll vertical uniquement (max 10 lignes)
   Séparation des deux axes = position:sticky fonctionne sur thead th     */
.table-scroll-wrap {
  overflow-x: auto;
}
.table-scroll-body {
  overflow-y: auto;
  max-height: 370px;  /* ≈ 10 lignes table-sm à 33px/ligne */
}

/* Tables : en-têtes fixes dans .table-scroll-body */
.table thead tr th {
  background: #111 !important;
  color: #fff !important;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-color: #333 !important;
  position: sticky;
  top: 0;
  z-index: 10;
}
.table td { vertical-align: middle; }

/* ── Barre actions/filtres — fixe sur la page ── */
.sticky-bar {
  position: sticky;
  top: 74px;          /* navbar + breadcrumb */
  z-index: 300;
  background: #f4f6f9;
  padding-bottom: 6px;
  padding-top: 2px;
}

/* Formulaires */
.form-label { font-weight: 500; font-size: 0.85rem; }
.required::after { content: ' *'; color: red; }

/* Ligne dynamique */
.ligne-commande { background: #f9f9f9; border-radius: 6px; padding: 8px 12px; margin-bottom: 6px; }

/* Ligne de filtres (inputs) dans le thead — fixe sous la 1re ligne header */
.filter-row th { background: #f0f4f8 !important; color: #333 !important; padding: 4px 4px !important; position: sticky; top: 33px; z-index: 9; }
.filter-row input, .filter-row select {
  font-size: 0.72rem; padding: 2px 5px; height: 24px;
  border: 1px solid #ccc; border-radius: 3px; width: 100%;
  background: #fff;
}
.filter-row input:focus, .filter-row select:focus { border-color: #2d6a9f; outline: none; box-shadow: none; }

/* ── Boutons : outline → plein ───────────────────────────────────── */
.btn-outline-primary   { background:#0d6efd;  color:#fff !important; border-color:#0d6efd;  }
.btn-outline-secondary { background:#6c757d;  color:#fff !important; border-color:#6c757d;  }
.btn-outline-success   { background:#198754;  color:#fff !important; border-color:#198754;  }
.btn-outline-danger    { background:#dc3545;  color:#fff !important; border-color:#dc3545;  }
.btn-outline-warning   { background:#ffc107;  color:#000 !important; border-color:#ffc107;  }
.btn-outline-info      { background:#0dcaf0;  color:#000 !important; border-color:#0dcaf0;  }
.btn-outline-dark      { background:#212529;  color:#fff !important; border-color:#212529;  }
.btn-outline-light     { background:#f8f9fa;  color:#000 !important; border-color:#dee2e6;  }

.btn-outline-primary:hover   { background:#0b5ed7; border-color:#0b5ed7; }
.btn-outline-secondary:hover { background:#5c636a; border-color:#5c636a; }
.btn-outline-success:hover   { background:#157347; border-color:#157347; }
.btn-outline-danger:hover    { background:#b02a37; border-color:#b02a37; }
.btn-outline-warning:hover   { background:#e0a800; border-color:#e0a800; }
.btn-outline-info:hover      { background:#31d2f2; border-color:#31d2f2; }
.btn-outline-dark:hover      { background:#1a1e21; border-color:#1a1e21; }

/* Bouton extra-petit */
.btn-xs { font-size: 0.7rem; padding: 1px 5px; line-height: 1.4; border-radius: 3px; }

/* Impression */
@media print {
  .top-navbar, .breadcrumb-bar, .btn, .alert { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
