/* =====================================================================
   ALLIANCES COSMETIQUE — socle d'interface
   Grille, composants et utilitaires. Aucune dépendance externe :
   l'application fonctionne sans accès à Internet.
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.5; }
img, svg { vertical-align: middle; max-width: 100%; }
h1, h2, h3, h4, h5, h6, p, figure { margin: 0 0 .5rem; }
ul, ol { margin: 0 0 .5rem; padding-left: 1.4rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Grille ---------------------------------------------------- */
.container-fluid { width: 100%; padding: 0 1rem; margin: 0 auto; }

.row { display: flex; flex-wrap: wrap; margin: 0 -.5rem; }
.row > * { padding: 0 .5rem; width: 100%; }

.g-1 { margin: -.125rem -.125rem 0; } .g-1 > * { padding: .125rem; }
.g-2 { margin: -.25rem -.25rem 0; }   .g-2 > * { padding: .25rem; }
.g-3 { margin: -.5rem -.5rem 0; }     .g-3 > * { padding: .5rem; }

.col       { flex: 1 0 0%; width: auto; }
.col-auto  { flex: 0 0 auto; width: auto; }
.col-1  { flex: 0 0 auto; width: 8.3333%; }
.col-2  { flex: 0 0 auto; width: 16.6667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.3333%; }
.col-5  { flex: 0 0 auto; width: 41.6667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.3333%; }
.col-8  { flex: 0 0 auto; width: 66.6667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; }
.col-11 { flex: 0 0 auto; width: 91.6667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
  .col-sm-6 { flex: 0 0 auto; width: 50%; }
  .d-sm-inline { display: inline !important; }
}

@media (min-width: 768px) {
  .col-md-auto { flex: 0 0 auto; width: auto; }
  .col-md-1  { flex: 0 0 auto; width: 8.3333%; }
  .col-md-2  { flex: 0 0 auto; width: 16.6667%; }
  .col-md-3  { flex: 0 0 auto; width: 25%; }
  .col-md-4  { flex: 0 0 auto; width: 33.3333%; }
  .col-md-5  { flex: 0 0 auto; width: 41.6667%; }
  .col-md-6  { flex: 0 0 auto; width: 50%; }
  .col-md-7  { flex: 0 0 auto; width: 58.3333%; }
  .col-md-8  { flex: 0 0 auto; width: 66.6667%; }
  .col-md-9  { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
  .d-md-inline { display: inline !important; }
  .mt-md-4 { margin-top: 1.5rem !important; }
}

@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
  .d-lg-none { display: none !important; }
}

/* ---------- Utilitaires ------------------------------------------------ */
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }
.w-100 { width: 100% !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }
.text-nowrap { white-space: nowrap !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.small { font-size: .85em; }
.h5 { font-size: 1.1rem; font-weight: 600; }

.gap-1 { gap: .25rem !important; } .gap-2 { gap: .5rem !important; } .gap-3 { gap: 1rem !important; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }     .mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; } .mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: .25rem !important; }   .mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }     .mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: .25rem !important; } .me-2 { margin-right: .5rem !important; }
.p-0 { padding: 0 !important; }  .p-3 { padding: 1rem !important; }
.pb-0 { padding-bottom: 0 !important; }

/* ---------- Tableaux ---------------------------------------------------- */
.table > thead > tr > th,
.table > tbody > tr > td,
.table > tfoot > tr > td { padding: .5rem .75rem; text-align: left; }
.table > thead > tr > th { font-weight: 600; }
.table > tbody > tr > td { border-top: 1px solid #f0eeeb; }
.table-sm > thead > tr > th, .table-sm > tbody > tr > td { padding: .35rem .5rem; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.align-middle td, .align-middle th { vertical-align: middle; }

/* ---------- Formulaires -------------------------------------------------- */
.form-label { display: block; }
.form-control, .form-select {
  display: block; width: 100%; background: #fff;
  border: 1px solid #dcd9d4; border-radius: 7px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.form-select {
  appearance: none; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236d747c' stroke-width='1.6' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 14px;
}
.form-control[type=file] { padding: .3rem .5rem; }
.form-control:disabled, .form-select:disabled { background: #f4f2ef; color: #7b8087; }
textarea.form-control { min-height: 4.5rem; resize: vertical; }
.form-control-sm, .form-select-sm { padding: .28rem .5rem !important; font-size: .82rem !important; }
.form-select-sm { padding-right: 1.8rem !important; }

.input-group { display: flex; width: 100%; }
.input-group > .form-control, .input-group > .form-select { flex: 1 1 auto; width: 1%; border-radius: 7px 0 0 7px; }
.input-group > .input-group-text { display: flex; align-items: center; padding: .42rem .7rem;
  border: 1px solid #dcd9d4; border-left: 0; border-radius: 0 7px 7px 0; white-space: nowrap; }
.input-group-sm > .form-control, .input-group-sm > .input-group-text { padding: .28rem .5rem; font-size: .82rem; }

.form-check { display: block; min-height: 1.4rem; padding-left: 1.6rem; position: relative; }
/* Case à cocher : positionnée à gauche de son libellé dans un bloc .form-check,
   affichée normalement partout ailleurs (cellules de tableau, lignes de document). */
.form-check-input { position: static; display: inline-block; vertical-align: middle;
  width: 1.1rem; height: 1.1rem; margin: 0; accent-color: #b08a53; cursor: pointer; }
.form-check > .form-check-input { position: absolute; left: 0; top: .2rem; width: 1rem; height: 1rem; }
.form-check-label { cursor: pointer; }
.form-switch { padding-left: 2.6rem; }
.form-switch > .form-check-input { width: 2rem; height: 1.1rem; top: .15rem; border-radius: 1rem; }

/* ---------- Boutons ------------------------------------------------------- */
.btn {
  display: inline-block; text-align: center; vertical-align: middle;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap; line-height: 1.45;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: .3rem .6rem !important; font-size: .8rem !important; }

.btn-outline-secondary { color: #4a5057; border-color: #d5d2cd; background: #fff; }
.btn-outline-secondary:hover, .btn-outline-secondary.active { background: #f0ece6; color: #2b2b2b; }
.btn-outline-danger { color: #b3413a; border-color: #e3c4c2; background: #fff; }
.btn-outline-danger:hover { background: #b3413a; color: #fff; }
.btn-outline-success { color: #2f7d5d; border-color: #bcd9cc; background: #fff; }
.btn-outline-success:hover { background: #2f7d5d; color: #fff; }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.35); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-close {
  width: 1.4rem; height: 1.4rem; padding: 0; border: 0; border-radius: 4px; opacity: .5; cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath stroke='%23000' stroke-width='1.6' d='M3 3l10 10M13 3L3 13'/%3E%3C/svg%3E") center/.7rem no-repeat;
}
.btn-close:hover { opacity: .9; }
.alert-dismissible { position: relative; padding-right: 2.6rem; }
.alert-dismissible .btn-close { position: absolute; top: .55rem; right: .6rem; }

.btn-group { display: inline-flex; vertical-align: middle; }
.btn-group > .btn { border-radius: 0; margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
.btn-group > .btn:last-child { border-radius: 0 7px 7px 0; }
.btn-group > .btn:only-child { border-radius: 7px; }
.btn-group > .btn.active { position: relative; z-index: 1; }

/* ---------- Badges, alertes ------------------------------------------------ */
.badge { display: inline-block; border-radius: 5px; line-height: 1.4; white-space: nowrap; }
.text-bg-secondary { background: #eceae7; color: #4a5057; }
.text-bg-light     { background: #f4f2ef; color: #4a5057; }
.text-bg-success   { background: #e2f0e9; color: #1d5a42; }
.text-bg-danger    { background: #fbe4e2; color: #8c302b; }
.text-bg-warning   { background: #fbeed3; color: #7d5c1c; }
.text-bg-info      { background: #f4ecdf; color: #6f552f; }
.text-bg-primary   { background: #e4e6e8; color: #2f3338; }

.alert { position: relative; }
.fade { transition: opacity .15s linear; }
.fade:not(.show) { opacity: 0; }

/* ---------- Barre de navigation --------------------------------------------- */
.navbar { display: flex; align-items: center; }
.navbar .container-fluid { display: flex; align-items: center; }
.navbar-brand { display: inline-flex; align-items: center; }
.sticky-top { position: sticky; top: 0; z-index: 30; }

/* ---------- Panneau latéral mobile -------------------------------------------- */
@media (max-width: 991.98px) {
  .offcanvas-lg {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: 280px;
    background: #fff; transform: translateX(-100%); transition: transform .25s ease;
    display: flex; flex-direction: column; box-shadow: 2px 0 20px rgba(0,0,0,.18); visibility: hidden;
  }
  .offcanvas-lg.affiche { transform: none; visibility: visible; }
  .offcanvas-header { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid #e4e2de; }
  .offcanvas-body { flex: 1 1 auto; overflow-y: auto; }
  .voile { position: fixed; inset: 0; background: rgba(20,18,15,.45); z-index: 45; }
}
@media (min-width: 992px) {
  .offcanvas-header { display: none; }
  .offcanvas-body { display: flex; }
}

/* ---------- Repli / dépliement ------------------------------------------------- */
.collapse:not(.affiche) { display: none; }
tr.collapse.affiche { display: table-row; }

/* ---------- Menu déroulant ------------------------------------------------------ */
.dropdown, .btn-group { position: relative; }
.dropdown-toggle::after {
  content: ''; display: inline-block; margin-left: .4em; vertical-align: .15em;
  border-top: .3em solid; border-right: .3em solid transparent; border-left: .3em solid transparent;
}
.dropdown-menu {
  position: absolute; top: 100%; left: 0; z-index: 40; display: none; min-width: 12rem;
  padding: .3rem 0; margin-top: .25rem; background: #fff;
  border: 1px solid #e4e2de; border-radius: 8px; box-shadow: 0 8px 24px rgba(20,18,15,.12);
  list-style: none;
}
.dropdown-menu.affiche { display: block; }
.dropdown-menu-end { left: auto; right: 0; }
.dropdown-item { display: block; width: 100%; padding: .42rem .9rem; color: #23272b; font-size: .875rem; }
.dropdown-item:hover { background: #f6efe4; text-decoration: none; }

/* ---------- Liste ---------------------------------------------------------------- */
.list-group { display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; }
.list-group-flush { border-radius: 0; }
.list-group-item { padding: .6rem .85rem; background: #fff; border-bottom: 1px solid #efedea; color: #23272b; font-size: .9rem; }
.list-group-item:last-child { border-bottom: 0; }
.list-group-item-action:hover { background: #f6efe4; text-decoration: none; cursor: pointer; }
.list-group-item.active { background: #f6efe4; font-weight: 600; border-left: 3px solid #b08a53; }

/* ---------- Icônes ---------------------------------------------------------------- */
/* Les icônes sont décoratives : chaque bouton porte aussi son libellé en toutes lettres. */
.bi { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em;
      background-color: currentColor; mask-repeat: no-repeat; mask-position: center;
      mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
      -webkit-mask-size: contain; flex: none; }

/* ---------- Couleurs de texte ------------------------------------------------- */
.text-muted   { color: #6d747c !important; }
.text-danger  { color: #b3413a !important; }
.text-warning { color: #b5832a !important; }
.text-success { color: #2f7d5d !important; }
.text-white   { color: #fff !important; }
.text-white-50 { color: rgba(255,255,255,.5) !important; }
.offcanvas-title { font-size: .95rem; font-weight: 600; margin: 0; }
code { background: #f4f2ef; padding: .1em .35em; border-radius: 4px; font-size: .88em; }
.show { opacity: 1; }
.btn-group-sm > .btn { padding: .3rem .6rem; font-size: .8rem; }
.navbar-expand-lg, .offcanvas-start { /* marqueurs de structure, sans style propre */ }

/* ---------- Affichage responsive (placé en fin de fichier pour primer) -------- */
@media (min-width: 576px) { .d-sm-inline { display: inline !important; } }
@media (min-width: 768px) { .d-md-inline { display: inline !important; } }
@media (min-width: 992px) { .d-lg-none { display: none !important; } }
