/* ERP brand typography. Scope is supplied by the ERP host/login guard and Desk.
   IBM Plex Sans is distributed unchanged under OFL; see fonts/ibm-plex-sans/.
   Keep this stylesheet after the Desk and application styles. */
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 100 700;
	font-stretch: 85% 100%;
	font-display: swap;
	src: url("../fonts/ibm-plex-sans/IBMPlexSansVar-Roman.woff2") format("woff2");
}
@font-face {
	font-family: "IBM Plex Sans";
	font-style: italic;
	font-weight: 100 700;
	font-stretch: 85% 100%;
	font-display: swap;
	src: url("../fonts/ibm-plex-sans/IBMPlexSansVar-Italic.woff2") format("woff2");
}
/* Plex covers the four UI alphabets. Use the existing Noto asset for manat. */
@font-face {
	font-family: "Noto Sans";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/noto-sans/NotoSans-Regular.ttf") format("truetype");
	unicode-range: U+20BC;
}
@font-face {
	font-family: "Noto Sans";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/noto-sans/NotoSans-Bold.ttf") format("truetype");
	unicode-range: U+20BC;
}

/* Print formats and storefront pages retain their own type systems. */
@media screen {
	html.rzc-erp-typography {
		--rzc-erp-font-ui: "IBM Plex Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
		--rzc-erp-font-code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
		--font-stack: var(--rzc-erp-font-ui);
		--rzc-erp-muted: #52635d;
		font-family: var(--rzc-erp-font-ui);
		font-variation-settings: normal;
	}
	html.rzc-erp-typography[data-theme="dark"] {
		--rzc-erp-muted: #b5c6c0;
	}
	html.rzc-erp-typography body {
		font-family: var(--rzc-erp-font-ui);
		font-size: 15px;
		font-weight: 400;
		line-height: 1.5;
		letter-spacing: 0;
		color: var(--text-color, #1b2a25);
	}
	/* Explicit containers override older Inter/Manrope/Source Sans declarations. */
	html.rzc-erp-typography :is(.modal, .popover, .tooltip, .frappe-control, .datatable, .notification-list,
		.rzc-business-dashboard-v2, .rzc-dash-sidebar, .rzc-mp-dashboard, .rzc-seo-manager, .rzc-help,
		.chart-container, .chart-container svg text) {
		font-family: var(--rzc-erp-font-ui);
	}
	html.rzc-erp-typography .rzc-mp-dashboard {
		--rzc-mp-sans: var(--rzc-erp-font-ui);
	}
	html.rzc-erp-typography #page-login.rzc-login {
		font-family: var(--rzc-erp-font-ui);
	}
	/* Select controls rather than all descendants: icon and code fonts are private. */
	html.rzc-erp-typography :is(input, textarea, select, button, .form-control, .btn):not(:where(
		.ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .cm-editor, .cm-editor *,
		.monaco-editor, .monaco-editor *, .fa, .fas, .far, .fab, .octicon, .icon)) {
		font-family: var(--rzc-erp-font-ui);
		letter-spacing: 0;
	}
	html.rzc-erp-typography #page-login.rzc-login .form-control,
	html.rzc-erp-typography[data-rzc-erp-brand="1"] .page-card .page-card-body input.form-control,
	html.rzc-erp-typography :is(.form-control, .rzc-seo-form input, .rzc-seo-form textarea, .rzc-seo-form select):not(:where(
		.ace_editor *, .CodeMirror *, .cm-editor *, .monaco-editor *)) {
		font-size: 15px;
		font-weight: 400;
	}
	html.rzc-erp-typography :is(.control-label, .form-section .section-head, .grid-heading-row, .list-row-head) {
		font-size: 14px;
		font-weight: 600;
		letter-spacing: 0;
	}
	html.rzc-erp-typography :is(.help-box, .form-footer, .form-message, .field-description) {
		font-size: 13px;
		line-height: 1.5;
	}
	html.rzc-erp-typography .frappe-control .help-box,
	html.rzc-erp-typography :is(.help-box, .field-description) {
		color: var(--rzc-erp-muted);
	}
	/* The current Desk template adds an !important pale utility to hints. */
	html.rzc-erp-typography .frappe-control .help-box.text-extra-muted {
		color: var(--rzc-erp-muted) !important;
	}
	html.rzc-erp-typography :is(.page-title .title-text, .page-head h1, .rzc-home-hero-text h1) {
		font-size: clamp(22px, 1.5vw + 8px, 26px);
		font-weight: 600;
		line-height: 1.25;
		letter-spacing: -0.02em;
	}
	html.rzc-erp-typography :is(.modal-title, .msgprint-dialog .modal-title) {
		font-size: 20px;
		font-weight: 600;
		line-height: 1.3;
		letter-spacing: -0.015em;
	}
	html.rzc-erp-typography :is(.modal-body, .msgprint, .alert, .notification-item, .notification-content) {
		font-size: 15px;
		line-height: 1.5;
	}
	/* Menu labels stay readable without changing glyphs or row geometry. */
	html.rzc-erp-typography :is(.body-sidebar, .standard-sidebar, .desk-sidebar)
		:is(.item-label, .sidebar-item-label, .sidebar-label, .header-title, .section-title),
	html.rzc-erp-typography .body-sidebar .standard-sidebar-item .item-anchor .sidebar-item-label,
	html.rzc-erp-typography .desktop-icon .desktop-icon-label {
		font-family: var(--rzc-erp-font-ui);
		font-size: 15px;
		font-weight: 600;
		line-height: 1.4;
		letter-spacing: 0;
	}
	html.rzc-erp-typography .navbar :is(.nav-link, .dropdown-item, .navbar-brand) {
		font-family: var(--rzc-erp-font-ui);
		font-size: 14px;
		font-weight: 500;
	}
	/* Dense operational rows remain compact; financial digits align vertically. */
	html.rzc-erp-typography :is(.list-row, .grid-row, .dt-cell__content, .report-wrapper table, .table) {
		font-size: 14px;
		line-height: 1.4;
	}
	html.rzc-erp-typography :is(.dt-cell--header, .table th, .grid-heading-row) {
		font-weight: 600;
	}
	html.rzc-erp-typography :is([data-fieldtype="Currency"], [data-fieldtype="Float"], [data-fieldtype="Int"],
		[data-fieldtype="Percent"], input[type="number"], .dt-cell__content.text-right, .number,
		.number-card-value, .rzc-dash-kpi-value, .rzc-seo-summary dd, .rzc-home-hero-date) {
		font-variant-numeric: lining-nums tabular-nums;
	}
	/* Rich text keeps authored spans; actual code blocks/editors remain monospace. */
	html.rzc-erp-typography .ql-editor {
		font-family: var(--rzc-erp-font-ui);
		font-size: 15px;
		line-height: 1.65;
	}
	html.rzc-erp-typography :is(pre, code, kbd, samp) {
		font-family: var(--rzc-erp-font-code);
		font-variant-numeric: normal;
		letter-spacing: 0;
	}
	/* Home metadata used to be pale 10–12px text on white cards. */
	html.rzc-erp-typography :is(.rzc-home-empty, .rzc-home-footer, .rzc-home-hero-date small,
		.rzc-home-hero-text > p:not(.rzc-home-company), .rzc-home-recent-item small,
		.rzc-home-ann-item small, .rzc-home-actions-label, .rzc-home-sechead b) {
		color: var(--rzc-erp-muted);
		font-size: 13px;
		line-height: 1.5;
	}
	html.rzc-erp-typography .rzc-home-empty { font-size: 14px; }
	html.rzc-erp-typography :is(.rzc-home-action, .rzc-report-card, .rzc-home-recent-item strong) {
		font-size: 14px;
		font-weight: 600;
	}
	html.rzc-erp-typography .desktop-icon.rzc-photo-card .icon-title,
	html.rzc-erp-typography .rzc-report-card .rzc-report-label {
		font-size: 14px !important;
		line-height: 1.25 !important;
	}
	html.rzc-erp-typography .rzc-report-card .rzc-report-label { white-space: normal !important; }
	html.rzc-erp-typography .rzc-home-panel-head b { font-size: 16px; font-weight: 600; }
	html.rzc-erp-typography .rzc-home-recent-tag { font-size: 12px; font-weight: 600; }
	html.rzc-erp-typography .rzc-home-footer { gap: 12px; flex-wrap: wrap; }
	html.rzc-erp-typography .rzc-home-footer > * { min-width: 0; overflow-wrap: anywhere; }
	@media (max-width: 767px) {
		/* Prevent mobile browser input zoom; do not resize code-editor textareas. */
		html.rzc-erp-typography #page-login.rzc-login :is(input, textarea, select, .form-control),
		html.rzc-erp-typography[data-rzc-erp-brand="1"] .page-card .page-card-body input.form-control,
		html.rzc-erp-typography body :is(input, textarea, select, .form-control):not(:where(
			.ace_editor *, .CodeMirror *, .cm-editor *, .monaco-editor *)) {
			font-size: 16px;
		}
		html.rzc-erp-typography :is(.modal-title, .page-title .title-text) { overflow-wrap: anywhere; }
		html.rzc-erp-typography .rzc-home-recent-item { grid-template-columns: auto minmax(0, 1fr); }
		html.rzc-erp-typography .rzc-home-recent-item small { grid-column: 2; }
	}
}
