:root {
  --samta-deep: #0c4550;
  --samta-mid: #127d7a;
  --samta-mint: #3fc07d;
  --samta-blue: #1d8cb6;
  --samta-soft: #f7fbfa;
  --samta-card: #fffdfa;
  --samta-border: #159286;
  --samta-text: #17434a;
  --samta-muted: #7d8d91;
}

.samta-report-app,
.samta-report-app * {
  box-sizing: border-box;
}

.samta-report-app {
  font-family: Tahoma, Arial, sans-serif;
  color: var(--samta-text);
  max-width: 1180px;
  margin: 0 auto;
  direction: rtl;
}

.samta-panel {
  background: #ffffff;
  border: 1px solid rgba(18, 125, 122, 0.18);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(12, 69, 80, 0.10);
  padding: 24px;
  margin: 24px 0;
}

.samta-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.samta-panel h2 {
  margin: 0 0 8px;
  font-size: 26px;
  color: var(--samta-deep);
}

.samta-panel p {
  margin: 0;
  color: #65777c;
}

.samta-badge {
  background: linear-gradient(135deg, var(--samta-deep), var(--samta-mint));
  color: white;
  border-radius: 999px;
  padding: 9px 14px;
  white-space: nowrap;
  font-weight: 700;
}

.samta-form-grid,
.samta-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.samta-upload-grid {
  margin-top: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.samta-panel label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  color: var(--samta-deep);
}

.samta-wide {
  grid-column: 1 / -1;
}

.samta-panel input,
.samta-panel textarea {
  width: 100%;
  border: 1px solid rgba(18, 125, 122, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--samta-text);
  background: #fcfffe;
  outline: none;
  transition: 0.2s;
}

.samta-panel input:focus,
.samta-panel textarea:focus {
  border-color: var(--samta-mid);
  box-shadow: 0 0 0 4px rgba(63, 192, 125, 0.14);
}

.samta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.samta-actions button {
  border: 0;
  border-radius: 14px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: #e9f6f3;
  color: var(--samta-deep);
}

.samta-actions .samta-primary {
  background: linear-gradient(135deg, var(--samta-deep), var(--samta-mint));
  color: white;
  box-shadow: 0 12px 25px rgba(18, 125, 122, 0.23);
}

.samta-sheet-wrap {
  overflow: auto;
  padding: 18px 0 40px;
}

.samta-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
  padding: 0 11mm 18mm;
  isolation: isolate;
}

.samta-report-header {
  margin: 0 -11mm;
  position: relative;
  min-height: 45mm;
  background: var(--samta-deep);
  color: #fff;
  border-bottom-left-radius: 10mm;
  border-bottom-right-radius: 10mm;
  border-bottom: 1.2mm solid var(--samta-mint);
}

.samta-report-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3mm;
  height: 3mm;
  background: linear-gradient(90deg, var(--samta-blue), transparent, var(--samta-mint));
  opacity: 0.65;
}

.samta-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10mm;
  padding: 6mm 12mm 0;
}

.samta-ministry-text,
.samta-ministry-mark {
  width: 55mm;
  text-align: center;
  line-height: 1.7;
}

.samta-ministry-text strong,
.samta-ministry-text span,
.samta-ministry-mark strong,
.samta-ministry-mark span {
  display: block;
}

.samta-ministry-text strong,
.samta-ministry-mark strong {
  font-size: 12px;
}

.samta-ministry-text span,
.samta-ministry-mark span {
  font-size: 10px;
  opacity: 0.9;
}

.samta-divider {
  width: 0.7mm;
  height: 24mm;
  background: linear-gradient(180deg, var(--samta-blue), var(--samta-mint));
  border-radius: 9px;
}

.samta-dots {
  width: 30mm;
  height: 14mm;
  margin: 0 auto 2mm;
  background-image: radial-gradient(circle, #fff 1.2mm, transparent 1.25mm);
  background-size: 4mm 4mm;
  clip-path: polygon(0 45%, 38% 0, 55% 45%, 100% 0, 100% 58%, 58% 100%, 43% 58%, 0 100%);
  opacity: 0.95;
}

.samta-report-header h1 {
  position: absolute;
  left: 30mm;
  right: 30mm;
  bottom: -7mm;
  margin: 0;
  background: var(--samta-deep);
  border: 0.45mm solid rgba(63, 192, 125, 0.55);
  box-shadow: 0 2mm 0 rgba(18, 125, 122, 0.22);
  color: #fff;
  border-radius: 2mm;
  text-align: center;
  padding: 2.5mm 5mm;
  font-size: 21px;
  letter-spacing: 1px;
}

.samta-title-band {
  margin-top: 22mm;
  background: var(--samta-deep);
  color: #fff;
  border-bottom: 1.5mm solid var(--samta-mint);
  text-align: center;
  padding: 5mm 4mm;
}

.samta-title-band h2 {
  margin: 0;
  font-size: 22px;
}

.samta-executor-row {
  margin-top: 7mm;
  border: 0.35mm solid var(--samta-border);
  border-radius: 2mm;
  min-height: 11mm;
  display: flex;
  align-items: center;
  gap: 3mm;
  padding: 2mm 5mm;
  font-size: 13px;
}

.samta-executor-row strong,
.samta-goals-box h3,
.samta-meta-list strong,
.samta-evidence-section h3 {
  color: var(--samta-mid);
}

.samta-info-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 2mm;
  margin-top: 2mm;
}

.samta-goals-box,
.samta-meta-list > div {
  border: 0.35mm solid var(--samta-border);
  border-radius: 2mm;
  background: #fff;
}

.samta-goals-box {
  padding: 2.5mm 4mm;
  min-height: 46mm;
}

.samta-goals-box h3 {
  font-size: 15px;
  margin: 0 0 2mm;
  text-align: right;
}

.samta-goals-box ul {
  margin: 0;
  padding: 0 7mm 0 0;
  list-style: none;
}

.samta-goals-box li {
  font-size: 12px;
  margin: 1.8mm 0;
  color: #7c888c;
  position: relative;
  line-height: 1.45;
}

.samta-goals-box li::before {
  content: "";
  width: 2.5mm;
  height: 0.7mm;
  background: var(--samta-mid);
  border-radius: 5px;
  position: absolute;
  right: -5mm;
  top: 2.5mm;
}

.samta-meta-list {
  display: grid;
  gap: 2mm;
}

.samta-meta-list > div {
  min-height: 10.5mm;
  display: flex;
  align-items: center;
  gap: 2mm;
  padding: 2mm 3mm;
  font-size: 12px;
}

.samta-meta-list strong {
  white-space: nowrap;
}

.samta-evidence-section {
  margin-top: 7mm;
  border: 0.35mm solid var(--samta-border);
  border-radius: 5mm;
  padding: 7mm 5mm 6mm;
  position: relative;
}

.samta-evidence-section::before {
  content: "";
  position: absolute;
  right: 7mm;
  left: 34mm;
  top: -0.35mm;
  height: 0.35mm;
  background: white;
}

.samta-evidence-section h3 {
  position: absolute;
  top: -8mm;
  right: 34mm;
  background: white;
  padding: 0 4mm;
  font-size: 16px;
  margin: 0;
}

.samta-evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3mm;
}

.samta-evidence-card {
  margin: 0;
  min-height: 47mm;
  border: 0.7mm solid var(--samta-border);
  border-radius: 4mm;
  background: linear-gradient(145deg, #f4f1ed 0%, #f4f1ed 64%, #fffaf4 64%, #fffaf4 100%);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

.samta-image-placeholder {
  height: 35mm;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.samta-image-placeholder.has-image svg {
  display: none;
}

.samta-image-placeholder svg {
  width: 28mm;
  height: 22mm;
}

.samta-image-placeholder rect {
  fill: #eaf7ec;
  stroke: #385a62;
  stroke-width: 4;
}

.samta-image-placeholder circle {
  fill: #f2c86b;
}

.samta-image-placeholder path:first-of-type {
  fill: #8fbca6;
}

.samta-image-placeholder path:last-of-type {
  fill: #9cd8d1;
}

.samta-evidence-card figcaption {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2mm;
  color: #2b3f45;
}

.samta-report-footer {
  position: absolute;
  right: 0;
  left: 11mm;
  bottom: 6mm;
  min-height: 15mm;
  border-top: 0.35mm solid var(--samta-border);
  border-top-left-radius: 6mm;
  background: linear-gradient(90deg, var(--samta-mint), var(--samta-blue));
  color: #fff;
  display: flex;
  align-items: center;
  gap: 3mm;
  padding: 3mm 12mm;
  font-size: 18px;
}

.samta-twitter-icon {
  width: 8mm;
  height: 8mm;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  color: var(--samta-blue);
  font-weight: 900;
  font-size: 15px;
}

@media (max-width: 900px) {
  .samta-form-grid,
  .samta-upload-grid {
    grid-template-columns: 1fr;
  }
  .samta-sheet-wrap {
    transform-origin: top center;
  }
}

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

@media print {
  html,
  body {
    width: 210mm;
    min-height: 297mm;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }

  body * {
    visibility: hidden !important;
  }

  .samta-sheet,
  .samta-sheet * {
    visibility: visible !important;
  }

  .no-print,
  .no-print * {
    display: none !important;
    visibility: hidden !important;
  }

  .samta-report-app,
  .samta-sheet-wrap {
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    max-width: none !important;
  }

  .samta-sheet {
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-after: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* v1.1 refinements: Ministry logo, no office/Twitter, evidence wording */
.samta-ministry-mark img {
  display: block;
  width: 42mm;
  max-height: 28mm;
  object-fit: contain;
  margin: 0 auto;
}

.samta-ministry-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24mm;
}

.samta-ministry-text strong {
  font-size: 13px;
  line-height: 1.9;
}

.samta-sheet::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  height: 9mm;
  background: linear-gradient(90deg, var(--samta-blue), var(--samta-mint));
  opacity: 0.9;
  z-index: -1;
}

.samta-evidence-section h3 {
  color: var(--samta-mid);
  font-weight: 900;
}

.samta-evidence-card figcaption {
  color: var(--samta-deep);
  font-size: 14px;
}

@media print {
  .samta-sheet::after {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* v1.2 print fix: print one clean A4 page only, using browser Save as PDF/Print dialog */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  .samta-sheet-wrap {
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .samta-sheet {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    padding-bottom: 18mm !important;
    overflow: hidden !important;
    box-shadow: none !important;
    page-break-before: auto !important;
    page-break-after: avoid !important;
    break-before: auto !important;
    break-after: avoid !important;
    break-inside: avoid !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
}

/* v1.2.2 safe route integration: keep /reports/ balanced inside the WordPress theme. */
body.samta-program-report-page .entry-content,
body.samta-program-report-page .site-main,
body.samta-program-report-page main,
body.samta-program-report-page .content-area {
  width: 100%;
  max-width: none;
}

body.samta-program-report-page .entry-content > .samta-report-app,
body.samta-program-report-page .samta-report-app {
  width: min(100%, 1180px);
  padding-inline: clamp(10px, 2vw, 24px);
}

@media (max-width: 900px) {
  body.samta-program-report-page .samta-report-app {
    width: 100%;
    padding-inline: 10px;
    overflow-x: hidden;
  }

  body.samta-program-report-page .samta-panel {
    padding: 16px;
    border-radius: 18px;
  }

  body.samta-program-report-page .samta-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  body.samta-program-report-page .samta-sheet-wrap {
    margin-inline: -10px;
    padding-inline: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
