/* ==============================================================================
 * DOC-BLOCK: assets/css/responsive_global.css
 * Role: styles de presentation frontend pour cette page/composant.
 * Portee: structure visuelle, couleurs, responsive et etats interactifs.
 * Note: ce fichier ne contient pas de logique metier; seulement la couche UI.
 * ============================================================================== */

/* Role: surcouches responsive globales partagees par toutes les vues. */

* {
  box-sizing: border-box;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

body {
  overflow-x: hidden;
}

.table-shell,
.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  width: min(94vw, 760px);
  max-width: 94vw;
}

@media (max-width: 1024px) {
  body:not(.admin-page):not(.small-admin-page) .topbar {
    min-height: 0;
    padding: 12px;
    gap: 10px 12px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body:not(.admin-page):not(.small-admin-page) .topbar .logo {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 72px;
    flex: 0 0 auto;
  }

  body:not(.admin-page):not(.small-admin-page) .topbar .welcome-container {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin-left: auto;
    text-align: left;
    padding-right: 0;
    max-width: calc(100% - 84px);
    overflow-wrap: anywhere;
  }

  body:not(.admin-page):not(.small-admin-page) .topbar .top-actions {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  body:not(.admin-page):not(.small-admin-page) .topbar .action {
    min-width: 72px;
  }

  body:not(.admin-page):not(.small-admin-page) .topbar .menu-button-logo {
    width: 34px;
    height: 34px;
    margin-bottom: 4px;
  }

  body:not(.admin-page):not(.small-admin-page) .table-shell table {
    min-width: 760px !important;
  }

  .admin-page .topbar,
  .small-admin-page .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-page .topbar-right,
  .small-admin-page .topbar-right {
    align-items: stretch;
  }

  .admin-page .welcome-container,
  .small-admin-page .welcome-container {
    min-width: 0;
    width: 100%;
    text-align: left;
  }

  .admin-page .top-actions,
  .small-admin-page .top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  body:not(.admin-page):not(.small-admin-page) .titlebar,
  body:not(.admin-page):not(.small-admin-page) .section-header,
  body:not(.admin-page):not(.small-admin-page) .content-wrap,
  body:not(.admin-page):not(.small-admin-page) .page-wrap {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body:not(.admin-page):not(.small-admin-page) .titlebar {
    font-size: 18px;
  }

  body:not(.admin-page):not(.small-admin-page) .section-title {
    font-size: 18px;
  }

  body:not(.admin-page):not(.small-admin-page) .page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body:not(.admin-page):not(.small-admin-page) .btn-linkish,
  body:not(.admin-page):not(.small-admin-page) .upload-panel button {
    width: 100%;
    text-align: center;
  }

  body:not(.admin-page):not(.small-admin-page) .upload-panel {
    padding: 12px;
  }

  body:not(.admin-page):not(.small-admin-page) .table-shell table {
    min-width: 680px !important;
  }

  .toast-stack {
    top: 10px !important;
    right: 10px !important;
    left: 10px;
    max-width: none !important;
  }

  .admin-page .users-filters {
    grid-template-columns: 1fr !important;
  }

  .admin-page .selector-grid,
  .small-admin-page .selector-grid {
    grid-template-columns: 1fr;
  }

  .admin-page .page-shell,
  .small-admin-page .page-shell {
    padding: 14px 10px 20px;
  }

  .admin-page .modal-dialog,
  .small-admin-page .modal-dialog {
    margin: 0.5rem;
  }

  .top-right-icons {
    position: static !important;
    top: auto !important;
    right: auto !important;
    justify-content: center;
    margin: 12px auto 0;
    display: flex;
    width: 100%;
  }

  .bottom-right-text {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    margin: 16px 0 8px;
    text-align: center;
  }

  body {
    background-attachment: scroll;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}
