/*
 * Maple Admin — base : remise à zéro, typographie, focus et utilitaires.
 * Le thème se pose sur <html>. Référence : docs/architecture/adminweb.md.
 */

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-14);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: 0;
  color: var(--text);
}

h1 { font-size: var(--text-24); line-height: var(--leading-tight); }
h2 { font-size: var(--text-18); }
h3 { font-size: var(--text-16); }
h4 { font-size: var(--text-14); }

p {
  margin: 0;
  max-width: 72ch;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { color: var(--accent-strong); }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

ul,
ol {
  margin: 0;
  padding: 0;
}

table {
  border-collapse: collapse;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: var(--text-12);
}

::selection {
  background: var(--accent-tint);
  color: var(--text);
}

/* Focus visible sur tout élément interactif, jamais retiré. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-control);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Un élément masqué par l'attribut hidden le reste, quel que soit l'affichage de son composant. */
[hidden] { display: none !important; }

/* Utilitaires. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

.id {
  font-family: var(--font-mono);
  font-size: var(--text-12);
  letter-spacing: 0;
  color: var(--text-2);
}

.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: var(--text-12); line-height: 16px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack--tight { gap: var(--space-1); }
.stack--loose { gap: var(--space-5); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.grow { flex: 1 1 auto; min-width: 0; }
