/**
 * Fichier  : assets/css/admin-mobile.css
 * Auteur   : KREMER Régis
 * Version  : 2.6.84
 * Date     : 2026-07-20
 * Description : Administration mobile/tablette — Utilisateurs, Fournisseurs et Paramètres.
 *
 * Changelog :
 *   v2.6.84 (2026-07-20) — ADMIN COMPLEX FORMS8 : cartes, assistants, sections,
 *                          confirmations renforcées et hub des réglages.
 */

/* ================================================================
   Base opt-in pour les trois écrans d'administration complexes
   ================================================================ */
.admin-mobile-entity-list,
.settings-mobile-hub,
.settings-mobile-section-head,
.archive-mobile-cards {
  display: none;
}

.admin-mobile-empty {
  display: grid;
  gap: 6px;
  padding: 24px 18px;
  border: 1px dashed var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  text-align: center;
}

.admin-mobile-empty strong {
  color: var(--text-primary);
  font-size: 16px;
}

.admin-mobile-empty.is-error {
  border-color: color-mix(in srgb, var(--red, #dc2626) 45%, var(--border));
}

.admin-badge--success,
.admin-badge--active {
  color: var(--green, #15803d) !important;
  background: color-mix(in srgb, var(--green, #15803d) 12%, transparent) !important;
}

.admin-badge--danger,
.admin-badge--blocked {
  color: var(--red, #b91c1c) !important;
  background: color-mix(in srgb, var(--red, #b91c1c) 12%, transparent) !important;
}

.admin-badge--watch {
  color: var(--orange, #b45309) !important;
  background: color-mix(in srgb, var(--orange, #b45309) 14%, transparent) !important;
}

.admin-badge--inactive {
  color: var(--text-muted) !important;
  background: var(--bg-elevated, var(--bg-body)) !important;
}

.admin-action-summary {
  display: grid;
  grid-template-columns: minmax(96px, .7fr) minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, var(--bg-body));
}

.admin-action-summary span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-action-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

/* ================================================================
   Formulaires, choix et permissions
   ================================================================ */
.admin-mobile-flow {
  min-width: 0;
}

.admin-mobile-flow .ms-flow {
  max-width: 820px;
}

.admin-mobile-flow [data-ms-flow-step] {
  display: grid;
  gap: 16px;
}

.admin-mobile-flow [data-ms-flow-step] > h3,
.admin-edit-sections summary,
.admin-section-heading h4 {
  color: var(--text-primary);
}

.admin-flow-help,
.admin-section-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.admin-field > span {
  color: var(--text-secondary, var(--text-primary));
  font-size: 13px;
  font-weight: 750;
}

.admin-field input,
.admin-field select,
.admin-field textarea {
  width: 100%;
  min-width: 0;
  font-size: 16px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.admin-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-segmented legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--text-secondary, var(--text-primary));
  font-size: 13px;
  font-weight: 750;
}

.admin-segmented label {
  position: relative;
  min-width: 0;
}

.admin-segmented input {
  position: absolute;
  inset: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-segmented span {
  display: grid;
  place-items: center;
  min-height: var(--ms-touch-target, 48px);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 800;
  text-align: center;
}

.admin-segmented input:checked + span {
  border-color: var(--blue, #2563eb);
  background: color-mix(in srgb, var(--blue, #2563eb) 12%, var(--bg-card));
  color: var(--blue, #2563eb);
}

.admin-segmented input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--blue, #2563eb) 70%, white);
  outline-offset: 2px;
}

.admin-choice-list,
.admin-permission-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.admin-choice-list.is-disabled,
.admin-permission-list.is-disabled {
  opacity: .48;
}

.admin-choice-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
}

.admin-choice-row input {
  width: 20px;
  height: 20px;
  margin: 4px 0 0;
}

.admin-choice-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-choice-row strong {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.admin-choice-row small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-choice-list--compact {
  grid-template-columns: minmax(0, 1fr);
}

.admin-permission-group {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, var(--bg-body));
}

.admin-permission-group legend {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.admin-info {
  padding: 12px 14px;
  border-left: 4px solid var(--blue, #2563eb);
  background: color-mix(in srgb, var(--blue, #2563eb) 9%, var(--bg-card));
  color: var(--text-secondary, var(--text-primary));
  line-height: 1.5;
}

.admin-review {
  min-width: 0;
}

.admin-review dl {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-review dl > div {
  display: grid;
  grid-template-columns: minmax(110px, .75fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-review dl > div:last-child {
  border-bottom: 0;
}

.admin-review dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-review dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-weight: 700;
}

/* ================================================================
   Fournisseur : contacts et sections de modification
   ================================================================ */
.admin-contact-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-contact-card__head,
.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-contact-card__head strong,
.admin-section-heading h4 {
  margin: 0;
  font-size: 15px;
}

.admin-edit-sections {
  display: grid;
  gap: 10px;
  padding-bottom: calc(var(--ms-sticky-actions-height) + 18px);
}

.admin-edit-sections details {
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-edit-sections summary {
  min-height: var(--ms-touch-target, 48px);
  padding: 14px 16px;
  font-weight: 850;
  cursor: pointer;
  list-style-position: inside;
}

.admin-edit-section__body {
  display: grid;
  gap: 16px;
  padding: 0 14px 16px;
}

.admin-edit-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px max(12px, var(--ms-safe-left)) calc(10px + var(--ms-safe-bottom)) max(12px, var(--ms-safe-right));
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

/* ================================================================
   Paramètres : hub et sous-pages
   ================================================================ */
.settings-mobile-hub {
  min-width: 0;
}

.settings-mobile-hub__intro {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.settings-mobile-hub__intro span {
  color: var(--blue, #2563eb);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.settings-mobile-hub__intro h2,
.settings-mobile-section-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(21px, 5vw, 28px);
}

.settings-mobile-hub__intro p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-mobile-hub__grid {
  display: grid;
  gap: 9px;
}

.settings-mobile-hub__card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: left;
}

.settings-mobile-hub__card > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-mobile-hub__card strong {
  font-size: 15px;
}

.settings-mobile-hub__card small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-mobile-hub__card.is-danger {
  border-color: color-mix(in srgb, var(--red, #dc2626) 40%, var(--border));
}

.settings-mobile-hub__card.is-danger strong,
.settings-mobile-hub__card.is-danger .settings-mobile-hub__icon {
  color: var(--red, #dc2626);
}

.settings-mobile-hub__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--bg-elevated, var(--bg-body));
  color: var(--blue, #2563eb);
  font-size: 20px;
  font-weight: 900;
}

.settings-mobile-section-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.settings-mobile-section-head > div {
  min-width: 0;
}

.settings-mobile-section-head span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.settings-mobile-section-head h2 {
  font-size: 20px;
}

.settings-mobile-section[hidden] {
  display: none !important;
}

.archive-mobile-cards {
  gap: 10px;
  margin-bottom: 14px;
}

/* ================================================================
   Confirmations renforcées
   ================================================================ */
.admin-confirm {
  display: grid;
  gap: 16px;
}

.admin-confirm__warning,
.admin-confirm__summary {
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, var(--bg-body));
  line-height: 1.5;
}

.admin-confirm__warning {
  border-left: 5px solid var(--red, #dc2626);
}

.admin-confirm__warning strong {
  color: var(--text-primary);
}

.admin-confirm__warning ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.admin-confirm__hint {
  margin: -8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* ================================================================
   Téléphone et tablette
   ================================================================ */
@media (max-width: 1199px) {
  #pgUsers .admin-page-hero,
  #pgSuppliers .admin-page-hero,
  #pgSettings .settings-hero-card {
    margin-bottom: 12px !important;
  }

  #pgUsers .filters-bar,
  #pgSuppliers .filters-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    padding: 10px;
  }

  #pgUsers .filters-section,
  #pgSuppliers .filters-section {
    width: 100%;
    margin: 0 !important;
  }

  #pgUsers .search-box,
  #pgSuppliers .search-box,
  #pgUsers .search-box input,
  #pgSuppliers .search-box input {
    width: 100%;
    min-width: 0;
  }

  #pgUsers #btnNewUser,
  #pgSuppliers #btnNewSupp {
    width: 100%;
    min-height: var(--ms-touch-target, 48px);
  }

  #pgUsers .filters-section.ml-auto,
  #pgSuppliers .filters-section.ml-auto {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .admin-mobile-entity-list,
  .settings-mobile-hub,
  .archive-mobile-cards {
    display: grid;
  }

  .settings-mobile-section-head {
    display: flex;
  }

  .admin-desktop-table,
  #archiveList .archive-table-wrap {
    display: none !important;
  }

  .admin-mobile-entity-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 12px;
  }

  .admin-mobile-entity-list .ms-entity-card {
    min-width: 0;
  }

  .admin-mobile-entity-list .ms-entity-card__actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #pgSettings .settings-shell,
  #pgSettings .settings-main-grid,
  #pgSettings .settings-main-column,
  #pgSettings .settings-side-column {
    min-width: 0;
  }

  #pgSettings .settings-main-grid {
    display: block;
  }

  #pgSettings .settings-mobile-section {
    margin: 0 0 12px !important;
  }

  #pgSettings .settings-card .card-body,
  #pgSettings .settings-card .card-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  #pgSettings .settings-form-grid,
  #pgSettings .archive-form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #pgSettings .settings-logo-panel,
  #pgSettings .settings-logo-title-row,
  #pgSettings .settings-logo-actions,
  #pgSettings .settings-push-actions,
  #pgSettings .archive-reminder,
  #pgSettings .archive-reminder-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  #pgSettings .settings-logo-actions .btn,
  #pgSettings .settings-push-actions .btn,
  #pgSettings .settings-danger-stack .btn,
  #pgSettings .archive-reminder-actions .btn {
    width: 100%;
    min-height: var(--ms-touch-target, 48px);
  }

  #pgSettings .settings-lang-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-mobile-cards .ms-entity-card__actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 600px) and (max-width: 1199px) {
  .admin-mobile-entity-list,
  .settings-mobile-hub__grid,
  .archive-mobile-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-form-grid,
  .admin-choice-list--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-mobile-entity-list .ms-entity-card__actions,
  .archive-mobile-cards .ms-entity-card__actions,
  .admin-edit-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-permission-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 599px) {
  .admin-review dl > div,
  .admin-action-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-review dt {
    margin-bottom: -6px;
  }

  .admin-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-section-heading .btn {
    width: 100%;
  }

  .settings-mobile-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-mobile-section-head .btn {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .admin-mobile-entity-list,
  .settings-mobile-hub,
  .settings-mobile-section-head,
  .archive-mobile-cards {
    display: none !important;
  }

  .admin-desktop-table,
  #pgSettings .settings-mobile-section {
    display: block !important;
  }
}

/* MageStock 2.6.113 — permissions système verrouillées pour le rôle Magasinier */
.is-role-locked{opacity:.58;cursor:not-allowed}.is-role-locked input{cursor:not-allowed}
