/* =============================================================================
   BUAMS AI new-ui — UTILITIES
   Spec: /frontend_design.md §E.2

   A deliberately small set. Bootstrap 5's utilities are available on these
   pages; this file only adds what Bootstrap lacks or what must be tokenised
   (Bootstrap's spacers are rem-based and would not follow the 4px token scale).
   ============================================================================= */

/* ── Screen-reader only (spec §I) ─────────────────────────────────────────── */
.bui-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;
}

/* Visible again on focus — for skip links and keyboard-only affordances */
.bui-sr-only-focusable:focus,
.bui-sr-only-focusable:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ── Token-scale spacing ──────────────────────────────────────────────────── */
.bui-mt-0 { margin-top: 0; }
.bui-mt-1 { margin-top: var(--bui-space-1); }
.bui-mt-2 { margin-top: var(--bui-space-2); }
.bui-mt-3 { margin-top: var(--bui-space-3); }
.bui-mt-4 { margin-top: var(--bui-space-4); }
.bui-mt-5 { margin-top: var(--bui-space-5); }
.bui-mt-6 { margin-top: var(--bui-space-6); }
.bui-mt-8 { margin-top: var(--bui-space-8); }

.bui-mb-0 { margin-bottom: 0; }
.bui-mb-1 { margin-bottom: var(--bui-space-1); }
.bui-mb-2 { margin-bottom: var(--bui-space-2); }
.bui-mb-3 { margin-bottom: var(--bui-space-3); }
.bui-mb-4 { margin-bottom: var(--bui-space-4); }
.bui-mb-5 { margin-bottom: var(--bui-space-5); }
.bui-mb-6 { margin-bottom: var(--bui-space-6); }
.bui-mb-8 { margin-bottom: var(--bui-space-8); }

/* ── Flex ─────────────────────────────────────────────────────────────────── */
.bui-flex        { display: flex; }
.bui-inline-flex { display: inline-flex; }
.bui-flex-col    { flex-direction: column; }
.bui-items-center{ align-items: center; }
.bui-items-start { align-items: flex-start; }
.bui-justify-between { justify-content: space-between; }
.bui-justify-center  { justify-content: center; }
.bui-flex-wrap   { flex-wrap: wrap; }
.bui-flex-1      { flex: 1 1 auto; min-width: 0; }

.bui-gap-1 { gap: var(--bui-space-1); }
.bui-gap-2 { gap: var(--bui-space-2); }
.bui-gap-3 { gap: var(--bui-space-3); }
.bui-gap-4 { gap: var(--bui-space-4); }

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

/* Truncate a single line — for tenant names of unknown length */
.bui-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bui-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.bui-w-full { width: 100%; }
.bui-block  { display: block; }
.bui-none   { display: none; }
.bui-relative { position: relative; }

/* ── Responsive visibility ────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .bui-hide-below-lg { display: none !important; }
}

@media (min-width: 992px) {
  .bui-hide-above-lg { display: none !important; }
}

@media (max-width: 767.98px) {
  .bui-hide-below-md { display: none !important; }
}

@media (max-width: 575.98px) {
  .bui-hide-below-sm { display: none !important; }
}

/* ── Print ────────────────────────────────────────────────────────────────── */
.bui-no-print { }

@media print {
  .bui-no-print { display: none !important; }
}
