/* ============================================================
   typography.css — single source of truth for fonts across EIS.
   Load this on every app page BEFORE the page's own stylesheet
   (page CSS may still add layout-specific rules, but should
   reference the tokens below instead of hardcoding font stacks).

   Excluded on purpose (print-fidelity documents, not app UI):
   Replica.html/css, InvoicePreviewViewer.html, receivables.css
   (also consumed server-side for official-receipt PDFs), and
   the emailTemplates.html HTML-source/preview widgets.
   ============================================================ */

:root {
  /* Font families */
  --font-family-base: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, "Helvetica Neue", sans-serif;
  --font-family-mono: 'Consolas', 'Courier New', monospace;

  /* Weights */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;

  /* Sizes (px) — use for new/rewritten rules; existing pixel-tuned
     component CSS is left as-is where changing it risked layout shift */
  --fs-caption:      12px;
  --fs-label:        13px;
  --fs-body:         14px;
  --fs-body-lg:      15px;
  --fs-section-title:16px;
  --fs-panel-title:  18px;
  --fs-page-title:   20px;
  --fs-display:      24px;

  /* Line heights */
  --lh-tight:   1.2;
  --lh-normal:  1.45;
  --lh-relaxed: 1.6;
}

html, body {
  font-family: var(--font-family-base);
}

button, input, select, textarea, optgroup {
  font-family: inherit;
}

/* ---------------- Typography utility classes ----------------
   Optional — use on new markup or when refactoring a component.
   ---------------------------------------------------------- */
.text-page-title {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--fs-page-title);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  color: #111827;
}

.text-section-title {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--fs-section-title);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: #111827;
}

.text-panel-title {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--fs-panel-title);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: #111827;
}

.text-body {
  font-family: var(--font-family-base);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
}

.text-label {
  font-family: var(--font-family-base);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-normal);
}

.text-caption {
  font-family: var(--font-family-base);
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: #6b7280;
}

.text-button {
  font-family: var(--font-family-base);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
}

.text-table-header {
  font-family: var(--font-family-base);
  font-size: 11.5px;
  font-weight: var(--fw-bold);
  letter-spacing: .2px;
}

.text-table-cell {
  font-family: var(--font-family-base);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
}

/* ==== DARK THEME: generated by scripts/theme/generate-dark.js — do not edit by hand; run `npm run theme:dark` after changing the styles above. ==== */
@media screen {
  :root[data-theme="dark"] .text-page-title:not(:where(.theme-paper, .theme-paper *)) {
    color: #dbdce4;
  }
  :root[data-theme="dark"] .text-section-title:not(:where(.theme-paper, .theme-paper *)) {
    color: #dbdce4;
  }
  :root[data-theme="dark"] .text-panel-title:not(:where(.theme-paper, .theme-paper *)) {
    color: #dbdce4;
  }
  :root[data-theme="dark"] .text-caption:not(:where(.theme-paper, .theme-paper *)) {
    color: #9094ab;
  }
}
/* ==== END DARK THEME ==== */
