/* =====================================================================
   SISIC (سيسك) — Pricing UI theme  ·  2026-10-03 redesign
   Brand: navy #113C64 · green #008445 (from official logo pack)
   CSS/layout only — no pricing logic lives here.
   ===================================================================== */

/* ---------- Fonts (bundled, offline) ---------- */
@font-face { font-family: "Tajawal"; src: url("/assets/fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/assets/fonts/Tajawal-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/assets/fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/assets/fonts/Tajawal-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

/* ---------- Tokens (light fallback) ---------- */
:root {
  color-scheme: light dark;
  --brand-navy: #113C64;
  --brand-navy-2: #0b2a47;
  --brand-green: #008445;
  --brand-green-2: #006b38;

  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef2f6;
  --ink: #0f1f2e;
  --muted: #5d6f80;
  --faint: #8a9aa9;
  --border: #e1e7ee;
  --border-strong: #cdd6e0;

  --primary: #113C64;
  --primary-dark: #113C64;
  --primary-soft: #e7eef6;
  --cta: #008445;
  --cta-hover: #006b38;
  --cta-soft: #e3f3ea;
  --accent: #008445;
  --accent-soft: #e3f3ea;
  --warn: #9a5b00;
  --warn-soft: #fff6e0;
  --warn-border: #f3d48b;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --danger-border: #f6c3bd;
  --info-soft: #e8f1fb;
  --info-border: #b9d3ee;

  --piece: #7cc8a0;
  --waste: #cbd5e1;
  --line: #113C64;

  --ring: 0 0 0 3px rgba(17,60,100,.16);
  --card-shadow: 0 1px 2px rgba(16,32,48,.05), 0 4px 16px rgba(16,32,48,.05);
  --float-shadow: 0 -6px 24px rgba(16,32,48,.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

@supports (color: light-dark(#fff, #000)) {
  :root {
    --bg: light-dark(#f3f6f9, #0c141c);
    --surface: light-dark(#ffffff, #142130);
    --surface-2: light-dark(#f6f8fb, #182839);
    --surface-3: light-dark(#eef2f6, #1d3044);
    --ink: light-dark(#0f1f2e, #e6edf4);
    --muted: light-dark(#5d6f80, #9db0c2);
    --faint: light-dark(#8a9aa9, #7389a0);
    --border: light-dark(#e1e7ee, #263a50);
    --border-strong: light-dark(#cdd6e0, #34506b);
    --primary: light-dark(#113C64, #7fb2e5);
    --primary-dark: light-dark(#113C64, #a9cdf0);
    --primary-soft: light-dark(#e7eef6, #1a3550);
    --cta: light-dark(#008445, #11a35c);
    --cta-hover: light-dark(#006b38, #14b866);
    --cta-soft: light-dark(#e3f3ea, #12352a);
    --accent: light-dark(#008445, #4cd08d);
    --accent-soft: light-dark(#e3f3ea, #12352a);
    --warn: light-dark(#9a5b00, #f5c46b);
    --warn-soft: light-dark(#fff6e0, #3a2a0b);
    --warn-border: light-dark(#f3d48b, #6b4e14);
    --danger: light-dark(#b42318, #ff9d94);
    --danger-soft: light-dark(#fdecea, #3d1512);
    --danger-border: light-dark(#f6c3bd, #6e2620);
    --info-soft: light-dark(#e8f1fb, #16304a);
    --info-border: light-dark(#b9d3ee, #2c5378);
    --piece: light-dark(#7cc8a0, #2f7a57);
    --waste: light-dark(#cbd5e1, #2a3a4c);
    --line: light-dark(#113C64, #7fb2e5);
    --ring: 0 0 0 3px light-dark(rgba(17,60,100,.16), rgba(127,178,229,.28));
    --card-shadow: 0 1px 2px light-dark(rgba(16,32,48,.05), rgba(0,0,0,.4)), 0 4px 16px light-dark(rgba(16,32,48,.05), rgba(0,0,0,.3));
    --float-shadow: 0 -6px 24px light-dark(rgba(16,32,48,.08), rgba(0,0,0,.45));
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
code { font-size: .85em; background: var(--surface-3); padding: .05rem .3rem; border-radius: 5px; }
a { color: var(--primary); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 1rem 1rem 2.5rem; }

/* Logo light/dark swap */
.logo-on-dark { display: none !important; }
html[data-theme="dark"] .logo-on-light { display: none !important; }
html[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .logo-on-light { display: none !important; }
  html:not([data-theme="light"]) .logo-on-dark { display: block !important; }
}

/* ---------- Header ---------- */
header.app-head {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: .9rem 1.1rem 0;
  margin-bottom: 1rem;
  overflow: hidden;
}
header.app-head::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--brand-green) 0 35%, var(--brand-navy) 35% 100%);
}
.head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem 1rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.brand .brand-logo { height: 56px; width: auto; flex-shrink: 0; display: block; }
/* Co-brand: SISIC | Wajihat Al Madinah */
.brand-logos { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.logo-divider { width: 1px; align-self: stretch; min-height: 32px; margin-block: .35rem; background: var(--border-strong, var(--border)); flex-shrink: 0; }
.partner-full { display: flex; align-items: center; flex-shrink: 0; }
.partner-logo { display: block; width: auto; flex-shrink: 0; }
.partner-mark { display: none; width: auto; flex-shrink: 0; }
.brand .brand-logo, .brand .partner-logo, .brand .partner-mark { height: 50px; }
/* let the brand block absorb width so the role bar stays on the same row */
.head-row > .brand { flex: 1 1 0; min-width: min(100%, 31rem); }
.head-row > .role-bar { flex: 0 0 auto; }
.brand-text h1 { white-space: nowrap; }
.brand-text { border-inline-start: 1px solid var(--border); padding-inline-start: .9rem; min-width: 0; }
.brand-text h1 {
  margin: 0; font-size: clamp(1.1rem, 2.6vw, 1.4rem); font-weight: 800;
  color: var(--primary-dark); line-height: 1.3;
}
.brand-text p { margin: .1rem 0 0; color: var(--muted); font-size: .84rem; font-weight: 500; }

.role-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.role-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-dark); border: 1px solid transparent;
}
.role-badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--cta); }
.role-badge.sales { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.role-badge.sales::before { background: var(--warn); }
.btn-logout {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: .3rem .8rem; font: inherit; font-weight: 700;
  font-size: .82rem; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-logout:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-logout.btn-exit:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.theme-select-wrap select {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: .3rem .7rem; font: inherit; font-weight: 700; font-size: .8rem;
  cursor: pointer;
}

.password-panel {
  margin-top: .85rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem 1rem;
}
.password-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: .6rem .75rem; align-items: end; }
.password-form > strong { grid-column: 1 / -1; color: var(--primary-dark); }
.password-form .actions { margin: 0; }
.password-form .pwd-err, .password-form .pwd-ok { grid-column: 1 / -1; margin: 0; }
@media (max-width: 720px) { .password-form { grid-template-columns: 1fr; } }
.pwd-err { color: var(--danger); font-weight: 700; min-height: 0; }
.pwd-ok { color: var(--accent); font-weight: 700; min-height: 0; }

/* Main tabs — underline bar inside header */
.main-tabs {
  display: flex; gap: .25rem; margin: .85rem -1.1rem 0; padding: 0 .75rem;
  border-top: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
}
.main-tabs::-webkit-scrollbar { display: none; }
.main-tab {
  position: relative; flex: 0 0 auto;
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: .8rem 1rem .75rem; cursor: pointer; white-space: nowrap;
  transition: color .15s;
}
.main-tab::after {
  content: ""; position: absolute; inset: auto .6rem 0 .6rem; height: 3px;
  border-radius: 3px 3px 0 0; background: transparent; transition: background .15s;
}
.main-tab:hover { color: var(--primary-dark); }
.main-tab.on { color: var(--primary-dark); font-weight: 800; }
.main-tab.on::after { background: var(--cta); }

/* ---------- Wizard top: steps + current product summary ---------- */
.wiz-top {
  display: grid; gap: .6rem; margin-bottom: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--card-shadow); padding: .7rem .8rem;
}
@media (min-width: 900px) {
  .wiz-top { position: sticky; top: .5rem; z-index: 25; }
}
.steps { display: flex; gap: .35rem; counter-reset: none; }
.steps .step {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .5rem .5rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 700; color: var(--muted);
  background: transparent; cursor: pointer; position: relative;
  transition: background .15s, color .15s; user-select: none; min-width: 0;
}
.step-n {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--surface-3); color: var(--muted); font-size: .82rem; font-weight: 800;
  border: 1.5px solid var(--border-strong);
}
.step-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .step:hover { background: var(--surface-2); color: var(--ink); }
.steps .step.on { background: var(--primary-soft); color: var(--primary-dark); }
.steps .step.on .step-n { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
html[data-theme="dark"] .steps .step.on .step-n { background: var(--primary); border-color: var(--primary); color: #0c141c; }
.steps .step.done { color: var(--ink); }
.steps .step.done .step-n { background: var(--cta); border-color: var(--cta); color: #fff; font-size: 0; }
.steps .step.done .step-n::after { content: "✓"; font-size: .85rem; }
.steps .step.blocked { opacity: .5; }
.steps .step:focus-visible { outline: none; box-shadow: var(--ring); }

.head-meta {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  padding-top: .55rem; border-top: 1px dashed var(--border);
}
.meta-lbl { font-size: .78rem; font-weight: 700; color: var(--faint); margin-inline-end: .2rem; }
.shape-badge, .type-badge, .pack-badge {
  display: inline-block; padding: .2rem .65rem; border-radius: 999px;
  font-weight: 700; font-size: .82rem;
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--border);
}
.type-badge { background: var(--primary-soft); color: var(--primary-dark); border-color: transparent; }
.shape-badge, .pack-badge { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; }
.pack-badge { background: var(--cta-soft); color: var(--accent); border-color: transparent; }

@media (max-width: 640px) {
  .steps { gap: .2rem; }
  .steps .step { flex-direction: column; gap: .2rem; padding: .4rem .15rem; font-size: .72rem; }
  .step-n { width: 1.45rem; height: 1.45rem; font-size: .75rem; }
}

/* ---------- Cards ---------- */
section.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.25rem 1.25rem;
  margin-bottom: 1rem; box-shadow: var(--card-shadow);
}
section.card h2 {
  margin: 0 0 .9rem; font-size: 1.06rem; font-weight: 800; color: var(--primary-dark);
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
section.card h2 .dot {
  width: 4px; height: 1.1rem; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(var(--brand-green) 0 50%, var(--brand-navy) 50% 100%);
}
html[data-theme="dark"] section.card h2 .dot { background: linear-gradient(var(--accent) 0 50%, var(--primary) 50% 100%); }
section.card h2 + .side-note, section.card h2 + p.side-note { margin-top: 0; }
section.card h3 { color: var(--primary-dark); }
section.card .step-tag {
  display: inline-block; margin-inline-start: .15rem; padding: .05rem .5rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: .72rem; font-weight: 800;
}
/* nested sub-sections inside the design card */
#dimsConfirmBlock, #outlineBlock {
  margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
#dimsConfirmBlock > h2, #outlineBlock > h2 { margin-top: 0 !important; }

.side-note {
  margin: .85rem 0 0; padding: .6rem .85rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--primary);
  border-radius: 8px; font-size: .82rem; color: var(--muted); line-height: 1.6;
}
.side-note strong { color: var(--ink); }
.actions .side-note, .actions > .side-note { border: 0; background: transparent; padding: 0 .25rem; align-self: center; }

/* ---------- Forms ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
@media (min-width: 640px) {
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

label.field {
  display: flex; flex-direction: column; gap: .3rem;
  font-size: .86rem; font-weight: 700; color: var(--ink);
}
label.field span.hint { font-size: .74rem; font-weight: 500; color: var(--faint); line-height: 1.4; }
/* push inputs to the bottom so fields line up across a row even when hints differ */
.grid > label.field > input:last-child,
.grid > label.field > select:last-child,
.grid > label.field > .cnc-one { margin-top: auto; }
label.field input, label.field select, .ai-dim-edit input, .password-form input {
  font-family: inherit; font-size: 1rem; font-weight: 700; color: var(--ink);
  padding: .6rem .8rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; min-height: 44px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
label.field input[type="date"] { min-height: 44px; }
label.field select, .cnc-one select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238a9aa9' stroke-width='1.8' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left .85rem center; padding-left: 2.2rem;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
label.field input:hover, label.field select:hover { border-color: var(--faint); }
label.field input:focus, label.field select:focus, .ai-dim-edit input:focus, .cnc-one select:focus, .cnc-one input:focus {
  border-color: var(--primary); box-shadow: var(--ring);
}
label.field input::placeholder { color: var(--faint); font-weight: 500; }

.cnc-one { display: grid; grid-template-columns: 160px 1fr; gap: .5rem; }
.cnc-one select, .cnc-one input {
  width: 100%; padding: .6rem .8rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem; font-weight: 700; background-color: var(--surface); color: var(--ink); min-height: 44px; outline: none;
}
.cnc-one input[readonly] { background: var(--surface-3); color: var(--muted); cursor: default; }
@media (max-width: 520px) { .cnc-one { grid-template-columns: 1fr; } }

input.ai-filled, select.ai-filled {
  border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(0,132,69,.2) !important;
  transition: box-shadow .3s ease, border-color .3s ease;
}

/* ---------- Choice cards (mode / type / cover) ---------- */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 640px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card {
  position: relative; text-align: right; font: inherit; color: var(--ink);
  border: 1.5px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius); padding: 1.05rem 1.15rem 1.05rem 2.6rem; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.mode-card::after {
  content: "←"; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-weight: 800; transition: color .15s, left .15s;
}
.mode-card:hover { border-color: var(--primary); background: var(--surface); box-shadow: var(--card-shadow); }
.mode-card:hover::after { color: var(--primary); left: .8rem; }
.mode-card.on { border-color: var(--cta); background: var(--cta-soft); box-shadow: 0 0 0 1px var(--cta); }
.mode-card strong { display: block; font-size: 1.05rem; font-weight: 800; color: var(--primary-dark); margin-bottom: .3rem; }
.mode-sub { display: block; font-size: .86rem; color: var(--muted); line-height: 1.55; }
.mode-chosen {
  display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; justify-content: space-between;
  margin-top: .85rem; padding: .6rem .6rem .6rem .8rem; border-radius: var(--radius-sm);
  background: var(--cta-soft); border: 1px solid transparent; font-weight: 800; color: var(--accent);
}
.mode-chosen .btn { min-height: 38px; padding: .4rem .9rem; font-size: .88rem; }

.type-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
@media (max-width: 560px) { .type-options { grid-template-columns: 1fr; } }
.type-opt, .cover-opt {
  position: relative; border: 1.5px solid var(--border); border-radius: 12px;
  padding: .85rem .85rem; cursor: pointer; background: var(--surface-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
  text-align: center; user-select: none; font-weight: 700;
}
.type-opt:hover, .cover-opt:hover { border-color: var(--primary); background: var(--surface); }
.type-opt.active, .cover-opt.active {
  border-color: var(--cta); background: var(--cta-soft); box-shadow: 0 0 0 1px var(--cta);
}
.type-opt.active::before, .cover-opt.active::before {
  content: "✓"; position: absolute; top: .45rem; right: .55rem;
  width: 1.2rem; height: 1.2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--cta); color: #fff; font-size: .7rem; font-weight: 800;
}
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt .t-name { font-weight: 800; font-size: 1.02rem; color: var(--ink); }
.type-opt .t-sub, .cover-opt .c-sub { font-size: .76rem; color: var(--muted); margin-top: .2rem; font-weight: 500; }
.cover-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
@media (max-width: 480px) { .cover-options { grid-template-columns: 1fr; } }
.cover-opt { color: var(--ink); padding: 1rem .85rem; }
.cover-opt.active { color: var(--accent); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; align-items: center; }
button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: inherit; font-size: .95rem; font-weight: 700; text-decoration: none;
  border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: .6rem 1.1rem;
  cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s, border-color .15s;
  min-height: 44px; line-height: 1.2;
}
button.btn:active { transform: translateY(1px); }
button.btn:focus-visible, a.btn:focus-visible { outline: none; box-shadow: var(--ring); }
button.btn-primary { background: var(--cta); color: #fff; box-shadow: 0 2px 8px rgba(0,132,69,.25); }
button.btn-primary:hover { background: var(--cta-hover); }
button.btn-ghost, a.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
button.btn-ghost:hover, a.btn-ghost:hover { background: var(--surface-3); border-color: var(--faint); }
button.btn-danger {
  background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border);
  font-size: .82rem; padding: .3rem .7rem; min-height: 32px;
}
button.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-link {
  border: none; background: none; color: var(--primary); font: inherit; font-weight: 700;
  cursor: pointer; padding: .15rem .3rem; text-decoration: none; border-radius: 6px;
}
.btn-link:hover { background: var(--primary-soft); }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { background: var(--danger-soft); }

/* ---------- Wizard footer (sticky nav) ---------- */
.wiz-footer {
  position: sticky; bottom: .6rem; z-index: 20;
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  margin: .25rem 0 1rem; padding: .6rem .7rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--float-shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.wiz-footer > div { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.wiz-footer .wiz-hint { font-size: .84rem; color: var(--muted); font-weight: 700; }
#btnWizNext { min-width: 9rem; }
#btnWizBack::before { content: "→"; }
#btnWizNext::after { content: "←"; }

/* ---------- Design upload + AI ---------- */
.design-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 760px) { .design-grid { grid-template-columns: 1.1fr .9fr; } }
.design-picks { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .55rem; }
@media (max-width: 520px) { .design-picks { grid-template-columns: 1fr; } }
.design-pick {
  display: flex; flex-direction: column; align-items: stretch; gap: .3rem;
  padding: .8rem .8rem; border: 1.5px dashed var(--border-strong); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
}
.design-pick:hover, .design-pick:focus-within { border-color: var(--cta); background: var(--cta-soft); }
.design-pick strong { font-size: .95rem; color: var(--ink); }
.design-pick span { font-size: .76rem; color: var(--muted); }
.design-pick input[type=file] { font-size: .76rem; width: 100%; color: var(--muted); }
.design-preview {
  position: relative; background: var(--surface-2); border: 1.5px dashed var(--border-strong); border-radius: 12px;
  min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: .5rem;
}
.design-preview img, .design-preview svg { max-width: 100%; max-height: 280px; display: block; }
.design-meta { font-size: .84rem; color: var(--muted); margin-top: .35rem; }
.design-meta:empty, .design-note:empty, .ai-summary:empty { display: none; }
.design-note {
  margin-top: .5rem; padding: .55rem .75rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .8rem; color: var(--muted); line-height: 1.5;
}
.ai-status-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .7rem 0 .4rem; }
.ai-status-row .design-meta { margin: 0; }
.ai-status-pill {
  display: inline-block; padding: .2rem .7rem; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: .8rem;
}
.ai-status-pill[data-status="working"] { background: var(--warn-soft); color: var(--warn); }
.ai-status-pill[data-status="done"] { background: var(--cta-soft); color: var(--accent); }
.ai-status-pill[data-status="error"] { background: var(--danger-soft); color: var(--danger); }
.ai-progress { width: 100%; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: .35rem 0; }
.ai-progress > span { display: block; height: 100%; background: var(--cta); width: 0%; transition: width .2s; }
.ai-summary { font-size: .9rem; font-weight: 700; margin: .35rem 0; }
.ai-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.ai-chips:empty { display: none; }
.ai-chip {
  background: var(--cta-soft); border: 1px solid transparent; color: var(--accent);
  padding: .25rem .45rem .25rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; cursor: default; user-select: none;
}
.ai-chip:hover { border-color: var(--cta); }
.ai-chip .ai-chip-val { cursor: pointer; text-decoration: underline dotted; }
.ai-chip .ai-chip-btn {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--primary);
  border-radius: 999px; padding: .1rem .45rem; font-size: .68rem; font-weight: 800; cursor: pointer; line-height: 1.3;
}
.ai-chip .ai-chip-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.ai-dims-hint { margin: .35rem 0 0; font-size: .78rem; color: var(--muted); }
details.ai-keys { margin-top: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
details.ai-keys > summary {
  cursor: pointer; padding: .7rem .9rem; font-weight: 700; color: var(--primary-dark); list-style: none;
  display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem;
}
details.ai-keys > summary::after { content: "▾"; color: var(--faint); transition: transform .2s; }
details.ai-keys[open] > summary::after { transform: rotate(180deg); }
details.ai-keys > summary::-webkit-details-marker { display: none; }
details.ai-keys .body { padding: 0 .9rem .9rem; }

.drawing-unit-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .45rem 0 .5rem;
  padding: .6rem .85rem; border-radius: var(--radius-sm); background: var(--info-soft);
  border: 1px solid var(--info-border); font-size: .88rem; font-weight: 700;
}
.drawing-unit-row .radio-inline { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; cursor: pointer; }
.drawing-unit-row input[type=radio] { accent-color: var(--brand-navy); width: 1rem; height: 1rem; }

.ai-dim-edit { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .7rem 0 .4rem; }
.ai-dim-edit label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; font-size: .86rem; }
.dims-confirm-actions, .hitl-assign-row, .shape-confirm-row, .click-pick-bar, .manual-path-row {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0 .35rem;
}
.raw-chip {
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--ink);
  padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.raw-chip:hover { border-color: var(--cta); background: var(--cta-soft); }
.nest-stats {
  margin-top: .55rem; padding: .65rem .8rem; border-radius: var(--radius-sm);
  background: var(--cta-soft); border: 1px solid var(--border); font-size: .9rem; color: var(--ink);
}
.nest-stats strong { font-weight: 800; }
.fp-tag-ok {
  display: inline-block; padding: .25rem .65rem; border-radius: 999px;
  background: var(--cta-soft); color: var(--accent); font-weight: 800; font-size: .82rem;
}
.click-pick-status { font-size: .82rem; font-weight: 700; color: var(--warn); margin: .25rem 0 0; min-height: 0; }
.click-pick-status:empty { display: none; }
.click-pick-hint, .hitl-stub-note { font-size: .77rem; color: var(--muted); margin: .25rem 0 .35rem; line-height: 1.5; }
.design-preview.click-pick-active { cursor: crosshair; border-color: #f59e0b; border-style: solid; background: var(--warn-soft); }
.design-preview .pick-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.design-preview .pick-marker {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2.5px solid #f59e0b; border-radius: 50%; background: rgba(251,191,36,.35);
  box-shadow: 0 0 0 3px rgba(245,158,11,.25); pointer-events: none;
  font-size: .62rem; font-weight: 800; color: #78350f; display: flex; align-items: center; justify-content: center;
}
.design-preview .pick-marker.thk { border-color: var(--brand-green); background: rgba(0,132,69,.3); color: #053d22; box-shadow: 0 0 0 3px rgba(0,132,69,.2); }

/* Banners */
.err-banner, .design-error-banner, .design-warn-banner, .nest-honest-banner {
  display: none; margin: .6rem 0 .8rem; padding: .7rem .95rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .9rem; white-space: pre-wrap; border: 1px solid; border-inline-start-width: 4px;
}
.err-banner, .design-error-banner { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.design-warn-banner, .nest-honest-banner { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.err-banner.show, .design-error-banner.show, .design-warn-banner.show, .nest-honest-banner.show { display: block; }
.err-banner { white-space: normal; }
.design-ok-banner {
  margin: .6rem 0 .8rem; padding: .7rem .95rem; border-radius: var(--radius-sm);
  background: var(--cta-soft); border: 1px solid var(--border); border-inline-start: 4px solid var(--cta);
  color: var(--accent); font-weight: 700; font-size: .9rem; white-space: pre-wrap;
}

.src-tag {
  display: inline-block; padding: .1rem .45rem; border-radius: 999px; background: var(--info-soft); color: var(--primary);
  font-size: .72rem; font-weight: 800; margin-inline-start: .25rem; vertical-align: middle;
}
.src-tag.manual { background: var(--warn-soft); color: var(--warn); }
.src-tag.click { background: #ede9fe; color: #5b21b6; }
.src-tag.file, .src-tag.draw { background: var(--cta-soft); color: var(--accent); }
.src-tag.unit { background: var(--surface-3); color: var(--muted); }

/* Outline / nest previews */
.outline-wrap, .pack-svg-wrap {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem; min-height: 150px; margin-top: .65rem; overflow: hidden;
}
.outline-wrap svg { width: 100%; height: auto; max-height: 300px; display: block; }
.pack-svg-wrap svg { width: 100%; height: auto; display: block; }
.outline-cands { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .55rem; }
.outline-cands:empty { display: none; }
.outline-pick {
  border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  padding: .4rem; cursor: pointer; text-align: center; min-width: 100px; color: var(--ink);
}
.outline-pick:hover { border-color: var(--primary); }
.outline-pick svg { width: 90px; height: 70px; display: block; margin: 0 auto .25rem; background: var(--surface-3); border-radius: 7px; }
.outline-pick span { display: block; font-weight: 700; font-size: .8rem; }
.outline-pick small { color: var(--muted); font-size: .7rem; }
.pack-panel { display: grid; grid-template-columns: 1fr; gap: .85rem; }
@media (min-width: 640px) { .pack-panel { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.pack-stat { background: var(--cta-soft); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.pack-stat .big {
  font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; color: var(--accent);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; line-height: 1.1;
}
.pack-stat .lbl { color: var(--muted); font-weight: 700; font-size: .9rem; margin-bottom: .25rem; }
.pack-stat .sub, #secPack .sub { font-size: .8rem; color: var(--muted); margin-top: .45rem; }

/* Principal dims */
.principal-dims { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.principal-dims h3 { margin: 0 0 .35rem; font-size: 1rem; color: var(--primary-dark); }
.principal-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .55rem; margin-top: .55rem; }
.principal-fact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .75rem; }
.principal-fact dt { font-weight: 800; color: var(--primary-dark); margin-bottom: .15rem; }
.principal-fact dd { margin: 0; font-variant-numeric: tabular-nums; }
.principal-fact .fp-sub { color: var(--muted); font-size: .8rem; }

/* ---------- Pricing results ---------- */
.sales-min-hero, .r-card.total {
  position: relative; overflow: hidden; color: #fff; border: none;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
  border-radius: var(--radius); padding: 1.15rem 1.3rem 1.2rem;
  box-shadow: 0 6px 20px rgba(17,60,100,.25);
}
.sales-min-hero::after, .r-card.total::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--brand-green);
}
.sales-min-hero { margin-bottom: .9rem; }
.sales-min-hero .lbl { font-size: .92rem; font-weight: 700; opacity: .9; margin-bottom: .2rem; }
.sales-min-hero .val { font-size: clamp(1.7rem, 5vw, 2.2rem); font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; text-align: start; }
.sales-min-hero .unit-tag { font-size: .82rem; opacity: .85; margin-top: .2rem; font-weight: 600; }
.sales-min-hero .sub-al { font-size: .88rem; margin-top: .5rem; opacity: .92; font-weight: 600; }

.results { display: grid; grid-template-columns: 1fr; gap: .65rem; }
@media (min-width: 560px) {
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results .total { grid-column: 1 / -1; }
}
@media (min-width: 900px) { .results { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.r-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .75rem .9rem; }
.r-card .lbl { font-size: .76rem; color: var(--muted); font-weight: 700; margin-bottom: .2rem; line-height: 1.4; }
.r-card .val {
  font-size: 1.22rem; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; text-align: start;
}
.r-card .unit-tag { font-size: .75rem; color: var(--muted); font-weight: 500; margin-top: .1rem; }
.r-card.total .lbl { color: rgba(255,255,255,.88); font-size: .95rem; }
.r-card.total .val { color: #fff; font-size: clamp(1.8rem, 5vw, 2.3rem); }
.r-card.total .unit-tag { color: rgba(255,255,255,.82); }
.r-card.highlight { background: var(--warn-soft); border-color: var(--warn-border); }
.r-card.highlight .val { color: var(--warn); }
#secPrice > label.field { margin-top: 1rem !important; }

/* ---------- Tables ---------- */
.quote-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: 12px; margin-top: .25rem;
}
.quote-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.quote-table th {
  background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: .8rem;
  padding: .65rem .7rem; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0;
}
.quote-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.quote-table tbody tr:last-child td { border-bottom: 0; }
.quote-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.quote-table tbody tr:hover td { background: var(--primary-soft); }
.quote-table td.num { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; text-align: left; }
.quote-sum {
  margin-top: .8rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  background: var(--cta-soft); border: 1px solid transparent; border-inline-start: 4px solid var(--cta);
  border-radius: var(--radius-sm); padding: .75rem 1rem; font-weight: 800; color: var(--ink);
}
.quote-sum .sum-val { font-size: 1.35rem; color: var(--accent); direction: ltr; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.empty-msg {
  color: var(--muted); text-align: center; padding: 1.4rem 1rem; font-size: .92rem;
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px;
}
.design-preview .empty-msg { background: transparent; border: 0; }
.products-filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem .85rem; margin-top: .6rem;
  padding: .9rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
}
.products-table-wrap { margin-top: .9rem; overflow-x: auto; }
.products-table { min-width: 920px; }
.products-table td.num, .products-table th.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; text-align: left; }
#productsEmpty, #quotesEmpty { margin-top: .9rem; }
.quote-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.detail-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.detail-table th, .detail-table td { text-align: right; padding: .5rem .5rem; border-bottom: 1px solid var(--border); }
.detail-table tr:nth-child(even) th, .detail-table tr:nth-child(even) td { background: var(--surface-2); }
.detail-table th { color: var(--muted); font-weight: 500; width: 62%; }
.detail-table td { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; text-align: left; }
.detail-table tr:last-child th, .detail-table tr:last-child td { border-bottom: none; }

/* ---------- Collapsibles ---------- */
details.adv {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 1rem; box-shadow: var(--card-shadow); overflow: hidden;
}
details.adv > summary {
  cursor: pointer; padding: .9rem 1.2rem; font-weight: 800; font-size: 1rem; color: var(--primary-dark);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; user-select: none;
}
details.adv > summary:hover { background: var(--surface-2); }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::after { content: "▾"; font-size: 1rem; color: var(--faint); transition: transform .2s; }
details.adv[open] > summary::after { transform: rotate(180deg); }
details.adv .body { padding: 1rem 1.2rem 1.2rem; border-top: 1px solid var(--border); }
details.adv .body h2 { font-size: 1rem; color: var(--primary-dark); display: flex; align-items: center; gap: .5rem; }
details.adv .body h2 .dot { width: 4px; height: 1rem; border-radius: 4px; background: var(--primary); }

/* ---------- Users ---------- */
.users-admin-list { display: grid; gap: .75rem; margin-top: 1rem; }
.user-card {
  border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem;
  background: var(--surface-2); display: grid; gap: .55rem;
}
.user-create { margin-top: .5rem; padding: 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.check-row { display: flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--ink); }

/* ---------- Footer ---------- */
footer.note {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem;
  text-align: center; color: var(--faint); font-size: .74rem; margin-top: 1.25rem; padding: 1rem .5rem 0;
  border-top: 1px solid var(--border); line-height: 1.6;
}
footer.note .foot-logo { height: 24px; width: auto; opacity: .85; }
footer.note .foot-divider { width: 1px; height: 18px; background: var(--border-strong, var(--border)); }
footer.note .foot-partner { opacity: .95; }

/* ---------- Login ---------- */
body.app-locked #appMain { display: none !important; }
body:not(.app-locked) #loginGate { display: none !important; }
#loginGate {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem;
  background:
    radial-gradient(1100px 500px at 100% 0%, color-mix(in srgb, var(--brand-navy) 12%, transparent), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, color-mix(in srgb, var(--brand-green) 10%, transparent), transparent 60%),
    var(--bg);
}
.login-card {
  position: relative; width: 100%; max-width: 410px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 10px 40px rgba(16,32,48,.12);
  padding: 1.8rem 1.6rem 1.5rem; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--brand-green) 0 35%, var(--brand-navy) 35% 100%);
}
.login-brand { display: flex; justify-content: center; align-items: center; gap: .9rem; margin-bottom: 1.1rem; }
.login-brand .brand-logo, .login-brand .partner-logo, .login-brand .partner-mark { height: 54px; width: auto; }
.login-brand .logo-divider { min-height: 40px; }
.login-card h1 { margin: 0 0 .25rem; font-size: 1.3rem; color: var(--primary-dark); text-align: center; font-weight: 800; }
.login-card .sub { margin: 0 0 1.2rem; color: var(--muted); font-size: .88rem; text-align: center; }
.login-card .field { margin-bottom: .8rem; }
.login-err {
  display: none; margin: .5rem 0 .75rem; padding: .65rem .8rem; border-radius: var(--radius-sm);
  background: var(--danger-soft); border: 1px solid var(--danger-border); color: var(--danger); font-weight: 700; font-size: .9rem;
}
.login-err.show { display: block; }
.login-hint { font-size: .74rem; color: var(--faint); margin: 1rem 0 0; text-align: center; }

/* ---------- Toasts & modal ---------- */
.products-toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--brand-navy); color: #fff; padding: .7rem 1.2rem; border-radius: 999px;
  font-weight: 700; font-size: .9rem; box-shadow: 0 8px 24px rgba(15,23,42,.25);
  z-index: 10000; opacity: 0; transition: .25s ease; pointer-events: none; max-width: 90vw;
}
.products-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.products-toast.err { background: #b42318; }
.drawing-modal {
  display: none; position: fixed; inset: 0; background: rgba(8,20,32,.6);
  z-index: 9999; align-items: center; justify-content: center; padding: 1rem;
}
.drawing-modal.show { display: flex; }
.drawing-modal-card {
  position: relative; background: var(--surface); color: var(--ink); border-radius: var(--radius);
  max-width: min(920px, 96vw); max-height: 90vh; overflow: auto; padding: 1rem; box-shadow: var(--card-shadow);
}
.drawing-modal-close {
  position: absolute; top: .5rem; left: .6rem; border: none; background: var(--danger-soft);
  color: var(--danger); width: 2rem; height: 2rem; border-radius: 999px; font-size: 1.2rem; cursor: pointer; font-weight: 800;
}
.drawing-modal-body img { max-width: 100%; height: auto; display: block; margin: .5rem auto 0; border-radius: 8px; }

/* ---------- Functional rules (roles / wizard) — unchanged semantics ---------- */
#secDesign[data-quick-hide="1"] { display: none !important; }
section.card[data-wiz-hidden="1"], .wiz-panel[data-wiz-hidden="1"] { display: none !important; }
body.role-sales [data-role="developer"],
body.role-sales .nest-dev-detail { display: none !important; }
body.role-developer #salesMinHero { display: none !important; }
body.role-sales #outlineCandidates,
body.role-sales #nestStats,
body.role-sales #advCosts,
body.role-sales #advDetails,
body.role-sales #aiKeysPanel,
body.role-sales #outSExcel,
body.role-sales #outSSource,
body.role-sales #ahFieldWrap,
body.role-sales #btnExportNestDxf,
body.role-sales #btnV36RegionOcr { display: none !important; }

/* Co-brand: compact header on mid widths — mark only */
@media (max-width: 900px) {
  .brand .partner-full { display: none; }
  .brand .partner-mark { display: block; }
}
@media (max-width: 420px) {
  .login-brand { gap: .65rem; }
  .login-brand .brand-logo, .login-brand .partner-logo, .login-brand .partner-mark { height: 44px; }
}
@media (max-width: 330px) {
  .login-brand .partner-full { display: none; }
  .login-brand .partner-mark { display: block; }
}
/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .wrap { padding: .6rem .6rem 2rem; }
  header.app-head { padding: .8rem .8rem 0; }
  .main-tabs { margin: .7rem -.8rem 0; padding: 0 .3rem; }
  .brand { gap: .6rem; }
  .brand .brand-logo, .brand .partner-mark { height: 42px; }
  .brand-logos { gap: .55rem; }
  .brand .logo-divider { min-height: 26px; margin-block: .25rem; }
  .brand-text { padding-inline-start: .6rem; }
  .brand-text p { display: none; }
  .role-bar { width: 100%; gap: .3rem; flex-wrap: nowrap; }
  .role-badge { margin-inline-end: auto; font-size: .76rem; padding: .25rem .6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .btn-logout, .theme-select-wrap select { font-size: .74rem; padding: .25rem .55rem; white-space: nowrap; }
  .main-tab { flex: 1 1 auto; padding: .7rem .25rem .65rem; font-size: .78rem; }
  .main-tab::after { inset-inline: .2rem; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .results .total { grid-column: 1 / -1; }
  .r-card { padding: .6rem .7rem; }
  .r-card .val { font-size: 1.05rem; }
  .wiz-footer { flex-wrap: nowrap; }
  .wiz-footer .wiz-hint { display: none; }
  section.card { padding: 1rem .9rem 1.05rem; }
  .wiz-footer { bottom: .35rem; padding: .5rem .55rem; }
  .wiz-footer .wiz-hint { font-size: .74rem; }
  #btnWizNext { min-width: 7rem; }
  .ai-dim-edit { grid-template-columns: 1fr 1fr; }
}
@media print {
  .wiz-footer, .main-tabs, .role-bar, .wiz-top { display: none !important; }
  body { background: #fff; }
}

/* قائمة التسعير — اسم الشركة + تصدير Excel */
.quote-company { margin-bottom: .75rem; }
.quote-company .req { color: var(--danger, #c0392b); }
.quote-company.invalid input { border-color: var(--danger, #c0392b); box-shadow: 0 0 0 2px rgba(192,57,43,.18); }
.quote-item-thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
.quote-export-msg { font-size: .85rem; opacity: .85; align-self: center; }
.quote-export-msg.err { color: var(--danger, #c0392b); opacity: 1; }

/* كلمة مرور افتراضية */
.pwd-force-note { margin: .25rem 0 .5rem; padding: .5rem .7rem; border-radius: 8px; background: rgba(230,126,34,.14); color: var(--text); font-size: .88rem; }
.pill-warn { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; background: rgba(230,126,34,.18); color: #b35c00; margin-inline-start: .35rem; }
body.must-change-pw #mainTabs, body.must-change-pw #pricingView, body.must-change-pw #productsView,
body.must-change-pw #quotesView, body.must-change-pw #usersView { display: none !important; }
