/*
 * Alfa-Rad ERP — Global Typography Scale
 *
 * This file is the single typography layer for the application UI.  It only
 * changes font metrics (size, weight and line-height); layout, spacing,
 * colours, data contracts and responsive grids remain owned by their
 * existing design-system files.
 */
:root {
  --erp-font-size-base: 16px;
  --erp-font-size-body: 14px;
  --erp-font-size-label: 15px;
  --erp-font-size-control: 15px;
  --erp-control-height: 46px;
  --erp-font-size-button: 15px;
  --erp-font-size-table: 15px;
  --erp-font-size-badge: 14px;
  --erp-font-size-kpi: 40px;
}

html { font-size: var(--erp-font-size-base); }

body,
body button,
body input,
body select,
body textarea {
  font-size: var(--erp-font-size-base);
  line-height: 1.6;
}

body p,
body .paragraph,
body .description,
body .text-description {
  font-size: var(--erp-font-size-body);
  line-height: 1.7;
}

/* Headings retain the existing hierarchy while becoming easier to scan. */
body h1,
body .h1 {
  font-size: 42px !important;
  line-height: 1.2;
}

body h2,
body .h2 {
  font-size: 30px !important;
  line-height: 1.25;
}

body h3,
body .h3 {
  font-size: 24px !important;
  line-height: 1.3;
}

/* Card/portal headings are intentionally smaller than page headings. */
body .card h2,
body .page-card h2,
body .section-card h2,
body .table-card h2,
body .chart-card h2,
body .summary-card h2,
body .module-card h2,
body .premium-report-card h2,
body .section-title,
body .module-group-title,
body .chart-title {
  font-size: 22px !important;
  line-height: 1.3;
}

body .card h3,
body .page-card h3,
body .section-card h3,
body .table-card h3,
body .chart-card h3,
body .summary-card h3,
body .module-card h3 {
  font-size: 24px !important;
  line-height: 1.3;
}

body .card p,
body .page-card p,
body .section-card p,
body .table-card p,
body .chart-card p,
body .summary-card p,
body .module-card p,
body .premium-report-card p,
body .module-group-description {
  font-size: 15px !important;
  line-height: 1.7;
}

/* Labels and controls use a consistent readable baseline. */
body label,
body .label,
body .field label,
body .form-label,
body .filter-label {
  font-size: var(--erp-font-size-label) !important;
  line-height: 1.45;
  font-weight: 600;
}

body input:not([type="checkbox"]):not([type="radio"]),
body select,
body textarea,
body .form-control,
body .form-select,
body .input,
body .select,
body .textarea {
  min-height: var(--erp-control-height);
  font-size: var(--erp-font-size-control) !important;
  line-height: 1.4;
}

body input::placeholder,
body textarea::placeholder,
body .form-control::placeholder {
  font-size: var(--erp-font-size-control);
  opacity: .78;
}

body .btn,
body button.btn,
body button,
body input[type="submit"],
body input[type="button"],
body .print-btn,
body .print-link {
  min-height: var(--erp-control-height);
  font-size: var(--erp-font-size-button) !important;
  line-height: 1.25;
  font-weight: 600;
}

/* RTL/LTR navigation follows the same visual scale. */
body .premium-nav .side-link,
body .premium-nav .side-group summary,
body .side-nav .side-link,
body .side-nav .side-group summary,
body .side-nav .side-sub-link {
  font-size: 16px !important;
  line-height: 1.4;
}

body .side-section-label,
body .premium-nav .side-section-label,
body .sidebar-group-title {
  font-size: 15px !important;
  line-height: 1.4;
}

body .sidebar-brand .brand-title { font-size: 16px !important; }
body .sidebar-brand .brand-sub { font-size: 14px !important; }

/* Tables and data density.  Existing padding and grids are unchanged. */
body .table,
body .data-table,
body .table th,
body .table td,
body .data-table th,
body .data-table td,
body .print-table,
body .print-table th,
body .print-table td {
  font-size: var(--erp-font-size-table) !important;
  line-height: 1.45;
}

body .table th,
body .data-table th,
body .print-table th {
  font-weight: 700;
}

body .table tbody tr,
body .data-table tbody tr { height: 50px; }

body .badge,
body .status-badge,
body .status-chip,
body .status-pill,
body .score-badge,
body .alert-pill {
  font-size: var(--erp-font-size-badge) !important;
  line-height: 1.35;
}

body .erp-breadcrumb,
body .breadcrumb,
body .page-breadcrumb {
  font-size: 14px !important;
  line-height: 1.5;
}

body .kpi-label,
body .kpi-card .label,
body .dashboard-card .label,
body .dashboard-card-title,
body .fin-kpi .label,
body .summary-label,
body .metric-label,
body .stat-label,
body .premium-report-stat span {
  font-size: 15px !important;
  line-height: 1.45;
}

body .kpi-value,
body .kpi-card .value,
body .dashboard-card .value,
body .dashboard-card-value,
body .wnum,
body .fin-kpi .value,
body .summary-value,
body .metric-value,
body .stat-value,
body .stat-number,
body .purchase-value-lg,
body .system-health-metrics article strong {
  font-size: var(--erp-font-size-kpi) !important;
  line-height: 1.15;
}

body .modal-title,
body .dialog-title,
body .erp-dialog-title {
  font-size: 28px !important;
  line-height: 1.25;
}

body .modal-body,
body .dialog-body,
body .erp-dialog-body { font-size: 16px !important; line-height: 1.7; }

body .erp-empty-state h2,
body .erp-empty-state h3,
body .empty-state h2,
body .empty-state h3 {
  font-size: 24px !important;
  line-height: 1.3;
}

body .erp-empty-state p,
body .empty-state p { font-size: 16px !important; line-height: 1.7; }

/* Keep the scale usable at the smallest supported viewport. */
@media (max-width: 575px) {
  body h1,
  body .h1 { font-size: 32px !important; }
  body h2,
  body .h2 { font-size: 26px !important; }
  body h3,
  body .h3 { font-size: 22px !important; }
  body .card h2,
  body .page-card h2,
  body .section-card h2,
  body .table-card h2,
  body .chart-card h2,
  body .summary-card h2,
  body .module-card h2,
  body .section-title,
  body .module-group-title,
  body .chart-title { font-size: 20px !important; }
  body .table tbody tr,
  body .data-table tbody tr { height: auto; min-height: 50px; }
}

/* Print keeps its existing paper geometry but uses the readable scale. */
@media print {
  body { font-size: 14px; line-height: 1.55; }
  body h1,
  body .h1 { font-size: 32px !important; }
  body h2,
  body .h2 { font-size: 24px !important; }
  body h3,
  body .h3 { font-size: 20px !important; }
  body .print-table,
  body .print-table th,
  body .print-table td { font-size: 14px !important; }
}
