/* ==========================================================================
   BioTrack Pro — Base
   Element defaults, typography scale, shared utilities.
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  letter-spacing: var(--tracking-tight);
}

/* ---------- Headings ------------------------------------------------------ */

.h1,
.h2,
.h3,
.h4,
.h5 {
  color: var(--color-text-strong);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

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

/* ---------- Text utilities ------------------------------------------------ */

.text-2xs  { font-size: var(--text-2xs); }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-md   { font-size: var(--text-md); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }

.font-regular  { font-weight: var(--weight-regular); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.text-strong { color: var(--color-text-strong); }
.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-danger { color: var(--color-danger); }
.text-success{ color: var(--color-success); }
.text-warning{ color: var(--color-warning); }
.text-info   { color: var(--color-info); }
.text-primary{ color: var(--color-primary); }
.text-critical { color: var(--color-critical); }

.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-caps {
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
  letter-spacing: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

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

.nowrap { white-space: nowrap; }

/* ---------- Links --------------------------------------------------------- */

.link {
  color: var(--color-link);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: var(--transition-colors);
  border-radius: var(--radius-xs);
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Layout utilities ---------------------------------------------- */

.stack        { display: flex; flex-direction: column; }
.row          { display: flex; flex-direction: row; align-items: center; }
.row-start    { display: flex; flex-direction: row; align-items: flex-start; }
.row-baseline { display: flex; flex-direction: row; align-items: baseline; }
.wrap         { flex-wrap: wrap; }
.grow         { flex: 1 1 auto; min-width: 0; }
.shrink-0     { flex-shrink: 0; }
.between      { justify-content: space-between; }
.center       { justify-content: center; }
.end          { justify-content: flex-end; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.items-start  { align-items: flex-start; }

.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.block  { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.relative { position: relative; }

.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Icons --------------------------------------------------------- */

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}

.icon-sm { width: 15px; height: 15px; }
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* ---------- Dividers ------------------------------------------------------ */

.divider {
  height: 1px;
  background: var(--color-border);
  border: none;
  margin: var(--space-4) 0;
}

.divider-v {
  width: 1px;
  align-self: stretch;
  background: var(--color-border);
  margin: 0 var(--space-2);
}

/* ---------- Selection ----------------------------------------------------- */

::selection {
  background: var(--color-primary-soft-hover);
  color: var(--color-text-strong);
}

/* ---------- Print-only / screen-only -------------------------------------- */

.print-only { display: none; }
