@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --red: #cf111b;
  --red-dark: #940b08;
  --navy: #092d3d;
  --navy-2: #073549;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f6f7f9;
  --paper-w: 210mm;
  --paper-h: 297mm;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: 'Tajawal', Arial, sans-serif; background: #eef1f5; color: var(--ink); }
body { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; }
button, input, textarea, select { font-family: inherit; }

.builder-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: #fff;
  border-left: 1px solid #d8dde6;
  padding: 18px;
  box-shadow: -8px 0 24px rgba(15, 23, 42, .08);
  z-index: 20;
}

.brand-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff, #f7f7f8);
  border: 1px solid var(--line);
}
.brand-strip h1 { font-size: 21px; margin: 0; font-weight: 900; color: var(--navy); }
.brand-strip p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.mini-logo {
  width: 54px; height: 54px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #fff;
}
.mini-logo img { width: 100%; height: 100%; object-fit: cover; }
.tool-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
button, .ghost-upload {
  border: 1px solid #d5dbe5;
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
}
button:hover, .ghost-upload:hover { background: #f8fafc; }
button.primary { background: var(--red); color: #fff; border-color: var(--red); grid-column: 1 / -1; }
.ghost-upload input { display: none; }
.panel-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 16px; }
.panel-tabs .tab { padding: 9px 6px; font-size: 13px; }
.panel-tabs .tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.form-grid { display: grid; gap: 12px; padding-bottom: 40px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 900; font-size: 13px; color: #334155; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid #d7dce5; border-radius: 12px; padding: 11px 12px; background: #fff; color: #111827; outline: none; font-size: 14px;
}
.field textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(207, 17, 27, .08); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-editor {
  border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fbfcfe; display: grid; gap: 10px;
}
.card-editor h3 { margin: 0; font-size: 16px; color: var(--navy); }
.card-editor .danger { color: #fff; background: #991b1b; border-color: #991b1b; }
.hint { color: var(--muted); font-size: 12px; margin: -4px 0 0; }

.preview-wrap { min-width: 0; padding: 22px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 0 auto 16px; max-width: 1050px; color: #334155; }
.preview-toolbar span { color: var(--muted); font-size: 13px; }
.document-preview { display: grid; gap: 26px; justify-content: center; }

.page {
  position: relative;
  width: var(--paper-w);
  min-height: var(--paper-h);
  height: var(--paper-h);
  background: #fff;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 18px 55px rgba(15, 23, 42, .16);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.page .page-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
.content-layer { position: relative; z-index: 2; height: 100%; padding: 24mm 17mm 28mm; }
.header-logo {
  position: absolute; top: 7mm; left: 12mm; z-index: 3; display: flex; align-items: center; gap: 6px; direction: ltr; color: var(--navy);
}
.header-logo img { max-width: 28mm; max-height: 18mm; object-fit: contain; }
.logo-mark { width: 17mm; height: 17mm; border: 2px solid var(--red); border-radius: 50%; color: var(--red); display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.logo-text { line-height: 1.05; font-weight: 900; font-size: 9px; white-space: nowrap; }
.logo-text small { display: block; font-weight: 700; color: #111; font-size: 7px; }
.footer-bar {
  position: absolute; z-index: 4; bottom: 3mm; left: 12mm; right: 12mm; height: 15mm;
  border-radius: 10px; background: rgba(255,255,255,.95); display: grid; grid-template-columns: 1.1fr 1.05fr 1.25fr; align-items: center; box-shadow: 0 4px 14px rgba(15,23,42,.13); border: 1px solid rgba(15,23,42,.08); overflow: hidden;
}
.footer-item { display: flex; align-items: center; justify-content: center; gap: 7px; height: 100%; font-weight: 900; font-size: 11px; color: var(--red); }
.footer-item + .footer-item { border-right: 1px solid #555; }
.footer-item .ico { width: 8mm; height: 8mm; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 14px; }
.footer-item.black { color: #111; direction: ltr; }
.footer-item .foot-logo { width: 9mm; height: 9mm; border: 2px solid var(--red); border-radius: 50%; color: var(--red); display: grid; place-items: center; font-size: 8px; font-weight: 900; }

.title-pill {
  margin: 6mm 0 14mm auto;
  width: 82%; min-height: 16mm; padding: 8px 22px; box-sizing: border-box;
  border-radius: 18px; background: var(--title-bg, var(--red)); color: var(--title-color, #fff);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-weight: 900; font-size: var(--title-size, 28px); line-height: 1.3;
  font-family: var(--title-font, 'Tajawal', sans-serif);
  text-align: center; word-wrap: break-word; overflow-wrap: break-word;
  box-shadow: 0 10px 20px rgba(207, 17, 27, .18);
}
.title-pill > span:first-child { flex: 1; min-width: 0; }
.title-pill .icon-box { flex-shrink: 0; font-size: calc(var(--title-size, 28px) * 0.86); font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Tajawal', sans-serif; }
.list-block { font-size: 19px; line-height: 1.82; font-weight: 600; margin: 0; padding: 0 18px 0 0; }
.list-block li { margin-bottom: 5px; padding-right: 3px; }
.list-block li::marker { font-weight: 900; }
.red-word { color: var(--red); font-weight: 900; }
.section-subtitle { font-weight: 900; color: var(--red); font-size: 17px; margin: -5mm 0 7mm; text-align: center; }
.split-grid { display: grid; grid-template-columns: 350px 350px; gap: 14px; align-items: start; justify-content: center; }
.split-grid.split-stacked { width: 100%; justify-content: stretch; }
.split-grid.split-stacked .split-section { width: 100%; }
.split-section { border: 1px solid rgba(207,17,27,.14); border-radius: 18px; padding: 13px; background: rgba(255,255,255,.82); }
.split-section h2 { margin: 0 0 8px; color: var(--red); font-size: 20px; font-weight: 900; }
.split-section .list-block { font-size: 14.5px; line-height: 1.7; padding-right: 15px; }
.note-box { border-right: 6px solid var(--red); padding: 12px 16px; background: rgba(207,17,27,.07); border-radius: 14px; line-height: 1.7; font-size: 17px; font-weight: 700; }

.cover .content-layer { padding: 14mm 13mm 42mm; }
.cover-gavel { position: absolute; top: 0; right: 0; width: 85mm; height: 55mm; opacity: .85; z-index: 2; }
.cover-logo { position: absolute; left: 10mm; top: 10mm; z-index: 3; text-align: center; color: var(--navy); font-weight: 900; }
.cover-logo img { max-width: 38mm; max-height: 24mm; object-fit: contain; display: block; margin: auto; }
.cover-logo .logo-mark { margin: auto; width: 20mm; height: 20mm; font-size: 17px; }
.cover-logo .ar { margin-top: 4px; font-size: 12px; }
.cover-logo .en { font-size: 9px; color: #333; direction:ltr; }
.cover-type { text-align: center; margin-top: 52mm; font-size: 17px; font-weight: 800; color: var(--red); letter-spacing: 8px; text-transform: uppercase; }
.cover-type::before, .cover-type::after { content:""; display: inline-block; width: 28mm; height: 1.5px; background: linear-gradient(90deg, transparent, var(--red), transparent); margin: 0 8mm; vertical-align: middle; }
.company-band {
  width: 80%; margin: 6mm auto 12mm; padding: 9mm 6mm; border-radius: 14px;
  background: linear-gradient(160deg, #1f2a52 0%, #131c3d 100%);
  color: #fff; text-align: center; font-size: 32px; font-weight: 900;
  letter-spacing: 1px; box-shadow: 0 10px 26px rgba(15,23,42,.22);
  position: relative; border-top: 2px solid #c9a250;
}
.company-band::after { content: ""; display: block; width: 40mm; height: 2px; margin: 4mm auto 0; background: linear-gradient(90deg, transparent, #c9a250, transparent); }
.date-panel { background: #fff; border-radius: 18px; box-shadow: 0 12px 30px rgba(9,45,61,.12), 0 2px 6px rgba(9,45,61,.06); display: grid; grid-template-columns: repeat(3, 1fr); min-height: 34mm; overflow: hidden; border: 1px solid rgba(9,45,61,.08); position: relative; }
.date-panel::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--red), #c9a250, var(--red)); }
.date-card { position: relative; display: grid; place-items: center; align-content: center; gap: 2.5mm; padding: 6mm 4mm 5mm; text-align: center; }
.date-card + .date-card::before { content: ""; position: absolute; inset-inline-start: 0; top: 22%; bottom: 22%; width: 1px; background: linear-gradient(180deg, transparent, rgba(9,45,61,.18), transparent); }
.date-card h3 { color: var(--red); margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .3px; text-transform: none; position: relative; padding-bottom: 2.5mm; }
.date-card h3::after { content: ""; position: absolute; inset-inline: 35%; bottom: 0; height: 2px; background: var(--red); border-radius: 2px; }
.date-card .day { font-size: 17px; font-weight: 900; color: var(--navy); letter-spacing: .2px; }
.date-card .date { font-size: 20px; font-weight: 900; color: var(--navy); line-height: 1.1; white-space: nowrap; display: inline-flex; align-items: baseline; gap: 5px; justify-content: center; }
.date-card .date .year { font-size: 14px; font-weight: 800; color: #64748b; letter-spacing: .5px; }
.cover-middle { display: grid; grid-template-columns: 48% 1fr; gap: 5mm; margin-top: 9mm; align-items: center; }
.feature-slab {
  position: relative; min-height: 78mm; padding: 22px 0 22px 28px;
  color: #fff; border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: grid; gap: 6px; align-content: center; overflow: hidden;
  direction: rtl;
}
.feature-line { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: center; padding: 12px 4px; font-weight: 800; font-size: 14px; letter-spacing: .3px; text-align: right; direction: rtl; }
.feature-line + .feature-line { border-top: 1px solid transparent; box-shadow: none; }
.feature-line .circle {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, rgba(207,17,27,.95), rgba(140,16,7,.85));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 14px rgba(207,17,27,.35), inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 4px rgba(0,0,0,.15);
  position: relative;
}
.feature-line .circle::after { content: ""; position: absolute; inset: -3px; border-radius: 15px; border: 1px solid rgba(201,162,80,.35); pointer-events: none; }
.feature-line .circle svg { width: 22px; height: 22px; stroke-width: 2.2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.feature-line > span:last-child { line-height: 1.45; text-shadow: none; }
.info-stack { display: grid; gap: 5mm; padding-inline-end: 4mm; margin-top: 8mm; }
.red-label { justify-self: center; background: var(--red); color: #fff; border-radius: 999px; padding: 8px 28px; text-align: center; font-size: 18px; font-weight: 900; box-shadow: 0 6px 14px rgba(207,17,27,.25); }
.platform-card { border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(15,23,42,.12); min-height: 22mm; padding: 14px 18px; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 19px; font-weight: 900; direction: ltr; color: #0652cc; text-decoration: none; border: 1.5px solid #fecaca; border-inline-start: 5px solid var(--red); transition: transform .15s; }
.platform-card:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(6,82,204,.22); }
.pc-icon { width: 32px; height: 32px; border-radius: 50%; background: #eaf2ff; display: grid; place-items: center; font-size: 18px; }
.pc-url { letter-spacing: .3px; }
.safety-card { border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(15,23,42,.12); min-height: 22mm; padding: 14px 18px; display: flex; align-items: center; gap: 14px; direction: rtl; color: #1f2937; font-size: 15px; line-height: 1.65; font-weight: 700; border: 1.5px solid #fecaca; border-inline-start: 5px solid var(--red); }
.safety-card .sc-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.safety-card .sc-text { flex: 1; }
.safety-card strong { color: var(--red); font-weight: 900; }

.buyer-title { text-align: center; font-size: 25px; color: var(--navy); font-weight: 900; margin: 18mm 0 8mm; }
.buyer-table { font-size: 13px; }
.buyer-table th { padding: 8px 6px; font-size: 13px; }
.buyer-table td { padding: 6px 6px; font-size: 13px; }
.buyer-table .cell-bid { color: var(--red); font-weight: 900; white-space: nowrap; }
.buyer-table .row-bid-start td { border-top: 2px solid var(--navy); }
.table-card { margin: 0 auto; width: 96%; border-radius: 18px; background: rgba(255,255,255,.95); box-shadow: 0 7px 18px rgba(15,23,42,.12); overflow: hidden; border: 1px solid #e5e7eb; }
.auction-table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: center; }
.auction-table th { background: var(--navy); color: #fff; padding: 10px; font-weight: 900; }
.auction-table td { border-top: 1px solid #e5e7eb; padding: 10px; font-weight: 700; }
.auction-table tr:nth-child(even) td { background: #f8fafc; }
.bid-label { position: absolute; top: 60mm; right: 16mm; width: 28mm; height: 28mm; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 900; line-height: 1.1; font-size: 18px; }
.contact-card { background: #fff; border-radius: 18px; padding: 14px 18px; box-shadow: 0 10px 28px rgba(15,32,73,.12); display: flex; flex-direction: column; gap: 8px; }
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px dashed #e5e7eb; padding-bottom: 6px; font-size: 14px; }
.contact-row:last-child { border-bottom: none; padding-bottom: 0; }
.contact-key { color: var(--red); font-weight: 900; }
.contact-val { color: var(--navy); font-weight: 700; direction: ltr; }
.bid-title { margin: 12mm auto 4mm; font-size: 26px; font-weight: 900; color: var(--navy); text-align: center; }
.bid-location { margin: 0 auto; font-size: 22px; font-weight: 900; color: #fff; text-align: center; background: var(--red); padding: 10px 22px; border-radius: 14px; width: fit-content; max-width: 80%; box-shadow: 0 8px 18px rgba(207,17,27,.22); }
.bid-note { margin-top: 4mm; font-size: 16px; color: var(--red); font-weight: 900; text-align: center; }
.photo-grid { margin-top: 25mm; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10mm; }
.photo-grid-1 { grid-template-columns: 1fr; }
.photo-grid-1 .photo-slot { height: 180mm; }
.photo-grid-1 .photo-slot img { object-fit: contain; background: #f8fafc; }
.photo-grid-2 .photo-slot { height: 130mm; }
.photo-grid-2 .photo-slot img { object-fit: contain; background: #f8fafc; }
.photo-grid-3 .photo-slot:nth-child(3) { grid-column: span 2; }
.photo-slot { height: 64mm; border: 2px dashed #d1d5db; border-radius: 16px; background: rgba(255,255,255,.84); display: grid; place-items: center; color: #9ca3af; font-weight: 900; overflow: hidden; position: relative; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .num { position: absolute; bottom: 8px; left: 10px; background: var(--red); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }

@media (max-width: 1100px) {
  body { grid-template-columns: 1fr; }
  .builder-panel { position: relative; height: auto; }
  .page { transform: scale(.72); transform-origin: top center; margin-bottom: -74mm; }
}

.page-order-controls { display: flex; gap: 6px; margin: 8px 0 12px; }
.page-order-controls button { padding: 4px 10px; font-size: 14px; border-radius: 8px; border: 1px solid #d1d5db; background: #f3f4f6; cursor: pointer; }
.page-order-controls button:hover:not(:disabled) { background: #e5e7eb; }
.page-order-controls button:disabled { opacity: .4; cursor: not-allowed; }
.page-order-controls button.danger { background: #fee2e2; border-color: #fca5a5; color: #991b1b; margin-right: auto; }
.card-editor.page-hidden { opacity: .55; background: #f9fafb; }
.card-editor.page-hidden > summary { color: #6b7280; }
@media print {
  @page { size: A4 portrait; margin: 0; }
  body { display: block; background: #fff; }
  .builder-panel, .preview-toolbar { display: none !important; }
  .preview-wrap { padding: 0; }
  .document-preview { display: block; }
  .page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    page-break-after: always;
    break-after: page;
    transform: none !important;
    margin-bottom: 0 !important;
  }
}

/* Login Gate */
body.locked { overflow: hidden; }
body.locked .builder-panel, body.locked .preview-wrap, body.locked .social-modal, body.locked .app-hub { visibility: hidden !important; }
body.hub-mode .builder-panel, body.hub-mode .preview-wrap { display: none !important; }
body.builder-mode .app-hub { display: none !important; }
@media print { .app-hub { display: none !important; } }

/* Hub — Official corporate identity */
.app-hub {
  position: fixed; inset: 0; z-index: 10;
  background: #ffffff url('assets/hub-bg.png') center top / cover no-repeat fixed;
  color: #14224a; overflow: auto;
  display: flex; flex-direction: column;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  isolation: isolate;
}

.hub-logout {
  position: fixed; top: 16px; left: 18px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: #cf111b !important;
  border: 1px solid rgba(207,17,27,.3); padding: 7px 14px; border-radius: 999px;
  font-weight: 800; cursor: pointer; font-size: 12px;
  transition: all .18s ease;
  box-shadow: 0 4px 12px rgba(207,17,27,.1);
}
.hub-logout:hover { background: #cf111b; color: #fff !important; border-color: #cf111b; transform: translateY(-1px); }

.hub-inner {
  flex: 1; max-width: 1240px; width: 100%; margin: 0 auto;
  padding: 50px 56px 50px;
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
}

.hub-top {
  display: flex; align-items: center; justify-content: center;
  gap: 36px; margin-bottom: 46px;
  flex-wrap: wrap;
}
.hub-logo-circle {
  width: 130px; height: 130px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: #fff;
  border: 2px solid #cf111b;
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 5px rgba(201,162,80,.5),
    0 12px 30px -12px rgba(28,38,73,.25);
}
.hub-logo-circle img { width: 86px; height: 86px; object-fit: contain; }

.hub-top-text { text-align: center; }
.hub-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 800;
  color: #c9a250; padding: 7px 22px;
  border: 1.5px solid rgba(201,162,80,.55);
  border-radius: 999px; background: #fff;
  box-shadow: 0 4px 12px -4px rgba(201,162,80,.3);
}
.hub-top-text h2 {
  margin: 16px 0 12px;
  font-size: 62px; font-weight: 900; color: #14224a;
  letter-spacing: -1px; line-height: 1.05;
}
.hub-top-text p {
  margin: 0 auto;
  font-size: 14.5px; line-height: 1.85; color: #6a7689; font-weight: 500;
}
.hub-pdf { color: #cf111b; font-weight: 800; }

.hub-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 30px;
}
.hub-card-wide {
  grid-column: 2 / 4;
  flex-direction: row !important;
  align-items: center;
  gap: 22px !important;
}
.hub-card-wide .hub-text { flex: 1; }
.hub-card-wide .hub-cta { width: auto; padding-top: 0; border-top: 0; padding-right: 16px; border-right: 1px solid rgba(28,38,73,.08); }

.hub-card {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; gap: 14px;
  background: #ffffff;
  border: 1px solid rgba(28,38,73,.07);
  border-radius: 14px; padding: 28px 22px 18px;
  text-align: right; color: #14224a; text-decoration: none;
  cursor: pointer; font: inherit;
  transition: transform .22s ease, box-shadow .22s, border-color .22s;
  box-shadow: 0 12px 28px -18px rgba(28,38,73,.28);
  overflow: visible;
  min-height: 240px;
}
.hub-card:hover {
  transform: translateY(-5px);
  border-color: rgba(207,17,27,.25);
  box-shadow: 0 22px 40px -18px rgba(207,17,27,.3);
}

.hub-ribbon {
  position: absolute; top: -2px; right: 18px;
  width: 38px; padding: 8px 0 12px;
  background: #cf111b;
  color: #fff; font-weight: 800; font-size: 13px;
  text-align: center; letter-spacing: .5px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  z-index: 2;
  box-shadow: 0 4px 8px -2px rgba(207,17,27,.4);
}

.hub-card .hub-icon {
  width: 78px; height: 78px;
  display: grid; place-items: center;
  background: #fff;
  border-radius: 50%;
  color: #cf111b;
  margin: 6px auto 0;
  border: 1.5px solid #cf111b;
  box-shadow: 0 6px 18px -6px rgba(207,17,27,.35), inset 0 0 0 3px #fff;
}
.hub-card .hub-icon svg { width: 36px; height: 36px; }

.hub-text { flex: 1; text-align: center; }
.hub-card h3 {
  margin: 4px 0 8px; font-size: 18px; font-weight: 900; color: #14224a;
  line-height: 1.4;
}
.hub-card p {
  margin: 0; font-size: 12.5px; line-height: 1.75;
  color: #7c8699; font-weight: 500;
}

.hub-cta {
  margin-top: 6px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  color: #cf111b; font-weight: 800; font-size: 14px;
  padding-top: 14px; border-top: 1px solid rgba(28,38,73,.06);
}
.hub-cta-arrow {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.2px solid rgba(207,17,27,.35);
  color: #cf111b;
  transition: all .22s ease;
}
.hub-card:hover .hub-cta-arrow {
  background: #cf111b; color: #fff; border-color: #cf111b;
  transform: translateX(-3px);
}

.hub-footer {
  background: linear-gradient(180deg, #14224a 0%, #0f1a3a 100%);
  color: #c9a250;
  padding: 16px 24px; text-align: center;
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; z-index: 2;
}
.hub-footer svg { color: #c9a250; flex-shrink: 0; }
.hub-footer p { margin: 0; }

.back-hub-btn {
  background: linear-gradient(180deg, #c9a250, #9c7a30);
  color: #14224a !important; font-weight: 900 !important;
  border: 0 !important;
}
.back-hub-btn:hover { transform: translateY(-1px); }

@media (max-width: 1100px) {
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-card-wide { grid-column: 1 / 3; flex-direction: column !important; }
  .hub-card-wide .hub-cta { width: 100%; padding-top: 14px; border-top: 1px solid rgba(28,38,73,.06); border-right: 0; padding-right: 0; }
}
@media (max-width: 720px) {
  .hub-inner { padding: 40px 22px 30px; }
  .hub-top { gap: 20px; margin-bottom: 30px; }
  .hub-logo-circle { width: 100px; height: 100px; }
  .hub-logo-circle img { width: 66px; height: 66px; }
  .hub-top-text h2 { font-size: 38px; }
  .hub-grid { grid-template-columns: 1fr; gap: 14px; }
  .hub-card-wide { grid-column: 1; }
}
.login-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  padding: 20px;
  background: #ffffff url('assets/hub-bg.png') center top / cover no-repeat;
  transition: opacity .3s ease;
  overflow-y: auto;
}
@media (max-width: 720px) {
  .login-gate {
    background-image: url('assets/hub-bg-mobile.png');
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
  }
}
.login-gate::before {
  content: "";
  flex: 0 0 auto;
  width: clamp(110px, 14vw, 160px);
  height: clamp(110px, 14vw, 160px);
  border-radius: 50%;
  background: #fff url('assets/logo.png') center/contain no-repeat;
  border: 3px solid #cf111b;
  box-shadow: 0 0 0 4px #c9a250, 0 18px 38px rgba(0,0,0,.25);
}
@media (max-width: 720px) {
  .login-gate::before { width: 110px; height: 110px; }
}
.login-gate.hide { opacity: 0; pointer-events: none; }
.login-card {
  width: min(420px, 92vw);
  background: rgba(255,255,255,.98);
  border-radius: 22px;
  padding: 32px 30px 24px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.6);
  border-top: 3px solid #c9a250;
  position: relative;
}
.login-logo {
  width: 84px; height: 84px; margin: 0 auto 14px;
  border-radius: 50%; overflow: hidden;
  border: 2px solid #c9a250;
  box-shadow: 0 8px 22px rgba(207,17,27,.25);
  background: #fff;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { color: var(--navy); font-size: 24px; margin: 6px 0 4px; font-weight: 900; }
.login-sub { color: var(--red); font-weight: 800; font-size: 14px; letter-spacing: .5px; margin: 0 0 18px; }
.login-hint { color: #475569; font-size: 13px; margin: 0 0 16px; }
#loginForm { display: grid; gap: 10px; }
#loginPass, #loginUser {
  text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 8px;
  padding: 13px 14px; border-radius: 12px; border: 1.5px solid #e2e8f0;
  background: #f8fafc; color: var(--navy); direction: ltr;
  transition: border-color .15s, box-shadow .15s;
}
#loginPass:focus, #loginUser:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(207,17,27,.12); background: #fff; }
#loginUser { margin-bottom: 10px; }
#loginForm button {
  padding: 12px; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #d80007, #b00007); color: #fff;
  font-size: 16px; font-weight: 900; letter-spacing: .5px;
  box-shadow: 0 8px 18px rgba(207,17,27,.3);
  transition: transform .12s, box-shadow .12s;
}
#loginForm button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(207,17,27,.4); }
#loginForm button:active { transform: translateY(0); }
.login-error { color: var(--red); font-weight: 700; font-size: 13px; margin-top: 4px; }
.login-footer { margin-top: 18px; color: #94a3b8; font-size: 11px; }
@keyframes shake { 10%,90%{transform:translateX(-2px)} 20%,80%{transform:translateX(3px)} 30%,50%,70%{transform:translateX(-5px)} 40%,60%{transform:translateX(5px)} }
#loginForm.shake { animation: shake .4s; }
@media print { .login-gate { display: none !important; } }

/* Rows Editor */
.rows-editor { display: grid; gap: 6px; background: #f8fafc; padding: 10px; border-radius: 12px; border: 1px solid #e2e8f0; }
.rows-head { display: grid; grid-template-columns: 28px 110px 1fr 32px; gap: 8px; font-size: 12px; font-weight: 800; color: #64748b; padding: 0 4px; }
.row-edit { display: grid; grid-template-columns: 28px 110px 1fr 32px; gap: 8px; align-items: center; }
.row-edit .row-num { background: var(--navy); color: #fff; border-radius: 8px; width: 28px; height: 32px; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.row-edit input { padding: 8px 10px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; font: inherit; }
.row-edit input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(207,17,27,.12); }
.row-edit .row-del { background: #fee2e2; color: var(--red); border: 0; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-weight: 900; font-size: 14px; transition: background .15s; }
.row-edit .row-del:hover { background: var(--red); color: #fff; }
.rows-editor .row-add { margin-top: 4px; background: #fff; border: 1.5px dashed var(--red); color: var(--red); padding: 9px; border-radius: 10px; cursor: pointer; font-weight: 800; transition: background .15s; }
.rows-editor .row-add:hover { background: var(--red); color: #fff; border-style: solid; }

/* Bid Signature Block */
.bid-signature { margin: 4mm auto 0; width: 96%; display: grid; gap: 2.5mm; }
.sig-price { display: grid; grid-template-columns: 1fr; gap: 2.5mm; }
.sig-price-row { display: grid; grid-template-columns: 28mm 1fr; align-items: end; gap: 4mm; border: 1.2px solid var(--red); border-radius: 10px; padding: 2mm 4mm; min-height: 10mm; }
.sig-price-row .sig-label { font-weight: 900; color: var(--red); font-size: 14px; align-self: center; }
.sig-ack { border: 1.2px solid var(--red); border-radius: 10px; padding: 3mm 5mm; font-size: 12px; line-height: 1.7; text-align: justify; font-weight: 600; color: #1f2937; }
.sig-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.sig-col { display: grid; gap: 2mm; }
.sig-row { display: flex; flex-wrap: nowrap; align-items: end; gap: 3mm; min-height: 7mm; border-bottom: 1.2px dotted #475569; padding-bottom: 0.5mm; }
.sig-row .sig-label { font-weight: 900; color: var(--red); font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.sig-row .sig-line { flex: 1; }
.sig-line { display: block; height: 1px; }

/* Booklets save/load */
.badge { display: inline-block; min-width: 18px; padding: 1px 6px; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 800; margin-inline-start: 4px; }
.badge:empty { display: none; }
.current-booklet { margin: 8px 0 10px; padding: 8px 12px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.cb-label { color: #065f46; font-weight: 700; }
.cb-name { color: #064e3b; font-weight: 900; }

.booklets-panel { display: grid; gap: 10px; }
.booklets-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.booklets-header h3 { margin: 0; color: var(--navy); font-size: 16px; font-weight: 900; }
.booklets-list { display: grid; gap: 10px; }
.empty-state { text-align: center; padding: 30px 20px; color: #64748b; font-size: 14px; }
.booklet-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; transition: background .15s; }
.booklet-item:hover { background: #f1f5f9; }
.booklet-item.is-current { background: #ecfdf5; border-color: #a7f3d0; }
.booklet-name { font-weight: 900; color: var(--navy); font-size: 14px; }
.current-tag { background: #10b981; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 6px; font-weight: 800; margin-inline-start: 4px; }
.booklet-meta { color: #64748b; font-size: 12px; margin-top: 2px; }
.booklet-actions { display: flex; gap: 6px; }
.booklet-actions button { padding: 6px 10px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.booklet-actions button.primary { background: var(--red); color: #fff; border-color: var(--red); }
.booklet-actions button.danger { background: #fff; color: var(--red); border-color: var(--red); }
.booklet-actions button.danger:hover { background: var(--red); color: #fff; }
@media print { .current-booklet { display: none !important; } }
.feature-edit-row { display: grid; gap: 10px; margin-bottom: 10px; padding: 12px; background: #f8fafc; border-radius: 10px; border: 1px solid #e5e7eb; }
.feature-edit-row label { font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 4px; display: block; white-space: nowrap; }
.feature-edit-row .fe-text textarea { width: 100%; box-sizing: border-box; min-height: 60px; resize: vertical; }
.feature-edit-row .fe-controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.feature-edit-row .fe-icon { flex: 1; min-width: 140px; }
.feature-edit-row .fe-icon select { width: 100%; box-sizing: border-box; height: 36px; }
.feature-edit-row .color-dot { position: relative; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 2px #cbd5e1, 0 2px 6px rgba(0,0,0,.1); display: grid; place-items: center; overflow: hidden; align-self: end; }
.feature-edit-row .color-dot span { display: none; }
.feature-edit-row .color-dot input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.feature-edit-row button.danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); border-radius: 50%; width: 38px; height: 38px; padding: 0; font-weight: 900; cursor: pointer; align-self: end; }
.bg-preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 8px; }
.bg-preset { background: #fff; border: 2px solid #e5e7eb; border-radius: 10px; padding: 6px; cursor: pointer; display: grid; gap: 4px; transition: all .15s; }
.bg-preset:hover { border-color: var(--red); transform: translateY(-1px); }
.bg-preset.active { border-color: var(--red); box-shadow: 0 0 0 3px rgba(207,17,27,.15); }
.bg-preset img { width: 100%; aspect-ratio: 1/1.414; object-fit: cover; border-radius: 6px; background: #f8fafc; }
.bg-preset span { font-size: 12px; font-weight: 700; color: var(--navy); text-align: center; }
.logout-btn { background: #fff; color: var(--red); border: 1.5px solid var(--red); font-weight: 800; }
.logout-btn:hover { background: var(--red); color: #fff; }

/* Closing page (mandatory last) - uses page bg like inner pages */
.closing-new .content-layer { padding: 26mm 16mm 38mm; }
.closing-wrap { width: 100%; display: grid; gap: 7mm; text-align: center; }
.closing-hero { display: grid; gap: 3mm; justify-items: center; margin-bottom: 2mm; }
.closing-monogram { width: 22mm; height: 22mm; border-radius: 50%; background: #fff; border: 2px solid var(--red); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(207,17,27,.18); overflow: hidden; }
.closing-monogram img { width: 80%; height: 80%; object-fit: contain; }
.closing-org { font-size: 18px; font-weight: 900; color: var(--navy); }
.closing-org-en { font-size: 11px; font-weight: 700; color: var(--red); letter-spacing: 1px; direction: ltr; }
.closing-divider { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--red); margin: 1mm 0; }
.closing-divider span { display: block; width: 28mm; height: 1.5px; background: linear-gradient(90deg, transparent, var(--red), transparent); }
.closing-title { font-size: 64px; font-weight: 900; color: var(--red); letter-spacing: 3px; line-height: 1; }
.closing-sub { font-size: 15px; font-weight: 700; color: var(--navy); margin-top: -3mm; }
.closing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5mm; margin: 4mm 0 2mm; }
.closing-feat { background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%); border: 1px solid rgba(15,23,42,.08); border-top: 3px solid var(--red); border-radius: 14px; padding: 7mm 3mm; display: grid; gap: 3mm; justify-items: center; box-shadow: 0 6px 14px rgba(15,23,42,.08); }
.closing-feat .cf-circle { width: 14mm; height: 14mm; border-radius: 50%; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(207,17,27,.3); }
.closing-feat .cf-circle svg { width: 8mm; height: 8mm; }
.closing-feat .cf-text { font-size: 13px; font-weight: 800; color: var(--navy); line-height: 1.4; }
.closing-contact-card { background: linear-gradient(160deg, #1f2a52 0%, #131c3d 100%); border-radius: 16px; padding: 6mm 5mm; color: #fff; box-shadow: 0 8px 22px rgba(9,45,61,.25); border-top: 3px solid #c9a250; }
.closing-contact-card .ccc-head { font-size: 14px; font-weight: 900; color: #c9a250; letter-spacing: 2px; margin-bottom: 4mm; }
.closing-contact-card .ccc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4mm 6mm; text-align: right; }
.closing-contact-card .ccc-item { display: flex; align-items: center; gap: 8px; direction: rtl; }
.closing-contact-card .ccc-ic { width: 9mm; height: 9mm; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 3px 8px rgba(207,17,27,.4); }
.closing-contact-card .ccc-ic svg { width: 5mm; height: 5mm; }
.closing-contact-card .ccc-text { display: grid; line-height: 1.2; min-width: 0; flex: 1; }
.closing-contact-card .ccc-lbl { font-size: 9px; font-weight: 700; color: #c9a250; letter-spacing: .5px; }
.closing-contact-card .ccc-val { font-size: 12px; font-weight: 900; color: #fff; direction: ltr; text-align: right; word-break: break-all; }
.closing-greeting { font-size: 13px; font-weight: 800; color: var(--navy); margin-top: 1mm; font-style: italic; }
.closing-social { display: grid; gap: 3mm; justify-items: center; }
.closing-social .cs-head { font-size: 11px; font-weight: 800; color: var(--navy); letter-spacing: 1px; }
.closing-social .cs-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4mm 5mm; direction: rtl; }
.closing-social .cs-item { display: flex; align-items: center; gap: 5px; }
.closing-social .cs-ic { width: 8mm; height: 8mm; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(15,23,42,.15); }
.closing-social .cs-ic svg { width: 4.5mm; height: 4.5mm; }
.closing-social .cs-handle { font-size: 11px; font-weight: 800; color: var(--navy); direction: ltr; }

/* ===== User Guide ===== */
.guide-wrap { display: grid; gap: 16px; padding-bottom: 20px; }
.guide-hero { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: linear-gradient(135deg, #1f2a52, #131c3d); color: #fff; border-radius: 14px; border-top: 3px solid #c9a250; }
.guide-hero-icon { font-size: 38px; }
.guide-hero h2 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.guide-hero p { margin: 0; font-size: 13px; opacity: .85; }
.guide-section { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.guide-num { width: 36px; height: 36px; display: grid; place-items: center; background: var(--red); color: #fff; border-radius: 50%; font-weight: 900; font-size: 16px; }
.guide-content h3 { margin: 0 0 8px; color: var(--navy); font-size: 16px; font-weight: 900; }
.guide-content h4 { margin: 14px 0 6px; color: var(--red); font-size: 13px; font-weight: 800; }
.guide-content p { margin: 0 0 10px; font-size: 13px; color: #334155; line-height: 1.7; }
.guide-tips { margin: 10px 0 0; padding-inline-start: 18px; font-size: 12.5px; color: #475569; line-height: 1.85; }
.guide-tips li { margin-bottom: 3px; }
.guide-tips b { color: var(--navy); }
.guide-steps { margin: 0; padding-inline-start: 18px; font-size: 13px; color: #334155; line-height: 1.9; }
.guide-foot { text-align: center; padding: 14px; font-size: 12px; color: #94a3b8; border-top: 1px dashed #e2e8f0; margin-top: 6px; }
.guide-shot { margin: 10px 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; background: #f8fafc; box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.guide-shot img { display: block; width: 100%; height: auto; }
.guide-shot figcaption { padding: 8px 12px; font-size: 12px; font-weight: 700; color: #475569; background: #fff; border-top: 1px solid #e2e8f0; text-align: center; }

/* Mockup elements */
.mock { background: #f8fafc; border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 12px; margin: 8px 0; display: grid; gap: 8px; }
.mock-card { background: #fff; padding: 16px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.06); text-align: center; max-width: 220px; margin: 0 auto; }
.mock-title { font-weight: 900; color: var(--navy); margin-bottom: 10px; font-size: 13px; }
.mock-input { background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 10px; font-size: 12px; color: #1e293b; text-align: start; }
.mock-input.small { padding: 4px 8px; font-size: 11px; }
.mock-btn { display: inline-block; padding: 6px 12px; border-radius: 8px; background: #e2e8f0; color: #475569; font-size: 12px; font-weight: 700; }
.mock-btn.primary { background: var(--red); color: #fff; }
.mock-btn.danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.mock-btn.small { padding: 3px 8px; font-size: 11px; }
.mock-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.mock-form .mock-field { display: grid; gap: 4px; }
.mock-form label { font-size: 11px; color: var(--red); font-weight: 800; }
.mock-pages .mock-page-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; color: #334155; }
.mock-chip { background: #1f2a52; color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.mock-chip.alt { background: var(--red); }
.mock-mini-btns { margin-inline-start: auto; color: #94a3b8; font-size: 11px; }
.mock-add { padding: 8px; text-align: center; border: 1.5px dashed var(--red); color: var(--red); border-radius: 8px; font-size: 12px; font-weight: 800; }
.mock-table { font-family: monospace; font-size: 11px; }
.mock-th { background: var(--navy); color: #fff; padding: 6px 10px; border-radius: 6px; font-weight: 800; }
.mock-tr { padding: 5px 10px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.mock-row-header { display: grid; grid-template-columns: 30px 1fr 1fr 30px; gap: 6px; padding: 6px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 800; border-radius: 6px; }
.mock-row { display: grid; grid-template-columns: 30px 1fr 1fr 30px; gap: 6px; align-items: center; padding: 4px; }
.mock-x { color: var(--red); text-align: center; font-weight: 800; }
.mock-signature { background: #fff; border: 1px solid var(--red); }
.mock-sig-row { padding: 6px 8px; border: 1px solid #fecaca; border-radius: 6px; font-size: 12px; }
.mock-sig-ack { padding: 8px; border: 1px solid #fecaca; border-radius: 6px; font-size: 11.5px; line-height: 1.7; color: #475569; }
.mock-sig-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11.5px; color: #475569; }
.mock-identity { display: grid; gap: 10px; }
.mock-color { width: 100%; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.1); }
.mock-upload { background: #fff; border: 1.5px dashed #cbd5e1; padding: 10px; text-align: center; border-radius: 8px; font-size: 12px; color: #64748b; }
.mock-save-btn { background: var(--red); color: #fff; padding: 8px 12px; border-radius: 8px; text-align: center; font-weight: 800; font-size: 12px; }
.mock-booklet-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 11.5px; gap: 8px; }
.mock-booklet-item.current { background: #ecfdf5; border-color: #a7f3d0; }
.mock-tag { background: #10b981; color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 4px; font-weight: 800; }
.mock-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; }
.flow-item { background: var(--navy); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700; }
.flow-item.closing { background: var(--red); }
.flow-arrow { color: #94a3b8; font-weight: 800; }
.guide-download { padding: 14px; background: linear-gradient(135deg, #fff7ed, #fef3c7); border: 1.5px solid var(--gold, #c9a250); border-radius: 12px; text-align: center; }
.guide-pdf-btn { display: inline-block; background: var(--red); color: #fff !important; padding: 10px 18px; border-radius: 10px; font-weight: 800; text-decoration: none; font-size: 14px; }
.guide-pdf-btn:hover { background: var(--navy); }
.guide-download .hint { margin: 8px 0 0; color: #92400e; font-weight: 600; }

.footer-row { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #f8fafc; }
.footer-row-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.footer-row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.footer-row-actions button { padding: 4px 10px; font-size: 13px; }
.footer-row-actions .check-line { font-size: 12px; font-weight: 600; }
.footer-row .field { margin: 6px 0; }
.card-editor code { background: #fef3c7; padding: 1px 6px; border-radius: 4px; font-size: 12px; color: #92400e; }

.section-card { background: #fafbfc; border: 1px dashed #cbd5e1; }
.section-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 6px; }
.section-card-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.section-card-actions button { padding: 3px 9px; font-size: 12px; }

.page-ack { margin: 5mm 6mm 0; padding: 4mm; border: 1.5px solid var(--red); border-radius: 4mm; background: #fff7f7; page-break-inside: avoid; }
.page-ack .page-ack-text { font-size: 12.5px; line-height: 1.7; color: #1f2937; margin-bottom: 4mm; font-weight: 600; }
.page-ack .sig-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm 8mm; align-items: start; }
.page-ack .sig-col { display: grid; grid-auto-rows: 9mm; gap: 3mm; }
.page-ack .sig-row { display: grid; grid-template-columns: 42mm 1fr; align-items: end; gap: 2mm; min-height: 9mm; border-bottom: 1.2px dotted #475569; padding-bottom: 0.5mm; }
.page-ack .sig-row .sig-label { font-weight: 900; color: var(--red); font-size: 13px; white-space: nowrap; text-align: start; }
.page-ack .sig-row .sig-line { display: block; }
.page-ack .sig-stamp { min-height: 9mm; }

.add-page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.add-page-actions button { flex: 1; min-width: 180px; }

.page-ack-note { margin-top: 4mm; padding: 2mm 3mm; background: #fef3c7; border-inline-start: 3px solid #d97706; border-radius: 2mm; font-size: 11.5px; font-weight: 700; color: #92400e; text-align: center; }

/* === Social Media Posts Modal === */
.social-modal { position: fixed; inset: 0; background: rgba(15,23,42,.92); z-index: 9999; display: flex; flex-direction: column; }
.social-modal[hidden] { display: none; }
.social-modal-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 18px; background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.social-modal-bar strong { font-size: 17px; }
.social-modal-bar .social-hint { color: #cbd5e1; font-size: 13px; flex: 1; min-width: 200px; }
.social-modal-bar button { padding: 8px 16px; border-radius: 8px; border: 0; cursor: pointer; font-weight: 800; font-family: inherit; }
.social-modal-bar button.primary { background: var(--red); color: #fff; }
.social-modal-bar button.danger { background: #fff; color: var(--red); }
.social-grid { flex: 1; overflow: auto; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; align-content: start; }
.social-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); display: flex; flex-direction: column; gap: 10px; }
.social-card-head { display: flex; justify-content: space-between; align-items: center; }
.social-card-head h3 { margin: 0; font-size: 15px; color: var(--navy); }
.social-card-head .dims { font-size: 12px; color: #64748b; font-weight: 700; }
.social-canvas-wrap { background: #0f172a; border-radius: 8px; overflow: hidden; position: relative; }
.social-canvas-frame { position: relative; transform-origin: top right; }
.social-card button.download-social { background: var(--red); color: #fff; border: 0; padding: 9px; border-radius: 8px; cursor: pointer; font-weight: 800; font-family: inherit; }
.social-card button.download-social:hover { background: var(--navy); }
.social-card button.download-social:disabled { opacity: .6; cursor: wait; }
.social-card button.download-video { background: linear-gradient(135deg, #cf111b, #14224a); }
.social-card button.download-video:hover { background: linear-gradient(135deg, #14224a, #cf111b); }
.social-section-title { grid-column: 1 / -1; color: #fff; font-size: 18px; font-weight: 900; padding: 14px 4px 6px; border-bottom: 2px solid rgba(255,255,255,.15); margin-bottom: 4px; }
.video-fmt-group { border: 2px solid #cf111b; }
.video-badge { display: inline-block; background: #cf111b; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; margin-inline-start: 6px; font-weight: 800; vertical-align: middle; }
.social-canvas-wrap { position: relative; }
.video-play-badge { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; color: rgba(255,255,255,.92); text-shadow: 0 4px 16px rgba(0,0,0,.6); pointer-events: none; }
.video-combined-card { width: 100%; }
.scene-list { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 4px 4px; max-height: 90px; overflow-y: auto; }
.scene-chip { display: inline-block; background: rgba(201,162,80,.18); color: #c9a250; border: 1px solid rgba(201,162,80,.4); font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 700; }
.ct-scene .ct-row { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.06); padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(4px); }
.ct-scene .ct-ic { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; font-weight: 900; }
.ct-scene .sp-accent-top, .ct-scene .sp-accent-bot { position: absolute; left: 0; right: 0; height: 6px; }
.ct-scene .sp-accent-top { top: 0; }
.ct-scene .sp-accent-bot { bottom: 0; }

/* === Owner notes box (organizer preview) === */
.owner-note-box { position: relative; z-index: 20; margin: 0 0 6mm 0; padding: 10px 12px; background: linear-gradient(135deg, #fff8e1, #fff3c4); border: 2px dashed #c9a250; border-radius: 10px; box-shadow: 0 4px 14px rgba(201,162,80,.25); font-family: inherit; }
.owner-note-box .onb-head { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 13px; color: #7a5c10; margin-bottom: 6px; }
.owner-note-box .onb-icon { font-size: 16px; }
.owner-note-box .onb-item { background: #fff; border: 1px solid #f2d98f; border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.owner-note-box .onb-text { color: #1f2937; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.owner-note-box .onb-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.owner-note-box .onb-ts { font-size: 10px; color: #92732a; }
.owner-note-box .onb-del { background: #fee2e2; color: #cf111b; border: 1px solid #fecaca; border-radius: 6px; padding: 3px 10px; font-size: 11px; font-weight: 800; cursor: pointer; font-family: inherit; }
.owner-note-box .onb-del:hover { background: #cf111b; color: #fff; border-color: #cf111b; }
@media print { .owner-note-box { display: none !important; } }
body.review-mode .owner-note-box { display: none !important; }
.review-page-card.rpc-readonly { opacity: .75; }
.review-page-card .rpc-readonly-note { background: rgba(201,162,80,.15); color: #c9a250; border: 1px dashed #c9a250; border-radius: 6px; padding: 8px 10px; font-size: 11px; font-weight: 700; text-align: center; }

/* Hide review sidebar entirely outside review mode */
body:not(.review-mode) #reviewSidebar,
body:not(.review-mode) .review-sidebar,
body:not(.review-mode) .review-sidebar-toggle { display: none !important; }

/* === Review mode === */
body.review-mode .builder-panel,
body.review-mode .app-hub,
body.review-mode .hub-section,
body.review-mode .hub-top { display: none !important; }
body.review-mode { display: grid !important; grid-template-columns: 1fr 340px; min-height: 100vh; }
body.review-mode.review-collapsed { grid-template-columns: 1fr 36px; }
body.review-mode .preview-wrap { display: block !important; grid-column: 1; margin: 0 !important; padding: 16px; box-sizing: border-box; overflow: auto; text-align: center; }
body.review-mode .preview-toolbar { display: inline-flex !important; width: auto !important; max-width: none !important; margin: 0 auto 14px !important; }
body.review-mode .document-preview { display: inline-grid !important; gap: 26px; margin: 0 auto !important; justify-content: center; vertical-align: top; }
body.review-mode .document-preview .page { transform-origin: top center; transform: scale(0.72); margin-bottom: calc(-297mm * 0.28) !important; }
@media (min-width: 1500px) { body.review-mode .document-preview .page { transform: scale(0.95); margin-bottom: calc(-297mm * 0.05) !important; } }
@media (min-width: 1750px) { body.review-mode .document-preview .page { transform: none; margin-bottom: 0 !important; } }
body.review-mode.review-collapsed .document-preview .page { transform: none; margin-bottom: 0 !important; }
.review-sidebar { grid-column: 2; }
body.review-mode .preview-toolbar { background: #14224a; color: #fff; padding: 12px 18px; border-radius: 10px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
body.review-mode .preview-toolbar strong { color: #c9a250; }

.review-sidebar { position: sticky; top: 0; align-self: start; width: 340px; height: 100vh; background: #0d1736; color: #fff; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.4); z-index: 50; transition: transform .25s ease; grid-column: 2; }
body.review-collapsed .review-sidebar { width: 36px; }
.review-sidebar-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.review-sidebar-toggle { position: absolute; top: 50%; left: -18px; transform: translateY(-50%); width: 36px; height: 56px; border-radius: 10px 0 0 10px; background: #c9a250; color: #14224a; border: 0; font-size: 22px; font-weight: 900; cursor: pointer; box-shadow: -3px 3px 10px rgba(0,0,0,.35); z-index: 51; display: grid; place-items: center; transition: transform .25s ease; }
.review-sidebar-toggle:hover { background: #d8b365; }
body.review-collapsed .review-sidebar .review-sidebar-inner { opacity: 0; pointer-events: none; }
body.review-collapsed .review-sidebar-toggle { transform: translateY(-50%) rotate(180deg); }
.review-side-head { padding: 14px 16px; background: linear-gradient(135deg,#14224a,#0d1736); border-bottom: 2px solid #c9a250; }
.review-side-head strong { display: block; font-size: 16px; color: #c9a250; }
.review-side-sub { display: block; font-size: 11px; opacity: .8; margin-top: 4px; }
.review-side-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.review-sidebar * { box-sizing: border-box; }
.review-page-card { background: rgba(255,255,255,.06) !important; border: 1px solid rgba(201,162,80,.25); border-radius: 10px; padding: 10px; color: #fff; }
.review-page-card .rpc-head { background: transparent !important; }
.review-page-card .rpc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
.review-page-card .rpc-num { background: #cf111b; color: #fff; font-weight: 900; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.review-page-card .rpc-title { font-size: 12px; font-weight: 700; flex: 1; text-align: right; color: #fff; }
.review-page-card textarea { width: 100%; min-height: 60px; max-height: 160px; padding: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.3); color: #fff; border-radius: 6px; font-size: 12px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.review-page-card textarea:focus { outline: none; border-color: #c9a250; }
.review-page-card .rpc-prev { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.review-page-card .rpc-prev-note { font-size: 11px; background: rgba(201,162,80,.12); border-right: 3px solid #c9a250; padding: 5px 8px; border-radius: 4px; opacity: .9; }
.review-send-btn { margin: 12px; padding: 12px; font-size: 15px; font-weight: 800; }

body.review-mode .document-preview .page-controls,
body.review-mode .document-preview [data-edit] { display: none !important; }
body.review-mode .document-preview .page { pointer-events: none; }

.review-link-body { padding: 18px; }
.review-hint { color: #fff; font-size: 13px; margin-bottom: 12px; opacity: .9; }
.review-link-row { display: flex; gap: 8px; }
.review-link-row input { flex: 1; padding: 10px; border: 2px solid #c9a250; border-radius: 8px; font-size: 13px; direction: ltr; background: #fff; color: #14224a; font-family: monospace; }
.review-status { margin-top: 10px; font-size: 13px; color: #c9a250; min-height: 18px; }

.owner-notes-body { padding: 18px; overflow-y: auto; max-height: calc(100vh - 80px); }
.owner-note-group { background: #fff; color: #14224a; border-radius: 10px; padding: 14px; margin-bottom: 12px; border-right: 4px solid #cf111b; }
.owner-note-group h4 { margin: 0 0 10px; font-size: 15px; color: #14224a; display: flex; gap: 8px; align-items: center; }
.owner-note-group .ong-num { background: #cf111b; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 900; }
.owner-note-item { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.owner-note-item .oni-text { flex: 1; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.owner-note-item .oni-ts { font-size: 10px; opacity: .6; margin-bottom: 4px; }
.owner-note-item button { background: #cf111b; color: #fff; border: none; padding: 4px 10px; border-radius: 6px; font-size: 11px; cursor: pointer; font-weight: 700; }
.owner-notes-empty { color: #c9a250; text-align: center; padding: 40px 20px; font-size: 15px; }

/* The actual social post — drawn at real pixel dimensions, scaled visually */
.sp { position: relative; overflow: hidden; color: var(--navy); font-family: 'Tajawal', 'Cairo', sans-serif; direction: rtl; }
.sp-bg { position: absolute; inset: 0; background: #ffffff; }
.sp-bg::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at top right, rgba(207,17,27,.10), transparent 55%), radial-gradient(ellipse at bottom left, rgba(9,45,61,.08), transparent 55%); }
.sp-accent-top { position: absolute; top: 0; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, var(--red), #d4af37, var(--red)); }
.sp-accent-bot { position: absolute; bottom: 0; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, var(--red), #d4af37, var(--red)); }
.sp-content { position: relative; height: 100%; display: flex; flex-direction: column; box-sizing: border-box; }
.sp-content-h .sp-h-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.sp-content-h .sp-h-mid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: 0; }
.sp-content-h .sp-h-left { display: flex; flex-direction: column; justify-content: center; }
.sp-content-h .sp-h-right { display: flex; align-items: center; }
.sp-content-h .sp-h-right .sp-dates { width: 100%; }
.sp-logo { display: flex; align-items: center; gap: 12px; }
.sp-logo img { object-fit: contain; background: transparent; border: 0; border-radius: 0; padding: 0; mix-blend-mode: multiply; }
.sp-logo .sp-org { font-weight: 900; color: var(--navy); line-height: 1.2; }
.sp-logo .sp-org small { display: block; color: #64748b; font-weight: 600; }
.sp-type { display: inline-block; background: linear-gradient(135deg, var(--red), #940b08); color: #fff; padding: 8px 20px; border-radius: 999px; font-weight: 900; align-self: center; box-shadow: 0 4px 12px rgba(207,17,27,.35); white-space: nowrap; flex-shrink: 0; }
.sp-h-top { flex-wrap: wrap; }
.sp-h-top .sp-logo { min-width: 0; flex-shrink: 1; }
.sp-h-top .sp-org { min-width: 0; }
.sp-title-band { background: var(--navy); border: 2px solid #d4af37; border-radius: 14px; padding: 18px 24px; text-align: center; }
.sp-title-band .sp-company { color: #fff; font-weight: 900; line-height: 1.2; }
.sp-dates { display: grid; gap: 12px; }
.sp-date { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 12px 16px; text-align: center; }
.sp-date h4 { margin: 0 0 6px; color: var(--red); font-weight: 900; }
.sp-date .day { color: var(--navy); font-weight: 900; }
.sp-date .date { color: #334155; font-weight: 700; }
.sp-date .date .yr { color: #94a3b8; }
.sp-foot { display: flex; justify-content: space-between; align-items: center; color: var(--navy); font-weight: 800; gap: 12px; flex-wrap: wrap; border-top: 2px solid #e2e8f0; padding-top: 10px; }
.sp-foot .sp-web { color: var(--red); }
.sp-features { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sp-feature { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; min-width: 80px; }
.sp-feature .ic { display: grid; place-items: center; background: var(--red); border-radius: 50%; }
.sp-feature .ic svg { stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sp-feature .lbl { color: #092d3d !important; font-weight: 800; text-align: center; line-height: 1.2; opacity: 1; }
.sp-social { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; color: #092d3d; font-weight: 800; width: 100%; row-gap: 6px; }
.sp-social-item { display: inline-flex; align-items: center; gap: 5px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 4px 8px; white-space: nowrap; flex-shrink: 0; }
.sp-social-ic { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 900; line-height: 1; flex-shrink: 0; overflow: hidden; }
.sp-social-ic svg { width: 100%; height: 100%; display: block; }
.social-fmt-group { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.social-fmt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.social-fmt-head h3 { margin: 0; color: var(--navy); font-size: 18px; }
.social-fmt-head .dims { color: #64748b; font-weight: 700; font-size: 13px; }
.social-fmt-head .variant-count { background: var(--red); color: #fff; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 12px; }
.social-variant-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.social-card-sub { font-weight: 800; color: var(--navy); text-align: center; padding: 4px 8px; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; margin-bottom: 8px; font-size: 13px; }
.sp-photos { width: 100%; }
.sp-photo { background-size: cover; background-position: center; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); min-height: 0; }
.client-logo { position: absolute; top: 7mm; right: 12mm; z-index: 3; display: flex; align-items: center; gap: 6px; direction: rtl; color: var(--navy); }
.client-logo .cl-name { order: 2; }
.client-logo img { order: 1; }
.client-logo img { max-width: 28mm; max-height: 18mm; object-fit: contain; background: transparent; }
.client-logo .cl-name { line-height: 1.05; font-weight: 900; font-size: 9px; white-space: nowrap; }
.client-logo-cover { top: 10mm; right: 10mm; display: block; text-align: center; }
.client-logo-cover img { max-width: 42mm; max-height: 26mm; display: block; margin: auto; }
.client-logo-cover .cl-name { margin-top: 3px; font-size: 12px; line-height: 1.15; white-space: normal; }
.sp-client img { object-fit: contain; background: transparent; border-radius: 8px; padding: 4px; mix-blend-mode: multiply; }

/* Developer-only zone */
.dev-zone { margin: 24px 0 12px; padding: 14px 16px; background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%); border: 2px dashed #c9a250; border-radius: 12px; }
.dev-zone-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.dev-zone-icon { font-size: 24px; flex-shrink: 0; }
.dev-zone-head strong { display: block; font-size: 14px; color: #8b6914; font-weight: 900; margin-bottom: 4px; }
.dev-zone-head p { font-size: 11px; color: #6b5410; line-height: 1.5; margin: 0; }
.dev-zone-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-zone-actions button, .dev-zone-actions .ghost-upload { font-size: 12px; padding: 6px 12px; }
