/* ==========================================================================
   Typography — "Figtree"
   Figtree for everything: body, interface (menu, tabs, labels, buttons,
   badges, table headers) and headings. Friendly and open like the Poppins
   it replaces, but narrower with a taller x-height, so it reads better at
   the app's 90% zoom. Body 14.5px at 500, interface text 600-700, headings
   700-800; the small .fs-* utilities are lifted to 12-13.5px.

   Rem stays 13px (Metronic) so spacing is untouched; sizes are set per role.
   Figtree (500-800) is loaded by layouts/app.blade.php; nothing loads 400,
   so the few rules that ask for 400 get 500 on purpose. Loaded last, after
   every other refresh stylesheet, so its tokens win.
   ========================================================================== */

:root {
    --ty-body: Figtree, Helvetica, Arial, sans-serif;
    --ty-ui: Figtree, Helvetica, Arial, sans-serif;
    --ty-head: Figtree, Helvetica, Arial, sans-serif;
    --ty-input: Figtree, Helvetica, Arial, sans-serif;
    --ty-size: 14.5px;
    --ty-weight: 500;
    --ty-lh: 1.55;
    --ty-color: #1d2531;
    --ty-muted: #646d7c;           /* .text-muted was #a1a5b7 (2.6:1); now 5.2:1 on white */
    --ty-head-weight: 700;
    --ty-head-track: -0.01em;

    /* Shared tokens the settled files read. */
    --bs-font-sans-serif: var(--ty-body);
    --mn-font: var(--ty-ui);
    --tb-font: var(--ty-ui);
    --fm-ui-font: var(--ty-ui);
    --fm-input-font: var(--ty-input);
    --fm-badge-font: var(--ty-ui);
    --fm-head-font: var(--ty-head);
    --fm-label-size: 13.5px;
    --fm-label-weight: 600;
    --fm-help-size: 13px;
    --fm-input-size: 14.5px;
    --fm-input-weight: 500;
    --fm-btn-size: 14px;
    --fm-btn-weight: 700;
    --fm-badge-size: 11.5px;
    --fm-badge-weight: 700;
    --fm-head-size: 17px;
    --fm-head-weight: 700;
    --fm-head-tracking: var(--ty-head-track);
    --fm-sub-size: 13px;
    --fm-section-size: 18.5px;
    --so-font: var(--ty-ui);
    --ud-font: var(--ty-ui);
    --ud-text-font: var(--ty-body);
    --mg-ui: var(--ty-ui);
    --mg-font: var(--ty-body);
}

/* --- Body ------------------------------------------------------------------ */
html {
    font-family: var(--ty-body);
}

body#kt_body {
    font-family: var(--ty-body);
    font-size: var(--ty-size) !important;
    font-weight: var(--ty-weight);
    line-height: var(--ty-lh);
    color: var(--ty-color);
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
}

#kt_body :is(button, input, select, textarea, optgroup) {
    font-family: inherit;
}

/* --- Size scale: the small utilities were 11-12px on screen at 90% zoom --- */
#kt_body .fs-base { font-size: 14.5px !important; }
#kt_body .fs-4 { font-size: 17px !important; }
#kt_body .fs-5 { font-size: 15.5px !important; }
#kt_body .fs-6 { font-size: 14.5px !important; }
#kt_body .fs-7 { font-size: 13.5px !important; }
#kt_body .fs-8 { font-size: 12.5px !important; }
#kt_body .fs-9 { font-size: 12px !important; }

/* --- Weights ---------------------------------------------------------------- */
#kt_body .fw-normal { font-weight: 500 !important; }
#kt_body .fw-bold { font-weight: 600 !important; }
#kt_body :is(.fw-bolder, .fw-semibold) { font-weight: 700 !important; }
#kt_body .fw-boldest { font-weight: 800 !important; }

/* --- Readable greys ------------------------------------------------------------- */
#kt_body :is(.text-muted, .text-gray-500) {
    color: var(--ty-muted) !important;
}

#kt_body .text-gray-600 {
    color: #5d6676 !important;
}

/* --- Headings ------------------------------------------------------------------- */
#kt_body :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
    font-family: var(--ty-head);
    font-weight: var(--ty-head-weight);
    letter-spacing: var(--ty-head-track);
}

#kt_body #kt_header .page-title > h1 {
    font-family: var(--ty-head);
    font-size: 19.5px;
    font-weight: 800 !important;
    letter-spacing: -0.015em;
}

#kt_body #kt_header .page-title > h3 {
    font-family: var(--ty-head);
    font-size: calc(19.5px - 2px);
    font-weight: 600 !important;
    color: var(--sk-text-muted) !important;
}

/* --- Menu ------------------------------------------------------------------------- */
#kt_aside .menu .menu-item .menu-link,
#kt_aside #kt_aside_footer .btn-custom {
    font-size: 14.5px;
}

#kt_aside .menu .menu-item .menu-link .menu-title {
    font-weight: 600;
}

#kt_aside .menu .menu-item .menu-link.active .menu-title,
#kt_aside #kt_aside_footer .btn-custom {
    font-weight: 700;
}

#kt_aside .menu .menu-item .menu-section {
    font-size: 12px !important;
}

/* --- Table headers and pagination ----------------------------------------------- */
#kt_body .table > thead > tr > th {
    font-family: var(--ty-ui) !important;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0;
}

#kt_body .page-item .page-link {
    font-family: var(--ty-ui) !important;
}

/* --- Figures: prices, dates and counts line up -------------------------------------- */
#kt_body :is(.table td, .badge, .page-link, .price, [class*="price"]) {
    font-variant-numeric: tabular-nums;
}

/* --- Third-party widgets that name Poppins (or a system font) themselves ----- */
#kt_body .daterangepicker,
#kt_body .ql-toolbar,
#kt_body .ql-container,
#kt_body .leaflet-container .leaflet-popup-content-wrapper .leaflet-popup-content {
    font-family: var(--ty-body);
}

#kt_body :is(.apexcharts-legend-text, .apexcharts-text, .apexcharts-title-text) {
    font-family: var(--ty-body) !important;
}

#kt_body .select2-container .select2-search--inline .select2-search__field {
    font-family: inherit;
}

/* Copilot's admin chat overview asks for Inter Tight without loading it;
   fall back to the app face rather than a system font. */
#kt_body .cpx-display {
    font-family: "Inter Tight", var(--ty-head);
}
