/* = Module core — styles propres aux gabarits de templates/core/.
   Un block utilisé par un second module remonte dans components.css.
   Issu du découpage de main.css (15/09/2026), chargé sur toutes les pages
   dans l'ordre fixé par templates/partials/feuilles_de_style.html.  */

.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--color-bg);
  padding: var(--space-6);
}

/* La carte d'une page d'erreur (403, 404, 405, 500) : `card p-10 text-center error-page__carte`. */
.error-page__carte {
  max-width: 480px;
  width: 100%;
}

.error-page__status {
  font-size: var(--text-56);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0 0 var(--space-4);
  line-height: var(--leading-none);
}

.error-page__text {
  color: var(--color-text-secondary);
  font-size: var(--text-14);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-6);
}

/* --- Widget du tableau de bord : `card p-4 widget kpi` et les classes que calcule
   `classes_widget` (apps/core/dashboard_services.py : largeur, ton de la carte et du
   chiffre quand un seuil est franchi). Reste au widget ce qui n'est qu'à lui : la largeur
   dans la grille (`--md`, `--lg`, en classes et non en `style=` — un `grid-column: span 4`
   inline recréait des colonnes implicites sur téléphone), le graphique, la zone qui défile
   et la poignée du glisser (`data-drag-handle`, core/dashboard.html). --- */
.widget {
  position: relative;
}

.widget__chart {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: var(--text-12);
}

.widget__scroll {
  overflow-x: auto;
  max-height: 300px;
}

/* Seules les lignes défilent : la tête reste. Une bordure de cellule ne suit pas une cellule
   collante (`border-collapse`) : l'ombre porte le trait. */
:where(.widget__scroll th) {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--table-head-border);
}

.widget--dragging {
  opacity: 0.35;
}

.widget__drag-handle {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: var(--text-14);
  line-height: var(--leading-none);
  cursor: grab;
  user-select: none;
  border-radius: var(--radius-sm);
  opacity: 0.55;
  transition:
    opacity 0.15s ease,
    background 0.15s ease;
  z-index: 3;
}

.widget__drag-handle:hover {
  opacity: 1;
  background: var(--color-bg-hover);
}

.widget__drag-handle:active {
  cursor: grabbing;
}

/* Largeur des widgets. En classes et non en `style=` inline : un
   `grid-column: span 4` pose sur l'element recree quatre colonnes implicites,
   meme quand la grille est passee a une seule colonne. Le tableau de bord
   debordait de 311 px sur telephone, et la media query n'y pouvait rien. */
.widget--md {
  grid-column: span 2;
}

.widget--lg {
  grid-column: span 4;
}

@media (width < 1280px) {
  /* Un widget « large » ne peut pas s'etendre sur quatre colonnes quand il
     n'en reste que deux. */
  .widget--lg {
    grid-column: span 2;
  }
}

@media (width <= 768px) {
  /* Sur une colonne, tout `span` recreerait des colonnes implicites. */
  .widget--md,
  .widget--lg {
    grid-column: auto;
  }
}

/* ━━━ Pages légales publiques (CGV, mentions, confidentialité) : une page de texte,
   écran à dessin propre (.css-exceptions) ━━━ */
.page-legal {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-15) var(--space-5);
  background: var(--color-surface);
  min-height: 100vh;
}

.page-legal__header {
  margin-bottom: var(--space-10);
  text-align: center;
}

.page-legal__section-title {
  font-size: var(--text-18);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-primary-bg);
  padding-bottom: var(--space-2-5);
}

.page-legal__content {
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  font-size: var(--text-14);
}

.page-legal__content p {
  margin-bottom: var(--space-3);
}

.page-legal__content strong {
  color: var(--color-primary);
}

.page-legal__content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.page-legal__content a:hover {
  opacity: 0.8;
}

.page-legal__footer {
  margin-top: var(--space-15);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-primary-bg);
  text-align: center;
  font-size: var(--text-12);
  color: var(--color-text-secondary);
}

.page-legal__content ul,
.page-legal__content ol {
  margin-left: var(--space-5);
  margin-bottom: var(--space-3);
}

.page-legal__content li {
  margin-bottom: var(--space-2);
}

/* Une pièce jointe de ticket affichée dans le fil (core/support/_piece_jointe.html,
   application et backoffice) : une image ou une vidéo bornée. */
.piece-jointe {
  display: block;
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
}

.notif-dropdown {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-shadow) 12%, transparent);
  overflow: hidden;
}

.notif-dropdown__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-bg-hover);
  font-size: var(--text-14);
}

.notif-dropdown__list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-dropdown__item {
  display: flex;
  gap: var(--space-2-5);
  padding: var(--space-2-5) var(--space-4);
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-bg-subtle);
  transition: background 0.15s;
}

.notif-dropdown__item:hover {
  background: var(--color-bg-subtle);
}

.notif-dropdown__item--unread {
  background: var(--color-primary-bg);
  border-left: 3px solid var(--color-info);
}

.notif-dropdown__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.notif-dropdown__item--unread .notif-dropdown__icon {
  background: var(--color-info-bg);
  color: var(--color-primary);
}

.notif-dropdown__content {
  min-width: 0;
}

.notif-dropdown__title {
  font-size: var(--text-13);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.notif-dropdown__time {
  font-size: var(--text-11);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.notif-dropdown__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2-5) var(--space-4);
  border-top: 1px solid var(--color-bg-hover);
  font-size: var(--text-12);
}

.notif-dropdown__mark-all {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--text-12);
  padding: 0;
}

.notif-dropdown__mark-all:hover {
  color: var(--color-text);
}
