/* ══════════════════════════════════════════════════════════════
   منصة خريطتي — styles.css
   Exact theme from شبكات التنقيط page
   Primary  : #0f3460
   Accent   : #00b4d8
   Page BG  : #f0f4f8
   Font     : Cairo
══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: #f0f4f8;
  direction: rtl;
  color: #1e293b;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   NAVBAR  — exact copy from .navbar in شبكات
══════════════════════════════════════════════════════════════ */
.navbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(15,52,96,.07);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f3460, #00b4d8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,180,216,.30);
  overflow: hidden;
}

.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-brand-text {
  font-size: 19px;
  font-weight: 800;
  color: #0f3460;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* exact .nav-link from شبكات */
.nav-link {
  padding: 7px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: all .18s;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  background: #f0f9ff;
  color: #0f3460;
}

/* active state — exact from شبكات .nav-link.active */
.nav-link.active {
  background: linear-gradient(135deg, rgba(15,52,96,.08), rgba(0,180,216,.08));
  color: #0f3460;
  border-color: rgba(0,180,216,.2);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f3460;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  display: block;
}

.nav-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  outline: 2px solid transparent;
  transition: outline-color .18s;
}

.nav-avatar-btn:hover { outline-color: #00b4d8; }

.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: block;
}

/* mobile hamburger */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: #64748b;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background .18s, color .18s;
  font-family: 'Cairo', sans-serif;
}

.mobile-menu-btn:hover { background: #f0f9ff; color: #0f3460; }

/* nav-menu transitions */
#nav-menu { transition: max-height .3s ease-in-out, opacity .3s ease-in-out; }
.mobile-menu-hidden { max-height: 0; opacity: 0; pointer-events: none; overflow: hidden; }
.mobile-menu-visible { max-height: 700px; opacity: 1; pointer-events: auto; }

@media (min-width: 768px) {
  .mobile-menu-hidden {
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: visible !important;
    display: flex !important;
  }
  .mobile-menu-btn { display: none !important; }
  .nav-user { display: flex !important; }
}

/* ── Reports dropdown — exact from شبكات ── */
.reports-dropdown { position: relative; }

.reports-dropdown-menu {
  transition: opacity .2s ease, transform .2s ease;
  transform-origin: top right;
}
.reports-dropdown-menu.dropdown-closed {
  opacity: 0;
  transform: scale(.95) translateY(-5px);
  pointer-events: none;
}
.reports-dropdown-menu.dropdown-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
@media (min-width: 768px) {
  .reports-dropdown:hover .reports-dropdown-menu {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto !important;
  }
}

.report-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: all .2s;
  border-right: 3px solid transparent;
  text-decoration: none;
  color: #374151;
}
.report-item:hover {
  background: linear-gradient(to left, #eff6ff, #fff);
  border-right-color: #00b4d8;
  padding-right: 20px;
}
.report-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .navbar { padding: 0 16px; height: auto; min-height: 60px; }
  .mobile-menu-btn { display: flex !important; align-items: center; justify-content: center; }
  .nav-user { display: none; }

  #nav-menu {
    position: absolute;
    top: 60px;
    left: 12px;
    right: 12px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 30px rgba(15,52,96,.12);
    padding: 12px;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
  }

  #nav-menu .nav-link {
    padding: 11px 14px;
    width: 100%;
    font-size: 14px;
  }

  .reports-dropdown-mobile-open .reports-dropdown-menu {
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    margin-top: 4px;
  }
  .chevron-icon { transition: transform .2s ease; }
  .reports-dropdown-mobile-open .chevron-icon { transform: rotate(180deg); }
}

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER HERO — exact from .page-header in شبكات
══════════════════════════════════════════════════════════════ */
.page-header {
  background: linear-gradient(135deg, #0f3460 0%, #1a4a7a 50%, #0f3460 100%);
  padding: 40px 32px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2300b4d8' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/svg%3E");
}

/* curved bottom cutout — exact from شبكات */
.page-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 32px;
  background: #f0f4f8;
  clip-path: ellipse(55% 100% at 50% 100%);
}

.page-header-content { position: relative; z-index: 1; }

.page-header h1 {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -.3px;
}

.page-header p {
  font-size: 14px;
  color: rgba(255,255,255,.78);
  max-width: 520px;
  margin: 0 auto 16px;
  line-height: 1.75;
}

/* tip strip inside hero — exact from .header-tip */
.header-tip {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(0,180,216,.18);
  border: 1px solid rgba(0,180,216,.3);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  max-width: 600px;
  text-align: right;
  line-height: 1.6;
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
}
.header-tip i { color: #00b4d8; flex-shrink: 0; font-size: 15px; margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════════════════ */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════════
   WIZARD CARD
   Same look as the white A4 card area in شبكات (sidebar panel)
══════════════════════════════════════════════════════════════ */
#wizard {
  background: #fff;
  width: 100%;
  max-width: 900px;
  border-radius: 2.5rem;
  box-shadow: 0 8px 40px rgba(15,52,96,.10);
  padding: 40px 48px;
  border: 1px solid rgba(255,255,255,.9);
  animation: fadeInUp .55s cubic-bezier(.16,1,.3,1) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Wizard header text */
.wizard-header {
  text-align: center;
  margin-bottom: 36px;
}
.wizard-header h2 {
  font-size: 24px;
  font-weight: 900;
  color: #0f3460;
  margin-bottom: 8px;
  letter-spacing: -.2px;
}
.wizard-header p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
}

/* section divider inside wizard */
.wizard-divider {
  border: none;
  border-top: 1.5px solid #f1f5f9;
  margin: 28px 0;
}

/* ══════════════════════════════════════════════════════════════
   STEP INDICATORS  — matches sidebar-section in شبكات
══════════════════════════════════════════════════════════════ */
.step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

/* active — exact .step-indicator.active */
.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  transition: all .25s;
}
.step-indicator.active {
  background: #00b4d8;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0,180,216,.20);
}
.step-indicator.inactive {
  background: #e2e8f0;
  color: #94a3b8;
}

.step-title {
  font-size: 17px;
  font-weight: 800;
  transition: color .25s;
}
.step-title.active  { color: #0f3460; }
.step-title.inactive { color: #94a3b8; }

/* ══════════════════════════════════════════════════════════════
   TELMIDTICE ACCORDION
   Matches .sidebar-section card style from شبكات
══════════════════════════════════════════════════════════════ */
#talamid-instructions {
  margin-bottom: 28px;
  border-radius: 16px;
  background: linear-gradient(to left, #f8fafc, #fff);
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15,52,96,.05);
}

#talamid-toggle-btn {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background .2s;
}
#talamid-toggle-btn:hover { background: rgba(0,180,216,.05); }

.talamid-toggle-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.talamid-toggle-inner img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.talamid-toggle-inner h4 {
  font-size: 14px;
  font-weight: 800;
  color: #0f3460;
  margin-bottom: 2px;
}
.talamid-toggle-inner .talamid-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #00b4d8;
}

#talamid-toggle-icon {
  font-size: 14px;
  color: #94a3b8;
  transition: transform .3s;
}

#talamid-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease-in-out;
  border-top: 1px solid #f1f5f9;
  background: rgba(248,250,252,.6);
}
#talamid-content .talamid-inner {
  padding: 18px 20px;
  font-size: 13px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#talamid-content .talamid-inner strong {
  font-weight: 800;
  color: #0f3460;
  display: block;
  margin-bottom: 6px;
}

/* path code block — matches .add-col-row style from شبكات */
.path-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.path-code {
  flex: 1;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #0f3460;
  direction: ltr;
  min-width: 0;
}

/* copy button — exact same as .add-col-row button from شبكات */
.btn-copy {
  padding: 8px 14px;
  background: linear-gradient(135deg, #0f3460, #00b4d8);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,180,216,.25);
}
.btn-copy:hover {
  background: linear-gradient(135deg, #0b2847, #0095b3);
  box-shadow: 0 4px 12px rgba(0,180,216,.35);
  transform: translateY(-1px);
}
.btn-copy.copied {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  font-family: 'Cairo', sans-serif;
}

.talamid-inner .run-imgs {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  opacity: .75;
}
.talamid-inner .run-imgs img {
  height: 60px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* ══════════════════════════════════════════════════════════════
   FILE UPLOAD DROP ZONE
   Exact copy of .upload-zone from شبكات
══════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  color: #94a3b8;
  background: #fafbfc;
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #00b4d8;
  background: rgba(0,180,216,.04);
  color: #00b4d8;
}

.upload-icon-wrap {
  width: 64px;
  height: 64px;
  background: #e0f2fe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  transition: transform .3s;
}
.upload-zone:hover .upload-icon-wrap { transform: scale(1.08); }
.upload-icon-wrap i { font-size: 28px; color: #00b4d8; }

.upload-zone .upload-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f3460;
  margin-bottom: 4px;
}
.upload-zone .upload-formats {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}
#file-name {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #00b4d8;
  min-height: 18px;
}

/* ══════════════════════════════════════════════════════════════
   ANALYSIS PROGRESS
   Exact copy of .progress-wrap / .progress-bar-bg from شبكات
══════════════════════════════════════════════════════════════ */
#analysis-result {
  margin-top: 18px;
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px 18px;
  border: 1.5px solid #e2e8f0;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
}

.progress-bg {
  background: #e2e8f0;
  border-radius: 8px;
  height: 6px;
  overflow: hidden;
}

/* exact .progress-bar-fill from شبكات */
#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0f3460, #00b4d8);
  border-radius: 8px;
  transition: width .4s ease;
  width: 0%;
}

/* OCR sub-bar */
#ocr-progress-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.ocr-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
#ocr-language-select {
  font-family: 'Cairo', sans-serif;
  font-size: 11px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px 8px;
  outline: none;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: border-color .18s;
}
#ocr-language-select:focus { border-color: #00b4d8; }

#ocr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 8px;
  transition: width .2s linear;
  width: 0%;
}

/* ══════════════════════════════════════════════════════════════
   GENERATE BUTTON — exact copy of .download-btn from شبكات
══════════════════════════════════════════════════════════════ */
#generate-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0f3460, #00b4d8);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(0,180,216,.35);
  position: relative;
  overflow: hidden;
}
#generate-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.10), transparent);
}
#generate-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #0b2847, #0095b3);
  box-shadow: 0 6px 20px rgba(0,180,216,.45);
  transform: translateY(-2px);
}
#generate-btn:not(:disabled):active { transform: scale(.98); }
#generate-btn:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
#generate-btn i { font-size: 18px; color: #00f2ff; }

/* spinner — exact .btn-spinner from شبكات */
.loader {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* View maps button */
#view-maps-container { margin-top: 10px; }

#view-maps-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 800;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(16,185,129,.30);
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
#view-maps-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent);
}
#view-maps-btn:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 6px 20px rgba(16,185,129,.40);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════
   PROFILE MODAL — exact visual from شبكات profile panel
══════════════════════════════════════════════════════════════ */
#profile-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  background: rgba(0,0,0,.40);
  backdrop-filter: blur(4px);
}
#profile-modal.hidden { display: none; }

.profile-modal-card {
  background: #fff;
  border-radius: 2.5rem;
  box-shadow: 0 20px 60px rgba(15,52,96,.18);
  width: 100%;
  max-width: 400px;
  margin: 72px 20px 0;
  overflow: hidden;
  animation: popIn .28s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.92) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* dark blue header — exact from .sheet-header-bar gradient */
.profile-modal-header {
  background: linear-gradient(135deg, #0f3460 0%, #1a4a7a 100%);
  padding: 32px 28px 28px;
  text-align: center;
  position: relative;
}
.profile-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: rgba(255,255,255,.50);
  font-size: 18px;
  cursor: pointer;
  transition: color .18s;
  padding: 4px 6px;
  border-radius: 8px;
}
.profile-modal-close:hover { color: #fff; background: rgba(255,255,255,.10); }

.profile-modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(0,180,216,.50);
  box-shadow: 0 4px 16px rgba(0,0,0,.20);
  margin: 0 auto 12px;
  display: block;
}
.profile-modal-name {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.profile-modal-academy {
  font-size: 13px;
  font-weight: 700;
  color: #00b4d8;
}

.profile-modal-body { padding: 24px 28px 28px; }

/* ── TIP CARD — exact from شبكات .tip-card ── */
.tip-card {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 1.25rem;
  padding: 1.25rem;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.tip-card::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(251,191,36,.20), transparent 70%);
  border-radius: 50%;
}
.tip-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tip-card-head i { color: #f59e0b; font-size: 16px; }
.tip-card-head strong { font-size: 13px; font-weight: 800; color: #92400e; }
.tip-card-head .tip-date { margin-right: auto; font-size: 10px; font-weight: 700; color: #b45309; }
.tip-card-quote {
  font-style: italic;
  font-weight: 600;
  color: #78350f;
  line-height: 1.85;
  font-size: .95rem;
  position: relative;
  z-index: 1;
}
.tip-card-source {
  text-align: left;
  font-size: .75rem;
  color: #b45309;
  margin-top: 8px;
  font-weight: 700;
}

/* ── Modal action buttons — exact from شبكات ── */
.modal-actions { display: flex; flex-direction: column; gap: 10px; }

/* upgrade = same as .download-btn */
.btn-upgrade {
  display: block;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0f3460, #00b4d8);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(0,180,216,.30);
  position: relative;
  overflow: hidden;
}
.btn-upgrade::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.10), transparent);
}
.btn-upgrade:hover {
  background: linear-gradient(135deg, #0b2847, #0095b3);
  box-shadow: 0 6px 20px rgba(0,180,216,.40);
  transform: translateY(-2px);
}

.btn-admin {
  display: block;
  width: 100%;
  padding: 12px;
  background: #1e293b;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s;
}
.btn-admin:hover { background: #0f172a; }

.btn-logout {
  display: block;
  width: 100%;
  padding: 12px;
  background: none;
  border: 2px solid #fee2e2;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #ef4444;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s;
}
.btn-logout:hover { background: #fef2f2; border-color: #fca5a5; }

/* ══════════════════════════════════════════════════════════════
   CREDIT MODAL — exact from شبكات
══════════════════════════════════════════════════════════════ */
#credit-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(5px);
}
#credit-modal.hidden { display: none; }

.credit-modal-card {
  background: #fff;
  border-radius: 2rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  width: 100%;
  max-width: 420px;
  margin: 0 20px;
  padding: 36px 32px;
  text-align: center;
  animation: popIn .28s cubic-bezier(.34,1.56,.64,1) both;
}
.credit-modal-icon {
  width: 80px;
  height: 80px;
  background: #fef3c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 0 8px #fef9e7;
}
.credit-modal-icon i { font-size: 36px; color: #f59e0b; }
.credit-modal-title {
  font-size: 22px;
  font-weight: 900;
  color: #0f3460;
  margin-bottom: 8px;
}
.credit-modal-body {
  font-size: 14px;
  color: #64748b;
  line-height: 1.75;
  margin-bottom: 24px;
}
.credit-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 420px) {
  .credit-modal-actions { flex-direction: row; justify-content: center; }
}

.btn-subscribe {
  flex: 1;
  padding: 13px 20px;
  background: linear-gradient(135deg, #0f3460, #00b4d8);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(0,180,216,.28);
}
.btn-subscribe:hover { box-shadow: 0 6px 20px rgba(0,180,216,.40); transform: translateY(-2px); }

.btn-dismiss {
  flex: 1;
  padding: 12px 20px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}
.btn-dismiss:hover { background: #e2e8f0; }

/* ══════════════════════════════════════════════════════════════
   FOOTER — exact copy from شبكات .footer
══════════════════════════════════════════════════════════════ */
.site-footer {
  background: #0f172a;
  color: #64748b;
  padding: 44px 32px 24px;
  direction: rtl;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px;
}
.footer-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f3460, #00b4d8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,180,216,.3);
  overflow: hidden;
}
.footer-logo img { width: 100%; height: 100%; object-fit: contain; }
.footer-logo-text { font-size: 18px; font-weight: 900; color: #00b4d8; }
.footer-desc { font-size: 13px; line-height: 1.8; color: #475569; }
.footer-col h4 { font-size: 14px; font-weight: 700; color: #f1f5f9; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col ul li a {
  font-size: 13px;
  color: #475569;
  text-decoration: none;
  transition: color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-col ul li a::before { content: '←'; font-size: 11px; opacity: .4; }
.footer-col ul li a:hover { color: #00b4d8; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  text-align: center;
  font-size: 12.5px;
  color: #334155;
}
.footer-bottom a { color: #00b4d8; text-decoration: none; font-weight: 700; }

@media (max-width: 767px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ══════════════════════════════════════════════════════════════
   TOOLS SECTION — exact copy from شبكات .tools-section
══════════════════════════════════════════════════════════════ */
.tools-section {
  background: #fff;
  padding: 36px 32px;
  border-top: 1px solid #e2e8f0;
}
.tools-section-inner { max-width: 860px; margin: 0 auto; text-align: center; }
.tools-section h2 { font-size: 20px; font-weight: 800; color: #0f3460; margin-bottom: 6px; }
.tools-section p { font-size: 13.5px; color: #64748b; margin-bottom: 20px; }
.tools-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tool-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
  text-decoration: none;
  background: #fff;
  transition: all .18s;
  cursor: pointer;
}
.tool-card:hover {
  border-color: #00b4d8;
  background: #f0f9ff;
  color: #0f3460;
  box-shadow: 0 4px 12px rgba(0,180,216,.15);
  transform: translateY(-2px);
}
.tool-card i { font-size: 17px; color: #00b4d8; }

/* ══════════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ══ TAFRIGH APP STYLES ══ */
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Cairo',sans-serif;background:#f0f4f8;direction:rtl;color:#1e293b;min-height:100vh;}

.navbar{background:#fff;border-bottom:1px solid #e2e8f0;padding:0 28px;height:64px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100;box-shadow:0 2px 12px rgba(15,52,96,.07);}
.nav-brand{display:flex;align-items:center;gap:10px;text-decoration:none;}
.nav-logo{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#0f3460,#00b4d8);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px rgba(0,180,216,.3);}
.nav-logo span{color:#fff;font-weight:900;font-size:13px;letter-spacing:-1px}
.nav-brand-text{font-size:19px;font-weight:800;color:#0f3460}
.nav-links{display:flex;align-items:center;gap:4px}
.nav-link{padding:7px 15px;border-radius:10px;font-size:13.5px;font-weight:600;color:#64748b;text-decoration:none;transition:all .18s;}
.nav-link:hover{background:#f0f9ff;color:#0f3460}
.nav-link.active{background:linear-gradient(135deg,rgba(15,52,96,.08),rgba(0,180,216,.08));color:#0f3460;border:1px solid rgba(0,180,216,.2);}

.page-header{background:linear-gradient(135deg,#0f3460 0%,#1a4a7a 50%,#0f3460 100%);padding:40px 32px 32px;text-align:center;position:relative;overflow:hidden;}
.page-header::before{content:'';position:absolute;inset:0;background:url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2300b4d8' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/svg%3E");}
.page-header::after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:32px;background:#f0f4f8;clip-path:ellipse(55% 100% at 50% 100%);}
.page-header-content{position:relative;z-index:1}
.page-header h1{font-size:26px;font-weight:900;color:#fff;margin-bottom:10px;letter-spacing:-.3px;}
.page-header p{font-size:14px;color:rgba(255,255,255,.78);max-width:520px;margin:0 auto 16px;line-height:1.75;}
.header-tip{display:inline-flex;align-items:flex-start;gap:10px;background:rgba(0,180,216,.18);border:1px solid rgba(0,180,216,.3);border-radius:14px;padding:10px 16px;font-size:13px;max-width:600px;text-align:right;line-height:1.6;color:rgba(255,255,255,.9);backdrop-filter:blur(4px);}
.header-tip i{color:#00b4d8;flex-shrink:0;font-size:15px;margin-top:2px}

.app-shell{display:flex;height:calc(100vh - 64px);overflow:hidden;}

.sidebar{width:340px;flex-shrink:0;background:#fff;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent;}
.sidebar::-webkit-scrollbar{width:4px}
.sidebar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}
.sidebar-section{padding:18px 18px;border-bottom:1px solid #f1f5f9;}

.tabs{display:flex;background:#f1f5f9;border-radius:12px;padding:3px;gap:3px;margin-bottom:18px;}
.tab-btn{flex:1;padding:8px 6px;border:none;border-radius:10px;font-family:'Cairo',sans-serif;font-size:12px;font-weight:700;cursor:pointer;background:transparent;color:#94a3b8;transition:all .2s;}
.tab-btn.active{background:#fff;color:#0f3460;box-shadow:0 1px 6px rgba(15,52,96,.12);}

.section-label{font-size:11px;font-weight:700;color:#94a3b8;letter-spacing:.7px;text-transform:uppercase;margin-bottom:12px;display:flex;align-items:center;gap:7px;}
.section-label i{font-size:13px;color:#00b4d8}

/* ═══════════════════════════════════
   TEMPLATE PICKER
═══════════════════════════════════ */
.tpl-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:4px;}
.tpl-card{
  border:2px solid #e2e8f0;border-radius:14px;padding:10px 8px 8px;
  cursor:pointer;background:#fafbfc;transition:all .2s;text-align:center;
  position:relative;overflow:hidden;
}
.tpl-card:hover{border-color:#00b4d8;background:#f0f9ff;transform:translateY(-2px);box-shadow:0 4px 14px rgba(0,180,216,.15);}
.tpl-card.active{border-color:#00b4d8;background:linear-gradient(135deg,rgba(15,52,96,.05),rgba(0,180,216,.09));box-shadow:0 0 0 3px rgba(0,180,216,.15);}
.tpl-card.active::after{content:'✓';position:absolute;top:5px;left:7px;font-size:11px;font-weight:900;color:#00b4d8;}
.tpl-thumb{
  width:100%;height:62px;border-radius:8px;margin-bottom:7px;
  overflow:hidden;display:flex;flex-direction:column;gap:3px;padding:5px;
  border:1px solid #e2e8f0;background:#fff;
}
.tpl-name{font-size:12px;font-weight:800;color:#334155;}
.tpl-desc{font-size:10.5px;color:#94a3b8;margin-top:2px;line-height:1.4;}

/* ── Decoration style picker ── */
.deco-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.deco-card{border:2px solid #e2e8f0;border-radius:12px;padding:8px 6px 7px;cursor:pointer;background:#fafbfc;transition:all .2s;text-align:center;position:relative;overflow:hidden;}
.deco-card:hover{border-color:#00b4d8;background:#f0f9ff;transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,180,216,.13);}
.deco-card.active{border-color:#00b4d8;background:linear-gradient(135deg,rgba(15,52,96,.05),rgba(0,180,216,.09));box-shadow:0 0 0 3px rgba(0,180,216,.15);}
.deco-card.active::after{content:'✓';position:absolute;top:4px;left:6px;font-size:11px;font-weight:900;color:#00b4d8;}
.deco-thumb{width:100%;height:52px;border-radius:7px;margin-bottom:6px;overflow:hidden;border:1px solid #e2e8f0;}
.deco-name{font-size:11.5px;font-weight:800;color:#334155;}

/* Thumb preview shapes */
.th-bar{height:8px;border-radius:3px;width:100%;}
.th-row{height:5px;border-radius:2px;width:100%;background:#e2e8f0;}
.th-row.dark{background:#cbd5e1;}

/* UPLOAD ZONE */
.upload-zone{border:2px dashed #cbd5e1;border-radius:16px;padding:26px 16px;text-align:center;cursor:pointer;transition:all .2s;color:#94a3b8;background:#fafbfc;position:relative;}
.upload-zone:hover,.upload-zone.drag-over{border-color:#00b4d8;background:rgba(0,180,216,.04);color:#00b4d8;}
.upload-zone i{font-size:30px;display:block;margin-bottom:8px}
.upload-zone p{font-size:13px;font-weight:700;color:#334155;margin-bottom:4px}
.upload-zone span{font-size:11.5px}
#file-input{display:none}

.import-result{margin-top:12px;border-radius:14px;overflow:hidden;border:1.5px solid #d1fae5;background:#f0fdf4;display:none;}
.import-result.error{border-color:#fecaca;background:#fef2f2;}
.import-result-head{display:flex;align-items:center;gap:10px;padding:10px 14px;background:rgba(16,185,129,.1);}
.import-result.error .import-result-head{background:rgba(239,68,68,.08);}
.import-result-head i{font-size:18px;color:#10b981;flex-shrink:0;}
.import-result.error .import-result-head i{color:#ef4444;}
.import-result-head strong{font-size:13px;font-weight:800;color:#065f46;flex:1;}
.import-result.error .import-result-head strong{color:#991b1b;}
.import-result-info{padding:8px 14px 10px;font-size:12px;color:#374151;line-height:1.7;}
.import-result-info .info-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.info-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:20px;background:#dcfce7;color:#166534;font-size:11.5px;font-weight:700;border:1px solid #bbf7d0;}
.import-result.error .info-chip{background:#fee2e2;color:#991b1b;border-color:#fecaca;}
.change-file-btn{display:block;width:100%;padding:7px;margin-top:6px;background:none;border:1.5px solid #d1fae5;border-radius:8px;font-family:'Cairo',sans-serif;font-size:12px;font-weight:700;color:#059669;cursor:pointer;transition:all .15s;text-align:center;}
.import-result.error .change-file-btn{border-color:#fecaca;color:#dc2626;}
.change-file-btn:hover{background:#ecfdf5;border-color:#6ee7b7;}
.import-result.error .change-file-btn:hover{background:#fef2f2;border-color:#f87171;}
.how-to-strip{background:linear-gradient(90deg,#f0f9ff,#e0f2fe);border:1px solid #bae6fd;border-radius:10px;padding:8px 12px;font-size:11.5px;color:#0369a1;display:flex;align-items:flex-start;gap:8px;margin-top:10px;line-height:1.6;}
.how-to-strip i{font-size:14px;flex-shrink:0;margin-top:1px;}

.subject-chips{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:16px}
.subj-chip{padding:6px 14px;border:1.5px solid #e2e8f0;border-radius:20px;font-family:'Cairo',sans-serif;font-size:13px;font-weight:700;cursor:pointer;background:#fff;color:#475569;transition:all .18s;}
.subj-chip:hover{border-color:#00b4d8;color:#0f3460}
.subj-chip.active{background:linear-gradient(135deg,#0f3460,#00b4d8);border-color:transparent;color:#fff;box-shadow:0 2px 8px rgba(0,180,216,.3);}

.field{margin-bottom:11px}
.field label{display:block;font-size:11.5px;font-weight:700;color:#64748b;margin-bottom:5px;}
.field input,.field select{width:100%;padding:8px 11px;border:1.5px solid #e2e8f0;border-radius:10px;font-family:'Cairo',sans-serif;font-size:13.5px;color:#1e293b;background:#fff;outline:none;transition:all .18s;direction:rtl;}
.field input:focus,.field select:focus{border-color:#00b4d8;box-shadow:0 0 0 3px rgba(0,180,216,.12);}

.cols-list{display:flex;flex-direction:column;gap:5px;margin-bottom:10px}
.col-row{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1.5px solid #e2e8f0;border-radius:10px;padding:7px 10px;cursor:grab;transition:all .15s;}
.col-row:hover{border-color:#00b4d8;background:#f0f9ff}
.col-row.dragging{opacity:.4;border-style:dashed}
.col-row.drag-over{border-color:#00b4d8;border-style:dashed;background:#e0f7fc}
.drag-handle{color:#cbd5e1;font-size:16px;cursor:grab;user-select:none}
.drag-handle:active{cursor:grabbing}
.col-name{flex:1;font-size:13.5px;font-weight:700;color:#334155}
.col-del{background:none;border:none;cursor:pointer;color:#cbd5e1;font-size:15px;padding:0 2px;transition:color .15s;line-height:1;}
.col-del:hover{color:#ef4444}

.quick-title{font-size:11px;font-weight:700;color:#94a3b8;letter-spacing:.5px;margin-bottom:7px;}
.quick-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.quick-chip{padding:4px 11px;border:1.5px solid #bae6fd;border-radius:16px;font-family:'Cairo',sans-serif;font-size:12px;font-weight:700;cursor:pointer;background:#f0f9ff;color:#0369a1;transition:all .15s;position:relative;}
.quick-chip:hover{background:#0f3460;color:#fff;border-color:#0f3460}
.quick-chip.used{background:linear-gradient(135deg,#0f3460,#00b4d8);color:#fff;border-color:transparent;box-shadow:0 2px 6px rgba(0,180,216,.25);}
.quick-chip.used::after{content:' ✕';font-size:10px;opacity:.8}
.quick-chip.used:hover{background:linear-gradient(135deg,#dc2626,#ef4444);border-color:transparent;}

.add-col-row{display:flex;gap:8px}
.add-col-row input{flex:1;padding:8px 11px;border:1.5px solid #e2e8f0;border-radius:10px;font-family:'Cairo',sans-serif;font-size:13px;outline:none;transition:all .18s;color:#1e293b;}
.add-col-row input:focus{border-color:#00b4d8;box-shadow:0 0 0 3px rgba(0,180,216,.1)}
.add-col-row button{padding:8px 14px;background:linear-gradient(135deg,#0f3460,#00b4d8);color:#fff;border:none;border-radius:10px;font-family:'Cairo',sans-serif;font-size:13px;font-weight:700;cursor:pointer;transition:all .18s;white-space:nowrap;box-shadow:0 2px 8px rgba(0,180,216,.25);}
.add-col-row button:hover{background:linear-gradient(135deg,#0b2847,#0095b3);box-shadow:0 4px 12px rgba(0,180,216,.35);transform:translateY(-1px);}

.sidebar-footer{padding:16px 18px}
.orient-label{font-size:11px;font-weight:700;color:#94a3b8;letter-spacing:.7px;text-transform:uppercase;display:flex;align-items:center;gap:7px;margin-bottom:10px;}
.orient-label i{font-size:13px;color:#00b4d8}

/* ── SVG decoration toggle ── */
.svg-toggle-row{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;margin-bottom:12px;background:#f8fafc;border:1.5px solid #e2e8f0;border-radius:12px;transition:border-color .18s,background .18s;cursor:pointer;}
.svg-toggle-row.on{border-color:#00b4d8;background:linear-gradient(135deg,rgba(15,52,96,.04),rgba(0,180,216,.07));}
.svg-toggle-label{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:700;color:#334155;pointer-events:none;}
.svg-toggle-label i{font-size:16px;color:#94a3b8;transition:color .18s;}
.svg-toggle-row.on .svg-toggle-label i{color:#00b4d8;}
.svg-toggle-label small{display:block;font-size:10.5px;font-weight:500;color:#94a3b8;margin-top:1px;}
.pill-switch{position:relative;width:38px;height:22px;flex-shrink:0;pointer-events:none;}
.pill-switch input{opacity:0;width:0;height:0;position:absolute;}
.pill-track{position:absolute;inset:0;border-radius:11px;background:#cbd5e1;transition:background .2s;}
.pill-switch input:checked+.pill-track{background:linear-gradient(135deg,#0f3460,#00b4d8);}
.pill-thumb{position:absolute;top:3px;right:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.18);transition:transform .2s;}
.pill-switch input:checked~.pill-thumb{transform:translateX(-16px);}

.orientation-toggle{display:flex;gap:8px;margin-bottom:14px}
.orient-btn{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:10px 6px;border:2px solid #e2e8f0;border-radius:12px;background:#fff;cursor:pointer;font-family:'Cairo',sans-serif;font-size:12px;font-weight:700;color:#64748b;transition:all .18s;}
.orient-btn:hover{border-color:#00b4d8;color:#0f3460}
.orient-btn.active{border-color:#00b4d8;background:linear-gradient(135deg,rgba(15,52,96,.05),rgba(0,180,216,.08));color:#0f3460;box-shadow:0 0 0 3px rgba(0,180,216,.12);}
.orient-icon{display:flex;align-items:center;justify-content:center;width:28px;height:36px;border:2px solid currentColor;border-radius:3px;background:rgba(0,180,216,.07);}
.orient-icon.landscape{width:36px;height:28px}
.orient-icon i{font-size:13px}

.download-btn{width:100%;padding:13px;background:linear-gradient(135deg,#0f3460,#00b4d8);color:#fff;border:none;border-radius:14px;font-family:'Cairo',sans-serif;font-size:15px;font-weight:800;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:9px;transition:all .2s;box-shadow:0 4px 16px rgba(0,180,216,.35);position:relative;overflow:hidden;}
.download-btn::before{content:'';position:absolute;inset:0;background:linear-gradient(135deg,rgba(255,255,255,.1),transparent);}
.download-btn:hover:not(:disabled){background:linear-gradient(135deg,#0b2847,#0095b3);box-shadow:0 6px 20px rgba(0,180,216,.45);transform:translateY(-2px);}
.download-btn:disabled{opacity:.65;cursor:not-allowed;transform:none}
.download-btn i{font-size:18px}
.btn-spinner{width:18px;height:18px;border:2.5px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;flex-shrink:0;}
@keyframes spin{to{transform:rotate(360deg)}}

.progress-wrap{margin-top:10px;display:none}
.progress-bar-bg{background:#e2e8f0;border-radius:8px;height:6px;overflow:hidden;}
.progress-bar-fill{height:100%;background:linear-gradient(90deg,#0f3460,#00b4d8);border-radius:8px;transition:width .3s ease;width:0%;}
.progress-label{font-size:11px;color:#64748b;font-weight:700;margin-top:5px;text-align:center;}

.preview-panel{flex:1;background:#eef2f7;overflow-y:auto;padding:24px;display:flex;flex-direction:column;}
.preview-panel::-webkit-scrollbar{width:6px}
.preview-panel::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}
.preview-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;}
.preview-title{font-size:13px;font-weight:700;color:#64748b;display:flex;align-items:center;gap:8px;}
.preview-title i{color:#00b4d8}
.preview-badges{display:flex;gap:8px;flex-wrap:wrap;}
.badge{padding:4px 12px;border-radius:8px;font-size:11px;font-weight:700;background:#fff;color:#64748b;border:1px solid #e2e8f0;box-shadow:0 1px 3px rgba(0,0,0,.04);}
.badge.tpl-badge{background:linear-gradient(135deg,rgba(15,52,96,.06),rgba(0,180,216,.1));color:#0f3460;border-color:rgba(0,180,216,.25);}

/* ═══════════════════════════════════════════════════
   TEMPLATE 1 — CLASSIC (original deep-navy)
═══════════════════════════════════════════════════ */
.tpl-classic .a4-sheet{background:#fff;width:100%;max-width:900px;margin:0 auto 20px;box-shadow:0 8px 32px rgba(15,52,96,.12);border-radius:4px;overflow:hidden;direction:rtl;color:#1a1a1a;font-family:'Cairo',sans-serif;border-top:4px solid #00b4d8;}
.tpl-classic .sheet-header-bar{min-height:80px;background:linear-gradient(135deg,#0f3460 0%,#1a4a7a 60%,#0f3460 100%);display:flex;align-items:stretch;}
.tpl-classic .sheet-header-side{width:140px;min-width:140px;flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:14px 10px;background:rgba(255,255,255,.06);}
.tpl-classic .sheet-header-side p{font-size:10px;color:rgba(255,255,255,.88);line-height:1.8;font-weight:600;}
.tpl-classic .sheet-header-center{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px 20px;text-align:center;}
.tpl-classic .sheet-main-title{font-size:20px;font-weight:900;color:#fff;margin-bottom:4px;white-space:nowrap;}
.tpl-classic .sheet-phase{font-size:13px;font-weight:700;color:rgba(255,255,255,.9);background:rgba(0,180,216,.3);border:1px solid rgba(0,180,216,.4);padding:3px 14px;border-radius:20px;}
.tpl-classic .sheet-year-level{font-size:12px;color:rgba(255,255,255,.75);margin-top:6px;}
.tpl-classic .sheet-meta-bar{display:flex;align-items:center;padding:9px 16px;background:#f8faff;border-bottom:2px solid #00b4d8;flex-wrap:wrap;gap:12px;}
.tpl-classic .meta-field{display:flex;align-items:baseline;gap:5px;font-size:12px;}
.tpl-classic .meta-field strong{color:#0f3460;font-weight:700;white-space:nowrap;}
.tpl-classic .meta-field span{border-bottom:1px solid #94a3b8;min-width:90px;display:inline-block;color:#374151;font-size:12px;padding-bottom:1px;}
.tpl-classic .grid-wrap{overflow-x:auto;width:100%}
.tpl-classic .grid-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;}
.tpl-classic .grid-table thead tr th{background:linear-gradient(180deg,#0f3460,#143d6e);color:#fff;font-weight:700;font-size:12px;padding:8px 6px;text-align:center;border:1px solid #1a4a7a;}
.tpl-classic .grid-table thead tr th.col-num{width:38px;background:#0b2847}
.tpl-classic .grid-table thead tr th.col-name{width:200px;text-align:right;padding-right:10px}
.tpl-classic .grid-table tbody tr td{border:1px solid #e2e8f0;padding:5px 4px;text-align:center;height:28px;font-size:12px;}
.tpl-classic .grid-table tbody tr td.td-num{background:#f8fafc;color:#94a3b8;font-size:11px;font-weight:700;}
.tpl-classic .grid-table tbody tr td.td-name{text-align:right;padding-right:10px;font-size:12.5px;color:#1e293b;}
.tpl-classic .grid-table tbody tr:nth-child(even) td{background:#f8fafc}
.tpl-classic .grid-table tbody tr:nth-child(even) td.td-num{background:#f1f5f9}
.tpl-classic .sheet-sigs{display:flex;justify-content:space-between;padding:14px 28px 10px;border-top:1px solid #e2e8f0;}
.tpl-classic .sig-block{text-align:center}
.tpl-classic .sig-line{width:130px;border-bottom:1px solid #334155;margin:32px auto 6px;}
.tpl-classic .sig-label{font-size:11px;font-weight:700;color:#334155}
.tpl-classic .sheet-watermark{text-align:center;font-size:10px;color:#94a3b8;padding:6px;font-weight:700;letter-spacing:.5px;}

/* ═══════════════════════════════════════════════════
   TEMPLATE 2 — EMERALD (green theme, modern)
═══════════════════════════════════════════════════ */
.tpl-emerald .a4-sheet{background:#fff;width:100%;max-width:900px;margin:0 auto 20px;box-shadow:0 8px 32px rgba(4,120,87,.12);border-radius:4px;overflow:hidden;direction:rtl;color:#1a1a1a;font-family:'Cairo',sans-serif;border-top:4px solid #10b981;}
.tpl-emerald .sheet-header-bar{min-height:80px;background:linear-gradient(135deg,#064e3b 0%,#065f46 60%,#047857 100%);display:flex;align-items:stretch;}
.tpl-emerald .sheet-header-side{width:140px;min-width:140px;flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:14px 10px;background:rgba(255,255,255,.05);}
.tpl-emerald .sheet-header-side p{font-size:10px;color:rgba(255,255,255,.88);line-height:1.8;font-weight:600;}
.tpl-emerald .sheet-header-center{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px 20px;text-align:center;}
.tpl-emerald .sheet-main-title{font-size:20px;font-weight:900;color:#fff;margin-bottom:4px;white-space:nowrap;}
.tpl-emerald .sheet-phase{font-size:13px;font-weight:700;color:rgba(255,255,255,.95);background:rgba(16,185,129,.35);border:1px solid rgba(16,185,129,.5);padding:3px 14px;border-radius:20px;}
.tpl-emerald .sheet-year-level{font-size:12px;color:rgba(255,255,255,.7);margin-top:6px;}
.tpl-emerald .sheet-meta-bar{display:flex;align-items:center;padding:9px 16px;background:#f0fdf4;border-bottom:2px solid #10b981;flex-wrap:wrap;gap:12px;}
.tpl-emerald .meta-field{display:flex;align-items:baseline;gap:5px;font-size:12px;}
.tpl-emerald .meta-field strong{color:#065f46;font-weight:700;white-space:nowrap;}
.tpl-emerald .meta-field span{border-bottom:1px solid #6ee7b7;min-width:90px;display:inline-block;color:#374151;font-size:12px;padding-bottom:1px;}
.tpl-emerald .grid-wrap{overflow-x:auto;width:100%}
.tpl-emerald .grid-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;}
.tpl-emerald .grid-table thead tr th{background:linear-gradient(180deg,#047857,#065f46);color:#fff;font-weight:700;font-size:12px;padding:8px 6px;text-align:center;border:1px solid #065f46;}
.tpl-emerald .grid-table thead tr th.col-num{width:38px;background:#064e3b}
.tpl-emerald .grid-table thead tr th.col-name{width:200px;text-align:right;padding-right:10px}
.tpl-emerald .grid-table tbody tr td{border:1px solid #d1fae5;padding:5px 4px;text-align:center;height:28px;font-size:12px;}
.tpl-emerald .grid-table tbody tr td.td-num{background:#f0fdf4;color:#6ee7b7;font-size:11px;font-weight:700;}
.tpl-emerald .grid-table tbody tr td.td-name{text-align:right;padding-right:10px;font-size:12.5px;color:#1e293b;}
.tpl-emerald .grid-table tbody tr:nth-child(even) td{background:#f0fdf4}
.tpl-emerald .grid-table tbody tr:nth-child(even) td.td-num{background:#dcfce7}
.tpl-emerald .sheet-sigs{display:flex;justify-content:space-between;padding:14px 28px 10px;border-top:1px solid #d1fae5;}
.tpl-emerald .sig-block{text-align:center}
.tpl-emerald .sig-line{width:130px;border-bottom:1px solid #047857;margin:32px auto 6px;}
.tpl-emerald .sig-label{font-size:11px;font-weight:700;color:#065f46}
.tpl-emerald .sheet-watermark{text-align:center;font-size:10px;color:#6ee7b7;padding:6px;font-weight:700;letter-spacing:.5px;}

/* ═══════════════════════════════════════════════════
   TEMPLATE 3 — MINIMAL (clean B&W, no color header)
═══════════════════════════════════════════════════ */
.tpl-minimal .a4-sheet{background:#fff;width:100%;max-width:900px;margin:0 auto 20px;box-shadow:0 4px 20px rgba(0,0,0,.08);border-radius:4px;overflow:hidden;direction:rtl;color:#1a1a1a;font-family:'Cairo',sans-serif;border:2px solid #1e293b;}
.tpl-minimal .sheet-header-bar{background:#1e293b;display:flex;align-items:stretch;min-height:80px;}
.tpl-minimal .sheet-header-side{width:140px;min-width:140px;flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:12px 10px;border-left:1px solid rgba(255,255,255,.12);}
.tpl-minimal .sheet-header-side p{font-size:10px;color:rgba(255,255,255,.78);line-height:1.8;font-weight:600;}
.tpl-minimal .sheet-header-center{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 16px;text-align:center;overflow:hidden;}
.tpl-minimal .sheet-main-title{font-size:18px;font-weight:900;color:#fff;margin-bottom:5px;letter-spacing:.3px;white-space:nowrap;}
.tpl-minimal .sheet-phase{font-size:12px;font-weight:700;color:#fff;background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.3);padding:3px 12px;border-radius:4px;letter-spacing:.2px;white-space:nowrap;}
.tpl-minimal .sheet-year-level{font-size:11px;color:rgba(255,255,255,.6);margin-top:5px;white-space:nowrap;}
.tpl-minimal .sheet-meta-bar{display:flex;align-items:center;padding:8px 16px;background:#f8fafc;border-bottom:2px solid #1e293b;flex-wrap:wrap;gap:12px;}
.tpl-minimal .meta-field{display:flex;align-items:baseline;gap:5px;font-size:12px;}
.tpl-minimal .meta-field strong{color:#1e293b;font-weight:800;white-space:nowrap;}
.tpl-minimal .meta-field span{border-bottom:1.5px solid #334155;min-width:90px;display:inline-block;color:#374151;font-size:12px;padding-bottom:1px;}
.tpl-minimal .grid-wrap{overflow-x:auto;width:100%}
.tpl-minimal .grid-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;}
.tpl-minimal .grid-table thead tr th{background:#334155;color:#fff;font-weight:700;font-size:12px;padding:8px 6px;text-align:center;border:1px solid #475569;}
.tpl-minimal .grid-table thead tr th.col-num{width:38px;background:#1e293b}
.tpl-minimal .grid-table thead tr th.col-name{width:200px;text-align:right;padding-right:10px}
.tpl-minimal .grid-table tbody tr td{border:1px solid #e2e8f0;padding:5px 4px;text-align:center;height:28px;font-size:12px;}
.tpl-minimal .grid-table tbody tr td.td-num{background:#f8fafc;color:#94a3b8;font-size:11px;font-weight:700;}
.tpl-minimal .grid-table tbody tr td.td-name{text-align:right;padding-right:10px;font-size:12.5px;color:#1e293b;}
.tpl-minimal .grid-table tbody tr:nth-child(even) td{background:#f8fafc}
.tpl-minimal .grid-table tbody tr:nth-child(even) td.td-num{background:#f1f5f9}
.tpl-minimal .sheet-sigs{display:flex;justify-content:space-between;padding:14px 28px 10px;border-top:2px solid #1e293b;}
.tpl-minimal .sig-block{text-align:center}
.tpl-minimal .sig-line{width:130px;border-bottom:1.5px solid #1e293b;margin:32px auto 6px;}
.tpl-minimal .sig-label{font-size:11px;font-weight:700;color:#1e293b}
.tpl-minimal .sheet-watermark{text-align:center;font-size:10px;color:#94a3b8;padding:6px;font-weight:700;letter-spacing:.5px;}

/* ═══════════════════════════════════════════════════
   TEMPLATE 4 — ROYAL PURPLE
═══════════════════════════════════════════════════ */
.tpl-purple .a4-sheet{background:#fff;width:100%;max-width:900px;margin:0 auto 20px;box-shadow:0 8px 32px rgba(109,40,217,.12);border-radius:4px;overflow:hidden;direction:rtl;color:#1a1a1a;font-family:'Cairo',sans-serif;border-top:4px solid #8b5cf6;}
.tpl-purple .sheet-header-bar{min-height:80px;background:linear-gradient(135deg,#4c1d95 0%,#5b21b6 60%,#6d28d9 100%);display:flex;align-items:stretch;}
.tpl-purple .sheet-header-side{width:140px;min-width:140px;flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:14px 10px;background:rgba(255,255,255,.05);}
.tpl-purple .sheet-header-side p{font-size:10px;color:rgba(255,255,255,.88);line-height:1.8;font-weight:600;}
.tpl-purple .sheet-header-center{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px 20px;text-align:center;}
.tpl-purple .sheet-main-title{font-size:20px;font-weight:900;color:#fff;margin-bottom:4px;white-space:nowrap;}
.tpl-purple .sheet-phase{font-size:13px;font-weight:700;color:rgba(255,255,255,.95);background:rgba(167,139,250,.35);border:1px solid rgba(167,139,250,.5);padding:3px 14px;border-radius:20px;}
.tpl-purple .sheet-year-level{font-size:12px;color:rgba(255,255,255,.7);margin-top:6px;}
.tpl-purple .sheet-meta-bar{display:flex;align-items:center;padding:9px 16px;background:#faf5ff;border-bottom:2px solid #8b5cf6;flex-wrap:wrap;gap:12px;}
.tpl-purple .meta-field{display:flex;align-items:baseline;gap:5px;font-size:12px;}
.tpl-purple .meta-field strong{color:#5b21b6;font-weight:700;white-space:nowrap;}
.tpl-purple .meta-field span{border-bottom:1px solid #c4b5fd;min-width:90px;display:inline-block;color:#374151;font-size:12px;padding-bottom:1px;}
.tpl-purple .grid-wrap{overflow-x:auto;width:100%}
.tpl-purple .grid-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;}
.tpl-purple .grid-table thead tr th{background:linear-gradient(180deg,#5b21b6,#4c1d95);color:#fff;font-weight:700;font-size:12px;padding:8px 6px;text-align:center;border:1px solid #4c1d95;}
.tpl-purple .grid-table thead tr th.col-num{width:38px;background:#3b0764}
.tpl-purple .grid-table thead tr th.col-name{width:200px;text-align:right;padding-right:10px}
.tpl-purple .grid-table tbody tr td{border:1px solid #ede9fe;padding:5px 4px;text-align:center;height:28px;font-size:12px;}
.tpl-purple .grid-table tbody tr td.td-num{background:#faf5ff;color:#c4b5fd;font-size:11px;font-weight:700;}
.tpl-purple .grid-table tbody tr td.td-name{text-align:right;padding-right:10px;font-size:12.5px;color:#1e293b;}
.tpl-purple .grid-table tbody tr:nth-child(even) td{background:#faf5ff}
.tpl-purple .grid-table tbody tr:nth-child(even) td.td-num{background:#f3e8ff}
.tpl-purple .sheet-sigs{display:flex;justify-content:space-between;padding:14px 28px 10px;border-top:1px solid #ede9fe;}
.tpl-purple .sig-block{text-align:center}
.tpl-purple .sig-line{width:130px;border-bottom:1px solid #5b21b6;margin:32px auto 6px;}
.tpl-purple .sig-label{font-size:11px;font-weight:700;color:#5b21b6}
.tpl-purple .sheet-watermark{text-align:center;font-size:10px;color:#c4b5fd;padding:6px;font-weight:700;letter-spacing:.5px;}

/* ═══════════════════════════════════════════════════
   TEMPLATE 5 — WARM ORANGE (تقييم دعم)
═══════════════════════════════════════════════════ */
.tpl-orange .a4-sheet{background:#fff;width:100%;max-width:900px;margin:0 auto 20px;box-shadow:0 8px 32px rgba(194,65,12,.12);border-radius:4px;overflow:hidden;direction:rtl;color:#1a1a1a;font-family:'Cairo',sans-serif;border-top:4px solid #f97316;}
.tpl-orange .sheet-header-bar{min-height:80px;background:linear-gradient(135deg,#7c2d12 0%,#9a3412 60%,#c2410c 100%);display:flex;align-items:stretch;}
.tpl-orange .sheet-header-side{width:140px;min-width:140px;flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:14px 10px;background:rgba(255,255,255,.05);}
.tpl-orange .sheet-header-side p{font-size:10px;color:rgba(255,255,255,.88);line-height:1.8;font-weight:600;}
.tpl-orange .sheet-header-center{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px 20px;text-align:center;}
.tpl-orange .sheet-main-title{font-size:20px;font-weight:900;color:#fff;margin-bottom:4px;white-space:nowrap;}
.tpl-orange .sheet-phase{font-size:13px;font-weight:700;color:rgba(255,255,255,.95);background:rgba(249,115,22,.35);border:1px solid rgba(249,115,22,.5);padding:3px 14px;border-radius:20px;}
.tpl-orange .sheet-year-level{font-size:12px;color:rgba(255,255,255,.7);margin-top:6px;}
.tpl-orange .sheet-meta-bar{display:flex;align-items:center;padding:9px 16px;background:#fff7ed;border-bottom:2px solid #f97316;flex-wrap:wrap;gap:12px;}
.tpl-orange .meta-field{display:flex;align-items:baseline;gap:5px;font-size:12px;}
.tpl-orange .meta-field strong{color:#9a3412;font-weight:700;white-space:nowrap;}
.tpl-orange .meta-field span{border-bottom:1px solid #fdba74;min-width:90px;display:inline-block;color:#374151;font-size:12px;padding-bottom:1px;}
.tpl-orange .grid-wrap{overflow-x:auto;width:100%}
.tpl-orange .grid-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;}
.tpl-orange .grid-table thead tr th{background:linear-gradient(180deg,#c2410c,#9a3412);color:#fff;font-weight:700;font-size:12px;padding:8px 6px;text-align:center;border:1px solid #9a3412;}
.tpl-orange .grid-table thead tr th.col-num{width:38px;background:#7c2d12}
.tpl-orange .grid-table thead tr th.col-name{width:200px;text-align:right;padding-right:10px}
.tpl-orange .grid-table tbody tr td{border:1px solid #fed7aa;padding:5px 4px;text-align:center;height:28px;font-size:12px;}
.tpl-orange .grid-table tbody tr td.td-num{background:#fff7ed;color:#fdba74;font-size:11px;font-weight:700;}
.tpl-orange .grid-table tbody tr td.td-name{text-align:right;padding-right:10px;font-size:12.5px;color:#1e293b;}
.tpl-orange .grid-table tbody tr:nth-child(even) td{background:#fff7ed}
.tpl-orange .grid-table tbody tr:nth-child(even) td.td-num{background:#ffedd5}
.tpl-orange .sheet-sigs{display:flex;justify-content:space-between;padding:14px 28px 10px;border-top:1px solid #fed7aa;}
.tpl-orange .sig-block{text-align:center}
.tpl-orange .sig-line{width:130px;border-bottom:1px solid #c2410c;margin:32px auto 6px;}
.tpl-orange .sig-label{font-size:11px;font-weight:700;color:#9a3412}
.tpl-orange .sheet-watermark{text-align:center;font-size:10px;color:#fdba74;padding:6px;font-weight:700;letter-spacing:.5px;}

/* ═══════════════════════════════════════════════════
   TEMPLATE 6 — ROSE RED (امتحانات)
═══════════════════════════════════════════════════ */
.tpl-rose .a4-sheet{background:#fff;width:100%;max-width:900px;margin:0 auto 20px;box-shadow:0 8px 32px rgba(159,18,57,.12);border-radius:4px;overflow:hidden;direction:rtl;color:#1a1a1a;font-family:'Cairo',sans-serif;border-top:4px solid #f43f5e;}
.tpl-rose .sheet-header-bar{min-height:80px;background:linear-gradient(135deg,#881337 0%,#9f1239 60%,#be123c 100%);display:flex;align-items:stretch;}
.tpl-rose .sheet-header-side{width:140px;min-width:140px;flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:14px 10px;background:rgba(255,255,255,.05);}
.tpl-rose .sheet-header-side p{font-size:10px;color:rgba(255,255,255,.88);line-height:1.8;font-weight:600;}
.tpl-rose .sheet-header-center{flex:1;min-width:0;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px 20px;text-align:center;}
.tpl-rose .sheet-main-title{font-size:20px;font-weight:900;color:#fff;margin-bottom:4px;white-space:nowrap;}
.tpl-rose .sheet-phase{font-size:13px;font-weight:700;color:rgba(255,255,255,.95);background:rgba(244,63,94,.35);border:1px solid rgba(244,63,94,.5);padding:3px 14px;border-radius:20px;}
.tpl-rose .sheet-year-level{font-size:12px;color:rgba(255,255,255,.7);margin-top:6px;}
.tpl-rose .sheet-meta-bar{display:flex;align-items:center;padding:9px 16px;background:#fff1f2;border-bottom:2px solid #f43f5e;flex-wrap:wrap;gap:12px;}
.tpl-rose .meta-field{display:flex;align-items:baseline;gap:5px;font-size:12px;}
.tpl-rose .meta-field strong{color:#9f1239;font-weight:700;white-space:nowrap;}
.tpl-rose .meta-field span{border-bottom:1px solid #fda4af;min-width:90px;display:inline-block;color:#374151;font-size:12px;padding-bottom:1px;}
.tpl-rose .grid-wrap{overflow-x:auto;width:100%}
.tpl-rose .grid-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed;}
.tpl-rose .grid-table thead tr th{background:linear-gradient(180deg,#be123c,#9f1239);color:#fff;font-weight:700;font-size:12px;padding:8px 6px;text-align:center;border:1px solid #9f1239;}
.tpl-rose .grid-table thead tr th.col-num{width:38px;background:#881337}
.tpl-rose .grid-table thead tr th.col-name{width:200px;text-align:right;padding-right:10px}
.tpl-rose .grid-table tbody tr td{border:1px solid #fecdd3;padding:5px 4px;text-align:center;height:28px;font-size:12px;}
.tpl-rose .grid-table tbody tr td.td-num{background:#fff1f2;color:#fda4af;font-size:11px;font-weight:700;}
.tpl-rose .grid-table tbody tr td.td-name{text-align:right;padding-right:10px;font-size:12.5px;color:#1e293b;}
.tpl-rose .grid-table tbody tr:nth-child(even) td{background:#fff1f2}
.tpl-rose .grid-table tbody tr:nth-child(even) td.td-num{background:#ffe4e6}
.tpl-rose .sheet-sigs{display:flex;justify-content:space-between;padding:14px 28px 10px;border-top:1px solid #fecdd3;}
.tpl-rose .sig-block{text-align:center}
.tpl-rose .sig-line{width:130px;border-bottom:1px solid #be123c;margin:32px auto 6px;}
.tpl-rose .sig-label{font-size:11px;font-weight:700;color:#9f1239}
.tpl-rose .sheet-watermark{text-align:center;font-size:10px;color:#fda4af;padding:6px;font-weight:700;letter-spacing:.5px;}

/* shared for all templates */
#sheets-container .grid-table tbody tr:hover td{filter:brightness(.96);}

.tools-section{background:#fff;padding:36px 32px;border-top:1px solid #e2e8f0;}
.tools-section-inner{max-width:860px;margin:0 auto;text-align:center}
.tools-section h2{font-size:20px;font-weight:800;color:#0f3460;margin-bottom:6px;}
.tools-section p{font-size:13.5px;color:#64748b;margin-bottom:20px}
.tools-grid{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;}
.tool-card{display:flex;align-items:center;gap:9px;padding:10px 18px;border:1.5px solid #e2e8f0;border-radius:12px;font-size:13.5px;font-weight:700;color:#334155;text-decoration:none;background:#fff;transition:all .18s;cursor:pointer;}
.tool-card:hover{border-color:#00b4d8;background:#f0f9ff;color:#0f3460;box-shadow:0 4px 12px rgba(0,180,216,.15);transform:translateY(-2px);}
.tool-card i{font-size:17px;color:#00b4d8}
.footer{background:#0f172a;color:#64748b;padding:44px 32px 24px;direction:rtl;}
.footer-inner{max-width:1100px;margin:0 auto}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:36px;margin-bottom:32px;}
.footer-brand-row{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.footer-logo{width:38px;height:38px;border-radius:10px;background:linear-gradient(135deg,#0f3460,#00b4d8);display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,180,216,.3);}
.footer-logo span{color:#fff;font-weight:900;font-size:12px;letter-spacing:-1px}
.footer-logo-text{font-size:18px;font-weight:900;color:#00b4d8}
.footer-desc{font-size:13px;line-height:1.8;color:#475569}
.footer-col h4{font-size:14px;font-weight:700;color:#f1f5f9;margin-bottom:14px}
.footer-col ul{list-style:none;display:flex;flex-direction:column;gap:9px}
.footer-col ul li a{font-size:13px;color:#475569;text-decoration:none;transition:color .15s;display:flex;align-items:center;gap:6px;}
.footer-col ul li a:hover{color:#00b4d8}
.footer-col ul li a::before{content:'←';font-size:11px;opacity:.4}
.footer-bottom{border-top:1px solid #1e293b;padding-top:20px;text-align:center;font-size:12.5px;color:#334155;}
.footer-bottom a{color:#00b4d8;text-decoration:none;font-weight:700}

/* ══════════════════════════════════════════════════════════════
   MOBILE — single column, form on top, preview below
══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  .app-shell {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .sidebar {
    width: 100% !important;
    min-width: 0 !important;
    flex-shrink: unset !important;
    height: auto !important;
    overflow-y: visible !important;
    border-left: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
  }

  .preview-panel {
    width: 100% !important;
    flex: none !important;
    height: auto !important;
    overflow-y: visible !important;
    padding: 16px 10px !important;
  }

  .page-header {
    padding: 24px 16px 28px !important;
  }

  .page-header h1 {
    font-size: 18px !important;
  }

  .grid-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-section { padding: 14px !important; }
  .sidebar-footer   { padding: 14px !important; }
  .download-btn     { width: 100%; justify-content: center; }
}

@media print{
  .navbar,.page-header,.sidebar,.preview-header,.tools-section,.footer{display:none!important}
  .app-shell{display:block;height:auto;overflow:visible}
  .preview-panel{padding:0;background:#fff;overflow:visible}
  .a4-sheet{box-shadow:none;page-break-after:always;max-width:100%;width:100%;border-radius:0;margin:0 auto !important;}
  body{background:#fff}
  .grid-table{width:100% !important;table-layout:fixed !important}
  .grid-wrap{width:100% !important;overflow:visible !important;}
}

/* ══ SECURITY ══ */
.navbar,.sidebar,.page-header,.tools-section,.footer,
.section-label,.tab-btn,.ctrl-btn,.download-btn,.badge{
    -webkit-user-select:none;
    -moz-user-select:none;
    user-select:none;
}
#_sec_overlay{
    display:none;position:fixed;inset:0;z-index:999999;
    background:rgba(10,15,30,.97);
    align-items:center;justify-content:center;
    flex-direction:column;gap:18px;
    font-family:'Cairo',sans-serif;text-align:center;
    backdrop-filter:blur(10px);
}
#_sec_overlay.on{display:flex;}
#_sec_overlay h2{font-size:24px;font-weight:900;color:#ef4444;margin:0;}
#_sec_overlay p{font-size:14px;color:#94a3b8;max-width:360px;line-height:1.8;margin:0;}
#_sec_overlay small{font-size:11px;color:#334155;}