/*
Theme Name: From Scratch ERP
Theme URI: https://fromscratch.ink
Author: From Scratch
Author URI: https://fromscratch.ink
Description: Multi-tenant SaaS ERP by From Scratch. The site owner adds subscribing companies with monthly or yearly plans; each company signs in and runs sales, purchasing, inventory, accounting (chart of accounts, automatic journal entries, VAT), expenses, HR & payroll and 30+ reports from one dashboard. Arabic & English (RTL/LTR).
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fromscratch-erp
*/

:root {
	--mint: #38f9b6;
	--mint-600: #12d394;
	--mint-50: #e8fff6;
	--ink: #003633;
	--ink-2: #0b4a45;
	--ink-3: #14615a;
	--bg: #f3f6f5;
	--card: #ffffff;
	--line: #e3ebe9;
	--line-2: #eef3f2;
	--text: #0f2a28;
	--muted: #5f7774;
	--good: #0e9f6e;
	--good-bg: #e3f8ef;
	--bad: #d64545;
	--bad-bg: #fdecec;
	--warn: #b7791f;
	--warn-bg: #fff4e0;
	--blue: #2563eb;
	--blue-bg: #e9f0ff;
	--radius: 14px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(0, 54, 51, .05), 0 4px 16px rgba(0, 54, 51, .04);
	--font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.fs {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
body.fs-modal-open { overflow: hidden; }
a { color: var(--ink-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; color: var(--ink); }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.fs-muted { color: var(--muted); }
.fs-small { font-size: 13px; }
.fs-num { font-variant-numeric: tabular-nums; }
.fs-cur { color: var(--muted); font-size: .78em; font-weight: 500; }
.fs-txt-bad { color: var(--bad); }
.fs-txt-warn { color: var(--warn); }
.fs-inline { display: inline; }

/* ---------- icons, logo */
.fs-ic { width: 18px; height: 18px; flex: none; }
.fs-logo-mark { width: 30px; height: 30px; fill: var(--mint); flex: none; }
[dir="rtl"] .fs-back .fs-ic { transform: scaleX(-1); }

/* ---------- buttons */
.fs-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	min-height: 40px; padding: 0 16px; border-radius: 10px;
	border: 1px solid var(--line); background: var(--card); color: var(--ink);
	font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
	transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.fs-btn:hover { background: var(--line-2); text-decoration: none; }
.fs-btn:active { transform: translateY(1px); }
.fs-btn:disabled, .fs-btn[disabled] { opacity: .5; cursor: not-allowed; }
.fs-btn:focus-visible, .fs-icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(56, 249, 182, .55); outline-offset: 1px; }
.fs-btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.fs-btn-primary:hover { background: var(--ink-2); }
.fs-btn-primary .fs-ic { color: var(--mint); }
.fs-btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.fs-btn-good:hover { background: #0b8a5f; }
.fs-btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.fs-btn-danger:hover { background: #bf3a3a; }
.fs-btn-ghost { background: transparent; border-color: transparent; }
.fs-btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.fs-btn-block { width: 100%; }
.fs-icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent;
	background: transparent; color: var(--muted); cursor: pointer; flex: none;
}
.fs-icon-btn:hover { background: var(--line-2); color: var(--ink); }
.fs-icon-btn:disabled { opacity: .35; cursor: default; }
.fs-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fs-link-sm { font-size: 13px; font-weight: 600; }

/* ---------- badges */
.fs-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.fs-tone-gray { background: var(--line-2); color: var(--muted); }
.fs-tone-green { background: var(--good-bg); color: var(--good); }
.fs-tone-red { background: var(--bad-bg); color: var(--bad); }
.fs-tone-amber { background: var(--warn-bg); color: var(--warn); }
.fs-tone-blue { background: var(--blue-bg); color: var(--blue); }
.fs-count { display: inline-flex; min-width: 22px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; background: var(--line-2); color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- forms */
.fs-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fs-span-2 { grid-column: 1 / -1; }
.fs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fs-field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fs-field > span i { color: var(--bad); font-style: normal; }
.fs-field small { color: var(--muted); font-size: 12px; }
.fs input:not([type]), .fs input[type=text], .fs input[type=time], .fs input[type=month], .fs input[type=email], .fs input[type=tel], .fs input[type=number], .fs input[type=date], .fs input[type=password], .fs input[type=search], .fs select, .fs textarea {
	width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.fs textarea { resize: vertical; min-height: 80px; }
.fs input:focus, .fs select:focus, .fs textarea:focus { border-color: var(--mint-600); box-shadow: 0 0 0 3px rgba(56, 249, 182, .25); outline: none; }
.fs input[dir=ltr] { text-align: left; }
.fs-addon { display: flex; gap: 6px; }
.fs-addon input { flex: 1; min-width: 0; }
.fs-addon-btn { display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--line-2); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fs-addon-btn:hover { background: var(--mint-50); border-color: var(--mint-600); }
.fs-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.fs-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.fs-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.fs-quick-dates { display: inline-flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.fs-quick-dates button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 10px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.fs-quick-dates button:hover { border-color: var(--mint-600); background: var(--mint-50); }
.fs-alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin: 12px 0; }
.fs-alert-error { background: var(--bad-bg); color: var(--bad); }
.fs-alert-warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- auth screens */
.fs-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.fs-auth-brand {
	background: radial-gradient(1200px 600px at 110% -10%, rgba(56, 249, 182, .22), transparent 60%), var(--ink);
	color: #d9f3ec; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px;
}
.fs-brand-row { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .12em; color: #fff; font-size: 15px; direction: ltr; }
.fs-brand-row .fs-logo-mark { width: 40px; height: 40px; }
.fs-brand-dark { color: var(--ink); justify-content: center; }
.fs-auth-brand h1 { color: #fff; font-size: clamp(28px, 3.4vw, 42px); max-width: 520px; }
.fs-auth-brand p { max-width: 520px; color: #b8dcd4; font-size: 17px; }
.fs-auth-points { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 12px; }
.fs-auth-points li { display: flex; gap: 10px; align-items: center; color: #e6faf4; }
.fs-auth-points li::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--mint); flex: none; }
.fs-auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 20px; position: relative; }
.fs-lang-link { position: absolute; top: 20px; inset-inline-end: 24px; font-weight: 600; }
.fs-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.fs-login-card { width: 100%; max-width: 420px; padding: 32px; }
.fs-login-card h2 { font-size: 24px; margin-bottom: 6px; }
.fs-login-card .fs-form { display: grid; gap: 16px; margin: 22px 0 18px; }
.fs-login-card label > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fs-lock { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(900px 500px at 50% -10%, rgba(56, 249, 182, .25), transparent 60%), var(--bg); }
.fs-lock-card { max-width: 480px; width: 100%; text-align: center; padding: 36px 28px; display: grid; gap: 14px; }
.fs-lock-icon { width: 68px; height: 68px; border-radius: 20px; margin: 8px auto 0; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); }
.fs-lock-card h1 { font-size: 24px; }
.fs-lock-company { font-weight: 700; color: var(--ink-3); }
.fs-lock-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* ---------- app shell */
.fs-app { min-height: 100vh; display: flex; }
.fs-boot { flex: 1; display: grid; place-items: center; min-height: 100vh; }
.fs-boot-logo { width: 54px; height: 54px; fill: var(--mint); animation: fs-pulse 1.2s ease-in-out infinite; }
@keyframes fs-pulse { 50% { opacity: .35; transform: scale(.94); } }
.fs-side {
	width: var(--side); flex: none; background: var(--ink); color: #cfe9e3;
	position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; z-index: 40;
}
.fs-side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 12px; }
.fs-side-brand b { display: block; color: #fff; font-size: 14px; letter-spacing: .04em; line-height: 1.25; word-break: break-word; }
.fs-side-brand small { color: #86b9b0; font-size: 12px; }
.fs-side-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.fs-nav { display: grid; gap: 2px; overflow-y: auto; }
.fs-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfe9e3; font-weight: 500; font-size: 14.5px; }
.fs-nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.fs-nav a.is-on { background: rgba(56, 249, 182, .14); color: #fff; }
.fs-nav a.is-on .fs-ic { color: var(--mint); }
.fs-side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.fs-plan-chip { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(56, 249, 182, .1); font-size: 12.5px; }
.fs-plan-chip span { color: var(--mint); font-weight: 700; }
.fs-plan-chip small { color: #9cc9c0; }
.fs-me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: #fff; }
.fs-me:hover, .fs-me.is-on { background: rgba(255, 255, 255, .06); text-decoration: none; }
.fs-me b { display: block; font-size: 13.5px; font-weight: 600; }
.fs-me small { color: #86b9b0; font-size: 12px; }
.fs-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--mint); color: var(--ink); font-weight: 700; font-size: 13px; flex: none; object-fit: cover; }
.fs-avatar.is-sm { width: 32px; height: 32px; font-size: 12px; background: var(--mint-50); color: var(--ink-3); }
.fs-avatar.is-xs { width: 22px; height: 22px; font-size: 10px; background: var(--mint-50); color: var(--ink-3); }
.fs-avatar.is-lg { width: 56px; height: 56px; font-size: 19px; }
.fs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fs-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(243, 246, 245, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 62px; }
.fs-top h1 { font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-top-actions { display: flex; align-items: center; gap: 4px; }
.fs-burger { display: none; }
.fs-ws-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 28px; background: var(--warn-bg); color: #7a5312; font-size: 13.5px; font-weight: 500; }
.fs-ws-banner span { flex: 1; }
.fs-view { padding: 24px 28px 60px; width: 100%; max-width: 1400px; }
.fs-page { display: grid; gap: 18px; }
.fs-scrim { display: none; }

/* ---------- page parts */
.fs-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.fs-page-head h2 { font-size: 24px; }
.fs-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); width: max-content; }
.fs-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fs-hero-main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.fs-hero-main h2 { font-size: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fs-hero-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--mint-50); color: var(--ink-3); display: grid; place-items: center; flex: none; }
.fs-hero-ic .fs-ic { width: 26px; height: 26px; }
.fs-hero-value { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.fs-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.fs-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-spacer { flex: 1; }
.fs-search { position: relative; flex: 0 1 320px; min-width: 200px; }
.fs-search .fs-ic { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.fs .fs-search input { padding-inline-start: 38px; background: #fff; }
.fs-select-sm { width: auto !important; min-width: 150px; }
.fs-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fs-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.fs-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fs-chip.is-on .fs-count { background: rgba(255, 255, 255, .16); color: #fff; }
.fs-seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 11px; border: 1px solid var(--line); }
.fs-seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.fs-seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.fs-hint { font-size: 12.5px; color: var(--muted); margin-top: -8px; }
.fs-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.fs-card-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.fs-card-head h3.is-late { color: var(--bad); }
.fs-card-head > div { display: flex; align-items: center; gap: 10px; }
.fs-card-head a { font-size: 13px; font-weight: 600; }
.fs-card-flush { padding: 0; overflow: hidden; }
.fs-card-flush .fs-card-head { margin: 0; }
.fs-pad { padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.fs-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.fs-grid-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.fs-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.fs-split-main, .fs-split-side { display: grid; gap: 18px; min-width: 0; }
.fs-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.fs-step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: var(--ink); font-size: 12.5px; font-weight: 700; }
.fs-onboard { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, var(--mint-50), #fff); border-color: #c9f5e4; }
.fs-onboard h3 { margin-bottom: 8px; }
.fs-onboard ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; color: var(--ink-2); }

/* ---------- KPIs */
.fs-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .fs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fs-kpis-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.fs-kpi { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.fs-kpi-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--mint-50); color: var(--ink-3); display: grid; place-items: center; flex: none; }
.fs-kpi.is-good .fs-kpi-ic { background: var(--good-bg); color: var(--good); }
.fs-kpi.is-warn .fs-kpi-ic { background: var(--warn-bg); color: var(--warn); }
.fs-kpi > div:last-child { min-width: 0; }
.fs-kpi-label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.fs-kpi-val { display: block; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.3; margin: 2px 0; word-break: break-word; }
.fs-kpi small { color: var(--muted); font-size: 12.5px; }

/* ---------- charts */
.fs-chart { position: relative; }
.fs-chart-svg { width: 100%; height: auto; display: block; }
.fs-grid-line { stroke: var(--line); stroke-width: 1; }
.fs-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.fs-bar { fill: #9ff5d6; transition: fill .15s; }
.fs-bar.is-last { fill: var(--mint-600); }
.fs-bar:hover { fill: var(--ink-3); }
.fs-bar-val { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--font); }
.fs-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; font-weight: 500; }
.fs-hbars { display: grid; gap: 14px; }
.fs-hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.fs-hbar-top small { color: var(--muted); }
.fs-hbar-track { height: 9px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.fs-hbar-track i { display: block; height: 100%; border-radius: inherit; background: var(--mint-600); min-width: 2px; }
.fs-hbar-track i.is-won { background: var(--good); }
.fs-hbar-track i.is-lost { background: #e7a4a4; }
.fs-donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.fs-donut { width: 170px; height: 170px; flex: none; }
.fs-donut-bg { stroke: var(--line-2); }
.fs-donut-num { font-size: 26px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.fs-donut-sub { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.fs-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 150px; }
.fs-legend li { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.fs-legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.fs-legend span { flex: 1; }

/* ---------- tables */
.fs-table-wrap { width: 100%; overflow-x: auto; }
.fs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fs-table th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 11px 16px; background: #fafcfb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fs-table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.fs-table tr:last-child td { border-bottom: 0; }
.fs-table tr.is-link { cursor: pointer; }
.fs-table tr.is-link:hover td { background: #f8fbfa; }
.fs-table td small { color: var(--muted); }
.fs-td-actions { text-align: end; white-space: nowrap; }
.fs-cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fs-cell-main b { display: block; font-weight: 600; }
.fs-cell-main small { display: block; font-size: 12.5px; color: var(--muted); }
.fs-you { font-weight: 500; }
.fs-table-foot { padding: 10px 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); }

/* ---------- empty / loading */
.fs-empty { text-align: center; padding: 40px 20px; color: var(--muted); display: grid; justify-items: center; gap: 12px; }
.fs-empty .fs-ic { width: 34px; height: 34px; color: #a7c4bf; }
.fs-empty-error .fs-ic { color: var(--bad); }
.fs-loading { display: grid; place-items: center; padding: 60px; }
.fs-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--mint-600); animation: fs-spin .7s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }

/* ---------- details lists, timeline */
.fs-dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.fs-dl dt { color: var(--muted); }
.fs-dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.fs-note { margin-top: 14px; padding: 12px; border-radius: 10px; background: #fafcfb; border: 1px dashed var(--line); font-size: 14px; white-space: pre-wrap; }
.fs-mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.fs-mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; flex-wrap: wrap; }
.fs-mini-list li:last-child { border-bottom: 0; }
.fs-mini-list li > span { display: inline-flex; gap: 8px; align-items: center; }
.fs-composer { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 16px; background: #fbfdfc; }
.fs-composer-types { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fs-composer-types input { position: absolute; opacity: 0; pointer-events: none; }
.fs-composer-types span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border: 1px solid transparent; }
.fs-composer-types .fs-ic { width: 15px; height: 15px; }
.fs-composer-types input:checked + span { background: #fff; border-color: var(--line); color: var(--ink); }
.fs .fs-composer textarea { border: 0; background: transparent; min-height: 56px; padding: 6px 4px; box-shadow: none; }
.fs-composer-foot { display: flex; justify-content: flex-end; }
.fs-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.fs-act { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.fs-act:not(:last-child)::before { content: ""; position: absolute; top: 42px; bottom: -4px; inset-inline-start: 15px; width: 2px; background: var(--line-2); }
.fs-act-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--line-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.fs-act-ic .fs-ic { width: 15px; height: 15px; }
.fs-act-note .fs-act-ic, .fs-act-call .fs-act-ic, .fs-act-meeting .fs-act-ic, .fs-act-whatsapp .fs-act-ic, .fs-act-email .fs-act-ic { background: var(--mint-50); color: var(--ink-3); }
.fs-act > div { min-width: 0; flex: 1; }
.fs-act-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 13.5px; }
.fs-act-head time { color: var(--muted); font-size: 12px; margin-inline-start: auto; }
.fs-act-type { font-size: 11.5px; font-weight: 700; color: var(--ink-3); background: var(--mint-50); padding: 1px 7px; border-radius: 6px; }
.fs-act-text { font-size: 14px; color: var(--text); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- tasks */
.fs-tasks { display: grid; }
.fs-task { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.fs-task:last-child { border-bottom: 0; }
.fs-task-main { flex: 1; min-width: 0; }
.fs-task-main b { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.fs-task.is-done .fs-task-main b { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.fs-task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.fs-task-meta > * { display: inline-flex; align-items: center; gap: 4px; }
.fs-task-meta .fs-ic { width: 13px; height: 13px; }
.fs-due.is-late { color: var(--bad); font-weight: 600; }
.fs-due.is-today { color: var(--warn); font-weight: 600; }
.fs-tick { position: relative; flex: none; cursor: pointer; margin-top: 1px; }
.fs-tick input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.fs-tick span { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #b9cfcb; display: grid; place-items: center; color: transparent; transition: .15s; }
.fs-tick .fs-ic { width: 14px; height: 14px; stroke-width: 3; }
.fs-tick input:checked + span { background: var(--good); border-color: var(--good); color: #fff; }
.fs-tick input:focus-visible + span { outline: 3px solid rgba(56, 249, 182, .55); }
.fs-row-actions { display: flex; opacity: .55; transition: opacity .15s; }
.fs-task:hover .fs-row-actions { opacity: 1; }
.fs-task-group { padding-bottom: 8px; }

/* ---------- kanban */
.fs-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.fs-col { background: #e9efee; border-radius: var(--radius); padding: 10px; min-height: 200px; display: flex; flex-direction: column; transition: background .15s, box-shadow .15s; }
.fs-col.is-over { background: var(--mint-50); box-shadow: inset 0 0 0 2px var(--mint-600); }
.fs-col header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.fs-col header > div { display: flex; align-items: center; gap: 7px; }
.fs-col header b { font-size: 14px; color: var(--ink); }
.fs-col header small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fs-col-won header b { color: var(--good); }
.fs-col-lost header b { color: var(--bad); }
.fs-col-body { display: grid; gap: 8px; }
.fs-deal { background: #fff; border-radius: 11px; padding: 12px; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); cursor: grab; display: grid; gap: 6px; position: relative; }
.fs-deal:hover { border-color: #bfe9da; }
.fs-deal.is-drag { opacity: .45; }
.fs-deal b { font-size: 14px; font-weight: 600; padding-inline-end: 22px; overflow-wrap: anywhere; }
.fs-deal-contact { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; color: var(--muted); }
.fs-deal-contact .fs-ic { width: 13px; height: 13px; }
.fs-deal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink); }
.fs-deal-foot small { font-weight: 500; font-size: 12px; color: var(--muted); }
.fs-deal-foot small.is-late { color: var(--bad); }
.fs-deal-owner { position: absolute; top: 10px; inset-inline-end: 10px; }
.fs-col-add { border: 1px dashed #c3d6d2; background: transparent; border-radius: 10px; padding: 8px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.fs-col-add:hover { background: #fff; color: var(--ink); }
.fs-stagepath { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.fs-stagepath button { flex: 1; min-width: 110px; border: 0; background: var(--line-2); padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
[dir="rtl"] .fs-stagepath button { clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 10px 100%, 0 50%); }
.fs-stagepath button:hover { background: #dfe9e7; color: var(--ink); }
.fs-stagepath button.is-past { background: #bff3df; color: var(--ink-2); }
.fs-stagepath button.is-now { background: var(--ink); color: #fff; }

/* ---------- doc editor */
.fs-items-wrap { overflow-x: auto; margin-bottom: 12px; }
.fs-items { width: 100%; border-collapse: collapse; min-width: 560px; }
.fs-items th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 0 6px 8px; }
.fs-items td { padding: 4px 6px; }
.fs-items td:nth-child(1) { width: 50%; }
.fs-items td:nth-child(2) { width: 12%; }
.fs-items td:nth-child(3) { width: 18%; }
.fs-item-total { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-totals { margin-top: 18px; margin-inline-start: auto; max-width: 360px; display: grid; gap: 8px; }
.fs-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14.5px; }
.fs .fs-totals input { width: 140px; min-height: 36px; }
.fs-totals .is-total { border-top: 1px solid var(--line); padding-top: 10px; font-size: 18px; }
.fs-totals .is-total b { color: var(--ink); }

/* ---------- invoice paper */
.fs-paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 40px; max-width: 900px; width: 100%; margin: 0 auto; font-size: 14px; color: #1d2b2a; }
.fs-bi { display: inline-flex; flex-direction: column; line-height: 1.2; }
.fs-bi [lang=en] { font-size: .78em; color: var(--muted); font-weight: 500; }
.fs-paper-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 3px solid var(--ink); flex-wrap: wrap; }
.fs-paper-seller { display: grid; gap: 4px; max-width: 380px; }
.fs-paper-seller h3 { font-size: 19px; }
.fs-paper-seller p { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; color: #42524f; }
.fs-paper-seller .fs-bi { flex-direction: row; gap: 5px; }
.fs-paper-logo { max-height: 64px; max-width: 180px; object-fit: contain; margin-bottom: 6px; }
.fs-paper-meta { text-align: end; }
.fs-paper-meta h2 { font-size: 22px; margin-bottom: 12px; }
.fs-paper-meta .fs-bi { align-items: flex-end; }
.fs-paper-meta dl { display: grid; grid-template-columns: auto auto; gap: 6px 14px; margin: 0; justify-content: end; align-items: center; }
.fs-paper-meta dt { color: var(--muted); }
.fs-paper-meta dt .fs-bi { flex-direction: row; gap: 4px; align-items: baseline; }
.fs-paper-meta dd { margin: 0; font-weight: 600; }
.fs-paper-buyer { padding: 18px 0; display: grid; gap: 3px; }
.fs-paper-buyer h4 { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.fs-paper-buyer h4 .fs-bi, .fs-paper-notes h4 .fs-bi { flex-direction: row; gap: 6px; align-items: baseline; }
.fs-paper-items { width: 100%; border-collapse: collapse; margin-top: 4px; }
.fs-paper-items th { background: var(--ink); color: #fff; text-align: start; padding: 9px 10px; font-size: 12.5px; font-weight: 600; }
.fs-paper-items th .fs-bi [lang=en] { color: #a9d6cd; }
.fs-paper-items td { padding: 10px; border-bottom: 1px solid var(--line); }
.fs-paper-items td:first-child, .fs-paper-items th:first-child { width: 36px; }
.fs-paper-items td:nth-child(n+3) { white-space: nowrap; }
.fs-paper-bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-top: 20px; flex-wrap: wrap; }
.fs-paper-qr { display: grid; gap: 6px; justify-items: center; }
.fs-paper-qr svg { width: 128px; height: 128px; }
.fs-paper-qr small { color: var(--muted); font-size: 11px; text-align: center; }
.fs-paper-qr small .fs-bi { align-items: center; }
.fs-paper-totals { border-collapse: collapse; min-width: 300px; margin-inline-start: auto; }
.fs-paper-totals th { text-align: start; font-weight: 500; padding: 7px 10px; color: #42524f; }
.fs-paper-totals th .fs-bi { flex-direction: row; gap: 5px; align-items: baseline; }
.fs-paper-totals td { text-align: end; padding: 7px 10px; font-weight: 600; white-space: nowrap; }
.fs-paper-totals .is-total th, .fs-paper-totals .is-total td { background: var(--mint-50); font-size: 16px; font-weight: 700; color: var(--ink); border-top: 2px solid var(--ink); }
.fs-paper-notes { margin-top: 20px; }
.fs-paper-notes h4 { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.fs-paper-notes p { white-space: pre-wrap; }
.fs-paper-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); color: #9db0ad; font-size: 11.5px; text-align: center; direction: ltr; }

/* ---------- team, settings */
.fs-seats { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.fs-seats > div { flex: 1; min-width: 220px; display: grid; gap: 8px; }
.fs-meter { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.fs-meter i { display: block; height: 100%; background: var(--mint-600); border-radius: inherit; }
.fs-logo-up { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.fs-logo-up > div:last-child { display: grid; gap: 6px; justify-items: start; }
.fs-logo-up label.fs-btn { cursor: pointer; }
.fs-logo-prev { width: 64px; height: 64px; border-radius: 14px; border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; color: #a7c4bf; background: #fafcfb; }
.fs-logo-prev img { width: 100%; height: 100%; object-fit: contain; }
.fs-stages { display: grid; gap: 8px; margin: 12px 0; }
.fs-stage-row { display: flex; align-items: center; gap: 6px; }
.fs-stage-row input { flex: 1; }
.fs-stage-n { width: 26px; height: 26px; border-radius: 8px; background: var(--line-2); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); flex: none; }
.fs-stage-row.is-fixed { padding: 8px 0; font-size: 14px; gap: 10px; color: var(--ink-2); }
.fs-plans { display: grid; gap: 12px; margin-bottom: 12px; }
.fs-plan-row { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr .8fr auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfc; }
.fs-plan-row .fs-icon-btn { margin-bottom: 3px; }

/* ---------- modal & toasts */
.fs-modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0, 30, 28, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fs-fade .15s ease-out; }
@keyframes fs-fade { from { opacity: 0; } }
.fs-modal { width: 100%; max-width: 500px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 30, 28, .25); animation: fs-rise .18s ease-out; }
.fs-modal.is-wide { max-width: 680px; }
@keyframes fs-rise { from { transform: translateY(10px); opacity: 0; } }
.fs-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.fs-modal-head h3 { font-size: 17px; }
.fs-modal-body { padding: 20px; }
.fs-modal-body .fs-alert { margin-bottom: 0; }
.fs-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fafcfb; border-radius: 0 0 16px 16px; }
.fs-confirm { font-size: 15px; }
.fs-cred { background: var(--ink); color: #dff8f0; padding: 16px; border-radius: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, var(--font); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; margin: 12px 0 14px; line-height: 1.7; }
.fs-toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
[dir="rtl"] .fs-toasts { transform: translateX(50%); }
.fs-toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); animation: fs-rise .2s ease-out; transition: opacity .3s, transform .3s; max-width: min(90vw, 460px); text-align: center; }
.fs-toast.fs-tone-bad { background: var(--bad); }
.fs-toast.is-out { opacity: 0; transform: translateY(6px); }

/* ---------- responsive */
@media (max-width: 1200px) {
	.fs-split, .fs-grid-wide { grid-template-columns: minmax(0, 1fr); }
	.fs-split-side { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 980px) {
	.fs-settings, .fs-grid-2 { grid-template-columns: minmax(0, 1fr); }
	.fs-plan-row { grid-template-columns: 1fr 1fr; }
	.fs-plan-row .fs-icon-btn { justify-self: end; grid-column: 1 / -1; }
}
@media (max-width: 900px) {
	.fs-side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
	[dir="rtl"] .fs-side { transform: translateX(100%); }
	.fs-nav-open .fs-side { transform: none !important; }
	.fs-nav-open .fs-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 30, 28, .4); z-index: 35; }
	.fs-burger { display: inline-flex; }
	.fs-top { padding: 10px 16px; }
	.fs-ws-banner { padding: 8px 16px; }
	.fs-view { padding: 18px 16px 50px; }
	.fs-auth { grid-template-columns: 1fr; }
	.fs-auth-brand { padding: 36px 20px 28px; }
	.fs-auth-brand h1 { font-size: 26px; }
	.fs-auth-points { display: none; }
	.fs-auth-form { padding: 24px 16px 40px; align-items: flex-start; }
	.fs-lang-link { position: static; display: block; margin-bottom: 12px; }
	.fs-auth-form { flex-direction: column; align-items: stretch; }
	.fs-login-card { margin: 0 auto; padding: 24px 20px; }
}
@media (max-width: 720px) {
	.fs-form-grid { grid-template-columns: minmax(0, 1fr); }
	.fs-hide-md { display: none; }
	.fs-page-head h2, .fs-hero-main h2 { font-size: 20px; }
	.fs-top-actions .fs-btn span { display: none; }
	.fs-search { flex: 1 1 100%; min-width: 0; }
	.fs-toolbar .fs-spacer { display: none; }
	.fs-toolbar > .fs-btn, .fs-toolbar > a.fs-btn { flex: 1; }
	.fs-select-sm { flex: 1; }
	.fs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.fs-kpi { flex-direction: column; gap: 10px; padding: 14px; }
	.fs-kpi-val { font-size: 18px; }
	.fs-board { grid-auto-columns: 82%; }
	/* tables become cards */
	.fs-table thead { display: none; }
	.fs-table, .fs-table tbody, .fs-table tr, .fs-table td { display: block; width: 100%; }
	.fs-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
	.fs-table td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
	.fs-table td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: start; flex: none; }
	.fs-table td:first-child { padding-bottom: 6px; }
	.fs-table td:first-child::before { display: none; }
	.fs-table td.fs-td-actions::before { display: none; }
	.fs-table td.fs-td-actions { justify-content: flex-end; }
	.fs-paper { padding: 20px 16px; font-size: 13px; }
	.fs-paper-meta { text-align: start; }
	.fs-paper-meta .fs-bi { align-items: flex-start; }
	.fs-paper-meta dl { justify-content: start; }
	.fs-paper-items { font-size: 12.5px; }
	.fs-paper-items td, .fs-paper-items th { padding: 7px 5px; }
	.fs-paper-totals { min-width: 0; width: 100%; }
	.fs-modal-wrap { padding: 0; align-items: flex-end; }
	.fs-modal, .fs-modal.is-wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; display: flex; flex-direction: column; }
	.fs-modal form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
	.fs-modal-body { overflow-y: auto; }
	.fs-modal-foot { border-radius: 0; }
	.fs-dl { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
	.fs-hero .fs-actions { width: 100%; }
}

/* ---------- print (invoice) */
@media print {
	@page { margin: 12mm; }
	body.fs { background: #fff; }
	.fs-side, .fs-top, .fs-ws-banner, .fs-no-print, .fs-toasts, .fs-scrim { display: none !important; }
	.fs-view { padding: 0; max-width: none; }
	.fs-paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
	.fs-paper-items th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.fs-paper-totals .is-total th, .fs-paper-totals .is-total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ======================================================================
   ERP additions
   ====================================================================== */
.fs-txt-good { color: var(--good); }
.fs-b { font-weight: 700; }
.fs-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; color: var(--muted); }
.fs-alert-info { background: var(--blue-bg); color: var(--blue); }
.fs-form-sec { font-size: 13.5px; color: var(--ink-3); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.fs-form-sec:first-child { margin-top: 0; }
.fs-total-line { margin-top: 12px; padding: 10px 12px; background: var(--mint-50); border-radius: 10px; font-size: 14px; }
.fs-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fs-checks { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0; }
.fs-checks legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.fs-checks.is-disabled { opacity: .45; pointer-events: none; }
.fs-actions-col { flex-direction: column; align-items: stretch; }
.fs-field-inline { flex-direction: row; align-items: center; gap: 8px; }
.fs-field-inline > span { white-space: nowrap; }
.fs-field-inline input, .fs-field-inline select { width: auto; min-width: 140px; }
.fs-field-inline.fs-grow { flex: 1 1 240px; }
.fs-field-inline.fs-grow select { flex: 1; width: 100%; }
.fs-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; }
.fs-modal.is-xwide { max-width: 920px; }

/* nav groups */
.fs-nav { gap: 0; }
.fs-nav-group { display: grid; gap: 2px; padding: 4px 0; }
.fs-nav-group + .fs-nav-group { border-top: 1px solid rgba(255, 255, 255, .06); }
.fs-nav-title { font-size: 11.5px; font-weight: 600; color: #7fb3aa; padding: 8px 12px 2px; letter-spacing: .02em; }
.fs-nav a { padding: 8px 12px; font-size: 14px; }
.fs-nav a .fs-ic { width: 17px; height: 17px; opacity: .85; }

/* dashboard */
.fs-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
a.fs-kpi { color: inherit; transition: border-color .15s, transform .1s; }
a.fs-kpi:hover { text-decoration: none; border-color: #bfe9da; }
.fs-legend-row { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 8px; }
.fs-legend-row li { font-size: 13px; }
.fs-grid-line.is-zero { stroke: #b9cfcb; }

/* cards grid (warehouses, cash) */
.fs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fs-wh p { min-height: 1.5em; font-size: 13.5px; margin-bottom: 12px; }
.fs-wh-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.fs-wh-stats div { background: #fafcfb; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; }
.fs-wh-stats small { display: block; color: var(--muted); font-size: 12px; }
.fs-wh-stats b { font-size: 16px; }
.fs-cash-card .fs-cash-bal { display: block; font-size: 24px; margin: 4px 0 14px; color: var(--ink); }

/* items editor */
.fs-items-erp { min-width: 860px; }
.fs-items-erp td:nth-child(1) { width: 22%; }
.fs-items-erp td:nth-child(2) { width: 30%; }
.fs-items-erp td:nth-child(3) { width: 10%; }
.fs-items-erp td:nth-child(4) { width: 13%; }
.fs-items-erp td:nth-child(5) { width: 8%; }
.fs-item-stock { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.fs-item-stock.is-low { color: var(--bad); font-weight: 600; }
.fs-je-lines { min-width: 820px; }
.fs-je-lines td:nth-child(1) { width: 30%; }
.fs-je-lines td:nth-child(2) { width: 20%; }
.fs .fs-cell-input { width: 96px; min-height: 34px; padding: 5px 8px; }

/* accounts tree */
.fs-tree { display: flex; align-items: center; gap: 6px; padding-inline-start: calc(var(--d) * 22px); }
.fs-tree-tog { border: 0; background: transparent; padding: 2px; cursor: pointer; color: var(--muted); display: inline-flex; }
.fs-tree-tog .fs-ic { width: 16px; height: 16px; transition: transform .15s; }
.fs-tree-tog .is-closed { transform: rotate(-90deg); }
[dir="rtl"] .fs-tree-tog .is-closed { transform: rotate(90deg); }
.fs-tree-dot { width: 6px; height: 6px; border-radius: 50%; background: #c3d6d2; margin: 0 7px; flex: none; }
.fs-tree-group { font-weight: 700; color: var(--ink); }

/* attendance */
.fs-att-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.fs-att-seg input { position: absolute; opacity: 0; pointer-events: none; }
.fs-att-seg span { display: inline-block; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; background: #fff; }
.fs-att-seg .is-present input:checked + span { background: var(--good-bg); color: var(--good); border-color: #9fe3c6; }
.fs-att-seg .is-late input:checked + span { background: var(--warn-bg); color: var(--warn); border-color: #f2d18f; }
.fs-att-seg .is-absent input:checked + span { background: var(--bad-bg); color: var(--bad); border-color: #f3b4b4; }
.fs-att-seg .is-leave input:checked + span { background: var(--blue-bg); color: var(--blue); border-color: #b8ccff; }
.fs .fs-att input[type=time] { width: 120px; }

/* reports */
.fs-rep-group { display: grid; gap: 12px; }
.fs-rep-group > h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.fs-rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.fs-rep-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.fs-rep-card:hover { text-decoration: none; border-color: var(--mint-600); box-shadow: 0 4px 16px rgba(0, 54, 51, .07); }
.fs-rep-card .fs-ic { color: var(--ink-3); background: var(--mint-50); border-radius: 10px; padding: 8px; width: 36px; height: 36px; flex: none; }
.fs-rep-card b { display: block; font-size: 14.5px; }
.fs-rep-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.fs-rep-meta { font-size: 13.5px; color: var(--muted); }
.fs-report th.is-num, .fs-report td.is-num { text-align: end; white-space: nowrap; }
.fs-report tr.is-head td { background: #f1f6f5; font-weight: 700; color: var(--ink); }
.fs-report tr.is-sub td { font-weight: 600; color: var(--ink-2); background: #fafcfb; }
.fs-report tr.is-total td { font-weight: 700; border-top: 1px solid var(--line); }
.fs-report tr.is-grand td { font-weight: 700; background: var(--mint-50); color: var(--ink); border-top: 2px solid var(--ink); font-size: 15px; }
.fs-report tr.is-first td { border-top: 1px solid var(--line); }
.fs-report tfoot td { background: #f1f6f5; border-top: 2px solid var(--line); }
.fs-table tfoot td { padding: 11px 16px; }
.fs-rep-chart { padding-bottom: 12px; }
.fs-print-head, .fs-print-foot { display: none; }

/* small papers: vouchers, payslips */
.fs-paper-sm { padding: 24px; box-shadow: none; }
.fs-voucher-dl { margin: 20px 0; font-size: 15px; }
.fs-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.fs-signs div { border-top: 1px solid var(--ink); padding-top: 6px; text-align: center; font-size: 13px; color: var(--muted); }
.fs-payslip { width: 100%; margin: 16px 0; }
.fs-payslip .is-sub th, .fs-payslip .is-sub td { border-top: 1px solid var(--line); font-weight: 700; }
.fs-paper-items td:nth-child(n+3), .fs-paper-items th:nth-child(n+3) { text-align: end; }
.fs-dl-inline { grid-template-columns: max-content 1fr max-content 1fr; margin-bottom: 14px; }

@media (max-width: 980px) {
	.fs-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.fs-dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
	.fs-grid-3 { grid-template-columns: minmax(0, 1fr); }
	.fs-filters { flex-direction: column; align-items: stretch; }
	.fs-field-inline { flex-direction: column; align-items: stretch; gap: 4px; }
	.fs-field-inline input, .fs-field-inline select { width: 100%; }
	.fs-dl-inline { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
	.fs-report tr.is-head td::before, .fs-report tr.is-grand td::before, .fs-report tr.is-total td::before { display: none; }
	.fs-report tr.is-head td:empty, .fs-report tr.is-total td:empty, .fs-report tr.is-grand td:empty, .fs-report tr.is-sub td:empty { display: none; }
	.fs-table tfoot tr { display: block; padding: 12px 16px; }
	.fs-table tfoot td { display: flex; justify-content: space-between; padding: 3px 0; border: 0; background: transparent; }
	.fs-table tfoot td:empty { display: none; }
	.fs-table tfoot td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; }
	.fs-table tfoot { display: block; background: #f1f6f5; }
	.fs .fs-cell-input { width: 100%; }
	.fs-att-seg span { padding: 5px 8px; }
}

@media print {
	.fs-print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 14px; }
	.fs-print-head img { max-height: 40px; margin-inline-end: 8px; vertical-align: middle; }
	.fs-print-head h2 { font-size: 18px; }
	.fs-print-head p { font-size: 12px; color: var(--muted); }
	.fs-print-foot { display: block; font-size: 11px; color: var(--muted); text-align: center; margin-top: 12px; }
	.fs-rep-meta, .fs-back { display: none !important; }
	.fs-card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
	.fs-report { font-size: 11.5px; }
	.fs-report td, .fs-report th { padding: 5px 8px; }
	.fs-kpi { box-shadow: none; }
	.fs-report tr.is-grand td, .fs-report tr.is-head td, .fs-report tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	body.fs-printing-el .fs-app { display: none !important; }
	body.fs-printing-el .fs-modal-wrap { position: static; background: none; padding: 0; display: block; }
	body.fs-printing-el .fs-modal { box-shadow: none; max-width: none; }
	body.fs-printing-el .fs-modal-head, body.fs-printing-el .fs-modal-foot { display: none; }
	body.fs-printing-el .fs-modal-body { padding: 0; }
	body.fs-printing-el:not(:has(.fs-modal-wrap)) .fs-app { display: block !important; }
	body.fs-printing-el:not(:has(.fs-modal-wrap)) .fs-app .fs-page > :not(.fs-print-target) { display: none !important; }
	.fs-modal-wrap { display: none; }
	body.fs-printing-el .fs-modal-wrap { display: block; }
}

.fs-sku { margin-inline-start: 6px; }
@media (max-width: 720px) {
	.fs-table.fs-report { display: table; min-width: 640px; }
	.fs-table.fs-report thead { display: table-header-group; }
	.fs-table.fs-report tbody { display: table-row-group; }
	.fs-table.fs-report tfoot { display: table-footer-group; }
	.fs-table.fs-report tr, .fs-table.fs-report tfoot tr { display: table-row; padding: 0; }
	.fs-table.fs-report td, .fs-table.fs-report tfoot td { display: table-cell; padding: 8px 10px; text-align: start; border-bottom: 1px solid var(--line-2); font-size: 13px; }
	.fs-table.fs-report td.is-num { text-align: end; }
	.fs-table.fs-report td::before, .fs-table.fs-report tfoot td::before { display: none; }
	.fs-table.fs-report td:empty { display: table-cell !important; }
	.fs-table.fs-report th { padding: 9px 10px; }
}
.fs-page > *, .fs-page [data-out] { min-width: 0; }

/* ================================================================ v1.1 */
.fs-alert-success { background: var(--good-bg); color: var(--good); }
.fs-btn-lg { min-height: 52px; font-size: 16px; padding: 0 20px; }
.fs-report tr.is-bad td { color: var(--bad); }
.fs-report tr.is-warn td { background: var(--warn-bg); }
.fs-plain { margin: 6px 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.fs-item-extra { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.fs-item-extra[hidden], .fs-item-extra [hidden] { display: none !important; }
.fs-item-extra select, .fs-item-extra input { min-height: 34px; font-size: 13px; flex: 1 1 110px; }
.fs-details { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.fs-details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.fs-details[open] summary { margin-bottom: 8px; }
.fs-rows-ed { overflow-x: auto; }
.fs-rows-ed .fs-items { min-width: 420px; }
.fs-rows-ed .fs-items td { width: auto !important; }
.fs-perms { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; display: grid; gap: 8px; }
.fs-perms legend { font-weight: 600; font-size: 13.5px; padding: 0 6px; }
.fs-perms.is-disabled { opacity: .55; }
.fs-perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; }
.fs-perm { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.fs-perm select { min-height: 34px; max-width: 120px; }
.fs-checks-row { display: flex; gap: 16px; flex-wrap: wrap; }
.fs-attach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fs-attach-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.fs-attach-list li a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.fs-attach-list li small { flex: 1 1 auto; }
.fs-alerts-box { border-inline-start: 4px solid var(--warn); }
.fs-alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fs-alert-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fs-alert-list li.is-bad .fs-ic { color: var(--bad); }
.fs-alert-list li.is-warn .fs-ic { color: var(--warn); }
.fs-drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 20px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; margin: 10px 0; }
.fs-drop:hover { border-color: var(--mint-600); background: var(--mint-50); }
.fs-drop input { max-width: 100%; }
.fs-preview td, .fs-preview th { font-size: 12.5px; white-space: nowrap; }
.fs-need { margin-top: 10px; }
.fs-quick-cash { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fs-table.fs-budget { min-width: 1480px; }
.fs-budget input { width: 100%; min-width: 80px; min-height: 34px; font-size: 13px; padding: 0 6px; }
.fs-budget td, .fs-budget th { padding: 6px 4px; }
.fs-budget td:first-child { min-width: 200px; }
.fs-budget tr.is-head td { background: #f1f6f5; }
.fs-plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fs-plan-opt { position: relative; display: grid; gap: 3px; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; }
.fs-plan-opt input { position: absolute; opacity: 0; }
.fs-plan-opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(56, 249, 182, .35); }
.fs-plan-opt small { color: var(--muted); }
.fs-lock-pay { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0 4px; }
.fs-lock-pay select { min-height: 42px; }
.fs-lock-pay .fs-alert { flex-basis: 100%; }
.fs-clock { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.fs-clock h3 { font-size: 34px; font-variant-numeric: tabular-nums; margin: 4px 0; }

/* POS */
.fs-pos-page { max-width: none !important; }
.fs-pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; min-height: calc(100vh - 120px); }
.fs-pos-left, .fs-pos-right { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.fs-pos-left { display: flex; flex-direction: column; gap: 10px; }
.fs-pos-right { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 76px; max-height: calc(100vh - 92px); }
.fs-pos-bar .fs-search { max-width: none; }
.fs-pos-bar input { min-height: 48px; font-size: 16px; }
.fs-pos-cats { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.fs-pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; overflow-y: auto; align-content: start; }
.fs-pos-item { display: grid; gap: 4px; text-align: start; background: var(--line-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; min-height: 86px; }
.fs-pos-item:hover { border-color: var(--mint-600); background: var(--mint-50); }
.fs-pos-item b { font-size: 14px; line-height: 1.3; }
.fs-pos-item span { font-weight: 700; color: var(--ink); }
.fs-pos-item small { color: var(--muted); font-size: 12px; }
.fs-pos-item.is-out { opacity: .6; }
.fs-pos-shift { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.fs-pos-cust select { width: 100%; min-height: 42px; }
.fs-pos-cart { flex: 1 1 auto; overflow-y: auto; min-height: 120px; display: grid; align-content: start; gap: 2px; }
.fs-pos-empty { display: grid; justify-items: center; gap: 6px; color: var(--muted); padding: 30px 0; }
.fs-pos-empty .fs-ic { width: 34px; height: 34px; }
.fs-pos-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.fs-pos-line-main { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.fs-pos-line-main small { margin-inline-start: auto; }
.fs-pos-line-main b { font-size: 14px; overflow-wrap: anywhere; }
.fs-pos-line-main small { color: var(--muted); }
.fs-pos-line-main select { min-height: 28px; font-size: 12px; max-width: 140px; }
.fs-pos-line-total { min-width: 64px; text-align: end; justify-self: end; }
.fs-qty { display: inline-flex; align-items: center; gap: 2px; }
.fs-qty input { width: 64px !important; min-width: 0; flex: none; min-height: 32px; text-align: center; padding: 0 4px; }
.fs-qty .fs-icon-btn { width: 30px; height: 30px; }
.fs-pos-sum { display: grid; gap: 4px; border-top: 2px solid var(--line); padding-top: 8px; }
.fs-pos-sum > div { display: flex; justify-content: space-between; }
.fs-pos-sum .is-total { font-size: 20px; color: var(--ink); }
.fs-pos-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fs-pos-pay [data-pay=split] { grid-column: 1 / -1; }
.fs-pos-tools { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 1000px) {
	.fs-pos { grid-template-columns: 1fr; }
	.fs-pos-right { position: static; max-height: none; }
	.fs-pos-grid { max-height: 46vh; }
}

/* thermal receipt */
.fs-receipt { width: 80mm; max-width: 100%; margin: 0 auto; background: #fff; color: #000; font-size: 12.5px; padding: 8px 6px; font-family: var(--font); }
.fs-receipt-58 { width: 58mm; font-size: 11px; }
.fs-receipt-a4 { width: 100%; max-width: 640px; font-size: 14px; }
.fs-rc-head { display: grid; justify-items: center; text-align: center; gap: 2px; }
.fs-rc-head img { max-height: 48px; filter: grayscale(1); }
.fs-rc-head b { font-size: 15px; }
.fs-rc-title { text-align: center; font-weight: 700; border-top: 1px dashed #000; border-bottom: 1px dashed #000; margin: 6px 0; padding: 3px 0; }
.fs-rc-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; }
.fs-rc-items, .fs-rc-tot { margin-top: 6px; display: grid; gap: 2px; }
.fs-rc-it { padding: 2px 0 4px; border-bottom: 1px dotted #999; }
.fs-rc-row { display: flex; justify-content: space-between; gap: 8px; }
.fs-rc-row > :last-child { white-space: nowrap; }
.fs-rc-tot .fs-rc-row.is-total { font-weight: 700; font-size: 1.15em; border-top: 1px dashed #000; padding-top: 4px; margin-top: 2px; }
.fs-rc-qr { display: flex; justify-content: center; margin: 8px 0; }
.fs-rc-qr svg { width: 110px; height: 110px; }
.fs-rc-foot { text-align: center; font-size: 11px; margin-top: 4px; }
@media print {
	body.fs-printing-el .fs-modal-body > .fs-receipt { width: auto; padding: 0; }
	@page { margin: 6mm; }
}
@media (max-width: 640px) {
	.fs-clock h3 { font-size: 28px; }
	.fs-budget input { width: 76px; }
}
