/* ==========================================================
   Alma Venta — interface styles
   Colours live in the variables below: change them in one place.
   ========================================================== */
:root {
  --brand: #1F3A5F;
  --brand-2: #2C5282;
  --accent: #F4B942;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F0F3F7;
  --line: #E2E8F0;
  --line-2: #CBD5E1;
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;
  --good: #16A34A;
  --warn: #D97706;
  --bad: #DC2626;
  --info: #0284C7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --side: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- boot / spinner ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side .logo img { width: 34px; height: 34px; }
.side .logo b { font-size: 16px; display: block; }
.side .logo span { font-size: 11.5px; opacity: .7; }
.side nav { padding: 6px 10px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,.82); margin-bottom: 2px; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.side nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.side nav a .ic { width: 18px; text-align: center; opacity: .9; }
.side nav a .count { margin-inline-start: auto; background: var(--accent); color: var(--brand); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 10px; }
.side .navsec { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .5; padding: 14px 12px 6px; }
.side .foot { padding: 14px 18px; font-size: 11px; opacity: .6; border-top: 1px solid rgba(255,255,255,.1); }
.side .foot a { color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.top .burger { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 9px 38px 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
[dir=ltr] .search input { padding: 9px 12px 9px 38px; }
.search .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { padding-inline-start: 36px; padding-inline-end: 12px; }
.search .results { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 420px; overflow-y: auto; z-index: 30; }
.search .results a { display: flex; gap: 10px; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search .results a:hover, .search .results a.sel { background: var(--surface-2); text-decoration: none; }
.search .results .k { font-size: 11px; color: var(--ink-3); min-width: 54px; }
.top .tools { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.iconbtn { position: relative; border: 0; background: transparent; width: 38px; height: 38px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 17px; }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn .dot { position: absolute; top: 5px; inset-inline-end: 5px; background: var(--bad); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.userchip { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; cursor: pointer; border: 0; background: none; }
.userchip:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.dropdown { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; z-index: 40; overflow: hidden; }
.dropdown a, .dropdown button.item { display: block; width: 100%; text-align: start; padding: 10px 14px; color: var(--ink); border: 0; background: none; cursor: pointer; }
.dropdown a:hover, .dropdown button.item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown .head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif { max-height: 420px; overflow-y: auto; min-width: 320px; }
.notif .n { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif .n.unread { background: #EFF6FF; }
.content { padding: 22px 24px 40px; flex: 1; min-width: 0; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead .sub { color: var(--ink-2); font-size: 13px; }
.pagehead .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: #fff; border-color: #FCA5A5; color: var(--bad); }
.btn.bad:hover { background: #FEF2F2; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.wa { background: #25D366; border-color: #25D366; color: #fff; }

/* ---------- cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card > .hd .actions { margin-inline-start: auto; display: flex; gap: 6px; }
.card > .bd { padding: 16px; }
.card > .bd.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.kpi { padding: 14px 16px; }
.kpi .lbl { color: var(--ink-2); font-size: 12.5px; }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 4px; }
.kpi .val small { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.kpi .hint { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.alert .val { color: var(--warn); }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form .row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field > label .req { color: var(--bad); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea, select.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; min-height: 38px; }
.field textarea { min-height: 80px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(44,82,130,.25); border-color: var(--brand-2); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.help { font-size: 12px; color: var(--ink-3); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input, .filters select { width: auto; min-width: 140px; min-height: 36px; padding: 6px 10px; }
.filters .grow { flex: 1; min-width: 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 20px; background: #fff; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: start; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #F8FAFC; }
table.t td.actions { text-align: end; white-space: nowrap; }
table.t tfoot td { font-weight: 600; background: var(--surface-2); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 32px; margin-bottom: 8px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.nodot::before { display: none; }
.b-draft { background: #F1F5F9; color: #475569; }
.b-pending_approval { background: #FEF3C7; color: #B45309; }
.b-approved { background: #E0F2FE; color: #0369A1; }
.b-sent { background: #EDE9FE; color: #6D28D9; }
.b-accepted { background: #DCFCE7; color: #15803D; }
.b-rejected { background: #FEE2E2; color: #B91C1C; }
.b-expired { background: #FFEDD5; color: #C2410C; }
.b-superseded { background: #F1F5F9; color: #94A3B8; }
.b-overdue { background: #FEE2E2; color: #B91C1C; }
.b-today { background: #FEF3C7; color: #B45309; }
.b-done { background: #DCFCE7; color: #15803D; }
.stagedot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button .n { background: var(--surface-2); border-radius: 10px; padding: 0 7px; font-size: 11.5px; margin-inline-start: 4px; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol { flex: 0 0 260px; background: var(--surface-2); border-radius: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kcol .kh { padding: 10px 12px; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.kcol .kh .n { margin-inline-start: auto; color: var(--ink-3); font-weight: 500; }
.kcol .kb { padding: 0 8px 8px; overflow-y: auto; min-height: 60px; flex: 1; }
.kcol.over { outline: 2px dashed var(--brand-2); outline-offset: -2px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; }
.kcard:hover { border-color: var(--line-2); }
.kcard b { display: block; font-size: 13.5px; }
.kcard .meta { font-size: 12px; color: var(--ink-2); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tic { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 14px; }
.timeline .tt { font-weight: 500; }
.timeline .tm { font-size: 12px; color: var(--ink-3); }

/* ---------- bars ---------- */
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 6px; background: var(--brand-2); }
.bar .v { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- quotation editor ---------- */
.qitems td { padding: 6px 8px; }
.qitems input, .qitems select { width: 100%; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; min-height: 34px; background: #fff; }
.qitems input.qty { width: 80px; }
.qitems input.price { width: 120px; }
.qitems .desc { min-width: 260px; }
.qitems .desc input + input { margin-top: 4px; }
.totals { display: grid; gap: 6px; max-width: 360px; margin-inline-start: auto; }
.totals div { display: flex; justify-content: space-between; gap: 20px; }
.totals .grand { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }
.warnbox { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.infobox { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.picker { position: relative; }
.picker .list { position: absolute; top: 100%; inset-inline: 0; z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; min-width: 320px; }
.picker .list div { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker .list div:hover { background: var(--surface-2); }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 12px; width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(920px, 100%); }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .mh .x { margin-inline-start: auto; }
.modal .mb { padding: 18px 20px; overflow-y: auto; }
.modal .mf { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); z-index: 200; display: grid; gap: 8px; }
[dir=ltr] #toasts { transform: translateX(-50%); }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; min-width: 240px; text-align: center; animation: fade .15s ease; }
.toast.bad { background: var(--bad); }
.toast.good { background: var(--good); }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .art { background: linear-gradient(150deg, var(--brand) 0%, #13263F 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .art h1 { font-size: 34px; margin-top: 40px; }
.auth .art p { opacity: .8; max-width: 420px; font-size: 15px; }
.auth .art .pts { display: grid; gap: 10px; margin-top: 26px; opacity: .9; }
.auth .panel { display: grid; place-items: center; padding: 32px; }
.auth .box { width: min(380px, 100%); }
.auth .box h2 { font-size: 22px; margin-bottom: 6px; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: start; }
.colorswatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); display: inline-block; vertical-align: middle; }
.filecard { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.filecard .thumb { width: 52px; height: 52px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 20px; }
.filecard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.daygroup { margin-bottom: 18px; }
.daygroup > h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }

/* ---------- chatbot placeholder hook ---------- */

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side); z-index: 60; transform: translateX(100%); transition: transform .2s; }
  [dir=ltr] .side { transform: translateX(-100%); }
  .side.open { transform: none !important; }
  .top .burger { display: inline-block; }
  .content { padding: 16px 14px 40px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .form .row, .form .row.three { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
  .userchip .nm { display: none; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi .val { font-size: 20px; } }

/* ==========================================================
   Printable quotation (A4)
   ========================================================== */
.doc { background: #fff; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 14mm 14mm 12mm; color: #111; font-size: 12px; box-shadow: var(--shadow); position: relative; }
.doc .dhead { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid var(--doc-brand, var(--brand)); padding-bottom: 10px; }
.doc .dhead img { max-height: 64px; max-width: 150px; }
.doc .dhead .co { flex: 1; }
.doc .dhead .co b { font-size: 17px; display: block; }
.doc .dhead .co span { color: #555; font-size: 11px; }
.doc .dtitle { text-align: end; }
.doc .dtitle .t1 { font-size: 20px; font-weight: 700; color: var(--doc-brand, var(--brand)); }
.doc .dtitle .t2 { font-size: 13px; color: #444; }
.doc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin: 14px 0; }
.doc .meta .m { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; border-bottom: 1px dotted #ccc; padding: 3px 0; }
.doc .meta .m .en { direction: ltr; color: #666; font-size: 11px; }
.doc .meta .m .ar { color: #666; font-size: 11px; }
.doc .intro { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 8px 0 10px; font-size: 11.5px; color: #333; }
.doc table.items { width: 100%; border-collapse: collapse; margin-top: 6px; }
.doc table.items th { background: var(--doc-brand, var(--brand)); color: #fff; font-weight: 600; padding: 6px 8px; font-size: 11px; }
.doc table.items th small { display: block; font-weight: 400; opacity: .85; }
.doc table.items td { border-bottom: 1px solid #e5e5e5; padding: 7px 8px; vertical-align: top; }
.doc table.items td .en { direction: ltr; text-align: left; color: #555; font-size: 11px; display: block; }
.doc table.items tr:nth-child(even) td { background: #fafafa; }
.doc .dtotals { width: 320px; margin-inline-start: auto; margin-top: 10px; }
.doc .dtotals div { display: flex; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid #eee; }
.doc .dtotals .grand { background: var(--doc-brand, var(--brand)); color: #fff; font-weight: 700; font-size: 14px; border-radius: 4px; }
.doc .terms { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.doc .terms h4 { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 13px; color: var(--doc-brand, var(--brand)); border-bottom: 1px solid #ddd; padding-bottom: 4px; margin-bottom: 4px; }
.doc .terms .ar { font-size: 11.5px; }
.doc .terms .en { direction: ltr; text-align: left; font-size: 11px; color: #333; }
.doc .terms b { font-weight: 600; }
.doc .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 28px; }
.doc .sign div { border-top: 1px solid #999; padding-top: 6px; font-size: 11.5px; min-height: 60px; }
.doc .dfoot { position: absolute; bottom: 8mm; inset-inline: 14mm; display: flex; justify-content: space-between; font-size: 9.5px; color: #888; border-top: 1px solid #eee; padding-top: 5px; }
.printbar { display: flex; gap: 8px; justify-content: center; padding: 14px; position: sticky; top: 0; background: var(--bg); z-index: 5; flex-wrap: wrap; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .side, .top, .printbar, #toasts, .noprint { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .doc { box-shadow: none; margin: 0; width: auto; min-height: 297mm; }
  .doc table.items th, .doc .dtotals .grand { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc table.items tr { break-inside: avoid; }
}
@media screen and (max-width: 860px) { .doc { width: 100%; min-height: 0; padding: 18px; } .doc .dfoot { position: static; margin-top: 20px; } .doc .meta, .doc .intro, .doc .terms { grid-template-columns: 1fr; } }
