/* Riyaz Group BMS — hand-written, no framework. Logical properties throughout so LTR (English) and
   RTL (Dari) share one stylesheet. Look: charcoal-green sidebar, yellow active state, card rows, colour pills. */

@font-face { font-family: "Urbanist"; src: url("../fonts/urbanist-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("../fonts/urbanist-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("../fonts/urbanist-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("../fonts/urbanist-700.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/vazirmatn-arabic-700-normal.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  --paper: #f3f4f6;          /* page background */
  --surface: #ffffff;
  --sunken: #f1f2f4;
  --ink: #1f2421;
  --ink-2: #39403c;
  --muted: #6b726e;
  --faint: #9aa19d;
  --line: #e4e6e9;
  --line-2: #eef0f2;
  --side: 264px;
  --side-bg: #2e3934;        /* charcoal green */
  --side-ink: #e9eeeb;
  --side-muted: #98a59f;
  --yellow: #f6cf45;         /* active / highlight */
  --yellow-ink: #2a2a1c;
  --green: #4f9a3e;          /* brand green */
  --green-ink: #2f6e22;
  --accent: #4f9a3e;
  --accent-ink: #2f6e22;
  --accent-soft: #e8f3e3;
  --ok: #3d8b37;   --ok-soft: #e6f4e2;
  --warn: #b57a00; --warn-soft: #fdf3d2;
  --bad: #d4572a;  --bad-soft: #fde8e0;
  --info: #1c76b8; --info-soft: #e1f0fb;
  --red: #e5484d;
  --radius: 10px;
  --font: "Urbanist", "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[dir="rtl"] { --font: "Vazirmatn", "Urbanist", system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
html[dir="rtl"] body { font-size: 14.5px; line-height: 1.7; font-weight: 400; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--green-ink); font-weight: 600; }
a.link:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.upper { text-transform: uppercase; letter-spacing: .07em; font-size: 11.5px; font-weight: 600; }
html[dir="rtl"] .upper { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px 20px; background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #4a5751 transparent;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--yellow); color: var(--side-bg); display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.1; color: #fff; }
.brand-sub { font-size: 11.5px; color: var(--side-muted); letter-spacing: .04em; }
.nav-label { display: flex; align-items: center; gap: 8px; padding: 18px 10px 6px; color: var(--side-muted); }
.nav-label::before { content: ""; width: 7px; height: 7px; border-inline-start: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg) translateY(2px); }
html[dir="rtl"] .nav-label::before { transform: rotate(-45deg) translateY(2px); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--side-ink); font-size: 15px; font-weight: 500; }
.nav a .ico { color: #c9d3ce; }
.nav a:hover { background: rgba(255, 255, 255, .07); }
.nav a.on { background: var(--yellow); color: var(--yellow-ink); font-weight: 700; }
.nav a.on .ico { color: var(--yellow-ink); }
.nav .count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; min-height: 70px; }
.topbar .spacer { flex: 1; }
.top-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); color: var(--muted); width: min(340px, 34vw); }
.top-search input { border: 0 !important; background: transparent !important; height: 36px !important; padding: 0 !important; box-shadow: none !important; font: 500 14px var(--font); width: 100%; }
.switcher { position: relative; }
.switcher summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 700; font-size: 14.5px; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary .sw-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--green); }
.switcher summary .chev { color: var(--muted); font-size: 10px; }
.switcher .menu { position: absolute; inset-inline-start: 0; top: calc(100% + 8px); min-width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(31, 36, 33, .3); padding: 8px; z-index: 30; }
.switcher .menu a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; font-weight: 600; }
.switcher .menu a:hover { background: var(--sunken); }
.switcher .menu .kind { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.lang a { padding: 8px 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.lang a.on { background: var(--side-bg); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: var(--yellow-ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 12.5px; }
.who-name { font-weight: 700; line-height: 1.2; }
.who-role { font-size: 12.5px; color: var(--muted); }

.content { padding: 28px 32px 64px; max-width: 1440px; width: 100%; }
.ribbon { background: #fff8e1; color: #6b5200; border-bottom: 1px solid #f3e3a6; font-size: 13px; padding: 7px 32px; display: flex; gap: 8px; align-items: center; }
.ribbon b { font-weight: 700; }

/* ---------- page header ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; font-weight: 600; }
.crumbs a:hover { color: var(--ink); }
.crumbs span.sep { color: var(--faint); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { font-size: 18px; font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #cfd3d8; background: #fafbfb; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-ink); border-color: var(--green-ink); }
.btn-accent, .btn-yellow { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.btn-accent:hover, .btn-yellow:hover { background: #ecc232; border-color: #ecc232; }
.btn-dark { background: var(--side-bg); border-color: var(--side-bg); color: #fff; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.panel-head .muted { font-size: 13px; }
.panel-body { padding: 18px 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid { display: grid; gap: 18px; align-items: start; }
.grid > .panel { margin-top: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.stack > * + * { margin-top: 18px; }

/* Action / figure cards (big number + label + arrow) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 4px; position: relative; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); }
.kpi-ico.green { background: var(--ok-soft); color: var(--ok); }
.kpi-ico.blue { background: var(--info-soft); color: var(--info); }
.kpi-ico.orange { background: var(--bad-soft); color: var(--bad); }
.kpi-ico.yellow { background: var(--warn-soft); color: var(--warn); }
.kpi-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--bad); }
.kpi-flag.ok { color: var(--ok); }
.kpi-flag.info { color: var(--info); }
.kpi .label { color: var(--muted); font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.15; }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-inline-start: 4px; }
.kpi .foot { font-size: 13px; color: var(--muted); }
.kpi .value.bad { color: var(--bad); }
.kpi a.go { position: absolute; inset: 0; border-radius: 14px; }
.kpi .arrow { color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* Card rows: one record per white card, small uppercase column labels (like a CRM list) */
.rows { display: flex; flex-direction: column; gap: 10px; }
.rowcard { display: grid; grid-template-columns: var(--cols, minmax(180px, 1.4fr) repeat(4, minmax(0, 1fr)) auto); align-items: center; gap: 18px; padding: 14px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .12s, box-shadow .12s; }
.rowcard:hover { border-color: #cfd6d2; box-shadow: 0 6px 18px -12px rgba(31,36,33,.35); }
.rowcard.dim { opacity: .6; }
.rowcard .who-cell { min-width: 0; }
.rowcard .title { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rowcard .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.rowcard .rc { min-width: 0; }
.rowcard .rc b, .rowcard .rc .val { white-space: nowrap; }
.rowcard .cap { display: block; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 3px; }
html[dir="rtl"] .rowcard .cap { text-transform: none; letter-spacing: 0; font-size: 12px; }
.rowcard .val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rowcard .val.bad { color: var(--bad); }
.rowcard .val.ok { color: var(--ok); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: start; font-weight: 600; color: var(--faint); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
html[dir="rtl"] table.data th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fafbfa; }
table.data tr.row-link { cursor: pointer; }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; background: #fafbfa; }
table.data td.strong, table.data .strong, .strong { font-weight: 700; }
table.data tr.muted-row td { color: var(--faint); }
table.data tr.muted-row td .badge { opacity: .7; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); }
td .sub-line { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 9px 18px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; font-weight: 600; }

/* ---------- pills (status) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-accent { background: #fff4cc; color: #8a6400; }
.b-ink { background: var(--side-bg); color: #f2f5f3; }
.b-mute { background: var(--sunken); color: var(--muted); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .error { font-size: 12.5px; color: var(--bad); margin-top: 5px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: 500 14.5px/1.2 var(--font); color: var(--ink);
}
input[type=file] { padding: 8px 10px; height: auto; }
textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--accent-soft); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
input.num { text-align: end; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--green); }
.input-group { display: flex; }
.input-group input { border-start-end-radius: 0; border-end-end-radius: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.panel > .filters { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.filters select, .filters input { width: auto; min-width: 160px; height: 40px; font-size: 14px; }
.filters input[type=search] { min-width: 240px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.segmented a, .segmented label { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 14px; color: var(--muted); border-radius: 8px; font-weight: 600; cursor: pointer; }
.segmented a:hover { color: var(--ink); background: var(--sunken); }
.segmented a.on { background: var(--ok-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--green); }
.segmented .n { padding: 1px 7px; border-radius: 6px; background: var(--sunken); font-size: 12px; color: var(--muted); }
.segmented a.on .n { background: var(--green); color: #fff; }

/* ---------- alerts ---------- */
.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; margin-bottom: 18px; display: flex; gap: 10px; align-items: center; }
.alert.ok { border-color: #bfe0b6; background: var(--ok-soft); color: var(--ok-ink, #2c6a27); }
.alert.bad { border-color: #f3c5b4; background: var(--bad-soft); color: #9e3c17; }
.alert.warn { border-color: #f0dc95; background: var(--warn-soft); color: #6f4f00; }
.alert.info { border-color: #bcdcf3; background: var(--info-soft); color: #165a8b; }
.alert ul { margin: 4px 0 0; padding-inline-start: 18px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-size: 14.5px; font-weight: 600; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--green); }

/* ---------- stacking plan (tower floors x units) ---------- */
.stack-plan { display: grid; gap: 5px; }
.floor { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: stretch; }
.floor .fl { color: var(--muted); font-size: 12px; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.floor .cells { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 5px; }
.cell { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; border: 1px solid var(--line); background: var(--surface); min-width: 0; transition: transform .08s ease; }
.cell:hover { transform: translateY(-1px); border-color: #c6cdc9; }
.cell .no { font-weight: 700; font-variant-numeric: tabular-nums; }
.cell .meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.s-available { background: var(--surface); }
.cell.s-reserved { background: #fff4cc; border-color: #f2dc86; }
.cell.s-booked { background: var(--info-soft); border-color: #b9dcf4; }
.cell.s-sold { background: var(--ok-soft); border-color: #c3e2ba; }
.cell.s-handed_over { background: var(--side-bg); color: #f1f4f2; border-color: var(--side-bg); }
.cell.s-handed_over .meta { color: #b9c4bf; }
.cell.s-unavailable { background: repeating-linear-gradient(135deg, var(--sunken) 0 6px, #e7e9ec 6px 12px); color: var(--muted); }
.plots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }

.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--sunken); gap: 2px; }
.bar > span { display: block; height: 100%; border-radius: 3px; }
.bar + .legend { margin-top: 12px; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-bottom: 2px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 49px, var(--line-2) 49px 50px); }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.chart .col span { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.chart .col i { display: block; width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: #9cc98f; }
.chart .col.top i { background: var(--green); }
.chart .col.last i { background: var(--yellow); }
.chart-x { display: flex; gap: 12px; margin-top: 8px; }
.chart-x span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px; padding-inline-start: 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 7px; top: 19px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--green); border-color: var(--green); }
.timeline .when { color: var(--muted); font-size: 13px; }

.progress { display: block; height: 8px; background: var(--sunken); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.progress.ok > span { background: var(--green); }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); }
.auth-art { background: var(--side-bg); color: #eef2f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .lines { position: absolute; inset: auto -60px -60px auto; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(246, 207, 69, .12); }
.auth-art h2 { font-size: 38px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; max-width: 460px; position: relative; color: #fff; }
.auth-art h2 em { font-style: normal; color: var(--yellow); }
.auth-art p { color: #b6c2bc; max-width: 430px; position: relative; font-size: 16px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 360px; }

/* print documents */
.doc { background: #fff; max-width: 800px; margin: 24px auto; padding: 40px 44px; border: 1px solid var(--line); border-radius: 12px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--side-bg); padding-bottom: 14px; margin-bottom: 18px; }
.doc h1 { font-size: 22px; }
.doc .draft { color: var(--bad); border: 1.5px solid var(--bad); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; display: inline-block; }
.doc .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.doc .sign div { border-top: 1px solid var(--ink); padding-top: 6px; font-size: 12px; color: var(--muted); }
.toolbar-print { max-width: 800px; margin: 16px auto 0; display: flex; gap: 8px; justify-content: flex-end; }
@media print {
  body { background: #fff; }
  .toolbar-print, .no-print { display: none !important; }
  .doc { border: 0; margin: 0; padding: 0; max-width: none; }
}

/* Directional icons mirror in Dari. */
html[dir="rtl"] svg.flip-rtl { transform: scaleX(-1); }
/* Keep amounts in left-to-right order inside Dari pages. */
html[dir="rtl"] .num, html[dir="rtl"] .kpi .value, html[dir="rtl"] .money, html[dir="rtl"] .rowcard .val { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] td.num, html[dir="rtl"] th.num { text-align: left; }

/* responsive */
.menu-btn { display: none; }
@media (max-width: 1180px) {
  .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
  .rowcard { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .top-search { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  html[dir="rtl"] .side { transform: translateX(100%); }
  body.nav-open .side { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; gap: 8px; min-height: 60px; }
  .content { padding: 20px 16px 48px; }
  .ribbon { padding: 6px 16px; font-size: 12px; }
  .g2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .who-text { display: none; }
  .who { padding: 0; border: 0; }
  .switcher summary span.sw-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .floor .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rowcard { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .chart, .chart-x { gap: 4px; }
  .chart .col span { display: none; }
  .chart-x span { font-size: 10px; }
}
