/* APXUTE PHASE 221 - AUTHORITATIVE GLOBAL TYPOGRAPHY SYSTEM
   Management UI: Manrope hierarchy + Inter operational text.
   IBM Plex Mono is reserved for technical identifiers only.
*/
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap');

:root {
    --font-heading: "Manrope", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;

    --leading-heading: 1.24;
    --leading-ui: 1.48;
    --leading-copy: 1.6;
}

html { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Tailwind/Vite compatibility: the historical build used a superseded font stack.
   These variables make every font-sans utility resolve to Inter even before the next Vite rebuild. */
:root {
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --default-font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --default-mono-font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.font-sans { font-family: var(--font-body) !important; }
.font-heading { font-family: var(--font-heading) !important; }
.font-mono { font-family: var(--font-mono) !important; }

/* Base application text */
body,
body :is(input, select, textarea, option),
body :where(div, span, a, summary, details, section, article, header, footer, main, aside, nav) {
    font-family: var(--font-body) !important;
}

body {
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-ui);
    letter-spacing: 0;
}

body :is(p, li, dd, dt, caption, td) {
    font-family: var(--font-body) !important;
    line-height: var(--leading-copy);
}

/* Headings / hierarchy */
body :is(h1, h2, h3, h4, h5, h6),
body :is(
    .kt-page-title,
    .apx-app-page-header h1,
    .apx-app-page-header h2,
    .apx127-page-header h1,
    .apx127-page-header h2,
    .apx129-page-header h1,
    .apx129-page-header h2,
    .apx130-page-header h1,
    .apx130-page-header h2,
    .apx213-finance-title,
    .apx216-page-title,
    [class*="metric"] [class*="value"],
    [class*="kpi"] [class*="value"]
) {
    font-family: var(--font-heading) !important;
    letter-spacing: -0.015em !important;
}

body h1 { font-size: clamp(24px, 2.25vw, 30px); font-weight: 700 !important; line-height: 1.2; }
body h2 { font-size: clamp(20px, 1.75vw, 22px); font-weight: 600 !important; line-height: 1.3; }
body h3 { font-size: clamp(16px, 1.35vw, 18px); font-weight: 600 !important; line-height: 1.35; }
body h4 { font-size: 15px; font-weight: 600 !important; line-height: 1.38; }
body h5, body h6 { font-size: 14px; font-weight: 600 !important; line-height: 1.4; }

/* Keep normal interface emphasis disciplined. */
body .font-black,
body .font-extrabold { font-weight: 700 !important; }
body .font-bold { font-weight: 600 !important; }
body .font-semibold { font-weight: 600 !important; }
body .font-medium { font-weight: 500 !important; }
body :is(strong, b) { font-weight: 600; }
body :is(h1, h2, h3, h4, h5, h6) strong { font-weight: inherit; }

/* Body / descriptions */
body :is(
    .kt-page-description,
    .apx-app-page-header p,
    .apx127-page-header p,
    .apx129-page-header p,
    .apx130-page-header p,
    [class*="description"],
    [class*="helper"],
    [class*="hint"]
) {
    font-family: var(--font-body) !important;
}

/* Navigation - Inter, compact and restrained. */
body :is(nav, aside, .kt-sidebar, .kt-master-sidebar, .kt-pro-sidebar) :is(a, button) {
    font-family: var(--font-body) !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}
body :is(nav, aside, .kt-sidebar, .kt-master-sidebar, .kt-pro-sidebar) :is(a.is-active, a[aria-current="page"], .is-active > a, .is-active > button) {
    font-weight: 600 !important;
}
body :is(.kt-business-brand-card, .kt-master-brand, .kt-pro-brand-card, .apx205-workspace-context, .apx207-workspace-context) strong {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}
body :is(.kt-business-side-link, .kt-master-nav-link, .kt-pro-nav-link, .kt-school-portal-nav) strong {
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}
body :is(.kt-business-side-link, .kt-master-nav-link, .kt-pro-nav-link, .kt-school-portal-nav) small {
    font-family: var(--font-body) !important;
    font-weight: 400 !important;
}

/* Top headers */
body :is(.kt-business-topbar, .kt-master-topbar, .kt-pro-topbar, .kt-institute-topbar) {
    font-family: var(--font-body) !important;
}
body :is(.kt-business-topbar, .kt-master-topbar, .kt-pro-topbar, .kt-institute-topbar) :is(h1, h2, .page-title, [class*="title"]) {
    font-family: var(--font-heading) !important;
}
body :is(.kt-business-profile-button, .kt-master-profile-button, [class*="profile-button"]) strong {
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
}

/* Buttons, tabs, badges and controls use Inter - not heading font. */
body :is(
    button,
    [role="button"],
    .btn,
    [class*="button"],
    [class*="-btn"],
    [class~="tab"],
    [class*="-tab"],
    [class*="tabs"],
    [class*="pill"],
    [class*="badge"],
    [class*="chip"]
) {
    font-family: var(--font-body) !important;
    letter-spacing: 0 !important;
}
body :is(button, [role="button"], .btn, [class*="button"], [class*="-btn"]) {
    font-weight: 600 !important;
}
body :is([class*="badge"], [class*="pill"], [class*="chip"]) {
    font-weight: 500 !important;
}

/* Small uppercase labels */
body :is(.uppercase, [class*="eyebrow"], [class*="kicker"], [class*="overline"], [class*="section-label"]) {
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    letter-spacing: .055em !important;
    line-height: 1.35;
}

/* Forms */
body :is(label, legend) {
    font-family: var(--font-body) !important;
    font-size: 13px;
    font-weight: 600 !important;
    line-height: 1.4;
    letter-spacing: 0 !important;
}
body :is(input, select, textarea, option) {
    font-size: 14px;
    font-weight: 400 !important;
    line-height: 1.45;
    letter-spacing: 0 !important;
}
body :is(input, textarea)::placeholder {
    font-family: var(--font-body) !important;
    font-size: 13px;
    font-weight: 400;
}

/* Tables */
body table {
    font-family: var(--font-body) !important;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}
body table thead :is(th, td) {
    font-family: var(--font-body) !important;
    font-size: 12.5px;
    font-weight: 600 !important;
    line-height: 1.35;
    letter-spacing: .015em !important;
}
body table tbody td {
    font-family: var(--font-body) !important;
    font-weight: 400;
    line-height: 1.5;
}
body table tbody td strong { font-weight: 600; }

/* Dashboard cards / metrics */
body :is(.apx-app-metric, [class*="metric-card"], [class*="stat-card"], [class*="kpi-card"]) :is(h2, h3, strong[class*="value"], [class*="metric-value"], [class*="stat-value"], [class*="kpi-value"]) {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
}
body :is([class*="metric-card"], [class*="stat-card"], [class*="kpi-card"]) :is(small, [class*="label"], [class*="note"]) {
    font-family: var(--font-body) !important;
}

/* Modals and drawers */
body :is(.apx-app-modal, .apx-app-dialog, .apx126-drawer, .apx-ops-drawer, .kt-modal, [role="dialog"]) {
    font-family: var(--font-body) !important;
}
body :is(.apx-app-modal, .apx-app-dialog, .apx126-drawer, .apx-ops-drawer, .kt-modal, [role="dialog"]) :is(h1, h2, h3, [class*="title"]) {
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}
body :is(.apx-app-modal, .apx-app-dialog, .apx126-drawer, .apx-ops-drawer, .kt-modal, [role="dialog"]) :is(p, label, input, select, textarea, button) {
    font-family: var(--font-body) !important;
}

/* Technical identifiers: deliberately selective. */
body :is(code, pre, kbd, .demo-login-id, .apx-technical-id, [data-apx-mono], .apx213-invoice-row-main > strong) {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0 !important;
}
body :is(code, .demo-login-id, .apx-technical-id, [data-apx-mono], .apx213-invoice-row-main > strong) {
    font-size: 12.5px;
    font-weight: 500 !important;
}

/* Auth UI */
body.kt-auth-body,
body .kt-auth-card,
body [class*="portal-card"] {
    font-family: var(--font-body) !important;
}
body :is(.kt-auth-card, [class*="portal-card"]) :is(h1, h2, h3) {
    font-family: var(--font-heading) !important;
}

/* Portal UI */
body.kt-portal-body :is(h1,h2,h3,h4,h5,h6),
body[data-kt-shell="school"] :is(.kt-page-title, .kt-pro-page-title, .apx-school-panel-heading h2, .apx-school-panel-heading h3) {
    font-family: var(--font-heading) !important;
}
body.kt-portal-body :is(nav a, nav button, button, input, select, textarea, label, p, li, td, th) {
    font-family: var(--font-body) !important;
}

/* Responsive hierarchy - preserve scanability instead of simply shrinking everything. */
@media (max-width: 1024px) {
    body h1 { font-size: clamp(26px, 3vw, 28px); }
    body h2 { font-size: 20px; }
}
@media (max-width: 760px) {
    body { font-size: 14px; line-height: 1.48; }
    body h1 { font-size: clamp(22px, 6vw, 24px); line-height: 1.22; }
    body h2 { font-size: 19px; }
    body h3 { font-size: 16px; }
    body table { font-size: 13px; }
    body table thead :is(th, td) { font-size: 12px; }
}


/* PHASE 222 — SCHOOL MANAGEMENT WEIGHT NORMALIZATION
   Old School visual layers used 750–950 weights. Those declarations are now
   normalized at source; this section defines the final semantic hierarchy. */
body[data-kt-shell="school"] :is(.apx175-command-hero > .apx175-hero-main > p,.apx175-kpi p,.apx175-operation-card p,.apx175-panel p,.apx-school-workspace p,.apx-school-workspace .text-slate-600,.apx-school-workspace .text-slate-500){
    font-family:var(--font-body)!important;
    font-weight:400!important;
    line-height:1.55!important;
}
body[data-kt-shell="school"] :is(.apx175-command-hero h1,.apx175-section-head h2,.apx-school-workspace section>h2,.apx-school-workspace form>h2,.apx-school-workspace .kt-school-table-toolbar h2){
    font-family:var(--font-heading)!important;
    font-weight:600!important;
}
body[data-kt-shell="school"] :is(.apx175-school-mark strong,.apx175-operation-card strong,.apx175-homework-list strong,.apx-school-workspace .font-semibold,.apx-school-workspace strong){
    font-weight:600!important;
}
body[data-kt-shell="school"] :is(.apx175-kpi>div>strong,.apx175-mini-grid strong,.apx175-money-grid strong,.apx175-learning-pill>strong,[class*="metric"] [class*="value"],[class*="kpi"] [class*="value"]){
    font-family:var(--font-heading)!important;
    font-weight:700!important;
}
body[data-kt-shell="school"] :is(.apx175-school-mark small,.apx175-section-head>div>span,.apx175-kpi small,.apx-school-workspace label,.apx-school-workspace table th){
    font-family:var(--font-body)!important;
    font-weight:500!important;
}
body[data-kt-shell="school"] .apx-school-workspace :is(input,select,textarea){font-weight:400!important}
body[data-kt-shell="school"] .apx-school-workspace :is(button,a[class*="bg-slate-950"],.kt-btn-primary){font-weight:600!important}
body[data-kt-shell="school"] .apx-school-workspace table th{font-size:12.5px!important;letter-spacing:.015em!important}
