/* Global Supply Brokers visual system
   VOICE: a working trade-operations product, calm and exact, built for money decisions.
   IDEA: a freight control tower: every deal moves left to right through stages, like cargo.
   PICTURE: the pipeline board and the deal progress track carry the page.
   COLOUR and TYPE: shipping blue for action, container orange for attention, money green for margin; Inter, tabular figures.
   LAYOUT: icon sidebar on desktop, app bar and bottom tabs on phones, cards on a cool grey ground. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #0f1a2b;
  --ink-2: #33415a;
  --muted: #687790;
  --line: #e3e8f0;
  --line-2: #eef1f6;
  --brand: #1450e6;
  --brand-ink: #0c3bb3;
  --brand-50: #edf2ff;
  --brand-100: #dbe5ff;
  --orange: #f0661a;
  --orange-50: #fff1e8;
  --green: #0b9a62;
  --green-50: #e6f6ef;
  --amber: #b45309;
  --amber-50: #fff5e4;
  --red: #d42a1f;
  --red-50: #fdecea;
  --violet: #6d4ae8;
  --violet-50: #f1edff;
  --r: 10px;
  --r-sm: 7px;
  --sh: 0 1px 2px rgba(15, 26, 43, .05), 0 1px 3px rgba(15, 26, 43, .06);
  --sh-lg: 0 12px 32px rgba(15, 26, 43, .14), 0 2px 6px rgba(15, 26, 43, .06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow-x: clip; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
h1 { font-size: 24px; line-height: 1.15; margin: 0; letter-spacing: -.02em; font-weight: 750; text-wrap: balance; }
h2 { font-size: 16px; margin: 0; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num, td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
svg.i.sm { width: 15px; height: 15px; vertical-align: -3px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- app frame ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 16px; }
.mark { min-width: 36px; padding: 0 5px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #3b7bff); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .02em; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.brand b { display: block; font-size: 14.5px; line-height: 1.2; }
.brand > div > span { display: block; font-size: 12px; color: var(--muted); }
.nav-group { padding: 6px 12px; }
.nav-group .lbl { font-size: 11.5px; color: var(--muted); padding: 10px 10px 6px; font-weight: 600; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; color: var(--ink-2); border-radius: 8px; font-weight: 550; margin-bottom: 2px; }
.side nav a:hover { background: var(--line-2); color: var(--ink); }
.side nav a.on { background: var(--brand-50); color: var(--brand); }
.side nav a .count { margin-inline-start: auto; font-size: 11.5px; background: var(--orange); color: #fff; border-radius: 10px; padding: 0 7px; font-weight: 700; }
.side-cta { padding: 4px 22px 12px; }
.side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.demo-tag { display: inline-flex; gap: 6px; align-items: center; background: var(--amber-50); color: var(--amber); padding: 4px 9px; border-radius: 20px; width: max-content; font-weight: 600; font-size: 12px; }
.demo-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.main { padding: 26px 32px 80px; max-width: 1320px; width: 100%; }
.mtop, .mtabs { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 5px; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.head-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 12px; gap: 10px; }

/* ---------- surfaces ---------- */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 18px 20px; margin-bottom: 16px; }
.panel > h3 { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel > h3 .hint { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.cols > .panel { margin-bottom: 0; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: 1 / -1; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
input, select, textarea { font: 400 14px/1.4 var(--font); color: var(--ink); border: 1px solid #ccd4e1; border-radius: var(--r-sm); padding: 9px 11px; background: #fff; width: 100%; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 0; }
input:hover, select:hover, textarea:hover { border-color: #b5c0d1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
input:disabled, select:disabled, textarea:disabled { background: var(--line-2); color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); flex: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687790' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.actions.sticky { position: sticky; bottom: 0; z-index: 5; background: rgba(243, 245, 249, .92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 0; margin: 0 0 0; }

/* ---------- buttons ---------- */
.btn { font: 600 13.5px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid #cdd5e2; background: #fff; color: var(--ink); border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: #f7f9fc; border-color: #b9c3d3; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(20, 80, 230, .3); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: #087a4d; color: #fff; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.wa:hover { background: #178a45; color: #fff; }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger-ghost { color: var(--red); border-color: #f0c4c0; background: #fff; }
.btn.danger-ghost:hover { background: var(--red-50); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font: inherit; font-weight: 600; text-align: start; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 6px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 3px; margin-bottom: 10px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; cursor: pointer; font: 600 12.5px var(--font); color: var(--muted); border-radius: 6px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--sh); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.panel .table-wrap { margin: 0; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th { text-align: start; font-size: 12px; font-weight: 600; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
table.grid td { border-bottom: 1px solid var(--line-2); padding: 11px 12px; vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: #f8faff; }
table.grid tfoot td { font-weight: 700; background: #f8fafc; border-top: 1px solid var(--line); border-bottom: 0; }
table.grid td input, table.grid td select { min-height: 34px; padding: 6px 9px; }
.best { color: var(--green); font-weight: 750; }
.best::after { content: ' ●'; font-size: 9px; vertical-align: 2px; }
td.actions-cell { white-space: nowrap; text-align: end; }
td.actions-cell .btn { margin-inline-start: 6px; }

/* ---------- pills, chips, avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 20px; background: #eef1f6; color: #3d4a60; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.st-new, .st-sent { background: #eef1f6; color: #4a5872; }
.st-sourcing, .st-draft { background: var(--violet-50); color: var(--violet); }
.st-pricing, .st-quoted { background: var(--amber-50); color: var(--amber); }
.st-offered { background: var(--brand-50); color: var(--brand); }
.st-accepted, .st-shipped, .st-ok { background: var(--green-50); color: var(--green); }
.st-closed { background: #e9ecf1; color: #59657a; }
.st-lost, .st-declined { background: var(--red-50); color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.ref { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.chip.blue { background: var(--brand-50); color: var(--brand); }
.chip.green { background: var(--green-50); color: var(--green); }
.chip.orange { background: var(--orange-50); color: var(--orange); }
.av { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 750; font-size: 11.5px; color: #fff; flex: none; letter-spacing: .02em; }
.av.lg { width: 40px; height: 40px; border-radius: 10px; font-size: 14px; }
.who { display: flex; align-items: center; gap: 10px; }
.who b { display: block; font-weight: 650; line-height: 1.25; }
.who > div > span { display: block; font-size: 12px; color: var(--muted); }
.who .nm { font-size: 12.5px; color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .av { width: 26px; height: 26px; font-size: 10.5px; border-radius: 7px; }
.who .av.lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.kpi .ic { grid-row: span 3; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic.blue { background: var(--brand-50); color: var(--brand); }
.ic.orange { background: var(--orange-50); color: var(--orange); }
.ic.green { background: var(--green-50); color: var(--green); }
.ic.violet { background: var(--violet-50); color: var(--violet); }
.ic.amber { background: var(--amber-50); color: var(--amber); }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.col { background: #e9edf4; border-radius: var(--r); padding: 10px; min-height: 150px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 700; font-size: 13px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-head .n { margin-inline-start: auto; font-size: 12px; color: var(--muted); font-weight: 600; background: #fff; border-radius: 10px; padding: 0 8px; }
.col-sum { font-size: 12px; color: var(--muted); padding: 0 4px 2px; font-variant-numeric: tabular-nums; }
.dcard { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; box-shadow: var(--sh); cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; display: block; color: var(--ink); }
.dcard:hover { box-shadow: var(--sh-lg); transform: translateY(-1px); border-color: var(--brand-100); color: var(--ink); }
.dcard .t { font-weight: 650; line-height: 1.3; margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dcard .dv { font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.dcard .dv .chip { font-size: 11px; padding: 1px 6px; }
.dcard .v { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 13px; }
.dcard .route { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.col-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 18px 6px; border: 1.5px dashed #ccd4e1; border-radius: 9px; }

.todo { list-style: none; margin: 0; padding: 0; }
.todo li { padding: 12px 4px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.todo li:last-child { border-bottom: 0; }
.todo .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.todo .txt { flex: 1; }
.todo .txt b { display: block; font-weight: 650; }
.todo .txt span { font-size: 12.5px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* deals list */
.dlist { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.drow { display: grid; grid-template-columns: 112px minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 120px 130px 120px; gap: 14px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line-2); color: var(--ink); cursor: pointer; }
.drow:last-child { border-bottom: 0; }
.drow:hover { background: #f8faff; color: var(--ink); }
.drow.head { background: #f8fafc; font-size: 12px; font-weight: 600; color: var(--muted); cursor: default; padding-top: 10px; padding-bottom: 10px; }
.drow.head:hover { background: #f8fafc; }
.drow .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .num b { display: block; }

/* ---------- deal page ---------- */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 20px 22px 0; margin-bottom: 16px; overflow: hidden; }
.hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hero-top .grow { flex: 1; }
.hero h1 { font-size: 23px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; color: var(--ink-2); }
.hero-meta .m { display: inline-flex; gap: 7px; align-items: center; }
.hero-meta .m svg { color: var(--muted); }
.hero-meta .av { width: 26px; height: 26px; font-size: 10.5px; border-radius: 7px; }
.hero-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px -22px 0; border-top: 1px solid var(--line); background: #fafbfd; }
.hero-figs > div { padding: 13px 22px; border-inline-end: 1px solid var(--line); }
.hero-figs > div:last-child { border-inline-end: 0; }
.hero-figs .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.hero-figs .v { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-figs .v.good { color: var(--green); }
.hero-figs .v .small { font-weight: 600; }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.step { display: flex; align-items: center; gap: 11px; padding: 13px 16px; color: var(--ink-2); position: relative; border-inline-end: 1px solid var(--line-2); }
.step:last-child { border-inline-end: 0; }
.step:hover { background: #f8faff; color: var(--ink); }
.step .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 13px; flex: none; background: var(--line-2); color: var(--muted); border: 2px solid transparent; }
.step.done .dot { background: var(--green); color: #fff; }
.step.on { background: var(--brand-50); color: var(--ink); }
.step.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand); }
.step.on .dot { background: #fff; color: var(--brand); border-color: var(--brand); }
.step.on.done .dot { background: var(--green); color: #fff; border-color: var(--green); }
.step b { display: block; font-size: 13px; line-height: 1.2; font-weight: 700; }
.step small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.check { display: flex; gap: 11px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.check:hover { border-color: var(--brand-100); background: #fafcff; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 9px; background: var(--brand-50); color: #183a8a; padding: 11px 14px; margin-bottom: 14px; border: 1px solid var(--brand-100); }
.notice.ok { background: var(--green-50); color: #075b3a; border-color: #bfe8d5; }
.notice.warn { background: var(--amber-50); color: #7c3d06; border-color: #f6dcae; }
.notice.bad { background: var(--red-50); color: #8f1c14; border-color: #f4c7c2; }
.notice svg { margin-top: 1px; }

/* price build-up */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 14px; }
.summary > div { padding: 12px 14px; border-inline-end: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: #fff; }
.summary .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.summary .v { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.summary .v.good { color: var(--green); }
.summary .v.bad { color: var(--red); }
.waterfall { margin: 18px 0 6px; }
.wf-bar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; background: var(--line-2); }
.wf-bar > div { height: 100%; min-width: 3px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.wf-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.wf-legend span { display: inline-flex; align-items: center; gap: 7px; }
.wf-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.big-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.big-figs > div { border-radius: var(--r-sm); padding: 14px 16px; background: #f8fafc; border: 1px solid var(--line); }
.big-figs .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.big-figs .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-figs .hl { background: var(--green-50); border-color: #bfe8d5; }
.big-figs .hl .v { color: var(--green); }
.big-figs .hl.neg { background: var(--red-50); border-color: #f4c7c2; }
.big-figs .hl.neg .v { color: var(--red); }

/* money progress */
.prog { margin: 6px 0 16px; }
.prog-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 9px 0; }
.prog-row .k { font-weight: 650; }
.prog-row .k span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.track { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.track > div { height: 100%; border-radius: 6px; background: var(--brand); transition: width .4s; }
.track.green > div { background: var(--green); }
.track.orange > div { background: var(--orange); }
.prog-row .v { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; text-align: right; font-size: 13px; }
.cash { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-sm); background: #f8fafc; border: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.cash .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cash .v.good { color: var(--green); } .cash .v.bad { color: var(--red); }
.docs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.doc-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); text-align: start; transition: border-color .15s, box-shadow .15s; }
.doc-btn:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.doc-btn:disabled { opacity: .45; cursor: not-allowed; }
.doc-btn .ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; }
.doc-btn b { font-weight: 650; font-size: 13px; line-height: 1.25; }
.doc-btn .dt span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 550; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 12px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- modal, toast, viewer ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 26, 43, .5); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 14px 20px; z-index: 50; overflow-y: auto; animation: fade .15s ease-out; }
.modal { background: #fff; width: 580px; max-width: 100%; border-radius: 14px; box-shadow: var(--sh-lg); overflow: hidden; animation: rise .18s ease-out; }
.modal.wide { width: 880px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px 20px; }
.linkbox { display: flex; gap: 8px; align-items: center; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px; font-size: 12.5px; }
.linkbox a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 10px); background: #0f1a2b; color: #fff; padding: 11px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: 90vw; font-weight: 550; box-shadow: var(--sh-lg); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); }
.doc-viewer { position: fixed; inset: 0; background: #dfe4ec; z-index: 70; display: flex; flex-direction: column; }
.doc-bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-viewer iframe { flex: 1; border: 0; background: #fff; width: min(880px, calc(100% - 24px)); margin: 14px auto; border-radius: 6px; box-shadow: var(--sh-lg); }

/* ---------- public link pages ---------- */
body.public { background: var(--bg); }
.pub-bar { background: #fff; border-bottom: 1px solid var(--line); }
.pub-bar .in { max-width: 920px; margin: 0 auto; padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.pub-bar .in b { font-size: 15px; }
.pub-bar .in .secure { margin-inline-start: auto; font-size: 12px; color: var(--green); display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.pub { max-width: 920px; margin: 0 auto; padding: 24px 18px 70px; }
.pub-head { background: linear-gradient(120deg, var(--brand) 0%, #2c6dff 70%, #4f86ff 100%); color: #fff; border-radius: 14px; padding: 24px 26px; margin-bottom: 18px; box-shadow: 0 10px 24px rgba(20, 80, 230, .22); position: relative; overflow: hidden; }
.pub-head::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.pub-head h1 { font-size: 26px; position: relative; }
.pub-head .co { font-weight: 650; opacity: .85; font-size: 13px; margin-bottom: 6px; position: relative; }
.pub-head p { margin: 10px 0 0; opacity: .92; position: relative; max-width: 640px; }
.pub-head .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; }
.pub-head .facts span { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); padding: 5px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.pub-head .notice { margin: 14px 0 0; position: relative; }
.pub-head.plain { background: #fff; color: var(--ink); box-shadow: var(--sh); border: 1px solid var(--line); }
.pub-head.plain::after { display: none; }
.tr { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.pub-head .tr { color: rgba(255,255,255,.75); font-size: 14px; font-weight: 500; margin-top: 2px; }
th .tr { font-size: 11px; }
.total-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--ink); color: #fff; border-radius: var(--r); padding: 18px 20px; margin: 14px 0 0; flex-wrap: wrap; }
.total-card .k { opacity: .75; font-size: 13px; }
.total-card .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.done-card { text-align: center; padding: 46px 20px; }
.done-card .ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--green-50); color: var(--green); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, #dfe8ff 0%, var(--bg) 60%); }
.login { width: 380px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-lg); padding: 28px; }
.login .mark { margin-bottom: 16px; min-width: 44px; height: 44px; font-size: 16px; }
.login h1 { margin-bottom: 4px; }
.login p { color: var(--muted); margin: 0 0 18px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .docs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .drow { grid-template-columns: 100px minmax(0, 2fr) minmax(0, 1.3fr) 110px 120px; }
  .drow .c-route, .drow .c-margin { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .mtop .mark { min-width: 32px; height: 32px; font-size: 12.5px; border-radius: 8px; }
  .mtop b { font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mtabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 4px 0; }
  .mtabs a.on { color: var(--brand); }
  .mtabs a.plus { color: #fff; }
  .mtabs a.plus span.b { width: 46px; height: 46px; border-radius: 14px; background: var(--brand); display: grid; place-items: center; margin-top: -18px; box-shadow: 0 6px 16px rgba(20, 80, 230, .35); }
  .mtabs a.plus em { color: var(--brand); font-style: normal; }
  .main { padding: 16px 14px 110px; }
  h1 { font-size: 21px; }
  .page-head { align-items: flex-start; margin-bottom: 14px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form-grid .span2 { grid-column: 1 / -1; }
  .panel, .card { padding: 16px; }
  .kpi { padding: 14px; gap: 2px 12px; }
  .kpi .ic { width: 36px; height: 36px; }
  .kpi .v { font-size: 21px; }
  .board { grid-auto-columns: 78%; }
  .board .col.is-empty { display: none; }
  .page-head > .btn.primary { display: none; }
  .hero { padding: 16px 16px 0; }
  .hero h1 { font-size: 20px; }
  .hero-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px -16px 0; }
  .hero-figs > div { padding: 11px 16px; border-bottom: 1px solid var(--line); }
  .hero-figs > div:nth-child(2n) { border-inline-end: 0; }
  .stepper { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .step { flex: 0 0 auto; padding: 11px 14px; scroll-snap-align: start; }
  .step small { max-width: 120px; }
  .docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big-figs { grid-template-columns: minmax(0, 1fr); }
  .prog-row { grid-template-columns: minmax(0, 1fr) auto; }
  .prog-row .track { grid-column: 1 / -1; grid-row: 2; }
  .drow { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 13px 14px; }
  .drow.head { display: none; }
  .drow .c-ref { grid-column: 1; grid-row: 1; }
  .drow .c-title { grid-column: 1 / -1; grid-row: 2; }
  .drow .c-buyer { grid-column: 1; grid-row: 3; }
  .drow .c-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .drow .c-value { grid-column: 2; grid-row: 3; }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; }
  .actions.sticky { bottom: calc(64px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .pub-head { padding: 20px; }
  .pub-head h1 { font-size: 22px; }
}
@media (max-width: 520px) {
  .form-grid, .form-grid.two { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 10px; }
  .kpi { grid-template-columns: minmax(0, 1fr); }
  .kpi .ic { grid-row: auto; margin-bottom: 6px; }
  td.actions-cell .btn { margin-block: 2px; margin-inline-start: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- languages ---------- */
.lang-pick { width: auto; min-height: 34px; padding: 5px 30px 5px 10px; font-size: 12.5px; font-weight: 600; background-color: #fff; }
.lang-pick.sm { min-height: 30px; padding-top: 3px; padding-bottom: 3px; font-size: 12px; }
.side-foot .lang-pick { margin-top: 4px; width: 100%; }
.mtop .lang-pick { margin-inline-start: 4px; }
.pub-bar .in .lang-pick { margin-inline-start: 10px; }
:root[lang=ar] body { font-family: 'IBM Plex Sans Arabic', var(--font); }
:root[lang=ar] h1, :root[lang=ar] h2, :root[lang=ar] h3, :root[lang=ar] .kpi .v, :root[lang=ar] .big-figs .v { letter-spacing: 0; }
[dir=rtl] select { background-position: left 11px center; padding-right: 11px; padding-left: 32px; }
[dir=rtl] .lang-pick { padding-right: 10px; padding-left: 30px; }
[dir=rtl] .i-arrow, [dir=rtl] .i-send, [dir=rtl] .i-out { transform: scaleX(-1); }
[dir=rtl] .side { border-inline-end: 1px solid var(--line); }
[dir=rtl] .pub-head::after { right: auto; left: -40px; }
[dir=rtl] .pub-head { background: linear-gradient(240deg, var(--brand) 0%, #2c6dff 70%, #4f86ff 100%); }
[dir=rtl] .chip.ref, [dir=rtl] .num, [dir=rtl] .linkbox a { direction: ltr; unicode-bidi: isolate; }
[dir=rtl] .best::after { content: ''; }
.pub-bar .in b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .pub-bar .in .sl { display: none; } .pub-bar .in { padding: 10px 14px; } }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
