/* ==========================================================================
   NetRoad — Design system (refonte 2026-10)
   Tokens issus de la maquette (NRDesignSystem). Chaque couleur est un triplet RGB
   pour être utilisable par Tailwind avec opacité : bg-nr-surface, text-nr-muted/70…
   (config Tailwind dans Pages/_Layout.cshtml). Police IBM Plex auto-hébergée (OFL).
   ========================================================================== */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-ext-400-normal.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: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-400-normal.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: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-ext-500-normal.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: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-500-normal.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: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-ext-600-normal.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: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-600-normal.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: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-ext-700-normal.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: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-sans-latin-700-normal.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: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-mono-latin-ext-400-normal.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: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-mono-latin-400-normal.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: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-mono-latin-ext-500-normal.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: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex/ibm-plex-mono-latin-500-normal.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; }

:root {
  --nr-page: 246 247 249;
  --nr-surface: 255 255 255;
  --nr-surface2: 249 250 251;
  --nr-sunken: 246 247 249;
  --nr-side: 251 251 252;
  --nr-hover: 243 244 246;
  --nr-input: 255 255 255;
  --nr-border: 229 231 235;
  --nr-border2: 209 213 219;
  --nr-text: 17 24 39;
  --nr-muted: 75 85 99;
  --nr-faint: 107 114 128;
  --nr-accent: 147 51 234;
  --nr-accent-text: 126 34 206;
  --nr-accent-soft: 243 232 255;
  --nr-ok-bg: 240 253 244;
  --nr-ok-bd: 134 239 172;
  --nr-ok-text: 22 101 52;
  --nr-ok: 22 163 74;
  --nr-warn-bg: 255 251 235;
  --nr-warn-bd: 245 158 11;
  --nr-warn-text: 146 64 14;
  --nr-warn: 217 119 6;
  --nr-or-bg: 255 247 237;
  --nr-or-bd: 253 186 116;
  --nr-or-text: 154 52 18;
  --nr-err-bg: 254 242 242;
  --nr-err-bd: 252 165 165;
  --nr-err-text: 185 28 28;
  --nr-err: 220 38 38;
  --nr-info-bg: 239 246 255;
  --nr-info-bd: 191 219 254;
  --nr-info-text: 29 78 216;
  --nr-info: 37 99 235;
  --nr-neu-bg: 243 244 246;
  --nr-neu-text: 55 65 81;
  --nr-track: 229 231 235;
  --nr-code: 246 247 249;
  --nr-sel: 250 245 255;
  --nr-toast: 17 24 39;
  --nr-toast-fg: 249 250 251;
  --nr-s-cached: 167 139 250;
}

html.dark {
  --nr-page: 11 13 18;
  --nr-surface: 18 22 30;
  --nr-surface2: 23 28 38;
  --nr-sunken: 14 18 24;
  --nr-side: 14 17 24;
  --nr-hover: 23 28 38;
  --nr-input: 14 18 24;
  --nr-border: 35 42 54;
  --nr-border2: 52 60 74;
  --nr-text: 243 244 246;
  --nr-muted: 170 177 189;
  --nr-faint: 139 147 161;
  --nr-accent: 147 51 234;
  --nr-accent-text: 216 180 254;
  --nr-accent-soft: 43 26 66;
  --nr-ok-bg: 14 33 23;
  --nr-ok-bd: 22 101 52;
  --nr-ok-text: 134 239 172;
  --nr-ok: 34 197 94;
  --nr-warn-bg: 35 26 7;
  --nr-warn-bd: 180 83 9;
  --nr-warn-text: 252 211 77;
  --nr-warn: 245 158 11;
  --nr-or-bg: 42 22 10;
  --nr-or-bd: 154 52 18;
  --nr-or-text: 253 186 116;
  --nr-err-bg: 42 16 18;
  --nr-err-bd: 153 27 27;
  --nr-err-text: 252 165 165;
  --nr-err: 239 68 68;
  --nr-info-bg: 13 26 46;
  --nr-info-bd: 30 58 138;
  --nr-info-text: 147 197 253;
  --nr-info: 59 130 246;
  --nr-neu-bg: 31 36 48;
  --nr-neu-text: 209 213 219;
  --nr-track: 42 48 60;
  --nr-code: 14 18 24;
  --nr-sel: 28 20 40;
  --nr-toast: 243 244 246;
  --nr-toast-fg: 17 24 39;
  --nr-s-cached: 124 58 237;
}

:root { color-scheme: light; }
html.dark { color-scheme: dark; }

html, body {
  background-color: rgb(var(--nr-page));
  color: rgb(var(--nr-text));
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
code, kbd, pre, samp, .font-mono { font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.nr-num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid rgb(var(--nr-accent)); outline-offset: 2px; }

/* ---------- Shell (sidebar + en-tête) ---------- */
.nr-sidebar { width: 248px; transition: width .15s ease; }
.nr-sidebar.is-collapsed { width: 64px; }
.nr-nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: 8px; font-size: 13.5px; font-weight: 500; color: rgb(var(--nr-muted)); text-decoration: none; white-space: nowrap; }
.nr-nav-item:hover { background: rgb(var(--nr-hover)); color: rgb(var(--nr-text)); }
.nr-nav-item.is-active { background: rgb(var(--nr-accent-soft)); color: rgb(var(--nr-accent-text)); font-weight: 600; }
.nr-nav-item i { width: 16px; text-align: center; font-size: 14px; flex: none; }
.nr-sidebar.is-collapsed .nr-nav-item { justify-content: center; width: 44px; padding: 0; }
.nr-sidebar.is-collapsed .nr-nav-label, .nr-sidebar.is-collapsed .nr-group-label, .nr-sidebar.is-collapsed .nr-side-footer-text { display: none; }
.nr-sidebar.is-collapsed .nr-group-sep { display: block; }
.nr-group-label { padding: 0 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--nr-faint)); }
.nr-group-sep { display: none; height: 1px; margin: 2px 8px 6px; background: rgb(var(--nr-border)); }
.nr-dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 999px; }
.nr-nav-item .nr-dot { margin-left: auto; }
.nr-dot.is-live { background: rgb(var(--nr-ok)); box-shadow: 0 0 0 3px rgb(var(--nr-ok) / .18); }
.nr-dot.is-info { background: rgb(var(--nr-info)); }
.nr-sidebar.is-collapsed .nr-dot { position: absolute; top: 6px; right: 6px; margin: 0; }
.nr-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; text-decoration: none; }

/* ---------- Transition : pages pas encore refondues ----------
   Les anciennes pages utilisent bg-white / bg-gray-* et des surcharges sombres globales.
   On les aligne sur les tokens pour que tout le dashboard partage la même palette en
   attendant leur refonte (lots 1 à 5). À supprimer quand toutes les pages seront migrées. */
.dark body { background-color: rgb(var(--nr-page)); color: rgb(var(--nr-text)); }
.dark .bg-white { background-color: rgb(var(--nr-surface)) !important; }
.dark .bg-gray-50 { background-color: rgb(var(--nr-surface2)) !important; }
.dark .bg-gray-100 { background-color: rgb(var(--nr-surface2)) !important; }
.dark .bg-gray-800 { background-color: rgb(var(--nr-surface)) !important; }
.dark .bg-gray-900 { background-color: rgb(var(--nr-page)) !important; }
.dark .bg-gray-700 { background-color: rgb(var(--nr-surface2)) !important; }
.dark .text-gray-900 { color: rgb(var(--nr-text)) !important; }
.dark .text-gray-700 { color: rgb(var(--nr-neu-text)) !important; }
.dark .text-gray-600, .dark .text-gray-500 { color: rgb(var(--nr-muted)) !important; }
.dark .text-gray-400 { color: rgb(var(--nr-faint)) !important; }
.dark .border-gray-200, .dark .border-gray-700, .dark .border-b { border-color: rgb(var(--nr-border)) !important; }
.dark .border-gray-300, .dark .border-gray-600 { border-color: rgb(var(--nr-border2)) !important; }
.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]), .dark .divide-gray-700 > :not([hidden]) ~ :not([hidden]) { border-color: rgb(var(--nr-border)) !important; }
.dark input, .dark select, .dark textarea { background-color: rgb(var(--nr-input)) !important; border-color: rgb(var(--nr-border2)) !important; color: rgb(var(--nr-text)) !important; }
.dark input::placeholder, .dark textarea::placeholder { color: rgb(var(--nr-faint)) !important; }
.dark .hover\:bg-gray-100:hover, .dark .hover\:bg-gray-50:hover { background-color: rgb(var(--nr-hover)) !important; }
.dark table thead { background-color: rgb(var(--nr-surface2)) !important; }
.dark table tbody tr:hover { background-color: rgb(var(--nr-hover)) !important; }
/* Anciennes pages calées pour l'ancienne barre latérale (lg:pl-80) : la nouvelle sidebar
   occupe déjà la gauche, on ramène une marge normale. */
@media (min-width: 1024px) { .nr-content .lg\:pl-80 { padding-left: 2rem !important; } }

/* ---------- Tableaux (classe utilitaire pour les pages refondues) ---------- */
.nr-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.nr-table thead th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11.5px; font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase; color: rgb(var(--nr-faint)); background: rgb(var(--nr-surface2));
  padding: 9px 14px; border-bottom: 1px solid rgb(var(--nr-border)); white-space: nowrap; }
.nr-table tbody td { padding: 10px 14px; border-bottom: 1px solid rgb(var(--nr-border)); color: rgb(var(--nr-text)); vertical-align: middle; }
.nr-table tbody tr:last-child td { border-bottom: 0; }
.nr-table tbody tr:hover td { background: rgb(var(--nr-hover)); }
.nr-table tbody tr.is-selected td { background: rgb(var(--nr-sel)); }
.nr-table .nr-num, .nr-table td.text-right { font-variant-numeric: tabular-nums; }
/* Les utilitaires d'alignement doivent l'emporter sur le text-align:left des en-têtes */
.nr-table thead th.text-right { text-align: right; }
.nr-table thead th.text-center { text-align: center; }

/* ---------- Champs de saisie (pages refondues) ---------- */
.nr-input { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid rgb(var(--nr-border2));
  background: rgb(var(--nr-input)); color: rgb(var(--nr-text)); font-size: 14px; width: 100%; }
.nr-input:focus { outline: 2px solid rgb(var(--nr-accent) / .55); outline-offset: 0; border-color: rgb(var(--nr-accent)); }
textarea.nr-input { height: auto; padding: 8px 12px; }

/* Carte (Leaflet) : popups et contrôles aux couleurs du thème */
.dark .leaflet-popup-content-wrapper,
.dark .leaflet-popup-tip { background: rgb(var(--nr-surface)); color: rgb(var(--nr-text)); box-shadow: 0 4px 16px rgb(0 0 0 / .45); }
.dark .leaflet-popup-content-wrapper p { color: rgb(var(--nr-muted)); }
.dark .leaflet-container a.leaflet-popup-close-button { color: rgb(var(--nr-muted)); }
.dark .leaflet-bar a { background: rgb(var(--nr-surface)); color: rgb(var(--nr-text)); border-bottom-color: rgb(var(--nr-border)); }
.dark .leaflet-bar a:hover { background: rgb(var(--nr-hover)); }
.leaflet-container { font-family: inherit; }

/* Largeur du contenu : centré, plafonné pour rester lisible sur 2K / 4K. */
.nr-container { width: 100%; max-width: 1920px; margin-inline: auto; }
@media (min-width: 3000px) { .nr-container { max-width: 2400px; } }
