/* ============================================================
   R&R — Remodel & Renovation
   Visual direction: site blueprint. Cool concrete surfaces,
   drafting-blue primary, marker amber for anything pending.
   Type: IBM Plex Sans / IBM Plex Sans Arabic (one family across
   both scripts) + IBM Plex Mono for money and reference codes.
   Fully RTL-aware via CSS logical properties.
   ============================================================ */

:root {
  --ink:        #14181D;
  --ink-2:      #4A545E;
  --ink-3:      #7B858F;
  --slab:       #EEF1F4;
  --chalk:      #FFFFFF;
  --line:       #D7DDE3;
  --line-soft:  #E6EAEE;

  --blueprint:  #1B4D8F;
  --blueprint-d:#143a6c;
  --blueprint-l:#E8EFF8;

  --marker:     #C88A00;
  --marker-l:   #FDF3DC;
  --verdigris:  #0D7A63;
  --verdigris-l:#E2F2EE;
  --brick:      #B03626;
  --brick-l:    #FAEAE7;

  --r:          6px;
  --shadow:     0 1px 2px rgba(20,24,29,.06), 0 4px 12px rgba(20,24,29,.04);
  --sidebar:    248px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--slab);
  color: var(--ink);
  font-family: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body[dir="rtl"] {
  font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, 'Segoe UI', sans-serif;
  line-height: 1.75;
}

a { color: var(--blueprint); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .92rem; }

/* Reference codes, money, dates — drafting register */
.mono, .ref, .num {
  font-family: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: embed;
}
.ref {
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--blueprint);
  background: var(--blueprint-l);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.num { font-size: .9rem; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--ink);
  color: #C4CCD4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 20px 18px 18px;
  border-block-end: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--marker);
  display: block;
  margin-block-end: 4px;
}
.brand-name { color: #fff; font-weight: 600; font-size: .98rem; }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  color: #C4CCD4;
  font-size: .9rem;
  margin-block-end: 2px;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a.on { background: var(--blueprint); color: #fff; font-weight: 500; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-sep {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #6B7783;
  padding: 16px 12px 6px;
}
body[dir="rtl"] .nav-sep { letter-spacing: 0; }

.sidebar-foot {
  padding: 12px;
  border-block-start: 1px solid rgba(255,255,255,.08);
  font-size: .82rem;
}
.who { color: #fff; font-weight: 500; }
.who-role { color: #7B858F; font-size: .76rem; }
.sidebar-foot a { color: #9AA5B0; display: inline-block; margin-block-start: 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--chalk);
  border-block-end: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .crumb { color: var(--ink-3); font-size: .84rem; }
.topbar .spacer { flex: 1; }

.langswitch { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.langswitch a {
  padding: 5px 11px;
  font-size: .8rem;
  color: var(--ink-2);
  background: var(--chalk);
}
.langswitch a:hover { background: var(--slab); text-decoration: none; }
.langswitch a.on { background: var(--ink); color: #fff; }

.content { padding: 24px; max-width: 1280px; width: 100%; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-block-end: 20px;
  flex-wrap: wrap;
}
.page-head .spacer { flex: 1; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); font-size: .88rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin-block-end: 18px;
}
.card-head {
  padding: 14px 18px;
  border-block-end: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-block-end: 20px; }
.stat {
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}
body[dir="rtl"] .stat .label { letter-spacing: 0; font-size: .8rem; }
.stat .value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  margin-block-start: 6px;
  direction: ltr;
  unicode-bidi: embed;
}
body[dir="rtl"] .stat .value { text-align: right; }
.stat .value small { font-size: .8rem; color: var(--ink-3); font-weight: 400; }
.stat.good .value { color: var(--verdigris); }
.stat.bad  .value { color: var(--brick); }

/* ---------- Budget bar (signature element) ---------- */
.budget { margin-block: 4px 10px; }
.budget-track {
  height: 26px;
  background: var(--slab);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  position: relative;
}
.budget-fill { background: var(--blueprint); height: 100%; transition: width .4s ease; }
.budget-fill.warn { background: var(--marker); }
.budget-fill.over { background: var(--brick); }
.budget-ticks {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .72rem;
  color: var(--ink-3);
  margin-block-start: 5px;
  direction: ltr;
}
.budget-note { font-size: .84rem; color: var(--ink-2); margin-block-start: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
  text-align: start;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 10px 14px;
  border-block-end: 1px solid var(--line);
  background: #FAFBFC;
  white-space: nowrap;
}
body[dir="rtl"] table.data th { letter-spacing: 0; font-size: .8rem; }
table.data td { padding: 11px 14px; border-block-end: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-block-end: 0; }
table.data tbody tr:hover { background: #FAFBFC; }
table.data td.right, table.data th.right { text-align: end; }
table.data td.money {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
  direction: ltr;
}
.t-strong { font-weight: 600; }
.t-dim { color: var(--ink-3); font-size: .84rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.neutral { background: var(--slab);        color: var(--ink-2);    border-color: var(--line); }
.badge.info    { background: var(--blueprint-l); color: var(--blueprint);border-color: #CBDCF0; }
.badge.good    { background: var(--verdigris-l); color: var(--verdigris);border-color: #BFE0D8; }
.badge.warn    { background: var(--marker-l);    color: var(--marker);   border-color: #EFDCA8; }
.badge.bad     { background: var(--brick-l);     color: var(--brick);    border-color: #EFC8C1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--chalk);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--r);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--slab); text-decoration: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blueprint);
  outline-offset: 2px;
}
.btn.primary { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }
.btn.primary:hover { background: var(--blueprint-d); }
.btn.danger { color: var(--brick); border-color: #EFC8C1; background: var(--brick-l); }
.btn.danger:hover { background: #F5DBD6; }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Forms ---------- */
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }

label.f { display: block; }
label.f > span {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-block-end: 5px;
}
label.f > span .req { color: var(--brick); }
label.f > span .hint { font-weight: 400; color: var(--ink-3); }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=tel], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--chalk);
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
}
input:disabled, select:disabled { background: var(--slab); color: var(--ink-3); }
textarea { min-height: 84px; resize: vertical; }
input[type=number] { direction: ltr; text-align: end; font-family: 'IBM Plex Mono', monospace; }
input[dir=rtl], textarea[dir=rtl] { direction: rtl; text-align: right; }
input[dir=ltr], textarea[dir=ltr] { direction: ltr; text-align: left; }

.form-actions {
  display: flex;
  gap: 10px;
  padding-block-start: 16px;
  margin-block-start: 4px;
  border-block-start: 1px solid var(--line-soft);
}
.form-actions .spacer { flex: 1; }

/* ---------- Alerts ---------- */
.alert {
  padding: 11px 15px;
  border-radius: var(--r);
  margin-block-end: 16px;
  font-size: .9rem;
  border: 1px solid;
}
.alert.ok  { background: var(--verdigris-l); border-color: #BFE0D8; color: #0a5c4a; }
.alert.err { background: var(--brick-l);     border-color: #EFC8C1; color: #8a291c; }

/* ---------- Empty state ---------- */
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty p { margin: 0 0 14px; }

/* ---------- Quotation line items ---------- */
table.items { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.items th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); text-align: start; padding: 8px 8px; border-block-end: 1px solid var(--line);
}
body[dir="rtl"] table.items th { letter-spacing: 0; font-size: .8rem; }
table.items td { padding: 6px 6px; border-block-end: 1px solid var(--line-soft); vertical-align: top; }
table.items input, table.items select { padding: 6px 8px; font-size: .86rem; }
.line-total {
  font-family: 'IBM Plex Mono', monospace;
  text-align: end;
  padding-block-start: 13px !important;
  white-space: nowrap;
  direction: ltr;
}
.totals { margin-inline-start: auto; width: min(340px, 100%); margin-block-start: 16px; }
.totals .row { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; font-size: .9rem; }
.totals .row span:last-child { font-family: 'IBM Plex Mono', monospace; direction: ltr; }
.totals .row.grand {
  border-block-start: 2px solid var(--ink);
  margin-block-start: 6px;
  padding-block-start: 11px;
  font-weight: 600;
  font-size: 1.05rem;
}


/* Internal execution split on the quotation builder */
.totals .row.split {
  font-size: .83rem;
  color: var(--ink-3);
  padding: 4px 0;
}
.totals .row.split:first-child { padding-block-start: 0; }
.totals .row.split + .row:not(.split) {
  border-block-start: 1px solid var(--line-soft);
  margin-block-start: 5px;
  padding-block-start: 9px;
}
td .exec-cwk { color: var(--blueprint); }
td .exec-outsource { color: var(--marker); }


/* ---------- Repeating letterhead on every printed page ---------- */
table.doc {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
table.doc > thead > tr > td,
table.doc > tfoot > tr > td,
table.doc > tbody > tr > td { padding: 0; border: 0; }

/* Space between the letterhead and the content, and above the footer */
table.doc > tbody > tr > td.doc-body { padding: 0 0 10mm; }

/* Keep blocks from splitting awkwardly across a page break */
.sheet-meta,
.totals,
.sign-row,
.vch-amount,
table.vch { break-inside: avoid; page-break-inside: avoid; }

/* Line-item rows should not be cut in half */
table.q tbody tr,
table.vch tr { break-inside: avoid; page-break-inside: avoid; }

/* Repeat the line-item column headings on each page too */
table.q thead { display: table-header-group; }

@media print {
  table.doc > thead { display: table-header-group; }
  table.doc > tfoot { display: table-footer-group; }
  table.doc > tbody { display: table-row-group; }

  /* The bands must keep their black fill when printed */
  .lh, .lh-mark, .lh-rule, .lh-foot,
  .rv-logo, .rv-band {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page { size: A4 portrait; margin: 8mm 0; }
}


/* Line-item description boxes — three visible lines, growable */
table.items textarea.d {
  width: 100%;
  min-height: 160px;
  padding: 6px 8px;
  font-size: .86rem;
  line-height: 1.5;
  resize: vertical;
  overflow-wrap: anywhere;
}
table.items textarea.d + textarea.d { margin-block-start: 4px; }
table.items td { vertical-align: top; }
/* Numeric cells line up with the first row of the description */
table.items td input[type=number],
table.items td select { margin-block-start: 0; }
table.items .line-total { padding-block-start: 13px !important; }

/* Add-line bar sits directly under the last row */
.add-line-bar {
  padding-block: 12px 4px;
  border-block-start: 1px dashed var(--line);
  margin-block-start: 6px;
}


/* Inline rename link next to a page title */
h1 .rename {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  margin-inline-start: 10px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 10px 3px 8px;
  text-decoration: none;
  white-space: nowrap;
}
h1 .rename:hover { color: var(--blueprint); border-color: #CBDCF0; background: var(--blueprint-l); text-decoration: none; }
h1 .rename svg { width: 13px; height: 13px; }


/* Payment schedule table on the printed quotation */
table.q.sched thead th { background: #4A545E; }
table.q.sched tfoot td { border-block-end: 0; }
table.q.sched { break-inside: avoid; page-break-inside: avoid; }

/* Schedule editor rows */
table.items tr.srow td { vertical-align: top; }
table.items tr.srow input[type=number] { text-align: end; }


/* ---------- Company stamp ---------- */
.sign-box { position: relative; }

.stampimg {
  position: absolute;
  width: 41mm;
  height: auto;
  opacity: .88;
  pointer-events: none;
  z-index: 2;
  /* Sits over the signature line, tilted like a real stamp */
  inset-block-start: -30mm;
  inset-inline-start: 6mm;
  transform: rotate(-11deg);
  mix-blend-mode: multiply;
}
.stampimg.on-voucher {
  width: 34mm;
  inset-block-start: -26mm;
  inset-inline-start: 4mm;
  transform: rotate(-8deg);
}
body.no-stamp .stampimg { display: none !important; }

/* Give the signature row room so the stamp does not collide with the text */
.sign-row { margin-block-start: 54px; }

.stamp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--chalk);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.stamp-toggle input { width: 15px; height: 15px; cursor: pointer; }

@media print {
  .stampimg {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}



/* ---------- Authorised signature ---------- */
.signimg {
  position: absolute;
  width: 38mm;
  height: auto;
  pointer-events: none;
  z-index: 3;
  /* Sits on the signature line, upright */
  inset-block-start: -17mm;
  inset-inline-start: 2mm;
  mix-blend-mode: multiply;
}
.signimg.on-voucher {
  width: 32mm;
  inset-block-start: -14mm;
  inset-inline-start: 26mm;
}
body.no-sign .signimg { display: none !important; }

/* On the voucher the boxes are inline spans — give them a frame to anchor to */
.rv-sign > div { position: relative; }

@media print {
  .signimg {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------- Important note (prints in red) ---------- */
textarea.red-note {
  color: #B03626;
  border-color: #EFC8C1;
  background: #FDF8F7;
  font-weight: 500;
}
textarea.red-note:focus { outline-color: #B03626; }
textarea.red-note::placeholder { color: #D6A79F; }

.red-note-print {
  margin-block-start: 20px;
  border: 2px solid #C81E1E;
  border-inline-start-width: 6px;
  background: #FEF6F5;
  padding: 11px 15px;
  break-inside: avoid;
  page-break-inside: avoid;
  color: #C81E1E;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  color-adjust: exact;
}
.red-note-print * {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.red-note-print .rn-title {
  color: #C81E1E;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-block-end: 5px;
}
.red-note-print .rn-title .rn-ar {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.red-note-print .rn-body {
  color: #C81E1E;
  font-size: .85rem;
  line-height: 1.75;
  font-weight: 500;
}
.red-note-print .rn-ar-body {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  direction: rtl;
  text-align: right;
  margin-block-start: 4px;
}

@media print {
  .red-note-print,
  .red-note-print .rn-title,
  .red-note-print .rn-title .rn-ar,
  .red-note-print .rn-body,
  .red-note-print .rn-ar-body {
    color: #C81E1E !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .red-note-print {
    border-color: #C81E1E !important;
    background: #FEF6F5 !important;
  }
}


/* ---------- Quotation revisions ---------- */
.rev-chip {
  display: inline-block; margin-inline-start: 6px;
  font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  background: var(--ink); color: #fff; vertical-align: middle;
}
.rev-latest {
  display: inline-block; margin-inline-start: 6px;
  font-size: .68rem; font-weight: 600; padding: 1px 7px; border-radius: 10px;
  background: var(--verdigris-l); color: var(--verdigris); border: 1px solid #BFE0D8;
}
tr.rev-current td { background: var(--blueprint-l); }
.rev-form {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px 18px; border-block-start: 1px solid var(--line-soft); background: #FAFBFC;
}
fieldset[disabled] input, fieldset[disabled] select, fieldset[disabled] textarea {
  background: var(--slab); color: var(--ink-2);
}
fieldset[disabled] .btn { opacity: .45; pointer-events: none; }


.rev-print {
  display: inline-block; margin-block-start: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: .82rem; font-weight: 600;
  letter-spacing: .08em; padding: 3px 10px; border: 1.5px solid #14181D;
}
.superseded-print {
  margin-block-start: 8px; padding: 5px 10px;
  font-size: .78rem; font-weight: 700; letter-spacing: .05em;
  color: #C81E1E; border: 2px solid #C81E1E; display: inline-block;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}


/* ---------- Deductions ---------- */
.ded-block {
  margin-block-start: 18px; padding: 14px 16px;
  border: 1px solid #EFC8C1; border-inline-start: 4px solid var(--brick);
  background: #FDF8F7; border-radius: var(--r);
}
.ded-block h3 { color: var(--brick); margin-block-end: 10px; }
.ded-block h3 .hint { font-weight: 400; color: var(--ink-3); font-size: .8rem; }
.ded-block input.da { color: var(--brick); font-weight: 500; }
.totals .row.ded { color: var(--brick); }

.ded-print-head {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #4A545E; padding: 8px 0 2px;
}
.totals .row.ded-print { font-size: .82rem; color: #4A545E; padding: 4px 0 4px 10px; gap: 14px; }
.totals .row.ded-print .ded-ar {
  display: block; font-family: 'IBM Plex Sans Arabic', sans-serif; direction: rtl; font-size: .8rem;
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(20,24,29,.97), rgba(20,24,29,.97)),
    repeating-linear-gradient(0deg, #1B4D8F 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, #1B4D8F 0 1px, transparent 1px 32px),
    var(--ink);
}
.login-card { width: min(400px, 100%); background: var(--chalk); border-radius: 8px; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.login-card .brand-mark { color: var(--marker); }
.login-card h1 { margin-block: 6px 4px; }
.login-card p.sub { color: var(--ink-3); font-size: .88rem; margin: 0 0 22px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; }
.login-lang { text-align: center; margin-block-start: 18px; font-size: .84rem; }

/* ---------- Print (quotations) ---------- */
.sheet { background: #fff; max-width: 210mm; margin: 0 auto; padding: 18mm 16mm; }
.sheet-head { display: flex; gap: 24px; align-items: flex-start; border-block-end: 3px solid var(--ink); padding-block-end: 14px; }
.sheet-head .co-name { font-size: 1.3rem; font-weight: 600; }
.sheet-head .co-meta { font-size: .8rem; color: var(--ink-2); line-height: 1.7; }
.sheet-title { text-align: end; }
.sheet-title .big { font-size: 1.5rem; font-weight: 600; letter-spacing: .04em; }
.sheet table.q { width: 100%; border-collapse: collapse; margin-block-start: 18px; font-size: .86rem; }
.sheet table.q th { background: var(--ink); color: #fff; padding: 8px 10px; text-align: start; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; }
.sheet table.q td { padding: 9px 10px; border-block-end: 1px solid var(--line); vertical-align: top; }
.sheet .bi-en { display: block; }
.sheet .bi-ar { display: block; color: var(--ink-2); font-size: .92em; direction: rtl; }
.sign-row { display: flex; gap: 40px; margin-block-start: 48px; }
.sign-box { flex: 1; border-block-start: 1px solid var(--ink); padding-block-start: 8px; font-size: .82rem; color: var(--ink-2); }


/* ---------- Letterhead (matches company stationery) ---------- */
.lh {
  background: #000;
  display: flex;
  align-items: stretch;
  min-height: 104px;
}
.lh-left {
  flex: 1;
  padding: 14px 26px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lh-name {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 44px;
  font-weight: 600;
  color: #D4A017;
  line-height: 1.05;
  letter-spacing: .01em;
}
.lh-name .amp { font-style: italic; padding: 0 2px; }
.lh-tag {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-style: italic;
  font-size: 18px;
  color: #FFFFFF;
  margin-top: 5px;
  padding-inline-start: 34px;
}
.lh-mark {
  width: 150px;
  flex: 0 0 150px;
  background: #000;
  border-inline-start: 2px solid #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  text-align: center;
}
.lh-mark img { max-width: 132px; max-height: 84px; object-fit: contain; }
.lh-mono {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 34px;
  color: #D4A017;
  line-height: 1;
}
.lh-mono .sm { font-size: 21px; font-style: italic; }
.lh-mark-text {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 10px;
  letter-spacing: .22em;
  color: #FFFFFF;
  margin-top: 6px;
  line-height: 1.6;
}
.lh-rule { height: 5px; background: #D4A017; }

.sheet-meta {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 14px 0 12px;
  border-block-end: 1px solid var(--line);
}
.sheet-meta .doc-title {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .05em;
  line-height: 1.1;
}
.sheet-meta .doc-title-ar {
  font-family: 'Amiri', 'IBM Plex Sans Arabic', serif;
  font-size: 24px;
  direction: rtl;
}

.lh-foot {
  margin-top: 26px;
  border-top: 3px solid #D4A017;
  background: #000;
  color: #fff;
  padding: 9px 22px;
  font-size: 10.5px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 1.7;
}

@media print {
  .lh, .lh-mark, .lh-foot {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .lh-rule { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


@media print {
  .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .sheet { max-width: none; padding: 0; }
  .shell, .sidebar, .topbar { display: block; }
  @page { size: A4; margin: 14mm; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid.c3, .grid.c4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .nav a { padding: 7px 11px; font-size: .85rem; }
  .nav-sep { display: none; }
  .sidebar-foot { display: flex; align-items: center; gap: 12px; }
  .content { padding: 16px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .stat .value { font-size: 1.3rem; }
  .sign-row { flex-direction: column; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
