/* Drawings are laid out left to right in their own coordinates: an Arabic (RTL) page must not
   turn their text around (text-anchor "start" would run leftwards over the leader lines). */
svg { direction: ltr; }
/* UOMAS — application styles. Direction-agnostic (logical properties) for Arabic RTL and
   English LTR. No external fonts or CDNs (CSP: same-origin only). */

:root {
  --ink: #16202b;
  --ink-2: #3d4b5c;
  --muted: #6b7a8c;
  --line: #dfe5ec;
  --line-2: #eef2f6;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --brand: #0f3b5f;        /* anodised navy */
  --brand-2: #1b5a8a;
  --accent: #0d8a8a;       /* glass teal */
  --accent-soft: #e3f4f3;
  --ok: #157347;
  --ok-soft: #e4f4ea;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --bad: #b42318;
  --bad-soft: #fde9e7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 16px rgba(16, 32, 48, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Geeza Pro",
          "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0c2f4c 0%, #0f3b5f 60%, #12466f 100%);
  color: #d8e3ee;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: .7rem; align-items: center; padding: 1.15rem 1.1rem 1rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; letter-spacing: .14em; font-size: 1.05rem; }
.brand small { display: block; font-size: .72rem; color: #a9bfd4; line-height: 1.3; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(3, 6px); gap: 3px; height: 26px; align-items: end; }
.brand-mark i { display: block; background: #8fd3d1; border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 14px; }
.brand-mark i:nth-child(2) { height: 26px; background: #cfe3f5; }
.brand-mark i:nth-child(3) { height: 20px; }
.brand-mark.big { grid-template-columns: repeat(3, 12px); gap: 6px; height: 56px; }
.brand-mark.big i:nth-child(1) { height: 30px; } .brand-mark.big i:nth-child(2) { height: 56px; } .brand-mark.big i:nth-child(3) { height: 42px; }

.sidebar nav { padding: .4rem .6rem 1rem; display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 1rem .6rem .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #8ea8c0; }
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .7rem; border-radius: 8px; color: #dce6f0; font-size: .93rem;
}
.nav-item:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav-item.active { background: rgba(143, 211, 209, .16); color: #fff; box-shadow: inset 3px 0 0 #8fd3d1; }
[dir="rtl"] .nav-item.active { box-shadow: inset -3px 0 0 #8fd3d1; }
.nav-item.muted { color: #9fb4c8; }
.nav-item em { margin-inline-start: auto; font-style: normal; font-size: .68rem; background: rgba(255,255,255,.1); padding: .05rem .4rem; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: .8rem 1.2rem; font-size: .72rem; color: #7f97ae; }

/* simple geometric icons drawn with CSS */
.ico { width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-radius: 3px; opacity: .85; position: relative; }
.ico-grid { border-radius: 2px; background: linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat, linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
.ico-users { border-radius: 50% 50% 4px 4px; }
.ico-folder { border-radius: 2px 6px 2px 2px; }
.ico-calc { background: linear-gradient(currentColor, currentColor) 50% 30% / 60% 2px no-repeat; }
.ico-profile { border-radius: 0; border-width: 2px 5px; }
.ico-box { border-radius: 2px; transform: rotate(45deg) scale(.8); }
.ico-layers { border-radius: 2px; box-shadow: 3px -3px 0 -1px currentColor; }
.ico-factory { border-radius: 0 0 2px 2px; border-top-width: 6px; }
.ico-soon { border-radius: 50%; border-style: dashed; }
.ico-key { border-radius: 50%; width: 12px; height: 12px; }
.ico-list { background: linear-gradient(currentColor, currentColor) 50% 35% / 70% 2px no-repeat, linear-gradient(currentColor, currentColor) 50% 70% / 70% 2px no-repeat; }
.ico.big { width: 48px; height: 48px; border-width: 3px; margin-bottom: .8rem; display: inline-block; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.6rem; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.crumbs { color: var(--muted); font-size: .9rem; }
.crumbs a { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: .6rem; }
.who { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; }
.who small { color: var(--muted); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 700; }
.content { padding: 1.5rem 1.6rem 3rem; max-width: 1360px; width: 100%; }
form.inline { display: inline; margin: 0; }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: .25rem; font-size: .92rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  padding: .52rem 1rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink);
}
.btn:hover { text-decoration: none; border-color: #c4ceda; background: #fafbfd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f1c4bf; }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .7rem; font-size: .82rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- panels, cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1.1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-body { padding: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--accent); }
.kpi .label { color: var(--muted); font-size: .82rem; }
.kpi .value { font-size: 1.75rem; font-weight: 700; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.kpi.warn::after { background: #e0a100; }
.kpi.brand::after { background: var(--brand); }
.money-list { list-style: none; margin: 0; padding: 0; }
.money-list li { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed var(--line-2); font-variant-numeric: tabular-nums; }
.money-list li:last-child { border-bottom: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .6rem .8rem; text-align: start; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; font-weight: 600; white-space: nowrap; }
table.data tbody tr:hover { background: #fafcfe; }
table.data td.num, table.data th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 700; background: #fafbfd; }
td.code, .code { font-family: var(--mono); font-size: .85rem; direction: ltr; unicode-bidi: isolate; }
.thumb { width: 46px; height: 46px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .14rem .55rem; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok, .st-verified, .st-approved, .st-awarded, .st-completed { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .st-unverified, .st-tender, .st-on_hold { background: var(--warn-soft); color: var(--warn); }
.badge.bad, .st-lost, .st-cancelled, .st-superseded { background: var(--bad-soft); color: var(--bad); }
.st-draft, .st-quoted { background: #e8eef7; color: var(--brand-2); }
.st-in_progress { background: var(--accent-soft); color: var(--accent); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem 1.1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.req { color: var(--bad); }
input, select, textarea {
  font: inherit; font-size: .93rem; color: var(--ink);
  padding: .52rem .7rem; border: 1px solid #ccd5e0; border-radius: 8px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(13,138,138,.25); border-color: var(--accent); }
input.num { text-align: end; font-variant-numeric: tabular-nums; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.error { color: var(--bad); font-size: .8rem; }
.hint { color: var(--muted); font-size: .78rem; }
.form-actions { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.fieldset-title { grid-column: 1 / -1; margin: .6rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line-2); font-size: .95rem; color: var(--brand); }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.searchbar { display: flex; gap: .5rem; flex-wrap: wrap; }
.searchbar input, .searchbar select { width: auto; min-width: 220px; }

/* ---------- details ---------- */
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; }
dl.props dt { color: var(--muted); font-size: .86rem; }
dl.props dd { margin: 0; }
.section-image { width: 100%; max-width: 380px; max-height: 340px; object-fit: contain; display: block; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .75rem; image-rendering: auto; }
.note { background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; color: var(--ink-2); font-size: .86rem; }
.note.warn { background: var(--warn-soft); border-color: #f1dca6; color: #6d4700; }
.totals { min-width: 320px; margin-inline-start: auto; }
.totals li strong { font-size: 1.05rem; }
.totals li.grand { border-top: 2px solid var(--ink); border-bottom: 0; padding-top: .7rem; font-size: 1.1rem; }

/* ---------- flash ---------- */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.flash.success { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cd; }
.flash.error { background: var(--bad-soft); color: var(--bad); border-color: #f3c8c3; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #f1dca6; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--ink-2); }
.empty-state p { color: var(--muted); max-width: 520px; margin: .4rem auto 1rem; }
.muted-text { color: var(--muted); }

/* ---------- auth pages ---------- */
.auth-page { background: radial-gradient(1200px 600px at 20% 0%, #164d78 0%, #0c2f4c 55%, #08243a 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(340px, 440px); align-items: center; gap: 3rem; max-width: 1080px; margin: 0 auto; padding: 2rem; }
.auth-side { color: #e2ecf5; }
.auth-side h1 { font-size: 2.6rem; letter-spacing: .2em; margin: 1rem 0 .3rem; color: #fff; }
.auth-side p { color: #a9c1d8; font-size: 1.05rem; max-width: 420px; }
.auth-card { background: #fff; border-radius: 14px; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); position: relative; }
.auth-card h2 { margin-bottom: 1rem; }
.lang-corner { position: absolute; inset-block-start: .8rem; inset-inline-end: .8rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .toolbar, .form-actions, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .panel { box-shadow: none; border: 0; }
  /* the owner: printed pages laid out by the page — a title never alone at the foot of a page,
     a table starting on a clean page with its header, no row cut in two, a block kept whole */
  h1, h2, h3, h4, .panel-head { break-after: avoid; page-break-after: avoid; }
  table { break-inside: auto; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  tr, td, th, figure, .offer-item, .of-sys, .kpi, .cut-group { break-inside: avoid; page-break-inside: avoid; }
  .panel, .of-page section { break-inside: avoid-page; }
  table.data, .of-table { break-before: auto; }
  p, li { orphans: 3; widows: 3; }
}

/* spacing utilities (no inline styles: CSP style-src 'self') */
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.nowrap { white-space: nowrap; }
a.kpi { color: inherit; display: block; }
a.kpi:hover { text-decoration: none; border-color: #c4ceda; }

/* keep the sidebar colour for the full height of long pages */
.shell { background: linear-gradient(to right, #0f3b5f 0, #0f3b5f 252px, transparent 252px); }
[dir="rtl"] .shell { background: linear-gradient(to left, #0f3b5f 0, #0f3b5f 252px, transparent 252px); }
@media (max-width: 900px) { .shell, [dir="rtl"] .shell { background: none; } }
.st-archived { background: var(--line-2); color: var(--muted); }

/* ---- bar cutting diagrams */
.bar-row { margin-bottom: 14px; }
.bar-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.bar-meta .waste-text { color: var(--danger, #b42318); }
.bar-svg { width: 100%; height: auto; display: block; direction: ltr; }
.bar-waste { fill: #fde2e1; stroke: #e5a3a0; stroke-dasharray: 4 3; }
.bar-piece { stroke: #1f3a5f; stroke-width: 1; }
.bar-piece.c0 { fill: #dbeafe; } .bar-piece.c1 { fill: #dcfce7; } .bar-piece.c2 { fill: #fef9c3; }
.bar-piece.c3 { fill: #fce7f3; } .bar-piece.c4 { fill: #ede9fe; } .bar-piece.c5 { fill: #cffafe; }
.bar-label { font-size: 13px; font-weight: 700; fill: #10233f; }
.bar-ref { font-size: 12px; fill: #1d4ed8; }
.bar-angle { font-size: 10px; fill: #b42318; }
@media print { .cut-group { break-inside: avoid; } }

/* ---- catalog library cards */
.system-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.system-card, .profile-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface, #fff); border: 1px solid var(--line, #e3e8ef); border-radius: 12px; padding: 10px; color: inherit; text-decoration: none; }
.system-card:hover, .profile-card:hover { border-color: var(--accent, #1d4ed8); box-shadow: 0 2px 10px rgba(16, 35, 63, .08); }
.system-card img, .system-card .ph { width: 100%; height: 120px; object-fit: contain; background: #fafbfc; border-radius: 8px; }
.system-card.with-cover img.cover { height: 260px; object-fit: cover; object-position: top; background: #fff; }
.system-card small, .profile-card small { color: var(--muted, #667085); }
.profile-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.profile-card .pic { display: flex; align-items: center; justify-content: center; height: 150px; background: #fafbfc; border-radius: 8px; overflow: hidden; }
.profile-card .pic img { max-width: 100%; max-height: 150px; object-fit: contain; }
.profile-card em { align-self: flex-start; font-style: normal; }
.section-image { max-width: 100%; max-height: 520px; object-fit: contain; }
.pic-cell img { width: 64px; height: 48px; object-fit: contain; background: #fafbfc; border-radius: 6px; }

/* ---------- system page (workbench) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tabs .tab { padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--line, #e3e6ea); background: #fff; color: inherit; text-decoration: none; font-weight: 600; }
.tabs .tab.on { background: var(--brand, #0f5c8c); color: #fff; border-color: transparent; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; margin-inline-start: auto; flex-wrap: wrap; }
.inline-form .small { font-size: .82rem; }
.title-input { font: inherit; font-weight: 700; border: 1px dashed transparent; background: transparent; padding: .1rem .3rem; min-width: 16rem; }
.title-input:hover, .title-input:focus { border-color: var(--line, #ccd); background: #fff; }
table.lines input, table.lines select { width: 100%; min-width: 4.5rem; font-size: .85rem; padding: .25rem .35rem; }
table.lines input.formula { min-width: 9rem; font-family: ui-monospace, Menlo, monospace; }
table.lines input.short { min-width: 4rem; max-width: 6rem; }
table.lines tr.k-value td { background: #f4f8fc; }
table.lines tr.k-glass td { background: #f2fbf6; }
table.lines tr.k-accessory td { background: #fbfaf5; }
table.lines tr.check td { background: #fff4d6; }
table.lines tr.new-row td { background: #fafafa; }
.cost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.cost-grid div { background: #f6f7f9; border-radius: 8px; padding: .5rem .75rem; display: flex; flex-direction: column; }
.cost-grid span { font-size: .8rem; color: var(--muted, #667085); }
.cost-grid strong { font-size: 1.05rem; }
.cost-grid .big { background: #0f2f45; color: #fff; }
.cost-grid .big span { color: #cfd8e3; }
.takeoff-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.takeoff-row label { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; font-weight: 600; }
.takeoff-row input, .takeoff-row select { min-width: 6rem; }
.takeoff-row .f-ref input, .takeoff-row .f-n input { width: 5rem; min-width: 0; }
.takeoff-row .f-w input, .takeoff-row .f-h input { width: 7rem; min-width: 0; }
.takeoff-row .f-t select { min-width: 12rem; }
.takeoff-row label.has-error input { border-color: var(--bad); }
.type-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.type-chip { padding: .55rem 1rem; border-radius: 10px; background: #f3f6f9; border: 1px solid #e3e6ea; color: inherit; text-decoration: none; font-weight: 600; }
form.inline { display: inline; }
.nav-old summary { cursor: pointer; list-style: none; }
.nav-old summary::-webkit-details-marker { display: none; }
.nav-old summary::after { content: " ▾"; }
.nav-old .nav-item { font-size: .85rem; padding-block: .35rem; }
.pick { position: relative; display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; font-weight: 600; }
.pick-current { display: flex; align-items: center; gap: .4rem; min-width: 8rem; height: 2.6rem; padding: .2rem .5rem; border: 1px solid var(--line, #d0d5dd); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; }
.pick-current img { height: 2.1rem; width: 2.4rem; object-fit: contain; }
.pick-panel { position: absolute; top: 100%; inset-inline-start: 0; z-index: 30; margin-top: .25rem; width: min(560px, 90vw); max-height: 380px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .4rem; padding: .5rem; background: #fff; border: 1px solid var(--line, #d0d5dd); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,47,69,.18); }
.pick-panel[hidden] { display: none; }
.pick-opt { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem; border: 1px solid #eef0f3; border-radius: 8px; background: #fff; cursor: pointer; font: inherit; }
.pick-opt:hover { border-color: var(--brand, #0f5c8c); }
.pick-opt.on { border-color: var(--brand, #0f5c8c); background: #eef6fb; }
.pick-opt img { height: 64px; width: 100%; object-fit: contain; }
.pick-opt small { font-weight: 400; color: var(--muted, #667085); font-size: .72rem; text-align: center; }
.pick-none { height: 64px; display: flex; align-items: center; font-size: 1.4rem; color: #98a2b3; }
[data-follows-system][hidden] { display: none !important; }
table.takeoff td.picks-cell { min-width: 15rem; max-width: 22rem; }
table.takeoff .tag { display: inline-block; margin: 1px 2px; padding: 0 .4rem; border-radius: 6px; background: #f1f4f8; font-size: .74rem; white-space: nowrap; color: #475467; }
table.takeoff td, table.takeoff th { padding-inline: .5rem; }
table.takeoff .row-actions { display: flex; gap: .5rem; font-size: .76rem; margin-top: .15rem; white-space: nowrap; }
table.takeoff .row-actions a, .linkish { color: var(--brand, #0f5c8c); }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: #b42318; }

/* =====================================================================
   UOMAS v2 look: graphite navy, brushed aluminium, glass blue, gold line
   ===================================================================== */
:root {
  --brand: #0b1f33;
  --brand-2: #1f6fa3;
  --accent: #1f8ac0;
  --accent-soft: #e6f3fa;
  --gold: #e2a72e;
  --bg: #f3f5f8;
  --line: #e1e6ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 31, 51, .06), 0 8px 24px rgba(11, 31, 51, .06);
}
.sidebar { background: linear-gradient(180deg, #08182a 0%, #0b1f33 55%, #10304d 100%); box-shadow: inset -1px 0 0 rgba(255,255,255,.04); }
.brand { padding: 1.2rem 1.1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo { border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.brand strong { letter-spacing: .22em; }
.nav-item.active { background: linear-gradient(90deg, rgba(226,167,46,.18), rgba(226,167,46,.04)); box-shadow: inset 3px 0 0 var(--gold); color: #fff; }
[dir="rtl"] .nav-item.active { box-shadow: inset -3px 0 0 var(--gold); background: linear-gradient(270deg, rgba(226,167,46,.18), rgba(226,167,46,.04)); }
.nav-group { color: #7f97ae; letter-spacing: .04em; }
.btn.primary { background: linear-gradient(180deg, #1f78b0, #165f8e); border-color: #165f8e; }
.btn.gold { background: linear-gradient(180deg, #ecb444, #d4981f); border-color: #c58c19; color: #1b1206; font-weight: 700; }
.panel { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.topbar { background: rgba(255,255,255,.85); backdrop-filter: blur(8px); }

/* home */
.hero { position: relative; overflow: hidden; border-radius: 16px; padding: 1.8rem 2rem; color: #fff; margin-bottom: 1.2rem;
  background: radial-gradient(120% 140% at 100% 0%, #1f6fa3 0%, #0b1f33 55%, #08182a 100%); box-shadow: var(--shadow); }
.hero h1 { color: #fff; font-size: 1.7rem; margin-bottom: .3rem; }
.hero p { color: #c6d6e6; margin: 0 0 1rem; max-width: 46rem; }
.hero .gold-line { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: var(--gold); }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.system-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.system-card2 { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: inherit; box-shadow: var(--shadow); }
.system-card2:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.system-card2 .cover { height: 130px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #f7f9fb, #eef2f6); }
.system-card2 .cover img { max-height: 110px; max-width: 88%; object-fit: contain; }
.system-card2 .body { padding: .7rem .9rem; }
.system-card2 .body b { font-size: 1.05rem; }
.system-card2 .body small { color: var(--muted); display: block; }

/* profile control */
.ctrl-head { display: grid; grid-template-columns: 220px 1fr; gap: 1.2rem; align-items: start; }
.ctrl-pic { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem; text-align: center; }
.ctrl-pic img { max-width: 100%; max-height: 220px; object-fit: contain; }
.case-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.case-tabs a { padding: .4rem .8rem; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: inherit; font-size: .88rem; }
.case-tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.case-tabs a em { font-style: normal; font-size: .72rem; opacity: .7; margin-inline-start: .25rem; }
table.edit input, table.edit select { width: 100%; min-width: 4.2rem; font-size: .86rem; padding: .28rem .4rem; }
table.edit input.f { font-family: var(--mono); min-width: 8rem; }
table.edit input.s { max-width: 5.5rem; }
table.edit tr.k-value td { background: #f2f7fc; }
table.edit tr.k-glass td { background: #eef8f2; }
table.edit tr.k-accessory td { background: #fbfaf4; }
table.edit tr.check td { background: #fff3d6; }
table.edit tr.new td { background: #fafbfc; }
.names-help { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.kind-badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; background: var(--accent-soft); color: #145d85; font-size: .78rem; font-weight: 600; }
.approved-badge { background: var(--ok-soft); color: var(--ok); }

/* shapes */
.shape-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.shape-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .6rem; color: inherit; }
.shape-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.shape-card svg { width: 100%; height: auto; }

/* مقايسة */
.boq-add { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.boq-add label, .boq-add .pick { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; font-weight: 600; }
.boq-add input.n { width: 5rem; } .boq-add input.wh { width: 6.5rem; } .boq-add select.shape { min-width: 13rem; }
.boq-add [hidden] { display: none !important; }
.boq-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; }
.boq-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.boq-card .head { display: flex; justify-content: space-between; align-items: center; padding: .55rem .8rem; background: linear-gradient(90deg, #0b1f33, #164a73); color: #fff; }
.boq-card .head b { letter-spacing: .05em; }
.boq-card .head small { color: #bcd0e2; }
.boq-card .pic { padding: .4rem; text-align: center; background: #fff; }
.boq-card .pic svg { width: 100%; height: auto; max-height: 260px; }
.boq-card .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.boq-card .facts div { background: #fff; padding: .4rem .5rem; text-align: center; font-size: .78rem; color: var(--muted); }
.boq-card .facts b { display: block; color: var(--ink); font-size: .95rem; }
.boq-card .tags { padding: .45rem .7rem; display: flex; flex-wrap: wrap; gap: .25rem; }
.boq-card .tags span { font-size: .72rem; background: #f1f4f8; padding: 0 .4rem; border-radius: 6px; direction: ltr; }
.boq-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: .5rem .8rem; border-top: 1px solid var(--line); }
.boq-card .price { font-weight: 800; font-size: 1.05rem; }
.boq-card .warn-line { color: var(--warn); font-size: .75rem; padding: 0 .8rem .4rem; }
.totals-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: 1rem 0; }
.totals-bar div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; }
.totals-bar span { display: block; font-size: .78rem; color: var(--muted); }
.totals-bar b { font-size: 1.15rem; }
.totals-bar .big { background: var(--brand); color: #fff; } .totals-bar .big span { color: #b9cde0; }
.drawings2 { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; align-items: start; }
.drawings2 svg { width: 100%; height: auto; }

/* picture pickers */
.pick { position: relative; }
.pick-current { display: flex; align-items: center; gap: .4rem; min-width: 8.5rem; height: 2.6rem; padding: .2rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; }
.pick-current img { height: 2.1rem; width: 2.4rem; object-fit: contain; }
.pick-panel { position: fixed; z-index: 40; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .4rem; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(11,31,51,.22); overflow: auto; }
.pick-panel[hidden] { display: none; }
.pick-opt { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem; border: 1px solid #eef0f3; border-radius: 8px; background: #fff; cursor: pointer; font: inherit; }
.pick-opt:hover, .pick-opt.on { border-color: var(--accent); background: #eef7fc; }
.pick-opt img { height: 64px; width: 100%; object-fit: contain; }
.pick-opt small { font-weight: 400; color: var(--muted); font-size: .72rem; text-align: center; }
.pick-none { height: 64px; display: flex; align-items: center; font-size: 1.4rem; color: #98a2b3; }

/* print documents (offer, cutting report) */
.doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem 1.6rem; box-shadow: var(--shadow); }
.doc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--gold); padding-bottom: .8rem; margin-bottom: 1rem; gap: 1rem; }
.doc-head .logo { display: flex; align-items: center; gap: .7rem; }
.doc-head .logo img { width: 54px; height: 54px; }
.doc-head .logo b { font-size: 1.5rem; letter-spacing: .25em; color: var(--brand); display: block; }
.doc-head .logo small { color: var(--muted); }
.doc-head .meta { text-align: end; font-size: .85rem; color: var(--ink-2); }
.offer-item { display: grid; grid-template-columns: 210px 1fr auto; gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.offer-item svg { width: 100%; height: auto; border-radius: 8px; }
.cut-group { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 1rem; overflow: hidden; break-inside: avoid; }
.cut-group .gh { display: flex; gap: 1rem; align-items: center; padding: .6rem .8rem; background: #f6f8fb; border-bottom: 1px solid var(--line); }
.cut-group .gh img { height: 56px; width: 70px; object-fit: contain; background: #fff; border-radius: 6px; }
.bar-row { padding: .5rem .8rem; border-bottom: 1px dashed var(--line); }
.bar-graph { position: relative; height: 34px; background: #f1f3f6; border: 1px solid #c9d1db; border-radius: 4px; margin: .3rem 0; overflow: hidden; }
.bar-graph .pc { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, #d3e8f6, #a9cfe8); border-inline-end: 2px solid #fff; font-size: .68rem; display: flex; align-items: center; justify-content: center; color: #0b2a44; overflow: hidden; white-space: nowrap; }
.bar-graph .pc.a45 { clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 100%, 0 100%); }
.pieces-table td svg.barcode { height: 40px; width: auto; display: block; }
@media print {
  .sidebar, .topbar, .no-print, .flash { display: none !important; }
  .shell { display: block; } .content { padding: 0; }
  .doc { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
}
.offcut-photo { max-height: 150px; max-width: 100%; object-fit: contain; border-radius: 8px; }
.plan-list { margin: 0; padding-inline-start: 1.2rem; line-height: 1.9; }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: #b42318; }
.row-actions { display: flex; gap: .6rem; }
.piece-glyph { display: block; }
.piece-label { display: flex; align-items: center; gap: .5rem; }
.piece-label svg.qr { display: block; }
.qr-link { line-height: 0; }
table.data tr.hit td { background: #fff3d6; font-weight: 700; }
.piece-banner { border: 2px solid var(--gold); background: #fffaf0; border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; }
/* window labels: small stickers, 3 (or 2) across an A4 sheet, rows to the end of the page */
.label-sheet { display: grid; gap: 3mm; width: 190mm; max-width: 100%; }
.label-sheet.cols-3 { grid-template-columns: repeat(3, 1fr); }
.label-sheet.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wlabel { height: 44mm; overflow: hidden; border: .3mm solid #1b2733; border-radius: 1.5mm; padding: 1.5mm 2mm; background: #fff;
  display: flex; flex-direction: column; gap: 1mm; break-inside: avoid; page-break-inside: avoid; font-size: 7pt; line-height: 1.25; }
.cols-2 .wlabel { height: 58mm; font-size: 8pt; }
.label-sheet .wlabel { height: 50mm; }
.label-sheet.cols-2 .wlabel { height: 58mm; }
/* the window's place and its glass: kind, build-up, each pane in cm (the owner, 30-11) */
.wl-spec { display: flex; flex-direction: column; gap: .4mm; border-top: .2mm dashed #b8c2cc; padding-top: .5mm; font-size: 6pt; }
.wl-place { display: flex; gap: 1mm; align-items: baseline; }
.wl-place span { color: #666; flex: none; }
.wl-place b { flex: 1; min-width: 0; border-bottom: .2mm dotted #9aa5b1; min-height: 2.6mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 6.5pt; }
.wl-glass { display: flex; flex-wrap: wrap; gap: .3mm 1.5mm; align-items: baseline; }
.wl-glass b { color: #1b5e8a; font-size: 6pt; }
.wl-glass em { font-style: normal; white-space: nowrap; }
.wl-glass em > * { margin-inline-end: .8mm; }
.wl-glass span { display: inline-block; direction: ltr; font-family: var(--mono); font-size: 6pt; font-weight: 700; }
.wl-glass i { font-style: normal; font-family: inherit; color: #2e7d32; font-weight: 700; }
.wl-glass small { font-weight: 500; color: #555; }
.cols-2 .wl-spec, .cols-2 .wl-glass b, .cols-2 .wl-glass span { font-size: 7pt; }
.wl-top { display: flex; align-items: center; gap: 1mm; border-bottom: .4mm solid var(--gold); padding-bottom: .6mm; }
.wl-logo { width: 4mm; height: 4mm; }
.wl-brand { letter-spacing: .15em; font-size: 6.5pt; color: var(--brand); }
.wl-code { margin-inline-start: auto; font-family: var(--mono); font-size: 6pt; }
.wl-main { display: flex; gap: 1.5mm; align-items: center; min-height: 0; flex: 1; }
.wl-qr svg { width: 23mm; height: auto; display: block; }
.cols-2 .wl-qr svg { width: 27mm; }
.wl-info { flex: 1; min-width: 0; }
.wl-ref { font-size: 12pt; font-weight: 800; line-height: 1; }
.wl-ref small { font-size: 6.5pt; font-weight: 600; color: #555; }
.wl-size { font-size: 9pt; font-weight: 700; margin-top: .5mm; }
.wl-shape { font-size: 6.5pt; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-pic { width: 15mm; flex: none; }
.cols-2 .wl-pic { width: 22mm; }
.wl-pic svg { width: 100%; height: auto; max-height: 17mm; display: block; }
.wl-profiles { display: flex; gap: 1mm; border-top: .2mm dashed #b8c2cc; padding-top: .6mm; }
.wl-prof { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.wl-prof img { height: 6mm; width: 100%; object-fit: contain; }
.cols-2 .wl-prof img { height: 7.5mm; }
.wl-prof span { font-size: 5pt; color: #555; white-space: nowrap; }
.wl-prof b { font-size: 5.5pt; font-family: var(--mono); }
@media print { @page { size: A4; margin: 10mm; } .label-sheet { width: 190mm; } }

.pick-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.pick-tags i { font-style: normal; font-size: .66rem; padding: 0 .3rem; border-radius: 4px; background: #eef2f6; color: #5b6b7c; }
.pick-tags i.yes { background: #e6f3fa; color: #145d85; font-weight: 700; }
.boq-add label.wide { flex: 1 1 100%; } .boq-add label.wide input { width: 100%; }

/* ---- curtain walls (facades) */
.cw-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; align-items: end; }
.cw-form label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; }
.cw-form .wide { grid-column: span 2; }
.cw-thumb svg, .cw-elev svg { max-width: 100%; height: auto; }
.cw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .cw-two { grid-template-columns: 1fr; } .cw-form .wide { grid-column: auto; } }
.cw-prof { display: flex; gap: 14px; align-items: flex-start; }
.cw-prof img { width: 110px; max-height: 230px; object-fit: contain; }
.cw-prof dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.cw-prof dt { color: var(--ink-2); }
.cw-prof dd { margin: 0; }
.calc-doc { background: #fff; max-width: 900px; margin: 0 auto; padding: 28px 36px; border: 1px solid var(--line, #e3e8ef); font-family: Georgia, "Times New Roman", serif; color: #111; }
.calc-doc h1 { font-size: 1.25rem; margin: 14px 0 8px; }
.calc-doc h2 { font-size: 1rem; background: #eef1f4; padding: 6px 10px; margin: 20px 0 8px; border: 1px solid #c9d1da; }
.calc-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid #1d9bd7; padding-bottom: 10px; }
.calc-head img { width: 48px; height: 48px; }
.calc-head div { display: flex; flex-direction: column; }
.calc-head b { font-size: 1.4rem; letter-spacing: .2em; }
.calc-ref { margin-inline-start: auto; text-align: end; font-size: .85rem; }
table.calc { border-collapse: collapse; margin: 6px 0; min-width: 380px; }
table.calc td { border: 1px solid #c9d1da; padding: 4px 10px; }
.calc-doc .eq { font-size: 1rem; margin: 6px 0; }
.calc-prof { display: flex; gap: 18px; align-items: flex-start; }
.calc-prof img { width: 90px; max-height: 220px; object-fit: contain; }
.calc-foot { margin-top: 28px; border-top: 1px solid #999; padding-top: 8px; font-size: .85rem; }
.cw-sheet { background: #fff; border: 2px solid #111; display: grid; grid-template-columns: 1fr 230px; grid-template-rows: 1fr auto; min-height: 780px; font-family: Arial, sans-serif; color: #111; page: cwsheet; }
.cw-draw { padding: 12px; border-inline-end: 1px solid #111; }
.cw-elev-box svg { width: 100%; height: auto; }
.cw-cap { font-size: .8rem; margin-top: 4px; }
.cw-details { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; border-top: 1px solid #bbb; padding-top: 10px; }
.cw-det { display: flex; gap: 10px; align-items: flex-start; font-size: .78rem; }
.cw-det img { width: 70px; max-height: 170px; object-fit: contain; }
.cw-notes { padding: 12px; font-size: .74rem; }
.cw-notes ol { padding-inline-start: 18px; margin: 6px 0; }
.cw-title { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr 1.2fr 1.4fr; border-top: 2px solid #111; }
.cw-title .tb { border-inline-end: 1px solid #111; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: .74rem; }
.cw-title .tb:last-child { border-inline-end: 0; }
.cw-title small { font-size: .62rem; color: #555; }
.cw-title b { font-size: .9rem; }
.cw-title .contractor img { width: 34px; height: 34px; }
.cw-title table { border-collapse: collapse; font-size: .68rem; }
.cw-title td { border: 1px solid #999; padding: 1px 4px; }
@page cwsheet { size: A3 landscape; margin: 8mm; }
@media print { .calc-doc { border: 0; padding: 0; } .cw-sheet { min-height: 0; } .content { max-width: none; } .shell { background: none; } }
.cw-fields { grid-column: 1 / -1; border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 10px 12px; }
.cw-fields legend { font-weight: 700; padding: 0 6px; }
.cw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 8px; }
.cw-grid label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; }
.cw-sheet + .cw-sheet { margin-top: 18px; break-before: page; }
.cw-sec-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: start; }
.cw-head { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.cw-head label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; }
.cw-left { font-weight: 700; color: var(--ok, #067647); }
.cw-left.bad { color: #b42318; }
table.cw-cells { border-collapse: collapse; }
table.cw-cells th, table.cw-cells td { border: 1px solid var(--line, #e3e8ef); padding: 3px 5px; font-size: .78rem; text-align: center; }
table.cw-cells select { min-width: 70px; }
table.cw-cells td.k-d { background: #fde8c8; }
table.cw-cells td.k-w { background: #dcecfb; }
table.cw-cells td.k-h { background: #f6dede; }
table.cw-cells td { min-width: 78px; height: 46px; }
.cw-ask { background: #fff7e0; border: 1px solid #f0d58a; border-radius: 6px; padding: 6px 10px; font-weight: 600; }

/* curtain wall shop drawing sheets, after the owner's own (Seoudi Mall of Mansoura, A620) */
.cw-sheet { display: flex; flex-direction: column; min-height: 0; border: 1.5px solid #000; width: 100%; box-sizing: border-box; overflow: hidden; }
.cw-remarks { font: 10px Arial, sans-serif; margin: 0; padding-inline-start: 16px; direction: rtl; text-align: right; }
.cw-s1 { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cw-s1-top { display: flex; gap: 10px; align-items: flex-end; }
.cw-fig { margin: 0; }
.cw-fig.grow { flex: 1; min-width: 0; }
.cw-fig > svg { display: block; max-width: 100%; height: auto; }
.cw-cap2 { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-family: Arial, sans-serif; }
.cw-cap2 .c { width: 24px; height: 24px; border: 1px solid #000; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 10px Arial, sans-serif; flex: none; }
.cw-cap2 b { font-size: 12px; } .cw-cap2 em { font-style: normal; font-size: 10px; margin-inline-start: 6px; }
.cw-cap2 small { display: block; font-size: 9px; }
table.cw-types { border-collapse: collapse; font: 10px Arial, sans-serif; width: 100%; }
table.cw-types th, table.cw-types td { border: 1px solid #000; padding: 2px 6px; text-align: left; }
.cw-dets { flex: 1; display: grid; gap: 8px; padding: 10px; grid-template-columns: repeat(2, 1fr); align-content: stretch; }
.cw-dets.cols-3 { grid-template-columns: repeat(3, 1fr); } .cw-dets.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cw-det-fig { margin: 0; display: flex; flex-direction: column; min-height: 0; }
.cw-det-fig .dd { flex: 1; border: 1px solid #000; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 6px; min-height: 0; }
.cw-det-fig .dd svg { max-width: 100%; max-height: 100%; }
.cw-det-fig .dd img.cw-pic { max-width: 100%; max-height: 100%; object-fit: contain; }
.cw-title { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 2.6fr) minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1.4fr); border-top: 1.5px solid #000; font-family: Arial, sans-serif; }
.cw-title .tb { border-inline-end: 1px solid #000; padding: 4px 6px; display: flex; flex-direction: column; gap: 1px; font-size: 9px; min-width: 0; }
.cw-title .tb:last-child { border-inline-end: 0; }
.cw-title small { font-size: 7px; color: #000; text-transform: uppercase; }
.cw-title b { font-size: 10px; }
.cw-title .contractor .logo { display: flex; gap: 6px; align-items: center; background: #000; color: #fff; padding: 6px; margin-top: 4px; }
.cw-title .contractor img { width: 30px; height: 30px; }
.cw-title .contractor i { display: block; font-size: 7px; font-style: normal; }
.cw-title .contractor b { font-size: 16px; letter-spacing: 1px; }
.cw-title .key svg { width: 100%; height: auto; max-height: 70px; }
.cw-title .notes ol { margin: 2px 0 0; padding-inline-start: 14px; font-size: 7.5px; line-height: 1.25; }
.cw-title table { border-collapse: collapse; width: 100%; font-size: 7.5px; }
.cw-title td { border: 1px solid #000; padding: 1px 3px; height: 11px; }
.cw-title .rev tr.h td { font-weight: 700; }
.cw-title .proj b { margin-bottom: 2px; }
.cw-title .info .c { text-align: center; border-bottom: 1px solid #000; }
.cw-title .sheet .t { font-size: 12px; min-height: 30px; }
.cw-title .sheet .sn { display: flex; gap: 10px; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 2px 0; }
.cw-title .sheet .sn b { font-size: 14px; }
.cw-sheet + .cw-sheet { margin-top: 18px; break-before: page; }
.cw-sheet.paper-A3 { page: cwA3; } .cw-sheet.paper-A2 { page: cwA2; } .cw-sheet.paper-A1 { page: cwA1; } .cw-sheet.paper-A0 { page: cwA0; }
@page cwA3 { size: 420mm 297mm; margin: 7mm; }
@page cwA2 { size: 594mm 420mm; margin: 8mm; }
@page cwA1 { size: 841mm 594mm; margin: 10mm; }
@page cwA0 { size: 1189mm 841mm; margin: 12mm; }
@media screen { .cw-sheet { min-height: 760px; } .cw-sheet.paper-A3 .cw-det-fig .dd { height: 360px; } }
@media print {
  html, body, .shell, .main, .content { background: #fff !important; }
  .content { max-width: none; }
  .cw-sheet { break-inside: avoid; overflow: hidden; box-sizing: border-box; }
  .cw-sheet.paper-A3 { height: 276mm; } .cw-sheet.paper-A2 { height: 398mm; }
  .cw-sheet.paper-A1 { height: 568mm; } .cw-sheet.paper-A0 { height: 810mm; }
  .cw-sheet + .cw-sheet { margin-top: 0; }
  .cw-s1-top .cw-fig.grow > svg { max-height: 120mm; width: auto; }
  .paper-A2 .cw-s1-top .cw-fig.grow > svg { max-height: 190mm; }
  .paper-A1 .cw-s1-top .cw-fig.grow > svg { max-height: 280mm; }
  .paper-A0 .cw-s1-top .cw-fig.grow > svg { max-height: 420mm; }
  .cw-s1-top .cw-fig:first-child > svg { max-height: 120mm; width: auto; }
  .cw-s1 > .cw-fig > svg { max-height: 45mm; width: auto; }
  .paper-A1 .cw-s1 > .cw-fig > svg, .paper-A0 .cw-s1 > .cw-fig > svg { max-height: 110mm; }
}
/* calculation report, page by page like the owner's CALC-CW01 */
.calc-page { padding-bottom: 18px; border-bottom: 1px dashed #bbb; margin-bottom: 18px; }
.calc-page:last-child { border-bottom: 0; }
.calc-two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.calc-box { border: 2px solid #1d9bd7; padding: 6px 10px; font-size: 1.02rem; display: inline-block; }
.calc-elev svg { width: 100%; height: auto; }
.calc-fig { max-width: 100%; height: auto; }
table.calc th { background: #eef1f4; text-align: left; border: 1px solid #c9d1da; padding: 4px 10px; }
table.calc tr.hl td { background: #fff4d6; font-weight: 700; }
table.calc.sign td { height: 26px; min-width: 200px; }
.calc-notes { font-family: Arial, sans-serif; font-size: .85rem; }
@media print {
  .calc-page { break-after: page; border: 0; margin: 0; padding: 0; min-height: 260mm; display: flex; flex-direction: column; }
  .calc-page .calc-foot { margin-top: auto; }
  .calc-page:last-child { break-after: auto; }
  .calc-page table.calc td, .calc-page table.calc th { padding: 1px 6px; font-size: 11px; }
  .calc-page { min-height: 255mm; font-size: 12px; }
  .calc-page h1 { margin: 8px 0 4px; }
}

/* =====================================================================
   UOMAS v3 looks, picked per user from the switch in the top bar:
   a = light (فاتح), b = mixed / graphite (خليط), c = dark (غامق, default).
   Brand: black / charcoal, the greys of the logo, and its pistachio #8CC63E.
   Paper (drawings, sheets, printed documents) always stays white.
   ===================================================================== */
html[data-theme] {
  --pist: #8CC63E; --pist-2: #79b02f; --pist-3: #9bd34d; --on-pist: #111214;
  --accent: #8CC63E; --gold: #8CC63E; --brand-2: #79b02f;
  --side: #111214; --side-2: #1a1b1e; --side-ink: #d7d9dc; --side-muted: #7d7f84; --side-line: #24252a;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Geeza Pro",
          "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
}
/* c: dark — the default */
html[data-theme="c"] {
  color-scheme: dark;
  --ink: #f2f3f4; --ink-2: #c9cbcf; --muted: #9a9ca1;
  --line: #2c2d32; --line-2: #25262a;
  --bg: #17181b; --panel: #1f2024; --soft: #26272b; --hover: #2a2b30;
  --field: #141517; --field-line: #3a3b40;
  --top: #141517; --top-ink: #f2f3f4; --top-line: #24252a;
  --side: #0c0d0f;
  --brand: #111214; --link: #a6d965;
  --accent-soft: rgba(140, 198, 62, .14); --accent-ink: #a6d965;
  --ok: #a6d965; --ok-soft: rgba(140, 198, 62, .14);
  --warn: #e3ad4a; --warn-soft: rgba(227, 173, 74, .14);
  --bad: #ef7d70; --bad-soft: rgba(239, 125, 112, .14); --danger: #ef7d70;
  --tint-blue: rgba(120, 170, 230, .10); --tint-green: rgba(140, 198, 62, .10);
  --tint-sand: rgba(227, 173, 74, .08); --tint-check: rgba(227, 173, 74, .16);
  --radius: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
}
/* a: light */
html[data-theme="a"] {
  color-scheme: light;
  --ink: #111214; --ink-2: #3a3b40; --muted: #6D6E72;
  --line: #d7d9dc; --line-2: #eef0f2;
  --bg: #f6f7f8; --panel: #ffffff; --soft: #f3f4f5; --hover: #f0f1f2;
  --field: #ffffff; --field-line: #cfd2d6;
  --top: #ffffff; --top-ink: #111214; --top-line: #e4e6e9;
  --brand: #111214; --link: #4f7f1a;
  --accent-soft: #eef6e1; --accent-ink: #3f6b12;
  --ok: #3f6b12; --ok-soft: #eef6e1;
  --warn: #8a5a00; --warn-soft: #fff3d6;
  --bad: #b42318; --bad-soft: #fde9e7; --danger: #b42318;
  --tint-blue: #f2f6fb; --tint-green: #f1f8e8; --tint-sand: #fbfaf4; --tint-check: #fff3d6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 18, 20, .05), 0 6px 20px rgba(17, 18, 20, .05);
}
/* b: mixed — black menu, charcoal top bar, mid grey page, white cards with a pistachio edge */
html[data-theme="b"] {
  color-scheme: light;
  --ink: #111214; --ink-2: #3a3b40; --muted: #6D6E72;
  --line: #d3d6da; --line-2: #e4e6e9;
  --bg: #e9ebee; --panel: #ffffff; --soft: #f1f2f4; --hover: #eceef0;
  --field: #ffffff; --field-line: #c9cdd2;
  --top: #17181b; --top-ink: #f2f3f4; --top-line: #17181b;
  --brand: #111214; --link: #4f7f1a;
  --accent-soft: #eef6e1; --accent-ink: #3f6b12;
  --ok: #3f6b12; --ok-soft: #eef6e1;
  --warn: #8a5a00; --warn-soft: #fff3d6;
  --bad: #b42318; --bad-soft: #fde9e7; --danger: #b42318;
  --tint-blue: #f2f6fb; --tint-green: #f1f8e8; --tint-sand: #fbfaf4; --tint-check: #fff3d6;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(17, 18, 20, .04), 0 2px 10px rgba(17, 18, 20, .07);
}

html[data-theme] body { background: var(--bg); color: var(--ink); }
html[data-theme] a { color: var(--link); }
html[data-theme] h1, html[data-theme] h2, html[data-theme] h3 { font-weight: 800; }

/* ---- side menu */
html[data-theme] .sidebar { background: var(--side); color: var(--side-ink); box-shadow: inset -1px 0 0 var(--side-line); }
html[data-theme] .shell { background: linear-gradient(to right, var(--side) 0, var(--side) 252px, transparent 252px); }
html[data-theme][dir="rtl"] .shell { background: linear-gradient(to left, var(--side) 0, var(--side) 252px, transparent 252px); }
html[data-theme] .brand { padding: 1.25rem 1.2rem 1.15rem; border-bottom: 1px solid var(--side-line); color: #fff; gap: .8rem; }
html[data-theme] .brand-logo { height: 40px; width: auto; border-radius: 0; box-shadow: none; }
html[data-theme] .brand strong { letter-spacing: .26em; font-weight: 800; font-size: 1.12rem; }
html[data-theme] .brand small { color: var(--side-muted); }
html[data-theme] .nav-group { color: var(--side-muted); font-weight: 700; letter-spacing: .04em; margin-top: 1.1rem; }
html[data-theme] .nav-item { color: var(--side-ink); font-weight: 600; }
html[data-theme] .nav-item:hover { background: var(--side-2); color: #fff; text-decoration: none; }
html[data-theme] .nav-item.muted { color: var(--side-muted); }
html[data-theme] .nav-item.active,
html[data-theme][dir="rtl"] .nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(140, 198, 62, .16), rgba(140, 198, 62, .03)); box-shadow: inset 3px 0 0 var(--pist); }
html[data-theme][dir="rtl"] .nav-item.active { background: linear-gradient(270deg, rgba(140, 198, 62, .16), rgba(140, 198, 62, .03)); box-shadow: inset -3px 0 0 var(--pist); }
html[data-theme] .nav-item.active .ico { color: var(--pist); opacity: 1; }
html[data-theme="a"] .nav-item.active, html[data-theme="a"][dir="rtl"] .nav-item.active { background: var(--pist); color: var(--on-pist); box-shadow: none; font-weight: 800; }
html[data-theme="a"] .nav-item.active .ico { color: var(--on-pist); }
html[data-theme] .sidebar-foot { color: var(--side-muted); border-top: 1px solid var(--side-line); }

/* ---- top bar */
html[data-theme] .topbar { background: var(--top); color: var(--top-ink); border-bottom: 1px solid var(--top-line); backdrop-filter: none; }
html[data-theme] .topbar .crumbs, html[data-theme] .topbar .crumbs a { color: var(--top-ink); opacity: .75; }
html[data-theme] .topbar .who small { color: var(--top-ink); opacity: .6; }
html[data-theme] .topbar .btn.ghost { color: var(--top-ink); border-color: color-mix(in srgb, var(--top-ink) 22%, transparent); }
html[data-theme] .topbar .btn.ghost:hover { border-color: var(--pist); background: transparent; }
html[data-theme] .avatar { background: var(--pist); color: var(--on-pist); font-weight: 800; }

/* the a / b / c switch */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; margin: 0;
  border: 1px solid color-mix(in srgb, var(--top-ink, #111) 20%, transparent); }
.theme-switch .th { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .8rem; font-weight: 700;
  padding: .22rem .65rem; border: 0; border-radius: 99px; background: transparent; color: var(--top-ink, #111); opacity: .7; cursor: pointer; }
.theme-switch .th:hover { opacity: 1; }
.theme-switch .th.on { background: var(--pist); color: var(--on-pist); opacity: 1; }
.theme-switch .th i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .6); }
.theme-switch .th-a i { background: #f6f7f8; }
.theme-switch .th-b i { background: linear-gradient(90deg, #111214 50%, #eef0f2 50%); }
.theme-switch .th-c i { background: #17181b; }

/* ---- buttons */
html[data-theme] .btn { background: var(--panel); color: var(--ink); border-color: var(--line); }
html[data-theme] .btn:hover { background: var(--hover); border-color: var(--field-line); }
html[data-theme] .btn.ghost { background: transparent; }
html[data-theme] .btn.primary, html[data-theme] .btn.gold, html[data-theme] .btn.accent {
  background: var(--pist); border-color: var(--pist); color: var(--on-pist); font-weight: 800; }
html[data-theme] .btn.primary:hover, html[data-theme] .btn.gold:hover, html[data-theme] .btn.accent:hover {
  background: var(--pist-3); border-color: var(--pist-3); }
html[data-theme] .btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

/* ---- surfaces */
html[data-theme] .panel, html[data-theme] .kpi { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
html[data-theme] .panel-head { border-bottom-color: var(--line-2); }
html[data-theme] .kpi::after { background: var(--pist); }
html[data-theme] .kpi .value { font-weight: 800; }
html[data-theme="b"] .panel, html[data-theme="b"] .kpi { border-top: 3px solid var(--pist); }
html[data-theme="b"] .kpi::after { display: none; }
html[data-theme] a.kpi:hover { border-color: var(--pist); }
html[data-theme] table.data th { background: var(--soft); color: var(--muted); }
html[data-theme] table.data tbody tr:hover { background: var(--hover); }
html[data-theme] table.data tfoot td { background: var(--soft); }
html[data-theme="b"] table.data th { border-bottom: 2px solid #111214; }
html[data-theme] input, html[data-theme] select, html[data-theme] textarea { background: var(--field); border-color: var(--field-line); color: var(--ink); }
html[data-theme] input:focus, html[data-theme] select:focus, html[data-theme] textarea:focus { outline: 3px solid rgba(140, 198, 62, .25); border-color: var(--pist); }
html[data-theme] .note { background: var(--soft); border-color: var(--line); color: var(--ink-2); }
html[data-theme] .note.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
html[data-theme] .flash { border-color: transparent; }
html[data-theme] .badge { background: var(--soft); color: var(--ink-2); }
html[data-theme] .badge.ok, html[data-theme] .st-verified, html[data-theme] .st-approved, html[data-theme] .st-awarded, html[data-theme] .st-completed { background: var(--ok-soft); color: var(--ok); }
html[data-theme] .badge.warn, html[data-theme] .st-unverified, html[data-theme] .st-tender, html[data-theme] .st-on_hold { background: var(--warn-soft); color: var(--warn); }
html[data-theme] .badge.bad, html[data-theme] .st-lost, html[data-theme] .st-cancelled, html[data-theme] .st-superseded { background: var(--bad-soft); color: var(--bad); }
html[data-theme] .st-draft, html[data-theme] .st-quoted { background: var(--soft); color: var(--ink-2); }
html[data-theme] .st-in_progress { background: var(--pist); color: var(--on-pist); }
html[data-theme] .kind-badge { background: var(--accent-soft); color: var(--accent-ink); }
html[data-theme] .fieldset-title { color: var(--accent-ink); }
html[data-theme] .system-card2, html[data-theme] .shape-card, html[data-theme] .boq-card, html[data-theme] .totals-bar div,
html[data-theme] .system-card, html[data-theme] .profile-card, html[data-theme] .pick-current, html[data-theme] .pick-panel,
html[data-theme] .case-tabs a, html[data-theme] .tabs .tab, html[data-theme] .type-chip, html[data-theme] .ctrl-pic {
  background: var(--panel); border-color: var(--line); color: var(--ink); }
html[data-theme] .pick-opt { background: var(--panel); border-color: var(--line-2); color: var(--ink); }
html[data-theme] .pick-opt:hover, html[data-theme] .pick-opt.on { background: var(--accent-soft); border-color: var(--pist); }
html[data-theme] .system-card2:hover, html[data-theme] .shape-card.on { border-color: var(--pist); }
html[data-theme] .case-tabs a.on, html[data-theme] .tabs .tab.on { background: var(--pist); color: var(--on-pist); border-color: var(--pist); }
html[data-theme] .boq-card .head { background: #111214; }
html[data-theme] .boq-card .head small { color: #9a9ca1; }
html[data-theme] .boq-card .facts { background: var(--line); border-color: var(--line); }
html[data-theme] .boq-card .facts div { background: var(--panel); }
html[data-theme] .boq-card .tags span, html[data-theme] table.takeoff .tag, html[data-theme] .pick-tags i { background: var(--soft); color: var(--ink-2); }
html[data-theme] .pick-tags i.yes { background: var(--accent-soft); color: var(--accent-ink); }
html[data-theme] .totals-bar .big, html[data-theme] .cost-grid .big { background: #111214; color: #fff; border-color: #111214; }
html[data-theme] .totals-bar .big span, html[data-theme] .cost-grid .big span { color: var(--pist); }
html[data-theme] .cost-grid div { background: var(--soft); }
html[data-theme] .title-input:hover, html[data-theme] .title-input:focus { background: var(--field); }
html[data-theme] .cut-group .gh { background: var(--soft); border-color: var(--line); }
html[data-theme] .bar-graph { background: var(--soft); border-color: var(--field-line); }
html[data-theme] table.lines tr.k-value td, html[data-theme] table.edit tr.k-value td { background: var(--tint-blue); }
html[data-theme] table.lines tr.k-glass td, html[data-theme] table.edit tr.k-glass td { background: var(--tint-green); }
html[data-theme] table.lines tr.k-accessory td, html[data-theme] table.edit tr.k-accessory td { background: var(--tint-sand); }
html[data-theme] table.lines tr.check td, html[data-theme] table.edit tr.check td, html[data-theme] table.data tr.hit td { background: var(--tint-check); }
html[data-theme] table.lines tr.new-row td, html[data-theme] table.edit tr.new td { background: var(--soft); }
html[data-theme] .piece-banner { background: var(--warn-soft); border-color: var(--pist); }
html[data-theme] .cw-ask { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--ink); }
html[data-theme] .cw-left { color: var(--ok); }

/* pictures and drawings are drawn for white paper: keep them on white in every look */
html[data-theme] .thumb, html[data-theme] .section-image, html[data-theme] .pic-cell img,
html[data-theme] .system-card img, html[data-theme] .system-card .ph, html[data-theme] .profile-card .pic,
html[data-theme] .ctrl-pic img, html[data-theme] .pick-current img, html[data-theme] .pick-opt img,
html[data-theme] .cut-group .gh img { background: #fff; }
html[data-theme] .system-card2 .cover { background: linear-gradient(180deg, #fbfbfc, #eceef0); }
html[data-theme="c"] .content svg:not(.no-paper), html[data-theme="c"] .content img:not(.no-paper) { background: #fff; border-radius: 6px; }
html[data-theme="c"] .shape-card svg, html[data-theme="c"] .boq-card .pic { background: #fff; }
.doc, .calc-doc, .cw-sheet, .wlabel, .paper {
  --ink: #111214; --ink-2: #3a3b40; --muted: #6D6E72; --line: #d7d9dc; --line-2: #eef0f2;
  --panel: #fff; --soft: #f3f4f5; --hover: #f0f1f2; --field: #fff; --field-line: #cfd2d6;
  --link: #4f7f1a; --ok: #3f6b12; --warn: #8a5a00; --bad: #b42318;
  --tint-blue: #f2f6fb; --tint-green: #f1f8e8; --tint-sand: #fbfaf4; --tint-check: #fff3d6;
  background: #fff; color: #111214; color-scheme: light; }

/* ---- home */
html[data-theme] .hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.7rem 2rem;
  background: radial-gradient(70% 140% at 0% 100%, rgba(140, 198, 62, .14), transparent 60%), linear-gradient(135deg, #1a1b1e, #0f1012);
  border: 1px solid #26272b; border-radius: 16px; color: #fff; box-shadow: var(--shadow); }
html[data-theme] .hero h1 { color: #fff; font-size: 1.75rem; }
html[data-theme] .hero p { color: #c9cbcf; margin: 0; }
html[data-theme] .hero-logo { width: 260px; height: auto; flex: none; }
html[data-theme="a"] .hero { background: #fff; border: 1px solid var(--line); color: var(--ink); border-inline-start: 4px solid var(--pist); }
html[data-theme="a"] .hero h1 { color: var(--ink); }
html[data-theme="a"] .hero p { color: var(--ink-2); }
html[data-theme] .home-kpis .kpi.lead { background: #111214; border-color: #111214; color: #fff; }
html[data-theme] .home-kpis .kpi.lead .label { color: #c9cbcf; }
html[data-theme] .home-kpis .kpi.lead .value { color: var(--pist); }
html[data-theme="c"] .home-kpis .kpi.lead { background: linear-gradient(160deg, rgba(140, 198, 62, .16), #1f2024 60%); border-color: rgba(140, 198, 62, .45); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.qa { display: flex; flex-direction: column; gap: .7rem; padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--soft); color: var(--ink) !important; min-height: 96px; justify-content: space-between; }
.qa:hover { text-decoration: none; border-color: var(--pist); }
.qa .ico { color: var(--pist); opacity: 1; }
.qa b { font-weight: 800; }
.qa.lead { background: var(--pist); border-color: var(--pist); color: var(--on-pist) !important; }
.qa-ico { width: 30px; height: 30px; border-radius: 9px; background: #111214; color: var(--pist); display: inline-grid; place-items: center; font-weight: 800; font-size: 1.2rem; line-height: 1; }

@media (max-width: 900px) {
  html[data-theme] .shell, html[data-theme][dir="rtl"] .shell { background: none; }
  html[data-theme] .hero { flex-direction: column-reverse; align-items: flex-start; padding: 1.3rem; }
  html[data-theme] .hero-logo { width: 190px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .theme-switch .th { padding: .22rem .5rem; }
}

/* printing is always on white */
@media print {
  html[data-theme] { --ink: #111214; --ink-2: #3a3b40; --muted: #6D6E72; --line: #d7d9dc; --line-2: #eef0f2;
    --bg: #fff; --panel: #fff; --soft: #f3f4f5; --field: #fff; --field-line: #cfd2d6; color-scheme: light; }
  html[data-theme] body { background: #fff; color: #111214; }
  html[data-theme="c"] .content svg, html[data-theme="c"] .content img { border-radius: 0; }
}

/* =====================================================================
   UOMAS v3 entrance (login): curtain wall at night
   ===================================================================== */
/* UOMAS — "Night Facade" entrance (login / welcome).
   Drop-in for templates/auth/layout.html + auth/login.html: everything is scoped under
   body.auth-page and uses the app's existing class names (.auth-wrap, .auth-side, .auth-card,
   .lang-corner, .field, .btn.primary.block, .flash.error). Add the decorative
   <div class="auth-bg" aria-hidden="true">…facade svg…</div> as the first child of <body>.
   Pure CSS/SVG, system fonts only (CSP-safe). Motion is disabled under prefers-reduced-motion. */

.auth-page {
  --e-bg: #0a0b0c;
  --e-ink: #f2f3f4;
  --e-ink-2: #c9cbcf;
  --e-muted: #9a9ca1;
  --e-line: #2a2b2f;
  --e-pist: #8CC63E;
  --e-pist-d: #79b02f;
  --e-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Geeza Pro",
            "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: var(--e-bg);
  color: var(--e-ink);
  font-family: var(--e-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }

/* ---------- background: curtain wall at night ---------- */
.auth-page .auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(900px 600px at 18% 55%, rgba(140,198,62,.10), transparent 65%),
    radial-gradient(1100px 700px at 85% 10%, #17181b 0%, transparent 70%),
    linear-gradient(180deg, #0d0e10 0%, #0a0b0c 60%, #08090a 100%); }
.auth-page .auth-bg .facade { position: absolute; width: 150vmax; height: auto; inset-inline-end: -30vmax; top: 50%;
  translate: 0 -50%;
  transform: perspective(1200px) rotateY(30deg) rotateX(-3deg);
  transform-origin: 0% 50%;
  -webkit-mask-image: radial-gradient(80% 75% at 40% 50%, #000 40%, transparent 100%);
          mask-image: radial-gradient(80% 75% at 40% 50%, #000 40%, transparent 100%);
  opacity: .95; }
[dir="ltr"] .auth-page .auth-bg .facade, .auth-page[dir="ltr"] .auth-bg .facade { transform: perspective(1200px) rotateY(-30deg) rotateX(-3deg); transform-origin: 100% 50%; }
.auth-page .auth-bg::after { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10,11,12,.15) 0%, rgba(10,11,12,.3) 35%, rgba(10,11,12,.66) 62%, rgba(10,11,12,.86) 100%),
    linear-gradient(180deg, rgba(10,11,12,.6) 0%, transparent 22%, transparent 78%, rgba(10,11,12,.85) 100%); }
[dir="ltr"] .auth-page .auth-bg::after { background:
    linear-gradient(270deg, rgba(10,11,12,.15) 0%, rgba(10,11,12,.3) 35%, rgba(10,11,12,.66) 62%, rgba(10,11,12,.86) 100%),
    linear-gradient(180deg, rgba(10,11,12,.6) 0%, transparent 22%, transparent 78%, rgba(10,11,12,.85) 100%); }
.auth-page .facade .lit { animation: ent-lit 1.6s ease-out both; }

.auth-page .facade .lit.d0 { animation-delay: 0.20s; }
.auth-page .facade .lit.d1 { animation-delay: 0.27s; }
.auth-page .facade .lit.d2 { animation-delay: 0.34s; }
.auth-page .facade .lit.d3 { animation-delay: 0.41s; }
.auth-page .facade .lit.d4 { animation-delay: 0.48s; }
.auth-page .facade .lit.d5 { animation-delay: 0.55s; }
.auth-page .facade .lit.d6 { animation-delay: 0.62s; }
.auth-page .facade .lit.d7 { animation-delay: 0.69s; }
.auth-page .facade .lit.d8 { animation-delay: 0.76s; }
.auth-page .facade .lit.d9 { animation-delay: 0.83s; }
.auth-page .facade .lit.d10 { animation-delay: 0.90s; }
.auth-page .facade .lit.d11 { animation-delay: 0.97s; }
.auth-page .facade .lit.d12 { animation-delay: 1.04s; }
.auth-page .facade .lit.d13 { animation-delay: 1.11s; }
.auth-page .facade .lit.d14 { animation-delay: 1.18s; }
.auth-page .facade .lit.d15 { animation-delay: 1.25s; }
.auth-page .facade .lit.d16 { animation-delay: 1.32s; }
.auth-page .facade .lit.d17 { animation-delay: 1.39s; }
.auth-page .facade .lit.d18 { animation-delay: 1.46s; }
.auth-page .facade .lit.d19 { animation-delay: 1.53s; }
.auth-page .facade .lit.d20 { animation-delay: 1.60s; }
.auth-page .facade .lit.d21 { animation-delay: 1.67s; }
.auth-page .facade .lit.d22 { animation-delay: 1.74s; }
.auth-page .facade .lit.d23 { animation-delay: 1.81s; }

/* ---------- layout ---------- */
.auth-page .auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid;
  grid-template-columns: minmax(0, 1fr) 420px; align-items: center; gap: 4rem;
  max-width: 1180px; margin: 0 auto; padding: 5.5rem 3rem 4.5rem; }

.auth-page .auth-side { color: var(--e-ink); animation: ent-rise .9s cubic-bezier(.2,.7,.2,1) both; }
.auth-page .auth-logo { display: block; width: min(500px, 100%); height: auto; margin-inline-start: -.6rem; }
.auth-page .auth-line { display: flex; align-items: center; gap: .9rem; margin: 1.6rem 0 .9rem;
  direction: ltr; justify-content: flex-end; font-size: .86rem; font-weight: 700; letter-spacing: .26em;
  text-transform: uppercase; color: #d7d9dc; }
[dir="ltr"] .auth-page .auth-line { justify-content: flex-start; }
.auth-page .auth-line::before { content: ""; width: 44px; height: 2px; background: var(--e-pist); border-radius: 2px; }
[dir="rtl"] .auth-page .auth-line::before { order: 2; }
.auth-page .auth-line i { font-style: normal; color: var(--e-pist); }
.auth-page .auth-side p { margin: 0; color: var(--e-muted); font-size: 1.08rem; font-weight: 600; max-width: 30rem; }
.auth-page .auth-side h1 { display: none; } /* the text "UOMAS" is already in the logo */
.auth-page .auth-facts { display: flex; gap: 2.2rem; margin-top: 2.4rem; }
.auth-page .auth-facts div { border-inline-start: 2px solid #2a2b2f; padding-inline-start: .9rem; }
.auth-page .auth-facts b { display: block; font-size: 1rem; font-weight: 800; color: var(--e-ink); }
.auth-page .auth-facts span { font-size: .8rem; color: var(--e-muted); }

/* ---------- sign-in card ---------- */
.auth-page .auth-card { position: relative; padding: 2.2rem 2.1rem 1.9rem; border-radius: 18px;
  background: linear-gradient(180deg, rgba(31,32,36,.92), rgba(23,24,27,.94));
  border: 1px solid #2c2d31;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: ent-rise .9s .12s cubic-bezier(.2,.7,.2,1) both; }
.auth-page .auth-card::before { content: ""; position: absolute; top: -1px; inset-inline: 2.1rem; height: 2px;
  background: linear-gradient(90deg, transparent, var(--e-pist), transparent); border-radius: 2px; }
.auth-page .auth-card .card-mark { display: block; width: 22px; height: 46px; margin-bottom: 1.1rem; }
.auth-page .auth-card h2 { margin: 0 0 .3rem; font-size: 1.6rem; font-weight: 800; line-height: 1.25; color: #fff; }
.auth-page .auth-card .hint { margin: 0 0 1.5rem; color: var(--e-muted); font-size: .93rem; }
.auth-page .stack { display: flex; flex-direction: column; gap: 1.05rem; margin: 0; }
.auth-page .field { display: flex; flex-direction: column; gap: .4rem; }
.auth-page .field label { font-size: .9rem; font-weight: 700; color: var(--e-ink-2); }
.auth-page .field input { width: 100%; height: 50px; padding: 0 1rem; border-radius: 11px;
  border: 1px solid #3a3b40; background: #0f1012; color: #fff; font: 600 1rem var(--e-font);
  outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-page .field input::placeholder { color: #6D6E72; font-weight: 500; }
.auth-page .field input:hover { border-color: #4a4b50; }
.auth-page .field input:focus { border-color: var(--e-pist); box-shadow: 0 0 0 4px rgba(140,198,62,.18); }
.auth-page .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer;
  font: 800 1rem var(--e-font); border-radius: 11px; border: 1px solid transparent; text-decoration: none; }
.auth-page .btn.primary { height: 52px; margin-top: .45rem; background: var(--e-pist); color: #111214;
  box-shadow: 0 10px 28px rgba(140,198,62,.22), inset 0 1px 0 rgba(255,255,255,.35); font-size: 1.05rem; }
.auth-page .btn.primary:hover { background: #9bd34d; }
.auth-page .btn.primary:active { background: var(--e-pist-d); }
.auth-page .btn.primary:focus-visible, .auth-page .btn.ghost:focus-visible { outline: 3px solid rgba(140,198,62,.5); outline-offset: 2px; }
.auth-page .btn.block { width: 100%; }
.auth-page .card-foot { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid #2a2b2f;
  display: flex; justify-content: space-between; gap: 1rem; font-size: .82rem; color: var(--e-muted); }
.auth-page .card-foot b { color: var(--e-ink-2); font-weight: 700; }
.auth-page .flash.error { margin: 0 0 1rem; padding: .65rem .9rem; border-radius: 10px; font-size: .9rem; font-weight: 600;
  background: rgba(239,125,112,.12); border: 1px solid rgba(239,125,112,.35); color: #f3a198; }

/* ---------- language toggle (fixed to the page corner) ---------- */
.auth-page .lang-corner { position: fixed; top: 1.4rem; inset-inline-end: 1.6rem; z-index: 3; margin: 0; }
.auth-page .lang-corner .btn.ghost { height: 38px; padding: 0 .95rem; gap: .5rem; border-radius: 99px;
  background: rgba(23,24,27,.75); border: 1px solid #34353a; color: #e4e6e8; font-size: .86rem; font-weight: 700;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.auth-page .lang-corner .btn.ghost:hover { border-color: var(--e-pist); color: #fff; }
.auth-page .lang-corner svg { width: 16px; height: 16px; fill: none; stroke: var(--e-pist); stroke-width: 1.8; }
.auth-page .auth-top { position: fixed; top: 1.4rem; inset-inline-start: 1.6rem; z-index: 3; display: flex; align-items: center; gap: .55rem;
  font-size: .8rem; color: var(--e-muted); font-weight: 600; }
.auth-page .auth-top i { width: 8px; height: 8px; border-radius: 50%; background: var(--e-pist); box-shadow: 0 0 0 4px rgba(140,198,62,.15); }
.auth-page .auth-foot { position: relative; z-index: 1; text-align: center; font-size: .76rem; color: #75777c;
  margin-top: -3.2rem; padding-bottom: 1.4rem; letter-spacing: .04em; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .auth-page .auth-wrap { grid-template-columns: 1fr; gap: 1.8rem; padding: 5rem 1.15rem 4.5rem; align-content: start; }
  .auth-page .auth-side { text-align: center; }
  .auth-page .auth-logo { width: min(290px, 78vw); margin: .4rem auto 0; }
  .auth-page .auth-line { justify-content: center; margin: 1.1rem 0 .5rem; font-size: .7rem; letter-spacing: .18em; gap: .6rem; }
  [dir="ltr"] .auth-page .auth-line { justify-content: center; }
  .auth-page .auth-line::before { display: none; }
  .auth-page .auth-side p { font-size: .92rem; margin: 0 auto; }
  .auth-page .auth-facts { display: none; }
  .auth-page .auth-card { padding: 1.6rem 1.25rem 1.4rem; border-radius: 16px; }
  .auth-page .auth-card .card-mark { display: none; }
  .auth-page .auth-card h2 { font-size: 1.35rem; }
  .auth-page .auth-card .hint { margin-bottom: 1.2rem; font-size: .88rem; }
  .auth-page .auth-bg .facade { width: 190vmax; inset-inline-end: -70vmax; top: 30%; }
  .auth-page .auth-bg::after { background: linear-gradient(180deg, rgba(10,11,12,.15) 0%, rgba(10,11,12,.4) 40%, rgba(10,11,12,.9) 72%, #0a0b0c 100%); }
  .auth-page .lang-corner { top: 1rem; inset-inline-end: 1rem; }
  .auth-page .auth-top { top: 1.15rem; inset-inline-start: 1.1rem; }
  .auth-page .auth-foot { margin-top: -2.6rem; }
}

/* ---------- motion ---------- */
@keyframes ent-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ent-lit { 0% { opacity: 0; } 60% { opacity: 1; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .auth-page .auth-side, .auth-page .auth-card, .auth-page .facade .lit { animation: none !important; }
  .auth-page .field input { transition: none; }
}

/* v3 tweaks: numbers in ink, compact menu on the phone */
html[data-theme] a.kpi, html[data-theme] a.kpi:hover { color: var(--ink); text-decoration: none; }
html[data-theme] .home-kpis a.kpi.lead { color: #fff; }
@media (max-width: 900px) {
  html[data-theme] .sidebar { position: sticky; top: 0; z-index: 20; height: auto; overflow: visible; }
  html[data-theme] .brand { padding: .7rem 1rem; border-bottom: 0; }
  html[data-theme] .brand-logo { height: 30px; }
  html[data-theme] .brand small, html[data-theme] .sidebar-foot, html[data-theme] .sidebar .nav-group { display: none; }
  html[data-theme] .sidebar nav { flex-direction: row; overflow-x: auto; gap: 4px; padding: 0 .6rem .6rem; scrollbar-width: none; }
  html[data-theme] .sidebar nav::-webkit-scrollbar { display: none; }
  html[data-theme] .nav-item { flex: none; white-space: nowrap; padding: .4rem .7rem; font-size: .86rem; background: var(--side-2); }
  html[data-theme] .topbar { position: static; padding: .6rem 1rem; flex-wrap: wrap; }
  html[data-theme] .content { padding: 1rem .9rem 2.5rem; }
  html[data-theme] .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  html[data-theme] .kpi .value { font-size: 1.45rem; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .qa { min-height: 74px; padding: .7rem .8rem; }
}
.glass-sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.glass-sheets figure { margin: 0; }
.glass-sheets figcaption { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.glass-sheets svg { max-width: 100%; height: auto; }
/* full offer file */
.offer-file .of-page { padding: 1.2rem 0 1.6rem; border-bottom: 1px dashed #c9ccd1; }
.offer-file .of-page:last-of-type { border-bottom: 0; }
.offer-file h2 { font-size: 1.25rem; border-inline-start: 4px solid #8CC63E; padding-inline-start: .6rem; margin: 0 0 1rem; }
.offer-file h3 { font-size: 1rem; margin: 1.1rem 0 .5rem; }
.of-cover { text-align: center; padding-top: 3rem !important; }
.of-cover .of-logo { width: 240px; max-width: 45%; height: auto; max-height: 120px; margin: 0 auto 1.6rem; display: block; }
.of-cover h1 { font-size: 2rem; margin-bottom: 1.4rem; }
.of-cover .of-meta { max-width: 520px; margin: 0 auto 1.4rem; text-align: start; }
.of-toc { display: inline-block; text-align: start; color: #3a3b40; }
.of-table { margin-bottom: .6rem; }
.of-table tfoot td { font-weight: 700; }
.of-table tr.of-grand td { background: #111214 !important; color: #fff; font-size: 1.05rem; }
.of-table tr.of-grand td:last-child { color: #8CC63E; }
.of-sys { border: 1px solid #d7d9dc; border-radius: 10px; padding: .7rem 1rem; margin-bottom: .7rem; }
.of-draws { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.of-draw { margin: 0; border: 1px solid #d7d9dc; border-radius: 10px; padding: .6rem; break-inside: avoid; }
.of-pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: .5rem; align-items: center; }
.of-pair svg { width: 100%; height: auto; }
.of-draw figcaption { font-size: .85rem; margin-top: .4rem; }
.of-elev svg { width: 100%; height: auto; max-height: 420px; }
@media print {
  .offer-file .of-page { break-after: page; border: 0; }
  .offer-file .of-page:last-of-type { break-after: auto; }
  .of-draws { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) { .of-draws { grid-template-columns: 1fr; } }
.of-mini svg { width: 200px; height: auto; max-height: 140px; }
.pricing-table th, .pricing-table td { padding: .5rem .55rem; }
.pricing-table td:first-child { white-space: nowrap; }
.pricing-table small { white-space: nowrap; }
.acc-prices input.num { width: 7.5rem; }
.acc-codes { max-width: 260px; white-space: normal; font-size: .78rem; }
.acc-prices input.acc-name { min-width: 14rem; font-weight: 700; }
.acc-pic img { width: 96px; height: 52px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.acc-actions { display: flex; gap: .35rem; align-items: center; } .acc-actions label.btn { cursor: pointer; }
/* المستخلص */
.doc-head .logo img.cert-logo { width: 190px; height: auto; }
.cert-table th, .cert-table td { padding: .35rem .4rem; font-size: .8rem; }
.cert-table input.n { width: 5.5rem; }
.cert-sum { max-width: 560px; margin: 1rem 0 0 auto; }
.cert-sum input.n { width: 4.5rem; }
.cert-sum tr.cert-net td { background: #111214; color: #fff; font-weight: 800; font-size: 1.05rem; }
.cert-sum tr.cert-net td:last-child { color: #8CC63E; }
.cert-notes { width: 100%; }
.cert-sign { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2.5rem; text-align: center; }
.cert-sign div { border-top: 1px solid #111214; padding-top: .4rem; font-weight: 700; }
@page certL { size: A4 landscape; margin: 8mm; }
@media print { .cert-doc input { border: 0; padding: 0; background: none; } .cert-doc { page: certL; } }
/* الحضور والمواقع */
.att-table td { vertical-align: middle; }
.att-status { white-space: nowrap; } .att-status label { margin-inline-end: .6rem; font-weight: 600; }
.att-table input[type=time] { width: 7.5rem; }
.site-days { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.site-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }
@media (max-width: 900px) { .site-days { grid-template-columns: 1fr; } }
/* المستخلص على نموذج المالك (borai-01) */
.mos { font-family: Arial, "Geeza Pro", "Noto Sans Arabic", sans-serif; color: #000; }
.mos input, .mos select, .mos textarea { font: inherit; padding: .15rem .3rem; border: 1px solid #b9c3cf; border-radius: 4px; background: #fffef2; width: auto; }
.mos .lbl { background: #10285a; color: #fff; font-weight: 700; padding: .2rem .6rem; margin-inline-end: .5rem; display: inline-block; }
.mos-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.mos-title { border: 1px dotted #000; background: #fbc531; padding: .25rem 1.4rem; font-size: 1.15rem; font-weight: 800; }
.mos-title b { margin: 0 1rem; }
.mos-date { border: 1px dotted #000; background: #fbc531; padding: .2rem .8rem; font-weight: 700; }
.mos-date .lbl { background: none; color: #000; }
.mos-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; margin-bottom: .8rem; }
.mos-who div, .mos-contract div { display: flex; align-items: center; gap: .3rem; border: 1px dotted #555; margin-bottom: .35rem; }
.mos-who b, .mos-contract b { flex: 1; }
.mos-contract span:last-child { font-size: .8rem; padding-inline-end: .4rem; }
.mos input.wide { width: 100%; }
.mos-body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 1rem; align-items: start; }
.mos-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.mos-table th, .mos-table td { border: 1px solid #000; padding: .3rem .35rem; }
.mos-table thead th { background: #bfe3f5; font-weight: 800; text-align: center; }
.mos-table thead th.y { background: #ffff00; }
.mos-table td.c { text-align: center; white-space: nowrap; }
.mos-table td.desc { font-weight: 700; min-width: 260px; }
.mos-table td.desc textarea { width: 100%; min-width: 240px; }
.mos-table input.u { width: 3.6rem; text-align: center; } .mos-table input.q { width: 5.2rem; text-align: center; }
.mos-table input.done { background: #e9f7d9; border-color: #8CC63E; font-weight: 700; }
.mos-table tfoot td { background: #f8c08f; font-weight: 800; }
.mos-table .mos-total-l { font-style: italic; }
.mos-words { text-align: center; font-style: italic; }
.mos-drop { display: block; font-size: .7rem; color: #b42318; cursor: pointer; }
.mos-new td { background: #f6f7f8; }
.mos-sum { border: 2px solid #000; }
.mos-sum-h { background: #10285a; color: #fff; font-weight: 800; padding: .3rem .6rem; text-align: center; }
.mos-sum table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.mos-sum td { border-bottom: 1px solid #000; padding: .3rem .4rem; font-weight: 700; }
.mos-sum td.v { background: #bfe3f5; text-align: center; white-space: nowrap; }
.mos-sum input.p { width: 3rem; text-align: center; } .mos-sum input.m { width: 7rem; text-align: center; }
.mos-sum tr.net td { background: #10285a; color: #fff; }
.mos-sum tr.net td.v { background: #8CC63E; color: #111214; font-size: 1rem; }
.mos-netw { font-size: .75rem; padding: .3rem .5rem; margin: 0; font-style: italic; }
.mos-vat { display: block; font-size: .75rem; padding: .3rem .5rem; }
.mos-notes { margin-top: .8rem; }
.mos-sign-h { display: flex; justify-content: space-between; background: #c9dbef; font-weight: 800; padding: .25rem .6rem; margin-top: 1.4rem; }
.mos-sign { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: .5rem .6rem 3rem; font-weight: 700; font-size: .85rem; }
@page mosL { size: A4 landscape; margin: 8mm; }
@media print {
  .mos { page: mosL; }
  .mos input, .mos select, .mos textarea { border: 0; background: none; padding: 0; resize: none; }
  .mos-body { grid-template-columns: minmax(0, 1fr) 240px; }
}
@media (max-width: 1100px) { .mos-body, .mos-head { grid-template-columns: 1fr; } }
@media print {
  .mos { font-size: 9pt; }
  .mos .mos-table-wrap { overflow: visible; }
  .mos-table { font-size: 7.5pt; }
  .mos-table th, .mos-table td { padding: 2px 3px; }
  .mos-table td.desc { min-width: 0; width: 30%; }
  .mos-table td.desc textarea { min-width: 0; width: 100%; height: auto; overflow: hidden; }
  .mos-table input.q { width: 4rem; } .mos-table input.u { width: 2.6rem; }
  .mos-body { grid-template-columns: minmax(0, 1fr) 62mm; gap: 4mm; }
  .mos-sum table, .mos-sum td { font-size: 7.5pt; }
  .mos-sum td:first-child { white-space: nowrap; }
  .mos-sum input.m { width: 5rem; }
  .content { padding: 0 !important; }
}
.mos-sum td:first-child { white-space: nowrap; }
.mos-body { grid-template-columns: minmax(0, 1fr) 300px; }
/* رفع المقاسات + البحث بالصورة */
.voice-out { background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: .5rem .8rem; font-weight: 700; }
.sketch-box { margin-top: .8rem; }
.sketch-head { display: flex; gap: .6rem; align-items: center; margin-bottom: .3rem; }
.sketch-box canvas { width: 100%; max-width: 640px; aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--line); border-radius: 10px; touch-action: none; display: block; }
.find-row { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.find-mine { margin: 0; } .find-mine canvas { background: #fff; border-radius: 10px; border: 1px solid var(--line); width: 220px; }
.find-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.find-results a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; color: var(--ink); text-decoration: none; }
.find-results a:hover { border-color: var(--pist, #8CC63E); }
.find-results img { width: 100%; height: 110px; object-fit: contain; background: #fff; border-radius: 6px; }
.find-results b { display: block; direction: ltr; text-align: start; } .find-results small { color: var(--muted); }
.find-results .score { float: left; margin-inline-start: .4rem; color: var(--pist, #8CC63E); font-weight: 800; }
@media (max-width: 760px) { .find-row { grid-template-columns: 1fr; } }
.kind-pick { min-width: 9rem; }
/* الكاميرات */
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cam img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; display: block; }
.cam-shot { display: flex; gap: .5rem; } .cam-shot input { flex: 1; }
.cam-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.cam-shots figure { margin: 0; } .cam-shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.cam-shots figcaption { font-size: .8rem; color: var(--muted); }
/* شوب درونج الشباك */
.sd-wrap { background: #fff; border-radius: 8px; overflow: auto; }
.sd-wrap svg { width: 100%; height: auto; display: block; }
/* each page prints at its own size (named pages): the sheet A3 across, the rest A4 */
@media print { .sd-wrap { page: cwsheet; border-radius: 0; } .sd-wrap svg { width: 100%; height: auto; } }

/* ---- the owner, 2026-11-28: the UOMAS logo at the top of the menu, a plain welcome */
html[data-theme] .brand.brand-full { justify-content: center; padding: 1.3rem 1rem 1.2rem; }
.brand.brand-full img { width: 196px; max-width: 100%; height: auto; display: block; }
html[data-theme] .hero.hello { align-items: center; padding: 2.2rem 2.4rem; }
html[data-theme] .hero.hello h1 { font-size: 2.3rem; letter-spacing: .02em; margin: 0; }
html[data-theme] .hero.hello .hero-logo { width: 240px; }

/* saw plan (cutting report) */
.plan-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.plan-kpis .pk { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .85rem; }
.plan-kpis .pk span { display: block; font-size: .78rem; color: var(--muted); }
.plan-kpis .pk b { font-size: 1.45rem; display: block; line-height: 1.3; }
.plan-kpis .pk small { color: var(--muted); }
.plan-kpis .pk.ok { border-color: #7cc49a; box-shadow: inset 4px 0 0 #3a9d62; }
.plan-kpis .pk.keep b { color: #1f6f43; } .plan-kpis .pk.scrap b { color: #9b2c2c; }
.plan-sum td { vertical-align: middle; }
.meter { width: 110px; height: 8px; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: .8rem 0; font-size: .85rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend .sw { width: 16px; height: 12px; }
.legend i { width: 16px; height: 12px; border-radius: 3px; border: 1px solid #284b63; display: inline-block; }
.legend i.lg-keep { background: repeating-linear-gradient(45deg, #e6f4ea 0 3px, #7cc49a 3px 5px); border-color: #9aa6b2; }
.legend i.lg-scrap { background: repeating-linear-gradient(45deg, #fbeaea 0 3px, #e0a1a1 3px 5px); border-color: #9aa6b2; }
.pattern { padding: .55rem .8rem .7rem; border-top: 1px dashed var(--line); break-inside: avoid; }
.pt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .9rem; margin-bottom: .35rem; font-size: .9rem; }
.pt-head .times { background: var(--brand); color: #fff; border-radius: 8px; padding: .05rem .55rem; font-weight: 800; font-size: 1.05rem; }
.pt-head .cuts { direction: ltr; unicode-bidi: isolate; }
.pt-head .cuts sup { color: var(--muted); font-size: .65rem; margin-inline-start: 1px; }
.pt-head .nums { color: var(--muted); margin-inline-start: auto; direction: ltr; }
.saw-bar { width: 100%; height: auto; display: block; direction: ltr; }
@media print { .pattern { padding: .3rem .4rem; } }

/* live window while adding a BOQ line */
.boq-live { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 1rem; padding: .8rem 1rem 1rem; border-top: 1px dashed var(--line); align-items: start; }
.boq-live .live-pic { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem; display: flex; justify-content: center; }
.boq-live .live-pic svg { max-width: 100%; height: auto; }
.boq-live .live-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; align-content: start; }
.boq-live .live-facts > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .7rem; }
.boq-live .live-facts span { display: block; font-size: .75rem; color: var(--muted); }
.boq-live .live-facts b { font-size: 1.1rem; }
.boq-live .live-facts .big { grid-column: 1 / -1; border-color: var(--accent, var(--brand)); }
.boq-live .live-facts .big b { font-size: 1.5rem; }
.boq-live .live-facts .big small { margin-inline-start: .6rem; color: var(--muted); }
.boq-live .live-warn { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; color: #9b2c2c; font-size: .85rem; }
.boq-add .glass-in input { min-width: 16rem; }
@media (max-width: 760px) { .boq-live { grid-template-columns: 1fr; } }

/* composite (تركيبة) in the BOQ form */
.comp-box { margin: .6rem 1rem 0; border: 1px dashed var(--line); border-radius: 12px; padding: .5rem .8rem; }
.comp-box summary { cursor: pointer; font-weight: 700; }
.comp-box summary small { font-weight: 400; color: var(--muted); margin-inline-start: .5rem; }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin-top: .6rem; }
.comp-grid fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem .6rem; margin: 0; display: grid; gap: .35rem; }
.comp-grid legend { font-weight: 700; padding: 0 .3rem; }
.comp-grid label { display: grid; gap: .15rem; font-size: .85rem; }
.comp-grid label.chk { display: inline-flex; align-items: center; gap: .35rem; }
.comp-bar small { color: var(--muted); }
.boq-live .bar-side { cursor: pointer; }
.boq-live .bar-side.off:hover, .boq-live .bar-side:hover { opacity: .75; }
.boq-live .live-units { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }

.comp-svg .fix-pane, .comp-svg .fix-mullion { cursor: pointer; }
.comp-svg .fix-pane:hover { fill: #d6ecf8; }
.comp-svg .fix-mullion:hover { fill: #fde68a; }

/* ---- the cutting report's windows table and the factory's file (ملف المصنع) */
.corner-list { color: #b42318; font-weight: 700; margin: .4rem 0; }
.fix-title { margin: .8rem 0 .3rem; font-size: 1rem; }
.win-block .gh small b { font-weight: 700; }
.corner-note { color: #b42318; font-weight: 700; margin-top: 2px; }
.corner-row td { color: #b42318; font-weight: 700; }
.glass-row td { background: #eef8fd; }
.pack-sheet svg { width: 100%; height: auto; }
@page packA4 { size: A4 portrait; margin: 10mm; }
@page packA4L { size: A4 landscape; margin: 8mm; }
@media print {
  .pack-doc { page: packA4; }
  .win-doc, .pack-doc.win-doc { page: packA4L; }
  .pack-next { break-before: page; page-break-before: always; }
  .pack-sheet { page: cwsheet; break-before: page; page-break-before: always; border: 0;
    box-shadow: none; padding: 0; }
  .pack-sheet svg { width: 100%; height: auto; max-height: 270mm; }
  .win-block { break-inside: auto; }
}

/* the saw plan: the counts table kept on its page; the windows' colours with the bars */
table.data.plan-sum th, table.data.plan-sum td { padding: 4px 5px; font-size: .76rem; }
table.data.plan-sum th { white-space: normal; letter-spacing: 0; }
table.data.plan-sum .pic-cell img { width: 44px; height: 32px; }
table.data.plan-sum .meter { width: 70px; }
.plan-cuts-title { margin: .8rem 0 .3rem; font-size: 1rem; }
.legend-in { margin-top: 3px; font-size: .74rem; }
@media print { .plan-cuts { break-before: auto; page-break-before: auto; } .plan-cuts-title { break-after: avoid; } }
@media print {
  /* the saw plan's counts on one page: the tiles and the rows tighter */
  .pack-doc .totals-bar { gap: 4px; margin-bottom: 4px; }
  .pack-doc .totals-bar > div, .pack-doc .plan-kpis .pk { padding: 4px 8px; min-height: 0; }
  .pack-doc .totals-bar b, .pack-doc .plan-kpis .pk b { font-size: 1rem; }
  .pack-doc .plan-kpis { gap: 4px; margin: 4px 0; }
  .pack-doc table.data.plan-sum td, .pack-doc table.data.plan-sum th { padding: 2px 4px; }
  .pack-doc table.data.plan-sum .kind-badge { padding: 0 4px; font-size: .68rem; }
  .pack-doc .doc-head { margin-bottom: 4px; padding-bottom: 4px; }
}


/* ---- جدول النماذج: a heavy frame, fine lines inside, a rule between the column groups,
   the headings in the brand's blue, each window its own box, the fixed rows green */
table.win-summary { width: 100%; border-collapse: collapse; font-size: .74rem; color: #101828;
  border: 2.4px solid #0f3b5f; font-variant-numeric: tabular-nums; }
.win-summary th, .win-summary td { border: .6px solid #c3ccd8; padding: 4px 4px;
  text-align: center; vertical-align: middle; }
.win-summary .g { border-inline-start: 1.6px solid #0f3b5f; }
.win-summary thead tr.h1 th { background: #0f3b5f; color: #fff; font-weight: 700;
  font-size: .72rem; border-color: #34618a; }
.win-summary thead tr.h2 th { background: #dfe8f2; color: #0f3b5f; font-weight: 700;
  font-size: .66rem; }
.win-summary thead tr.h1 th.g, .win-summary thead tr.h2 th.g { border-inline-start: 1.6px solid #0f3b5f; }
.win-summary thead tr.h2 th { border-bottom: 2px solid #0f3b5f; }
.win-summary th.glass-h { background: #155e75; }
.win-summary th.glass-h2 { background: #d4eef4; color: #155e75; }
.win-summary tbody.win-rows { border-top: 2.4px solid #0f3b5f; }
.win-summary tbody.win-rows:nth-of-type(even) td.ref { background: #eef3f8; }
.win-summary td.ref { font-weight: 800; font-size: .9rem; color: #0f3b5f; background: #f6f8fb;
  letter-spacing: .02em; }
.win-summary td.sz { font-weight: 700; }
.win-summary td.n { color: #475467; font-size: .7rem; }
.win-summary td.none { color: #98a2b3; }
.win-summary td.glass { background: #f0f9fb; }
.win-summary tr.fix-row td { background: #f1f9f3; }
.win-summary tr.fix-first td { border-top: 1.4px dashed #3a9d62; }
.win-summary tr.fix-row td.fix-glass { background: #cdebd6; }
.win-summary td.fix-tag { font-weight: 800; color: #1f6f43; font-size: .7rem; }
.win-summary td.fix-parts { text-align: start; }
.win-summary td.other-tag { font-weight: 700; color: #3d4a57; background: #eef1f4; }
.win-summary td.fix-parts span { display: inline-block; margin-inline-end: 14px; white-space: nowrap; }
.win-summary td.fix-parts em { font-style: normal; color: #1f6f43; font-weight: 700; }
.win-summary td.win-pic { background: #fff; width: 104px; }
.win-pic svg { width: 80px; height: auto; display: block; margin: 0 auto 3px; }
.win-pic small { display: block; max-width: 118px; margin: 0 auto; font-size: .6rem;
  line-height: 1.25; color: #344054; }
.win-key { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: .45rem 0 0;
  font-size: .74rem; }
.win-key i { display: inline-block; width: 14px; height: 10px; border-radius: 2px;
  vertical-align: -1px; margin-inline-end: 5px; border: .6px solid #98a2b3; }
.win-key .k-glass { background: #f0f9fb; }
.win-key .k-fix { background: #cdebd6; }
@media print { .win-summary tbody.win-rows { break-inside: avoid; } }

/* who printed it and when, in a corner of every printed page (the owner, 2026-12-01) */
.print-stamp { display: none; }
@media print {
  .print-stamp { display: block; position: fixed; bottom: 1.5mm; left: 3mm; font-size: 6.5pt; color: #8a8f96; direction: rtl; z-index: 9; }
}

/* الأسعار: one system's accessories per panel */
.price-sys > summary { cursor: pointer; list-style: none; }
.price-sys > summary::-webkit-details-marker { display: none; }
.price-sys .pic-cell img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 6px; }
.price-sys .pic-cell { white-space: nowrap; }
.price-sys .pic-btn { margin-inline-start: 6px; }
.price-sys .acc-name { width: 100%; min-width: 14rem; }
.price-sys .new-acc td { background: var(--surface-2, transparent); }
.price-sys .new-acc select { min-width: 5.5rem; }

/* نسخة المصنع: every piece's label carries its profile's section (the owner, 2026-12-01) */
.piece-label .piece-sec { height: 64px; width: 64px; object-fit: contain; background: #fff; border: 1px solid #d5dbe2; border-radius: 6px; padding: 2px; flex: none; }
.piece-label .piece-code { display: block; font-family: var(--mono); font-weight: 700; font-size: .8rem; text-align: center; }
@media print {
  .piece-label .piece-sec { height: 12mm; width: 12mm; }
  .pieces-table td { padding: 2px 5px; }
  .pieces-table .piece-glyph { width: 48px; height: 14px; }
  .pieces-table td small { white-space: nowrap; font-size: 7pt; }
  .piece-label { gap: .3rem; }
}

/* ملصقات البواقي (the owner, 2026-12-01): code, length in cm, colour, profile and its section */
.oclabel { height: 40mm; overflow: hidden; border: .3mm solid #1b2733; border-radius: 1.5mm; padding: 1.2mm 2mm; background: #fff; color: #111; display: flex; flex-direction: column; gap: .6mm; break-inside: avoid; }
.oc-top { display: flex; align-items: center; gap: 1.5mm; border-bottom: .3mm solid #7cb342; padding-bottom: .6mm; }
.oc-top .oc-code { margin-inline-start: auto; font-family: var(--mono); font-weight: 800; font-size: 9pt; }
.oc-main { display: flex; align-items: center; gap: 1.5mm; flex: 1; min-height: 0; }
.oc-qr svg { width: 17mm; height: auto; display: block; }
.oc-info { flex: 1; min-width: 0; }
.oc-len { font-size: 15pt; font-weight: 800; line-height: 1.05; text-align: start; }
.oc-len small { font-size: 7pt; font-weight: 600; }
.oc-prof { font-size: 6.5pt; line-height: 1.25; }
.oc-prof b { font-family: var(--mono); font-size: 7.5pt; }
.oc-color { font-size: 7pt; color: #2e7d32; font-weight: 700; }
.oc-sec { width: 14mm; height: 14mm; object-fit: contain; flex: none; }
.oc-foot { display: flex; align-items: center; justify-content: space-between; gap: 1mm; }
.oc-foot small { font-size: 5.5pt; color: #666; }
.oc-bar svg { height: 6mm; width: auto; display: block; }
.oc-sheet { gap: 3mm; }
.oc-code-tag { margin-inline-start: auto; font-weight: 700; }

/* العقد والملاحق، الفاتورة (2026-12-02) */
/* contracts/view.html */
.dk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.6rem}
.dk{border:1px solid var(--line,#d6dde6);border-radius:8px;padding:.55rem .7rem;display:flex;flex-direction:column;gap:.15rem}
.dk span{font-size:.85rem;opacity:.75}.dk b{font-size:1.25rem;direction:ltr;text-align:end}.dk small{font-size:.75rem;opacity:.7}
.dk.bad{background:#fff1f0;border-color:#f3b8b3;color:#222}.dk.ok{background:#eefaf0;border-color:#a8dcb3;color:#222}
tr.cancel td{background:#fde8e6}
tr.repl td{background:#e7f6ea}
.tag{font-size:.8rem;font-weight:700;margin-top:.2rem}tr.cancel .tag{color:#b3261e}tr.repl .tag{color:#1d6b33}
.legend .sw{display:inline-block;width:1em;height:1em;border-radius:3px;vertical-align:middle;margin-inline:.6rem .25rem}
.sw.cancel{background:#fde8e6;border:1px solid #f3b8b3}.sw.repl{background:#e7f6ea;border:1px solid #a8dcb3}
ul.alerts li{margin:.25rem 0}
table.items td.desc{min-width:340px;line-height:1.5}tr.cancel .txt{text-decoration:line-through;color:#9b2c22}tr.repl .txt{color:#1d6b33}
tr.cancel td,tr.repl td{color:#222}tr.cancel td.num{text-decoration:line-through}
details.edit{margin-top:.8rem}details.edit summary{cursor:pointer;font-weight:700}
details.edit textarea[name^="desc_"]{min-width:280px}details.edit input.q{width:8em}details.edit input.u{width:4.5em}

/* certificates/invoice.html */
.eta{background:#fff;color:#111;font-family:Arial,"Geeza Pro","Noto Sans Arabic",sans-serif;font-size:12px;padding:22px 26px;max-width:900px;margin:auto;border:1px solid #ddd}
.eta h1{font-size:22px;margin:0}.eta .muted{color:#666}.eta .row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.eta .box{border:1px solid #ccc;margin-top:14px}.eta .box .h{background:#4a5560;color:#fff;font-weight:700;padding:5px 10px}
.eta .box .b{padding:8px 12px;line-height:1.8}.eta .gray .h{background:#bdbdbd;color:#111}
.eta table{width:100%;border-collapse:collapse;margin-top:14px}.eta th{background:#bdbdbd;padding:6px;font-weight:700;border:1px solid #ccc}
.eta td{border:1px solid #ddd;padding:6px;vertical-align:top}.eta td.n{text-align:left;direction:ltr;white-space:nowrap}
.eta .qr{width:120px;height:120px;border:1px dashed #999;display:flex;align-items:center;justify-content:center;text-align:center;color:#888;font-size:11px}
.eta .tot td:first-child{text-align:right}.eta .big td{font-weight:700}
@media print{.eta{border:0;max-width:none}}
.eta .mt-s{margin-top:12px}.eta table.tot{width:55%;margin-inline-start:auto}

/* the مقايسة: the company first (2026-12-04) */
.maker-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.maker-pick form { margin: 0; }
.maker-card { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; background: #fff; border: 2px solid var(--line, #e3e8ef); border-radius: 14px; cursor: pointer; font: inherit; color: inherit; }
.maker-card b { font-size: 1.5rem; }
.maker-card small { color: var(--muted, #667085); }
.maker-card:hover { border-color: var(--accent, #1d4ed8); }
.maker-card.empty { opacity: .6; }
.maker-now { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line, #e3e8ef); }
.maker-now b { font-size: 1.15rem; }
a.maker-card { text-decoration: none; }

/* the barcode printer's labels (the owner, 2026-12-04: 50 × 30 mm): one label a page */
@page roll50 { size: 50mm 30mm; margin: 0; }
.roll-sheet { display: flex; flex-wrap: wrap; gap: 3mm; }
.roll { width: 50mm; height: 30mm; box-sizing: border-box; padding: 1mm 1.5mm; background: #fff; color: #000;
  border: .2mm dashed #9aa6b2; overflow: hidden; display: flex; flex-direction: column; font-family: Arial, sans-serif; }
.roll-bar svg { display: block; width: 100%; height: 9.5mm; }
.roll-body { display: flex; gap: 1mm; align-items: center; flex: 1; min-height: 0; }
.roll-qr svg { display: block; width: 16.5mm; height: 16.5mm; }
.roll-text { flex: 1; min-width: 0; line-height: 1.12; }
.roll-text div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll-l1 { font-size: 6.5pt; font-weight: 700; }
.roll-l2 { font-size: 9pt; font-weight: 700; }
.roll-l3 { font-size: 7pt; font-weight: 700; }
.roll-l4, .roll-l5 { font-size: 6pt; }
@media print {
  .roll-sheet { display: block; gap: 0; }
  .roll { page: roll50; border: 0; break-after: page; page-break-after: always; margin: 0; }
  .roll:last-child { break-after: auto; page-break-after: auto; }
}
@media print { body:has(.roll-sheet) .print-stamp { display: none !important; } }
.roll-img { display: block; width: 10mm; height: 14mm; object-fit: contain; flex: none; }
/* the sizes wanted, before each profile's saw plan */
.need-sizes { margin: .5rem .8rem .3rem; width: auto; min-width: 60%; font-size: .88rem; break-inside: avoid; }
.need-sizes td, .need-sizes th { padding: .2rem .5rem; }
.need-sizes tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
/* the windows table (جدول النماذج), the owner 2026-12-05: «خطوط وألوان مختلفة في كل خانة عشان
   اللخبطة» — each piece's two columns (size, qty) one colour, the next piece another; clear lines */
.win-summary th, .win-summary td { border: .8px solid #8d99a8; }
.win-summary .g { border-inline-start: 2.2px solid #0f3b5f; }
.win-summary thead tr.h1 th.cg0 { background: #1d4e89; } .win-summary .h2 th.cg0, .win-summary td.cg0 { background: #e3edfa; }
.win-summary thead tr.h1 th.cg1 { background: #7a4b00; } .win-summary .h2 th.cg1, .win-summary td.cg1 { background: #fdf0d9; }
.win-summary thead tr.h1 th.cg2 { background: #1f6f43; } .win-summary .h2 th.cg2, .win-summary td.cg2 { background: #e2f4e8; }
.win-summary thead tr.h1 th.cg3 { background: #8a2a5b; } .win-summary .h2 th.cg3, .win-summary td.cg3 { background: #f9e4ef; }
.win-summary thead tr.h1 th.cg4 { background: #4b3a8f; } .win-summary .h2 th.cg4, .win-summary td.cg4 { background: #ebe7fa; }
.win-summary thead tr.h1 th.cg5 { background: #8f3b1b; } .win-summary .h2 th.cg5, .win-summary td.cg5 { background: #fbe7dd; }
.win-summary thead tr.h1 th.cg6 { background: #2b5f5f; } .win-summary .h2 th.cg6, .win-summary td.cg6 { background: #ddf1f1; }
.win-summary thead tr.h1 th.cg7 { background: #5b5b14; } .win-summary .h2 th.cg7, .win-summary td.cg7 { background: #f3f3d6; }
.win-summary .h2 th[class*="cg"] { color: #101828; }
.win-summary td.n[class*="cg"] { color: #101828; font-weight: 600; }
@media print { .win-summary td[class*="cg"], .win-summary th[class*="cg"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* the factory's file printed tight (the owner, 2026-12-05: «لم الصفحات صح عشان في حاجات بعيدة
   وصفحات بيضاء»): a profile's saw plan may run on to the next page (kept whole it jumped to a
   new page and left the one before it empty); its head stays with its sizes table, each bar
   pattern and the sizes table whole. The windows table: the drawing in each row smaller, more
   windows a page. */
@media print {
  .cut-group, .pack-doc .cut-group { break-inside: auto; page-break-inside: auto; overflow: visible; }
  .cut-group .gh { break-after: avoid; page-break-after: avoid; }
  .need-sizes, .pack-doc .need-sizes { break-inside: auto; page-break-inside: auto; }
  .need-sizes tr { break-inside: avoid; }
  .cut-group .pattern { break-inside: avoid; page-break-inside: avoid; }
  .legend { break-after: avoid; page-break-after: avoid; }
  .win-summary .win-pic svg { width: auto; max-width: 60px; max-height: 26mm; }
  .win-summary td.win-pic { width: 72px; }
  .win-summary th, .win-summary td { padding: 2px 3px; }
}
/* the owner, 2026-12-05: «خلي بداية كل قطاع صفحة لوحده بمشتملاتها» — each profile's saw plan
   (its head, its sizes table, its bars) starts a page of its own; a long one runs on */
@media print {
  .cut-group, .pack-doc .cut-group { break-before: page; page-break-before: always; }
  .plan-cuts-title { display: none; }
}
/* bars cut alike, each drawn with its own windows (the owner, 2026-12-05) */
.pt-bar { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .5rem; margin-top: .15rem; }
.pt-bar .pt-n { font-size: .78rem; font-weight: 700; color: var(--brand); white-space: nowrap; direction: rtl; }
.pt-bar + .pt-bar { border-top: 1px dotted #d0d5dd; padding-top: .15rem; }
@media print { .pt-bar { break-inside: avoid; } }
/* مصمم الوحدة بالمربعات */
.grid-designer > summary { cursor: pointer; font-weight: 700; }
.grid-designer > summary small { font-weight: 400; color: var(--muted, #667085); margin-inline-start: .5rem; }
.gd { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; margin-top: .6rem; align-items: start; }
@media (max-width: 860px) { .gd { grid-template-columns: minmax(0, 1fr); } }
.gd-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .4rem 0; border-bottom: 1px dashed var(--line, #d0d5dd); }
.gd-row label { display: inline-flex; align-items: center; gap: .3rem; }
.gd-row input { width: 5.5rem; }
.gd-check { list-style: none; padding: 0; margin: .4rem 0 0; color: #b42318; }
.gd-svg { width: 100%; max-height: 300px; }
.gd-cell { fill: #e8f1fb; stroke: #284b63; stroke-width: 1.5; }
.gd-fixed { fill: #dbe9f7; }
.gd-fan { fill: #f3f4f6; }
.gd-open { fill: none; stroke: #8a5a00; stroke-width: 1; stroke-dasharray: 4 3; }
.gd-txt { font-size: 11px; fill: #101828; }
.gd-dim { font-size: 10px; fill: #475467; }
.gd-match { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.gd-chip { min-height: 2.2rem; padding: .25rem .8rem; border-radius: 1.1rem; border: 1px solid var(--line, #d0d5dd); background: transparent; cursor: pointer; }
.gd-chip.on { background: #9bbf3b; border-color: #9bbf3b; color: #111; font-weight: 700; }
.sash-limit { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .85rem; margin-top: .3rem; }
.sash-limit input { width: 5rem; }
.gd-row select { width: auto; min-width: 8.5rem; flex: 0 1 auto; }
.gd-row > b { min-width: 3rem; }
/* مراجعة خروج المصنع */
.exit-scan { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; padding: .8rem; }
.exit-scan label { flex: 1 1 22rem; display: grid; gap: .3rem; }
.exit-bar { width: 100%; height: .7rem; margin: .6rem 0; accent-color: #9bbf3b; }
.exit-table tr.gone td { color: #3b7d23; }
.exit-table tr.left td:first-child { border-inline-start: 3px solid #f79009; }
/* ملخص التنفيذ وكروت التصنيع */
.mcard-head { display: flex; gap: 1rem; align-items: baseline; padding: .6rem .8rem; border-bottom: 2px solid #9bbf3b; }
.mcard-head h2 { margin: 0; font-size: 1.4rem; }
.mcard-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: .8rem; padding: .6rem .8rem; }
@media (max-width: 760px) { .mcard-body { grid-template-columns: minmax(0, 1fr); } }
.mcard-pic svg { width: 100%; height: auto; }
.mcard-cuts .tick { width: 2rem; border: 1px solid #98a2b3; }
.mcard-acc { padding: 0 .8rem .6rem; margin: 0; font-size: .88rem; }
@media print {
  .mcard, .exec-block { break-inside: avoid; page-break-inside: avoid; }
  .mcard-cuts .pic-cell img { max-height: 22px; }
}
/* the phone (the site engineer, 2026-12-05): nothing wider than the screen — the menu row
   scrolls on its own, the page never sideways */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .main, .content { min-width: 0; max-width: 100vw; }
  .table-wrap { overflow-x: auto; max-width: 100%; }
}
@media (max-width: 900px) {
  .sidebar .brand img, .sidebar .brand svg { max-height: 44px; width: auto; }
  .sidebar .brand { padding: .5rem 1rem; justify-content: center; }
}

/* أوامر الشراء */
.po-draft .qty { width: 6rem; text-align: center; }
.po-save { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; padding: .75rem 1rem; }
.po-save label { display: grid; gap: .25rem; min-width: 12rem; }
tr.muted td { opacity: .5; text-decoration: line-through; }
@media print { .po-draft .qty { border: 0; } }
.po-report { display: flex; gap: .75rem; align-items: end; padding: .75rem 1rem; }

/* مخزن الخامات */
.stock-filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; padding: .75rem 1rem; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem; padding: 0 1rem; }
.stock-grid label { display: grid; gap: .25rem; }
tr.stock-neg td { color: var(--danger, #c0392b); }
.po-receive .qty { width: 6rem; text-align: center; }

/* التخصيمات من القطاع */
.geo-method ul { margin: .25rem 0 .5rem; padding-inline-start: 1.25rem; }
.geo-shape > summary { cursor: pointer; padding: .75rem 1rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.geo-count { font-size: .85rem; padding: .05rem .5rem; border-radius: 999px; }
.geo-count.ok { background: rgba(46, 160, 67, .15); }
.geo-count.near { background: rgba(212, 167, 44, .2); }
.geo-count.off { background: rgba(207, 34, 46, .18); }
tr.geo-off td { color: var(--danger, #c0392b); }
tr.geo-near td { color: #b7791f; }

/* everyone but the owner: nothing on the page can be selected to copy (fields still can) */
body.no-copy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.no-copy input, body.no-copy textarea, body.no-copy select, body.no-copy [contenteditable] { -webkit-user-select: text; user-select: text; }
