/* ============================================================
   utilities.css — small atomic utility classes used to retire
   inline `style="…"` attributes so the strict CSP can drop the
   `'unsafe-inline'` carveout from `style-src` (MED-01 follow-up).

   Naming follows the Bootstrap 4 spacing convention (mt-2, p-3,
   d-none, etc.) — familiar to anyone who's seen BS4/5 and not
   conflicting with the BS3 namespace currently loaded by avant.
   Spacing scale is in pixels, not rem, to match the existing
   px-based component sizing in the codebase.

   Scale:  0 = 0px   1 = 4px   2 = 8px   3 = 12px
           4 = 16px  5 = 20px  6 = 24px

   Per-view weirdness (chart heights, Razor-computed widths) lives
   in a <style> block at the top of each view and gets nonced by
   NonceTagHelper — no need to clutter this file with one-offs.
   ============================================================ */

/* ---------- Display ---------- */
.d-none         { display: none !important; }
.d-inline       { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block        { display: block !important; }
.d-flex         { display: flex !important; }

/* ---------- Margin ---------- */
.m-0  { margin: 0 !important; }
.m-1  { margin: 4px !important; }
.m-2  { margin: 8px !important; }
.m-3  { margin: 12px !important; }
.m-4  { margin: 16px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-5 { margin-top: 20px !important; }
.mt-6 { margin-top: 24px !important; }
.mt-n1 { margin-top: -4px !important; }
.mt-n2 { margin-top: -2px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-5 { margin-bottom: 20px !important; }

.ml-1 { margin-left: 4px !important; }
.ml-2 { margin-left: 8px !important; }
.ml-3 { margin-left: 12px !important; }
.ml-4 { margin-left: 16px !important; }

.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 12px !important; }
.mr-4 { margin-right: 16px !important; }

/* ---------- Padding ---------- */
.p-0 { padding: 0 !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }

.pt-1 { padding-top: 4px !important; }
.pt-2 { padding-top: 8px !important; }
.pt-3 { padding-top: 12px !important; }
.pt-4 { padding-top: 16px !important; }
.pt-5 { padding-top: 20px !important; }

.pb-1 { padding-bottom: 4px !important; }
.pb-2 { padding-bottom: 8px !important; }
.pb-3 { padding-bottom: 12px !important; }

/* ---------- Width / height ---------- */
.w-auto { width: auto !important; }
.w-25   { width: 25% !important; }
.w-50   { width: 50% !important; }
.w-75   { width: 75% !important; }
.w-100  { width: 100% !important; }

/* Pixel widths used in form controls / cells */
.w-px-20  { width: 20px !important; }
.w-px-70  { width: 70px !important; }
.w-px-80  { width: 80px !important; }
.w-px-100 { width: 100px !important; }
.w-px-130 { width: 130px !important; }
.w-px-140 { width: 140px !important; }
.w-px-160 { width: 160px !important; }
.w-px-280 { width: 280px !important; }

.h-auto { height: auto !important; }
.h-100  { height: 100% !important; }

/* ---------- Font size (px values used in the codebase) ---------- */
.fs-11   { font-size: 11px !important; }
.fs-12   { font-size: 12px !important; }
.fs-12-5 { font-size: 12.5px !important; }
.fs-14   { font-size: 14px !important; }
.fs-16   { font-size: 16px !important; }
.fs-display { font-size: 4em !important; }   /* Big error page numerals etc. */

/* ---------- Vertical alignment ---------- */
.va-middle { vertical-align: middle !important; }

/* ---------- Opacity ---------- */
.opacity-75 { opacity: 0.75 !important; }

/* ---------- Component-shaped utilities ---------- */

/* Used by Branding views to preview an uploaded logo. Three sizes
   for navbar / login / hero placements; the inner image keeps its
   aspect ratio inside the bordered box. */
.logo-preview {
  border: 1px solid #ddd;
  object-fit: contain;
  background: #f9f9f9;
}
.logo-preview-sm { max-height: 64px;  max-width: 265px; }
.logo-preview-md { max-height: 80px;  max-width: 200px; }
.logo-preview-lg { max-height: 120px; max-width: 500px; }

/* Code / pre block formatting — used by audit-trace detail and a few
   other places that dump raw text. */
.code-block {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #f8f9fa;
  padding: 16px;
  border-radius: 4px;
  font-size: 14px;
}

/* Scrollable region inside a dashboard tile / card body. */
.scroll-y { overflow-y: auto; }

/* Inline icon next to a label — small, vertically centered. Replaces
   the repeated `style="margin-left:6px;vertical-align:middle;font-size:16px;"`
   pattern around action icons. */
.icon-inline {
  margin-left: 6px;
  vertical-align: middle;
  font-size: 16px;
}
