/* utils.css — UTILITIES: spacing, alignment, and small layout helpers.
   Loaded LAST so a utility can override a component's default when needed. */

/* The hidden attribute always wins. The browser's own [hidden] rule loses to
   any class that sets display (.flash, .btn, .lv-offline-banner, …), so an
   element the markup or JS marks hidden still showed — every driver saw the
   "Hors ligne" banner while online. Patched class by class for a long time
   (.btn[hidden], .wh-modal-backdrop[hidden], …); this ends the whole family. */
[hidden] { display: none !important; }

/* --- Existing layout helpers (moved out of app.css) --- */
.muted { color: var(--muted); }
.d-none { display: none; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
/* min-width: 0 stops a wide child (e.g. a table with many/long columns) from
   forcing its own flex item past its basis via the default min-width: auto —
   without it, one column's real content can push the row to wrap while an
   otherwise-identical row with less content stays side by side, making
   sibling cards line up inconsistently for no visible reason. */
.grid-2 > * { flex: 1 1 320px; min-width: 0; }
.grid-2 > *:first-child { flex: 2 1 440px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* --- Display & flexbox --- */
.flex      { display: flex; }
.inline-flex { display: inline-flex; }
.block     { display: block; }
.inline    { display: inline; }
.contents  { display: contents; }
.hidden    { display: none; }
.flex-col  { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.grow      { flex: 1; }
.flex-none { flex: none; }
.relative  { position: relative; }
.col-span-full { grid-column: 1 / -1; }
.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.self-center     { align-self: center; }

/* --- Text alignment --- */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* --- Text size --- */
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 13px; }
.text-base { font-size: 14px; }
.text-sm\.5 { font-size: 12.5px; }
/* Relative to the parent's size: .text-em-85 = .85em. */
.text-em-85 { font-size: .85em; }
.text-em-70 { font-size: .7em; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.nowrap  { white-space: nowrap; }
.uppercase { text-transform: uppercase; }
.tracking-em-03 { letter-spacing: .03em; }

/* --- Text color (palette tokens from theme.css only, never a raw hex) --- */
.text-ink       { color: var(--ink); }
.text-red-600   { color: var(--red-600); }
.text-amber-700 { color: var(--amber-700); }

/* --- Gap (4px scale) --- */
.gap-0 { gap: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
/* Half steps (Tailwind's .5 names) — the in-between values the markup
   actually used as inline styles before they were moved onto classes. */
.gap-1\.5 { gap: 6px; }
.gap-2\.5 { gap: 10px; }
.gap-3\.5 { gap: 14px; }

/* --- Margin (4px scale) --- */
.m-0 { margin: 0; }    
.m-auto { margin: auto; }
/* Axis pairs before single sides, so `my-* mt-*` lets the side win. */
.my-0\.5 { margin-top: 2px; margin-bottom: 2px; }
.mt-0 { margin-top: 0; }     
.mt-1 { margin-top: 4px; }  
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }  
.mt-4 { margin-top: 16px; } 
.mt-5 { margin-top: 20px; } 
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }     
.mb-1 { margin-bottom: 4px; }  
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }  
.mb-4 { margin-bottom: 16px; } 
.mb-5 { margin-bottom: 20px; } 
.mb-6 { margin-bottom: 24px; }
.mt-0\.5 { margin-top: 2px; }
.mt-1\.5 { margin-top: 6px; }
.mt-2\.5 { margin-top: 10px; }
.mt-3\.5 { margin-top: 14px; }
.mb-0\.5 { margin-bottom: 2px; }
.mb-1\.5 { margin-bottom: 6px; }
.mb-2\.5 { margin-bottom: 10px; }
.mb-3\.5 { margin-bottom: 14px; }
.mt-0\.75 { margin-top: 3px; }
.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 4px; }  
.ml-2 { margin-left: 8px; }
.ml-1\.5 { margin-left: 6px; }  
.ml-auto { margin-left: auto; }
.mr-1 { margin-right: 4px; } 
.mr-1\.5 { margin-right: 6px; }
.mr-2 { margin-right: 8px; } 
.mr-auto { margin-right: auto; }

/* --- Padding (4px scale) --- */
.p-0 { padding: 0; }    
.p-2 { padding: 8px; }  
.p-3 { padding: 12px; } 
.p-4 { padding: 16px; } 
.p-5 { padding: 20px; } 
.p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }   
.px-3 { padding-left: 12px; padding-right: 12px; } 
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }   
.py-3 { padding-top: 12px; padding-bottom: 12px; } 
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-1\.75 { padding-left: 7px; padding-right: 7px; }
.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-4\.5 { padding-top: 18px; padding-bottom: 18px; }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
/* Single sides come after the axis pairs so `py-* pb-*` lets the side win. */
.pt-2\.5 { padding-top: 10px; }
.pb-1 { padding-bottom: 4px; }

/* --- Width & flex basis (same 4px scale: .w-20 = 80px, .min-w-60 = 240px;
   .w-px = 1px). .flex-1-40 = flex: 1 1 160px (grow, shrink, 40-step basis). --- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-px { width: 1px; }
.w-9 { width: 36px; }
.w-20 { width: 80px; }
.w-22\.5 { width: 90px; }
.w-24 { width: 96px; }
.w-42\.5 { width: 170px; }
.min-w-27\.5 { min-width: 110px; }
.min-w-37\.5 { min-width: 150px; }
.min-w-50 { min-width: 200px; }
.min-w-55 { min-width: 220px; }
.min-w-60 { min-width: 240px; }
.min-w-65 { min-width: 260px; }
.min-w-70 { min-width: 280px; }
.min-w-85 { min-width: 340px; }
.max-w-25 { max-width: 100px; }
.max-w-55 { max-width: 220px; }
.max-w-70 { max-width: 280px; }
.max-w-120 { max-width: 480px; }
.flex-1-35 { flex: 1 1 140px; }
.flex-1-37\.5 { flex: 1 1 150px; }
.flex-1-40 { flex: 1 1 160px; }
.flex-2-55 { flex: 2 1 220px; }

/* --- cursor --- */
.pointer { cursor: pointer; }
.border-0 { border: 0; }
.border-t-0 { border-top: 0; }
.border-t-soft { border-top: 1px solid var(--line-soft); }
.opacity-25 { opacity: .25; }
.no-select { user-select: none; }
.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;
}

/* --- Show / hide ---
   JS shows and hides with the hidden attribute (el.hidden = !show) — the
   [hidden] rule at the top of this file wins over any component display.
   .is-filtered-out is the second, independent switch for an element whose
   hidden attribute already means something else (a collapsed panel that a
   list filter must also hide without opening it when the filter clears). */
.is-filtered-out { display: none !important; }
