/* =============================================================================
   ARTISCODE ERP — RESET + FONDATIONS TYPOGRAPHIQUES
   ========================================================================== */

/* ---------- Polices locales (aucun appel réseau externe) ---------- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../vendor/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  tab-size: 4;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100vh;
  background: var(--bg-canvas);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-base);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-hover);
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

hr {
  height: 1px;
  border: 0;
  background: var(--border);
}

[hidden] {
  display: none !important;
}

/* ---------- Typographie ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-strong);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-sm); }

p { text-wrap: pretty; }

strong,
b {
  font-weight: 650;
  color: var(--fg-strong);
}

small {
  font-size: var(--text-xs);
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.15em 0.45em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-2);
  color: var(--fg-muted);
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

/* Chiffres alignés partout où l'on compare des nombres */
.tabular,
td,
th,
.stat-value,
.metric {
  font-variant-numeric: tabular-nums;
}

/* ---------- Accessibilité ---------- */

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: var(--brand);
  color: var(--fg-onbrand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-tooltip);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--fg-onbrand);
  font-weight: 650;
  box-shadow: var(--shadow-lg);
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease-spring);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--fg-onbrand);
}

/* ---------- Barres de défilement ---------- */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-subtle);
  background-clip: content-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- Impression ---------- */

@media print {
  .app-sidebar,
  .app-topbar,
  .app-footer,
  .no-print,
  .toast-stack {
    display: none !important;
  }

  .app-main,
  .app-shell {
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .panel {
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
