:root {
  color-scheme: light;
  --ink: #251a33;
  --muted: #6e627d;
  --line: #ddd6ea;
  --bg: #f7f5fb;
  --panel: #ffffff;
  --primary: #6f3fa0;
  --primary-dark: #4b2777;
  --accent: #8a5fb8;
  --active: #7b4bb3;
  --active-soft: #f5f0fb;
  --active-line: #cbbce2;
  --focus: #f7c948;
  --action-soft: #f7f2fc;
  --soft: #f0e8f8;
  --warn: #fff5db;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(75, 39, 119, 0.1);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  font-size: 16px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-color: var(--active-line);
  background: var(--active-soft);
  box-shadow: inset 3px 0 0 rgba(111, 63, 160, 0.28);
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--active);
  background: #ffffff;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(247, 201, 72, 0.45);
  border-color: var(--active);
  background: #ffffff;
  box-shadow: inset 4px 0 0 var(--active), 0 0 0 1px rgba(111, 63, 160, 0.12);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 88px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(83, 42, 127, 0.22);
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1;
  padding: 8px 10px;
  cursor: pointer;
}

.password-toggle:hover {
  background: #f3ecfb;
  border-color: rgba(83, 42, 127, 0.38);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(247, 201, 72, 0.65);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  min-height: 100vh;
  min-height: 100svh;
  background:
    linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(247,245,251,0.94) 58%),
    var(--bg);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(14px, 3vh, 30px);
  padding: clamp(24px, 4.4vh, 42px);
  background:
    linear-gradient(160deg, rgba(75, 39, 119, 0.98), rgba(111, 63, 160, 0.94)),
    #4b2777;
  color: #ffffff;
}

.school-identity,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.school-identity strong,
.school-identity span {
  display: block;
}

.school-identity strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.school-identity span {
  margin-top: 3px;
  color: #d9ebe8;
  font-size: 0.9rem;
}

.school-crest {
  width: clamp(48px, 7vh, 58px);
  height: clamp(48px, 7vh, 58px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  padding: 4px;
}

.school-crest.small {
  width: 42px;
  height: 42px;
  border-color: var(--line);
  padding: 3px;
}

.brand-copy {
  max-width: 560px;
}

.rpi-brand-image {
  display: block;
  width: clamp(56px, 8vh, 76px);
  height: clamp(56px, 8vh, 76px);
  margin-bottom: clamp(10px, 2vh, 16px);
  padding: 6px;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.brand-copy .eyebrow {
  margin: 0 0 10px;
  color: #f2d3ca;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.brand-panel h1 {
  max-width: 520px;
  margin: 0 0 clamp(8px, 1.4vh, 14px);
  font-size: clamp(3rem, 7vh, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand-panel p {
  max-width: 520px;
  color: #d9ebe8;
  line-height: 1.55;
}

.brand-cta-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: min(700px, 100%);
  margin-top: clamp(14px, 2.4vh, 22px);
  padding: 18px;
  border: 1px solid rgba(187, 247, 208, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(34, 197, 94, 0.12)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    0 18px 42px rgba(22, 12, 46, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
}

.brand-cta-strip::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(134, 239, 172, 0.72), rgba(255, 255, 255, 0.12), rgba(45, 212, 191, 0.5));
}

.brand-cta-strip .cta-tag {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #14532d;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand-cta-strip strong {
  display: block;
  margin-top: 7px;
  color: #ffffff;
  font-size: 1.28rem;
  line-height: 1.15;
}

.brand-cta-strip p {
  margin: 9px 0 0;
  color: #effcf6;
  font-size: 0.92rem;
  line-height: 1.45;
}

.brand-cta-strip .cta-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 170px;
}

.brand-cta-strip .btn {
  min-height: 44px;
  padding-inline: 16px;
  white-space: nowrap;
}

.brand-cta-strip .cta-primary {
  background: linear-gradient(135deg, #86efac, #22c55e);
  color: #073b1d;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.24);
}

.brand-cta-strip .cta-support {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  width: min(700px, 100%);
  max-width: 700px;
  align-items: stretch;
}

.brand-highlights > div {
  padding: clamp(10px, 1.6vh, 14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  min-height: 82px;
}

.brand-highlights strong,
.brand-highlights span {
  display: block;
}

.brand-highlights span {
  margin-top: 5px;
  color: #d9ebe8;
  font-size: 0.88rem;
  line-height: 1.45;
}

.system-credit {
  max-width: 360px;
  padding: clamp(10px, 1.6vh, 14px) 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.system-credit span,
.system-credit strong,
.system-credit small,
.sidebar-credit span,
.sidebar-credit strong,
.sidebar-credit small {
  display: block;
}

.system-credit span {
  color: #d9ebe8;
  font-size: 0.82rem;
}

.system-credit strong {
  margin-top: 5px;
  color: #ffffff;
  font-size: 1.02rem;
}

.system-credit small {
  margin-top: 4px;
  color: #f1ddd8;
  line-height: 1.45;
}

.bulk-review-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.bulk-review-table td:first-child,
.bulk-review-table th:first-child {
  width: 70px;
  text-align: center;
}

.bulk-review-table td {
  vertical-align: top;
}

.queue-rpi-select {
  width: 100%;
  min-width: 210px;
}

.queue-rpi-select + small {
  display: block;
  margin-top: 5px;
}

.signature-upload-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, auto);
  gap: 16px;
  align-items: center;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.signature-upload-card h3 {
  margin: 0 0 6px;
}

.signature-upload-actions {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.admin-reset-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #f0c4bd;
  border-radius: 8px;
  background: #fffafa;
}

.admin-reset-panel h3 {
  margin: 0 0 5px;
}

.parent-consent-panel,
.parent-alert {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #f0c4bd;
  border-radius: 8px;
  background: #fff7f5;
}

.parent-consent-panel h3 {
  margin: 0 0 6px;
}

.parent-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.parent-consent-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn:disabled,
.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: grayscale(0.2);
}

.parent-rpi-picker {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr);
  gap: 12px;
  align-items: end;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--active-line);
  border-radius: 8px;
  background: var(--action-soft);
}

.parent-rpi-picker strong,
.parent-rpi-picker span {
  display: block;
}

.parent-rpi-picker label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.parent-rpi-picker select {
  width: 100%;
}

.consent-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.consent-status.ok {
  background: var(--soft);
  color: var(--primary-dark);
}

.consent-status.warn {
  background: #fff0ec;
  color: #9f2419;
}

.parent-alert {
  border-color: #e08b7f;
  background: #fff0ec;
  color: #7f1d1d;
}

.parent-alert pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.45;
}

.parent-alert.compact {
  margin-top: 0;
}

.btn.parent-ok {
  background: #15803d;
  color: #ffffff;
  box-shadow: none;
  cursor: default;
}

.btn.parent-info {
  background: #b42318;
  color: #ffffff;
}

.btn.parent-done {
  border-color: var(--active-line);
  background: var(--action-soft);
  color: var(--primary-dark);
}

.signature-preview,
.approval-stamp {
  display: block;
  object-fit: contain;
}

.signature-preview {
  max-width: 240px;
  max-height: 88px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.signature-placeholder {
  min-width: 220px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfe;
}

.login-card {
  align-self: center;
  width: min(500px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(22px, 3.2vh, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card-head {
  margin-bottom: 6px;
}

.login-card h2,
.section-title h2,
.modal h2 {
  margin: 0;
  font-size: 1.35rem;
}

.login-card-head h2 {
  margin-top: 10px;
  font-size: 1.55rem;
}

.login-note {
  display: grid;
  gap: 4px;
  margin-top: clamp(10px, 1.6vh, 16px);
  padding: clamp(10px, 1.5vh, 12px);
  border: 1px solid var(--active-line);
  border-radius: 8px;
  background: var(--action-soft);
  color: var(--primary-dark);
  font-size: 0.9rem;
}

.login-note span {
  color: var(--muted);
  line-height: 1.45;
}

.demo-accounts {
  gap: 8px;
}

.demo-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.demo-account-grid span {
  padding: 8px;
  border: 1px solid #d8c7f1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.82rem;
}

.demo-account-grid b {
  display: block;
  color: var(--primary-dark);
  font-size: 0.78rem;
}

.login-support-box {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid #bfe7de;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(224, 251, 244, 0.98), rgba(241, 247, 255, 0.98)),
    #f5fffc;
  box-shadow: 0 14px 30px rgba(28, 116, 103, 0.08);
}

.login-support-box strong {
  display: block;
  margin-top: 6px;
  color: #123f37;
  font-size: 1rem;
  line-height: 1.2;
}

.login-support-box span {
  display: block;
  margin-top: 4px;
  color: #42645f;
  font-size: 0.86rem;
  line-height: 1.35;
}

.login-support-box .support-tag {
  display: inline-flex;
  width: fit-content;
  margin-top: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #0f6b5d;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-support-box .btn {
  min-width: 138px;
  white-space: nowrap;
}

.login-support-box .support-action {
  background: #20b486;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(32, 180, 134, 0.22);
}

.login-support-box .support-action:hover {
  background: #159a73;
}

.mobile-app-link {
  width: 100%;
  min-height: 38px;
  border: 0;
  margin-top: 9px;
  padding: 9px 12px;
  border: 1px solid #e6d5ff;
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.mobile-app-link:hover {
  background: var(--active-soft);
}

.registration-modal {
  width: min(920px, 100%);
}

.registration-receipt-modal {
  width: min(760px, 100%);
}

.receipt-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.receipt-card div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8ff;
}

.receipt-card span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.receipt-card strong {
  display: block;
  margin-top: 4px;
  color: var(--primary-dark);
  word-break: break-word;
}

.receipt-copy-box {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.45;
  resize: vertical;
}

.receipt-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.support-modal {
  width: min(760px, 100%);
}

.support-form textarea {
  min-height: 110px;
}

@media (min-width: 900px) {
  .login-page {
    height: 100vh;
    height: 100svh;
    overflow: hidden;
  }

  .login-card {
    max-height: calc(100svh - 32px);
    overflow: auto;
  }
}

@media (min-width: 900px) and (max-height: 760px) {
  .brand-copy .eyebrow {
    margin-bottom: 6px;
    font-size: 0.72rem;
  }

  .rpi-brand-image {
    width: 58px;
    height: 58px;
    padding: 5px;
  }

  .brand-panel h1 {
    font-size: 3rem;
  }

  .brand-cta-strip strong {
    font-size: 1.05rem;
  }

  .brand-cta-strip p {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .brand-panel p,
  .brand-highlights span {
    font-size: 0.86rem;
    line-height: 1.4;
  }

  .brand-highlights {
    gap: 8px;
  }

  .login-card-head h2 {
    font-size: 1.35rem;
  }
}

.logo-setting-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.logo-preview {
  border-color: var(--line);
}

.small-btn {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.registration-benefits {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid #d8c7f1;
  border-radius: 8px;
  background: #fbf8ff;
  color: var(--primary-dark);
  font-size: 0.88rem;
}

.registration-benefits span::before {
  content: "✓";
  margin-right: 8px;
  color: #15803d;
  font-weight: 800;
}

.registration-form {
  display: grid;
  gap: 12px;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.package-card {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.package-card.recommended {
  border-color: #8b5cf6;
  background: #fbf8ff;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.16);
}

.package-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mini-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ede9fe;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.package-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.package-price {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.05rem;
  font-weight: 800;
}

.package-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.package-meta {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.package-features {
  margin: 2px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.developer-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.billing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 14px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 42, 127, 0.08), rgba(24, 184, 156, 0.09)),
    #ffffff;
}

.billing-hero h3 {
  margin: 8px 0 6px;
  color: var(--primary-dark);
  font-size: 1.35rem;
}

.billing-hero p {
  margin: 3px 0;
  color: var(--muted);
}

.billing-amount {
  min-width: 230px;
  padding: 16px;
  border: 1px solid rgba(24, 184, 156, 0.36);
  border-radius: 8px;
  background: #f0fdfa;
}

.billing-amount span,
.billing-amount small {
  display: block;
  color: var(--muted);
}

.billing-amount strong {
  display: block;
  margin: 5px 0;
  color: #0f766e;
  font-size: 1.55rem;
}

.payment-history {
  margin-top: 12px;
}

.invoice-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: center;
  min-height: 250px;
}

.invoice-action-copy {
  align-self: start;
}

.billing-bank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.billing-bank-layout .profile-summary-grid strong {
  color: var(--primary-dark);
  font-size: 1.22rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.payment-qr-panel {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: center;
  min-height: 170px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.payment-qr-panel img {
  width: 116px;
  height: 116px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
}

.payment-qr-panel span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.payment-qr-panel.empty-qr {
  background: #fbf8ff;
}

.payment-qr-panel.large {
  min-height: 250px;
  padding: 18px;
}

.payment-qr-panel.large img {
  width: 210px;
  height: 210px;
}

.developer-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.developer-modal {
  width: min(860px, 100%);
}

@media (max-width: 720px) {
  .package-grid {
    grid-template-columns: 1fr;
  }

  .developer-panel {
    grid-template-columns: 1fr;
  }

  .billing-hero {
    grid-template-columns: 1fr;
  }

  .billing-amount {
    min-width: 0;
  }

  .billing-bank-layout {
    grid-template-columns: 1fr;
  }

  .invoice-action-card {
    grid-template-columns: 1fr;
  }

  .payment-qr-panel.large img {
    width: min(230px, 70vw);
    height: min(230px, 70vw);
  }

  .receipt-card,
  .receipt-actions {
    grid-template-columns: 1fr;
  }

  .login-support-box {
    grid-template-columns: 1fr;
  }

  .login-support-box .btn {
    width: 100%;
  }
}

.form-heading {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.profile-summary-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.profile-summary-grid span,
.profile-summary-grid strong {
  display: block;
}

.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 15px;
  align-content: start;
}

.field label {
  font-weight: 700;
  font-size: 0.9rem;
}

.field label::after {
  content: " boleh isi";
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dff0ff;
  color: #155d91;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.field label:has(input[type="checkbox"])::after,
.field label:has(input[type="radio"])::after {
  content: "";
  display: none;
}

.field-hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--active-soft);
  color: var(--ink);
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.form-grid {
  align-items: start;
}

.compact-field {
  grid-template-rows: auto 44px auto;
}

.compact-field input,
.compact-field select {
  height: 44px;
}

.compact-hint {
  min-height: 18px;
  font-size: 0.82rem;
}

.ai-panel {
  position: relative;
  padding: 14px;
  border: 1px solid var(--active-line);
  border-radius: 8px;
  background: var(--action-soft);
}

.ai-panel .btn {
  justify-self: start;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 7px;
  padding: 10px 14px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(111, 63, 160, 0.16);
}

.btn:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  border: 1px solid #d4c7e6;
  background: #fbf9fe;
  color: var(--primary-dark);
  box-shadow: none;
}

.btn.secondary:hover {
  border-color: var(--active);
  background: var(--active-soft);
}

.btn.danger {
  background: var(--danger);
  box-shadow: 0 8px 16px rgba(180, 35, 24, 0.16);
}

.demo-logins {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 0.9rem;
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.sidebar h1 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.teacher-pill {
  display: inline-flex;
  margin: 10px 0 22px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.85rem;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  justify-content: flex-start;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  text-decoration: none;
}

.nav button:hover,
.nav button:focus-visible,
.nav-link-btn:hover,
.nav-link-btn:focus-visible {
  border-color: var(--active);
  background: var(--active-soft);
  color: var(--primary-dark);
}

.achievement-app-shell .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fbf8ff 100%);
}

.achievement-app-shell .content {
  background: #f8fafc;
}

.sidebar-credit {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--active-line);
  border-radius: 8px;
  background: var(--action-soft);
  color: var(--primary-dark);
  font-size: 0.82rem;
  line-height: 1.45;
}

.sidebar-credit span {
  color: var(--muted);
}

.sidebar-credit strong {
  margin-top: 4px;
  font-size: 0.92rem;
}

.sidebar-credit small {
  margin-top: 3px;
  color: var(--muted);
}

.sync-status {
  display: grid;
  gap: 4px;
  margin: 8px 0 10px;
}

.sync-status .badge {
  justify-self: start;
}

.sync-status small {
  color: var(--muted);
  font-size: 0.76rem;
}

.content {
  padding: 28px;
  min-width: 0;
}

@media (min-width: 861px) {
  .dashboard {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar {
    height: 100vh;
    height: 100svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .content {
    height: 100vh;
    height: 100svh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-title {
  display: grid;
  gap: 6px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-bar {
  margin: 0 0 16px;
}

.search {
  min-width: min(360px, 100%);
  min-height: 40px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  padding: 9px 12px;
  background: var(--active-soft);
}

.search::placeholder,
textarea::placeholder,
input::placeholder {
  color: #687789;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.stat-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.stat-button:hover,
.stat-button:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(111, 56, 174, 0.12);
  outline: none;
}

.task-summary-card {
  margin-bottom: 16px;
}

.bulk-login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #bfe5df;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4fffb 0%, #fbf8ff 100%);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 12px 30px rgba(43, 20, 74, 0.06);
}

.bulk-login-panel strong,
.bulk-login-panel span {
  display: block;
}

.bulk-whatsapp-modal {
  max-width: 860px;
}

.bulk-whatsapp-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.bulk-whatsapp-progress div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf8ff;
  padding: 10px 12px;
}

.bulk-whatsapp-progress span,
.bulk-whatsapp-progress strong {
  display: block;
}

.bulk-whatsapp-progress strong {
  margin-top: 4px;
  font-size: 20px;
  color: var(--primary-dark);
}

.bulk-whatsapp-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.parent-whatsapp-panel {
  margin-bottom: 16px;
  border: 1px solid #bfe5df;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4fffb 0%, #fbf8ff 100%);
  padding: 14px;
  box-shadow: 0 12px 30px rgba(43, 20, 74, 0.06);
}

.parent-whatsapp-panel h3 {
  margin: 0;
}

.parent-whatsapp-panel.expanded {
  border-color: #9edfd5;
}

.parent-whatsapp-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.parent-whatsapp-header-actions .search {
  width: min(320px, 100%);
}

.parent-whatsapp-detail {
  margin-top: 12px;
  border-top: 1px solid rgba(25, 179, 155, 0.22);
  padding-top: 12px;
}

.parent-whatsapp-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.parent-whatsapp-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d8c7ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.parent-whatsapp-row span {
  display: grid;
  gap: 2px;
}

.parent-whatsapp-row small {
  color: var(--muted);
}

.mysql-loading-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr);
  background: var(--bg);
}

.mysql-loading-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(28px, 6vw, 72px);
  color: #fff;
  background: linear-gradient(150deg, #542a82, #7741ab 58%, #319c9a);
}

.mysql-loading-hero h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.mysql-loading-hero p {
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.55;
}

.mysql-loading-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(20px, 6vh, 70px);
}

.mysql-loading-brand strong,
.mysql-loading-brand span {
  display: block;
}

.mysql-loading-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 12px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.mysql-loading-panel {
  display: grid;
  place-items: center;
  padding: 28px;
}

.mysql-loading-card {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

.mysql-loading-card .sync-status {
  justify-content: flex-start;
}

.mysql-error-detail {
  max-height: 120px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #f0d7a1;
  border-radius: 8px;
  color: #704600;
  background: #fff8e8;
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.9rem;
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.task-tile {
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--active-line);
  border-radius: 8px;
  background: #fbf8ff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.task-tile span {
  color: var(--muted);
  font-weight: 700;
}

.task-tile strong {
  color: var(--primary);
  font-size: 28px;
  line-height: 1;
}

.action-date-stat input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--active-soft);
  color: var(--ink);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f9fafc;
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.82rem;
}

.badge.warn {
  background: var(--warn);
  color: #7a4c00;
}

.badge.secondary {
  background: #eef2f7;
  color: var(--muted);
}

.parent-admin-table table {
  min-width: 900px;
}

.login-audit-card {
  margin-top: 16px;
}

.login-audit-table table {
  min-width: 880px;
}

.parent-admin-table small {
  color: var(--muted);
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 51, 0.42);
  z-index: 20;
}

.modal {
  width: min(760px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

.full {
  grid-column: 1 / -1;
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.rpi-panel {
  display: grid;
  gap: 14px;
}

.achievement-toolbar {
  margin-bottom: 16px;
}

.achievement-search-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  width: 100%;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.achievement-search-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
}

.achievement-search-field span {
  font-size: 0.86rem;
}

.achievement-search-row .btn {
  min-height: 44px;
  padding-inline: 16px;
}

.mobile-achievement-card {
  display: none;
}

.achievement-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.achievement-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.achievement-form h3,
.achievement-list h3 {
  margin-top: 0;
}

.achievement-list {
  display: grid;
  gap: 12px;
}

.achievement-action-row,
.achievement-save-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.achievement-save-row .btn:first-child {
  min-height: 48px;
}

.achievement-entry {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.achievement-entry .topbar.compact {
  align-items: center;
}

.achievement-entry p {
  line-height: 1.45;
}

.evidence-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.evidence-summary div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.evidence-summary span,
.evidence-summary strong {
  display: block;
}

.evidence-checklist {
  align-content: start;
}

.evidence-checklist label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 3px 10px 3px 0;
  font-weight: 600;
}

.evidence-template-list {
  display: grid;
  gap: 8px;
}

.evidence-template-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.evidence-template-row input[type="text"],
.evidence-template-row input:not([type]) {
  min-height: 38px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--active-soft);
}

.evidence-template-row label {
  margin: 0;
  white-space: nowrap;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.evidence-file-current,
.evidence-file-line {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  font-size: 0.92rem;
}

.evidence-file-current a,
.evidence-file-line a {
  font-weight: 700;
  color: var(--primary);
}

.evidence-file-meta {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.evidence-file-missing {
  display: inline-block;
  color: var(--danger);
  font-weight: 700;
}

.evidence-skill-head {
  align-items: center;
  margin-bottom: 6px;
}

.hearing-support-panel {
  border: 1px solid #c7eadf;
  border-left: 4px solid #19b39b;
  border-radius: 8px;
  padding: 12px;
  background: #f2fffb;
}

.hearing-support-panel .compact-grid {
  margin-top: 10px;
}

.evidence-skill-head label {
  margin: 0;
}

.evidence-skill-head .btn {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.school-date-field {
  align-content: start;
}

.school-date-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.school-date-status {
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 0.92rem;
  font-weight: 700;
}

.school-date-status.ok {
  border: 1px solid #bbf7d0;
  background: #ecfdf3;
  color: #166534;
}

.school-date-status.blocked {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.school-date-calendar {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf9fe;
}

.school-date-calendar.collapsed {
  display: none;
}

.school-calendar-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  text-align: center;
}

.calendar-nav-btn {
  min-height: 38px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  background: var(--active-soft);
  color: var(--primary-dark);
  font-size: 1.4rem;
  font-weight: 800;
}

.calendar-nav-btn:hover {
  background: #ffffff;
}

.school-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.school-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.school-calendar-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-green {
  background: #16a34a;
}

.legend-red {
  background: #dc2626;
}

.school-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 6px;
}

.school-day-name,
.school-day-cell {
  min-height: 34px;
  border-radius: 7px;
  text-align: center;
}

.school-day-name {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.school-day-cell {
  border: 1px solid transparent;
  font-weight: 800;
}

.school-day-cell.blank {
  min-height: 34px;
}

.school-day-cell.available {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.school-day-cell.available:hover {
  border-color: #16a34a;
  background: #dcfce7;
}

.school-day-cell.blocked {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
  cursor: not-allowed;
  opacity: 1;
}

.school-day-cell.selected {
  outline: 3px solid rgba(247, 201, 72, 0.8);
  outline-offset: 1px;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  margin-bottom: 16px;
  align-items: start;
}

.report-action-list {
  display: grid;
  gap: 8px;
}

.report-action-item {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.report-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 10px;
}

.report-mini-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.report-mini-grid span,
.report-mini-grid strong {
  display: block;
}

.report-mini-grid strong {
  margin-top: 6px;
  font-size: 1.45rem;
}

.gb-report-layout {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
}

.gb-info-list,
.gb-band-list {
  display: grid;
  gap: 10px;
}

.gb-info-list div,
.gb-band-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.gb-info-list span,
.gb-info-list strong,
.gb-band-row span,
.gb-band-row strong {
  display: block;
}

.gb-info-list strong,
.gb-band-row strong {
  margin-top: 6px;
  font-size: 1.32rem;
}

.gb-band-row .progress-track {
  margin-top: 10px;
}

.ppd-review-picker {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.7fr);
  gap: 12px;
  margin: 12px 0;
}

.ppd-review-picker label,
.ppd-note-panel {
  display: grid;
  gap: 7px;
}

.ppd-review-picker span {
  color: var(--muted);
  font-weight: 700;
}

.ppd-note-panel {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.ppd-official-stack {
  margin-top: 12px;
}

.compact-table table {
  min-width: 560px;
}

.restore-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.restore-row:last-child {
  border-bottom: 0;
}

.objective-reference {
  margin: 12px 0 16px;
  padding: 12px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--soft);
}

.objective-reference p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.topbar.compact {
  margin-bottom: 8px;
}

.rpi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.rpi-card h3 {
  margin: 0 0 4px;
}

.rpi-card p {
  line-height: 1.45;
}

.rpi-compact-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.rpi-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

button.rpi-summary-pill {
  cursor: pointer;
}

button.rpi-summary-pill:hover {
  border-color: var(--primary);
  background: #fbf8ff;
}

.rpi-summary-pill span {
  color: var(--muted);
  font-size: 0.86rem;
}

.rpi-summary-pill strong {
  font-size: 1.05rem;
}

.rpi-panel {
  margin-top: 10px;
}

.achievement-toolbar {
  margin-top: 10px;
  margin-bottom: 10px;
}

.parent-whatsapp-panel:not(.expanded) {
  padding: 12px 16px;
}

.parent-whatsapp-panel:not(.expanded) .topbar {
  margin-bottom: 0;
}

.parent-whatsapp-panel:not(.expanded) h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.parent-whatsapp-panel:not(.expanded) p {
  margin: 0;
}

.rpi-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.rpi-list-pane,
.rpi-detail-pane {
  min-width: 0;
}

.rpi-list-pane {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 128px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.rpi-list-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.rpi-list-items {
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow: auto;
}

.rpi-list-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.rpi-list-item:hover,
.rpi-list-item.active {
  border-color: var(--primary);
  background: #fbf8ff;
}

.rpi-list-title {
  font-weight: 800;
  line-height: 1.2;
}

.rpi-list-subtitle,
.rpi-list-series,
.rpi-list-metrics {
  color: var(--muted);
  font-size: 0.86rem;
}

.rpi-list-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rpi-list-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.rpi-list-metrics span {
  min-width: 0;
}

.rpi-detail-pane {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 128px);
  overflow: auto;
}

.rpi-detail-card {
  min-height: calc(100vh - 148px);
}

.rpi-table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.rpi-compact-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.rpi-compact-table th,
.rpi-compact-table td {
  vertical-align: top;
}

.rpi-compact-table th:nth-child(1) {
  width: 36%;
}

.rpi-compact-table th:nth-child(2) {
  width: 25%;
}

.rpi-compact-table th:nth-child(5) {
  width: 210px;
}

.rpi-table-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.rpi-table-badges,
.rpi-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rpi-table-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
}

.rpi-preview-modal {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.rpi-preview-modal .rpi-detail-card {
  min-height: 0;
}

.backup-panel {
  margin-top: 16px;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.backup-restore {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.assessment-access-note {
  border-color: #c7ddd9;
  background: #f6fbfa;
}

.assessment-access-note p {
  margin-bottom: 0;
}

.rpi-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.rpi-meta-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.rpi-meta-grid span,
.rpi-meta-grid strong {
  display: block;
}

.rpi-meta-grid strong {
  margin-top: 4px;
}

.worksheet-modal {
  max-width: 940px;
}

.worksheet-chatgpt-modal {
  max-width: 880px;
}

.worksheet-chatgpt-card {
  border: 1px solid #bfe5df;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4fffb 0%, #f5edff 100%);
  padding: 16px;
  margin: 12px 0;
}

.worksheet-chatgpt-card h3 {
  margin: 8px 0 6px;
  color: var(--primary-dark);
}

.worksheet-chatgpt-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.worksheet-chatgpt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.trial-copy-status {
  margin-top: 10px !important;
  padding: 10px 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e !important;
  font-weight: 700;
}

.worksheet-prompt-box {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.worksheet-prompt-box textarea {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf8ff;
  color: #17122b;
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
}

.worksheet-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.worksheet-note {
  border: 1px solid #c7ddd9;
  background: #f4fbfa;
  color: #3e5f58;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.45;
}

.worksheet-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8ff 100%);
  padding: 14px;
  margin-bottom: 14px;
  display: grid;
  gap: 12px;
}

.worksheet-editor label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.worksheet-editor input,
.worksheet-editor select,
.worksheet-editor textarea {
  width: 100%;
  min-width: 0;
}

.worksheet-saved-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.worksheet-saved-panel .topbar {
  margin-bottom: 10px;
}

.worksheet-saved-panel h3 {
  margin: 0;
}

.worksheet-saved-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
  background: #fbf8ff;
}

.worksheet-saved-list {
  display: grid;
  gap: 8px;
}

.worksheet-saved-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbf8ff;
}

.worksheet-saved-item strong,
.worksheet-saved-item span {
  display: block;
}

.worksheet-saved-item span {
  color: var(--muted);
  margin-top: 3px;
  font-size: 13px;
}

.worksheet-saved-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.worksheet-a4-preview {
  border: 1px solid #d7c6ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 12px 34px rgba(43, 20, 74, 0.07);
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
  font-size: 12px;
}

.worksheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 4px solid var(--primary);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.worksheet-header img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  background: #fff;
}

.worksheet-header strong,
.worksheet-header span {
  display: block;
}

.worksheet-header strong {
  color: var(--primary);
  font-size: 22px;
}

.worksheet-header span {
  color: var(--muted);
  margin-top: 3px;
}

.worksheet-a4-preview h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.worksheet-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.worksheet-meta div,
.worksheet-score-grid span {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbf8ff;
  padding: 10px;
}

.worksheet-meta span,
.worksheet-meta strong {
  display: block;
}

.worksheet-meta span {
  color: var(--muted);
  font-size: 12px;
}

.worksheet-meta strong {
  margin-top: 3px;
}

.worksheet-a4-preview section {
  margin-top: 14px;
}

.worksheet-a4-preview h4 {
  margin: 0 0 7px;
  color: var(--primary);
}

.worksheet-a4-preview p,
.worksheet-a4-preview li {
  line-height: 1.5;
}

.worksheet-score-grid {
  display: grid;
  gap: 7px;
}

.worksheet-activity-block {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  padding: 12px;
  margin: 10px 0;
}

.worksheet-mini-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}

.worksheet-copy-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(120px, 1fr) minmax(160px, 1.15fr);
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.worksheet-copy-word {
  font-size: 20px;
  font-weight: 800;
}

.worksheet-trace-word {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: transparent;
  -webkit-text-stroke: 1px var(--primary);
  text-shadow: 0 0 0 #ffffff;
}

.worksheet-write-lines span {
  display: block;
  height: 28px;
  border-bottom: 1px solid var(--primary);
}

.worksheet-shape-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
}

.worksheet-shape-card {
  border: 1px dashed #bca5dd;
  border-radius: 9px;
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 8px;
}

.worksheet-shape-card svg {
  width: 88px;
  height: 64px;
}

.trace-line {
  stroke: #555;
  stroke-width: 3.4;
  stroke-dasharray: 3 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.worksheet-shape-card > span {
  color: var(--muted);
  font-size: 12px;
}

.worksheet-number-trace {
  font-size: 54px;
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--primary);
}

.worksheet-assessment-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8ff;
  padding: 10px;
  margin-top: 10px;
}

.worksheet-assessment-box strong {
  width: 100%;
}

.worksheet-assessment-box label {
  color: var(--muted);
  font-size: 12px;
}

.worksheet-assessment-box span {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -2px;
}

.worksheet-object-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 14px;
  margin: 10px 0;
}

.worksheet-main-object {
  width: 15cm;
  height: 15cm;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px dashed #d8c7ec;
  border-radius: 12px;
  background: #fff;
}

.worksheet-main-object svg {
  width: 14cm;
  height: 13cm;
  max-width: 100%;
}

.worksheet-main-object strong {
  color: var(--primary);
  font-size: 28px;
  margin-top: -14px;
}

.worksheet-object-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.worksheet-object-side > div {
  border: 1px dashed #d8c7ec;
  border-radius: 10px;
  padding: 10px;
  min-height: 74px;
}

.worksheet-object-side svg {
  width: 110px;
  height: 78px;
}

.worksheet-object-side span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.worksheet-mini-lines span {
  display: block;
  height: 24px;
  border-bottom: 1px solid var(--primary);
}

.worksheet-prompt-activities {
  display: grid;
  gap: 12px;
}

.worksheet-prompt-activities.compact {
  margin-top: 10px;
}

.worksheet-prompt-activity {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.worksheet-prompt-activity > span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.worksheet-activity-line {
  grid-column: 2;
  height: 36px;
  border-bottom: 1px solid var(--line);
}

.worksheet-counting-block,
.worksheet-copy-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.worksheet-counting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.worksheet-counting-grid div {
  border: 1px dashed #d8c7ec;
  border-radius: 10px;
  display: grid;
  place-items: center;
  min-height: 110px;
}

.worksheet-counting-grid svg {
  width: 120px;
  height: 92px;
}

.worksheet-number-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.worksheet-number-boxes span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-weight: 800;
}

.worksheet-copy-lines span {
  display: block;
  height: 34px;
  border-bottom: 1px solid var(--primary);
}

.worksheet-task-list {
  display: grid;
  gap: 12px;
}

.worksheet-task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.worksheet-task-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.worksheet-task-title span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.worksheet-answer-space {
  margin-top: 12px;
  border: 1px dashed #bca5dd;
  border-radius: 8px;
  padding: 9px;
  color: var(--muted);
}

.worksheet-answer-space div {
  height: 28px;
  border-bottom: 1px solid var(--line);
}

.worksheet-check-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.worksheet-check-row label {
  color: var(--muted);
  font-size: 12px;
}

.worksheet-check-row span {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -2px;
}

.worksheet-sign-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.worksheet-sign-row div {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
}

.worksheet-a4-preview {
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 18px 44px rgba(43, 20, 74, 0.1);
  position: relative;
  overflow: hidden;
}

.worksheet-a4-preview::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(90deg, var(--primary), #19b39b, #f7c948);
}

.worksheet-premium-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}

.worksheet-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf8ff;
  color: var(--primary);
  font-weight: 800;
  padding: 7px 10px;
}

.worksheet-brand-pill img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.worksheet-level-pill {
  border-radius: 999px;
  background: #e9fff8;
  color: #087966;
  font-weight: 800;
  padding: 8px 12px;
}

.worksheet-title-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f5edff, #e9fbf8);
  padding: 16px;
  margin-bottom: 12px;
}

.worksheet-title-band > div > span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.worksheet-title-band h3 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.05;
  color: #2b1648;
}

.worksheet-mini-visuals {
  display: flex;
  gap: 8px;
}

.worksheet-mini-visuals div {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
}

.worksheet-mini-visuals svg {
  width: 58px;
  height: 50px;
}

.worksheet-student-strip {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.worksheet-student-strip div {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  min-height: 54px;
}

.worksheet-student-strip span,
.worksheet-student-strip strong {
  display: block;
}

.worksheet-student-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.worksheet-student-strip strong {
  margin-top: 6px;
  min-height: 18px;
}

.worksheet-objective-card,
.worksheet-instruction-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  margin-top: 10px;
}

.worksheet-task-zone {
  margin-top: 10px;
}

.worksheet-prompt-activity {
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 16px;
}

.worksheet-prompt-visual {
  border: 1px dashed var(--line);
  border-radius: 12px;
  min-height: 70px;
  display: grid;
  place-items: center;
  background: #fbf8ff;
}

.worksheet-prompt-visual svg {
  width: 74px;
  height: 58px;
}

.worksheet-choice-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 2px;
}

.worksheet-choice-row label {
  color: var(--muted);
  font-size: 12px;
}

.worksheet-choice-row i {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--primary);
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -2px;
}

.worksheet-footer-panel {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.worksheet-footer-panel > div {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8ff;
  padding: 10px;
  min-height: 62px;
}

.worksheet-footer-panel strong {
  width: 100%;
}

.worksheet-footer-panel label {
  color: var(--muted);
  font-size: 12px;
}

.worksheet-footer-panel span {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -2px;
}

.worksheet-real-task {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.match-task {
  display: grid;
  grid-template-columns: 1fr 54px 1fr;
  gap: 10px;
  align-items: center;
}

.match-pictures,
.match-words {
  display: grid;
  gap: 8px;
}

.match-pictures div,
.match-words strong {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf8ff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
}

.match-pictures svg {
  width: 54px;
  height: 42px;
}

.match-pictures span {
  font-weight: 800;
  color: var(--primary-dark);
}

.match-lines {
  display: grid;
  gap: 32px;
}

.match-lines span {
  border-bottom: 2px dashed var(--primary);
  transform: rotate(-8deg);
}

.circle-task {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.circle-task div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbf8ff;
  min-height: 102px;
  display: grid;
  place-items: center;
  padding: 8px;
  position: relative;
}

.circle-task svg {
  width: 76px;
  height: 58px;
}

.circle-task strong {
  font-size: 12px;
}

.circle-task span {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 999px;
}

.write-task {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: 12px;
  align-items: center;
}

.trace-chip {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbf8ff;
  color: transparent;
  -webkit-text-stroke: 1px var(--primary);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 12px;
  text-align: center;
}

.write-lines span {
  display: block;
  height: 28px;
  border-bottom: 2px solid var(--primary);
}

.worksheet-large-object-block {
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  margin: 10px 0;
  text-align: center;
}

.worksheet-large-object-block > strong {
  display: block;
  color: var(--primary);
  font-size: 16px;
  margin-bottom: 8px;
}

.worksheet-large-object {
  width: 15cm;
  height: 15cm;
  max-width: 100%;
  margin: 0 auto;
  border: 2px dashed #cbb7e8;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
}

.worksheet-large-object svg {
  width: 14cm;
  height: 13cm;
  max-width: 94%;
}

.worksheet-large-caption {
  margin-top: 8px;
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.teacher-confirm-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.teacher-confirm-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.35fr) minmax(150px, 0.55fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.teacher-confirm-row strong,
.teacher-confirm-row span {
  display: block;
}

.teacher-confirm-row span,
.teacher-confirm-status {
  color: var(--muted);
  line-height: 1.4;
}

.teacher-confirm-date {
  font-weight: 800;
  color: var(--primary-dark);
}

.rpi-compliance {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.rpi-compliance div {
  padding: 10px;
  border: 1px solid #c7ddd9;
  border-radius: 7px;
  background: #f6fbfa;
}

.rpi-compliance span,
.rpi-compliance strong,
.rpi-compliance small {
  display: block;
}

.rpi-compliance strong {
  margin-top: 4px;
  color: var(--primary-dark);
}

.rpi-compliance small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.rpi-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.rpi-checklist span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 0.84rem;
}

.rpi-checklist .ok {
  background: var(--soft);
  color: var(--primary-dark);
}

.rpi-checklist .missing {
  background: var(--warn);
  color: #7a4c00;
}

.rpi-import-note {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 4px solid #d28a00;
  border-radius: 6px;
  background: var(--warn);
  color: #5f3a00;
}

.rpi-next-step,
.parent-review-note {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #f1c56b;
  border-left: 4px solid #d28a00;
  border-radius: 8px;
  background: var(--warn);
  color: #5f3a00;
}

.rpi-next-step strong,
.parent-review-note strong {
  display: block;
  color: #4d2f00;
}

.rpi-next-step p,
.parent-review-note p {
  margin: 4px 0 0;
}

.parent-review-note span {
  font-weight: 700;
}

.rpi-next-step-list {
  display: grid;
  gap: 5px;
  font-size: 0.92rem;
}

.rpi-next-step .btn {
  justify-self: start;
}

.timeline-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.timeline-strip span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline-strip .active {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary-dark);
  font-weight: 700;
}

.mini-chart {
  margin: 10px 0;
}

.mini-bars {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.mini-bars span {
  width: 20px;
  border-radius: 5px 5px 0 0;
  background: var(--primary);
}

.official-stack {
  display: grid;
  gap: 22px;
  justify-items: center;
}

.forms-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(620px, 1fr);
  gap: 14px;
  align-items: start;
}

.forms-browser-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

.forms-preview-panel {
  min-height: 660px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.forms-preview-panel .official-stack {
  min-width: 840px;
}

.parent-forms-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.parent-forms-workspace .forms-browser-panel {
  position: static;
  max-height: none;
  overflow: visible;
}

.parent-forms-workspace .forms-preview-panel {
  max-height: none;
  overflow: visible;
  padding: 18px;
}

.parent-forms-workspace .forms-preview-panel .official-stack {
  min-width: 0;
  justify-items: center;
}

.parent-forms-workspace .print-picker {
  margin-bottom: 12px;
}

.parent-forms-workspace .parent-consent-panel {
  margin: 0 0 14px;
}

.print-picker {
  display: block;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.print-dashboard {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.print-summary,
.print-warning,
.print-form-options {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.print-warning {
  color: var(--muted);
}

.print-form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 12px;
}

.print-form-options label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--active-line);
  border-radius: 6px;
  background: #fff;
}

.print-form-options input {
  width: 18px;
  height: 18px;
}

.print-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
}

.print-step-title strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--active-line);
  border-radius: 6px;
  background: var(--action-soft);
  color: var(--primary-dark);
}

.print-step-title span {
  color: var(--muted);
  font-weight: 700;
}

.print-step-title.compact {
  margin-top: 0;
}

.quick-print-modal {
  max-width: 680px;
}

.quick-print-steps {
  display: grid;
  gap: 12px;
}

.quick-form-options {
  margin-bottom: 0;
}

.quick-print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-print-actions .btn {
  min-height: 42px;
}

.current-page-print-root {
  display: none;
}

@media print {
  body.printing-current-page-only > :not(.current-page-print-root) {
    display: none !important;
  }

  body.printing-current-page-only .current-page-print-root {
    display: block !important;
  }

  body.printing-current-page-only .current-page-print-root .official-stack {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.printing-current-page-only .current-page-print-root .sop-page,
  body.printing-current-page-only .current-page-print-root .evidence-page,
  body.printing-current-page-only .current-page-print-root .evidence-attachment-page,
  body.printing-current-page-only .current-page-print-root .evidence-form-page {
    break-before: auto !important;
    page-break-before: auto !important;
    break-after: page !important;
    page-break-after: always !important;
  }

  body.printing-current-page-only .current-page-print-root .official-stack > :last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
}

/* Patch 20260625: trial/login controls */
.login-support-box {
  grid-template-columns: minmax(0, 1fr) 150px;
}

.login-support-box > div:first-child {
  min-width: 0;
}

.login-support-box > div:first-child span:not(.support-tag) {
  max-width: none;
}

.support-actions-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  justify-self: end;
  width: 150px;
}

.support-actions-inline .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
}

@media (max-width: 720px) {
  .login-support-box {
    grid-template-columns: 1fr;
  }

  .support-actions-inline {
    justify-self: stretch;
    width: 100%;
  }
}

.account-help-result {
  margin-top: 14px;
}

.trial-access-note {
  border-color: #f59e0b;
  background: #fffbeb;
}

.trial-preview-watermark {
  position: relative;
}

.trial-preview-watermark::before {
  content: "PREVIEW TRIAL";
  position: sticky;
  top: 12px;
  z-index: 5;
  display: block;
  width: max-content;
  margin: 0 auto -42px;
  padding: 8px 16px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: rgba(255, 251, 235, .95);
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

@media print {
  .trial-preview-watermark::before {
    display: none;
  }
}

.print-picker label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.print-picker select {
  min-width: min(420px, 100%);
  min-height: 42px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  padding: 9px 12px;
  background: var(--active-soft);
  color: var(--ink);
}

.multi-dropdown {
  position: relative;
  width: 100%;
}

.multi-dropdown summary {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  background: var(--active-soft);
  font-weight: 700;
  cursor: pointer;
}

.multi-dropdown-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  margin-top: 8px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.print-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  margin: 10px 0;
}

.multi-dropdown-list label {
  justify-content: flex-start;
  min-height: 34px;
  padding: 4px 2px;
}

.print-student-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(145px, 0.72fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}

.print-student-row.is-filtered-out {
  display: none !important;
}

.print-student-row:last-child {
  border-bottom: 0;
}

.print-student-row label {
  font-weight: 700;
}

.print-student-name {
  display: grid !important;
  gap: 3px;
  align-items: start !important;
}

.print-student-name strong {
  line-height: 1.18;
}

.print-student-name span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.print-student-row select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--active-line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--active-soft);
}

.print-student-row .btn.compact {
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}

.print-search-empty {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #ffffff;
}

.print-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sop-page {
  width: min(794px, 100%);
  min-height: 1123px;
  padding: 56px 42px;
  border: 1px solid #111827;
  border-radius: 2px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.25;
  position: relative;
  box-sizing: border-box;
}

.print-footer {
  position: absolute;
  right: 12mm;
  bottom: 7mm;
  left: 12mm;
  color: #4b5563;
  font-size: 10px;
  text-align: right;
}

.sop-code {
  text-align: right;
  font-size: 13px;
  margin-bottom: 28px;
}

.sop-page h3 {
  margin: 0 0 34px;
  text-align: center;
  font-size: 18px;
  line-height: 1.35;
  text-transform: uppercase;
}

.prasidang-page {
  padding-top: 64px;
}

.prasidang-page h3 {
  margin-bottom: 46px;
}

.sop-lines {
  display: grid;
  gap: 0;
}

.sop-line {
  display: grid;
  grid-template-columns: 28px 210px 22px 1fr;
  min-height: 38px;
  align-items: start;
  font-size: 17px;
}

.sop-box-line {
  min-height: 128px;
}

.sop-no,
.sop-label,
.sop-colon {
  font-weight: 700;
}

.sop-value {
  min-height: 26px;
  border-bottom: 1px dotted #4b5563;
  line-height: 1;
  text-align: justify;
  text-justify: inter-word;
  white-space: pre-wrap;
}

.prasidang-page .sop-value {
  display: block;
  width: 100%;
}

.sop-box-line .sop-value {
  min-height: 110px;
  border: 1px solid transparent;
  border-bottom: 1px dotted #4b5563;
}

.prasidang-page .sop-box-line .sop-value {
  border-top: 0;
  border-right: 0;
  border-left: 0;
}

.sop-section-title {
  margin: 14px 0 8px;
  font-weight: 700;
}

.rpi-page-two {
  padding: 40px 36px;
  font-size: 14px;
}

.rpi-page-two h3 {
  margin-bottom: 28px;
  font-size: 17px;
}

.rpi-ms2-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.7fr 1fr;
  border-top: 1px solid #111827;
  border-left: 1px solid #111827;
}

.rpi-ms2-grid .cell {
  min-height: 34px;
  padding: 7px 8px;
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
  line-height: 1;
  text-align: justify;
  text-justify: inter-word;
}

.rpi-ms2-grid .cell span {
  font-weight: 700;
}

.rpi-ms2-grid .wide-2 {
  grid-column: span 2;
}

.rpi-ms2-grid .wide-3 {
  grid-column: 1 / -1;
}

.rpi-ms2-grid .tall {
  min-height: 66px;
}

.focus-long-cell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px;
  align-items: start;
}

.focus-long-cell strong {
  white-space: nowrap;
}

.focus-long-cell span {
  display: block;
  line-height: 1.18;
}

.program-cell {
  display: grid;
  gap: 3px;
}

.focus-grid {
  margin-top: 0;
}

.rpi-page-three {
  padding: 50px 42px 32px;
  font-size: 12.8px;
}

.rpi-ms3-table {
  display: grid;
  grid-template-columns: 0.92fr 1.28fr 0.78fr;
  border-top: 1px solid #111827;
  border-left: 1px solid #111827;
}

.ms3-head,
.ms3-body {
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
  padding: 8px;
  line-height: 1;
}

.ms3-head {
  min-height: 54px;
  text-align: center;
  font-weight: 700;
}

.ms3-body {
  text-align: justify;
  text-justify: inter-word;
}

.ms3-head small {
  font-weight: 400;
}

.ms3-body {
  min-height: 260px;
}

.ms3-intervention-cell {
  display: grid;
  gap: 12px;
  align-content: start;
}

.ms3-intervention-cell div {
  min-height: 70px;
}

.achievement-report-item {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dotted #9ca3af;
  text-align: justify;
  text-justify: inter-word;
}

.achievement-report-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.ms3-block {
  min-height: 132px;
  padding: 12px 8px;
  border-left: 1px solid #111827;
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
  line-height: 1;
}

.ms3-block.medium {
  min-height: 96px;
}

.ms3-block span {
  display: block;
  margin-top: 8px;
}

.ms3-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-left: 1px solid #111827;
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
}

.ms3-dates div,
.ms3-imk {
  min-height: 38px;
  padding: 8px;
}

.ms3-dates div:first-child {
  border-right: 1px solid #111827;
}

.ms3-dates span,
.ms3-imk span,
.perakuan span:not(.dots) {
  font-weight: 700;
}

.ms3-imk {
  border-left: 1px solid #111827;
  border-right: 1px solid #111827;
  border-bottom: 1px solid #111827;
}

.perakuan-title {
  margin: 14px 0 9px;
  font-weight: 700;
}

.perakuan {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
  align-items: start;
}

.perakuan div {
  min-height: 52px;
  line-height: 1.5 !important;
}

.perakuan .wide {
  grid-column: 1 / -1;
  min-height: 24px;
}

.dots {
  display: block;
  width: 100%;
  margin-top: 28px;
  border-bottom: 1px dotted #111827;
}

.perakuan div:not(.wide) .dots {
  margin-top: 30px;
}

.approval-sign-block {
  position: relative;
  min-height: 88px;
  margin-top: 8px;
  padding-top: 4px;
}

.approval-sign-block .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  margin-top: 0;
}

.approval-stamp {
  position: absolute;
  left: 34%;
  bottom: 18px;
  width: 58%;
  max-height: 70px;
  z-index: 1;
}

.approval-sign-meta {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  width: 62%;
  margin-left: 34%;
  padding-top: 42px;
  line-height: 1.1;
  text-align: center;
}

.approval-sign-meta span {
  font-weight: 400 !important;
  font-size: 0.96rem;
}

.approval-sign-meta strong {
  display: block;
  color: #123b63;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.teacher-sign-block .approval-sign-meta {
  width: 72%;
  margin-left: 26%;
}

.teacher-sign-block .approval-sign-meta strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  font-size: 0.66rem;
}

.teacher-sign-block .approval-sign-meta span {
  font-size: 0.82rem;
}

.parent-sign-block {
  position: relative;
  min-height: 78px;
  margin-top: 8px;
  padding-top: 4px;
}

.parent-sign-block .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  margin-top: 0;
}

.parent-sign-meta {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding-top: 18px;
  line-height: 1.15;
  text-align: center;
}

.parent-sign-meta strong {
  font-size: 0.84rem;
  text-transform: uppercase;
}

.parent-sign-meta small,
.parent-sign-meta span {
  font-size: 0.78rem;
}

.official-form {
  border: 1px solid #1f2937;
  border-radius: 4px;
  padding: 22px;
  background: #ffffff;
}

.official-form h3 {
  margin: 4px 0 18px;
  text-align: center;
  text-transform: uppercase;
  font-size: 1rem;
  line-height: 1.4;
}

.official-form h4 {
  margin: 20px 0 10px;
  padding: 8px 10px;
  background: #eef2f7;
  border: 1px solid #cfd7e3;
  font-size: 0.95rem;
}

.form-code {
  text-align: right;
  color: var(--muted);
  font-size: 0.82rem;
}

.official-grid {
  display: grid;
  gap: 8px;
}

.official-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.official-row {
  display: grid;
  grid-template-columns: 34px minmax(150px, 0.45fr) 1fr;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d4dbe6;
  align-items: start;
}

.official-no {
  color: var(--muted);
}

.official-table {
  border-radius: 0;
  border-color: #1f2937;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.signature-grid div {
  min-height: 86px;
  padding: 10px;
  border: 1px solid #d4dbe6;
}

.letter {
  line-height: 1;
  text-align: justify;
  text-justify: inter-word;
}

.consent-second-paragraph {
  line-height: 1.5 !important;
  margin-top: 12px;
  margin-bottom: 18px;
}

.consent-page {
  padding: 58px 54px;
  font-size: 15px;
}

.consent-page h3 {
  margin-bottom: 26px;
  text-align: center;
}

.consent-standard-page {
  padding: 20mm 27mm 18mm;
  font-size: 12.5pt;
  line-height: 1.42;
}

.consent-standard-page .sop-code {
  margin-bottom: 8px;
  font-weight: 700;
}

.consent-standard-page h3 {
  margin-bottom: 30px;
  font-size: 14pt;
}

.consent-letter-head {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 22px;
  align-items: end;
}

.consent-address {
  display: grid;
  gap: 5px;
}

.consent-dotted-line {
  min-height: 20px;
  border-bottom: 1px dotted #111827;
}

.consent-date-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px;
  align-items: end;
}

.consent-date-row span {
  display: block;
  min-height: 20px;
  border-bottom: 1px dotted #111827;
  text-align: center;
}

.consent-separator {
  height: 1px;
  margin: 12px 0 24px;
  border-top: 1px solid #111827;
}

.consent-recipient {
  display: grid;
  gap: 5px;
  width: min(330px, 100%);
  margin-bottom: 24px;
}

.consent-subject {
  margin-top: 22px;
  text-transform: uppercase;
}

.consent-numbered {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  margin: 18px 0 22px;
}

.consent-numbered > span {
  font-weight: 700;
}

.consent-numbered p {
  margin: 0;
  line-height: 1.55;
}

.consent-inline-line {
  display: inline-block;
  min-width: 175px;
  padding: 0 8px;
  border-bottom: 1px dotted #111827;
  text-align: center;
  font-weight: 700;
}

.consent-inline-line.short {
  min-width: 135px;
}

.consent-standard-body {
  margin: 18px 0 22px;
  line-height: 1.5;
}

.consent-standard-body p {
  margin: 7px 0 20px 0;
  line-height: 1.55;
  text-align: justify;
  text-justify: inter-word;
}

.consent-original-statement {
  display: grid;
  gap: 5px;
  margin: 18px 0 6px;
}

.consent-original-line {
  display: grid;
  align-items: end;
  column-gap: 8px;
  min-height: 20px;
}

.consent-original-line span {
  line-height: 1.25;
}

.consent-original-line.line-one {
  grid-template-columns: 28px 36px 1fr;
}

.consent-original-line.line-two {
  grid-template-columns: 1fr;
  padding-left: 0;
}

.consent-original-line.line-three {
  grid-template-columns: minmax(150px, 0.28fr) 14px 52px 1fr;
}

.consent-original-line.line-four {
  grid-template-columns: auto minmax(170px, 0.38fr) 1fr;
}

.consent-number {
  font-weight: 700;
}

.consent-fill {
  min-height: 20px;
  padding: 0 8px 2px;
  border-bottom: 1px dotted #111827;
  text-align: center;
  text-transform: uppercase;
  font-size: 11.5pt;
  line-height: 1.08;
}

.parent-fill,
.child-fill {
  font-weight: 700;
}

.consent-statement-card {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  margin: 16px 0 14px;
}

.consent-statement-no {
  padding-top: 3px;
  font-weight: 700;
}

.consent-detail-grid {
  display: grid;
  gap: 8px;
}

.consent-detail-row {
  display: grid;
  gap: 8px;
  align-items: end;
}

.consent-detail-row span {
  line-height: 1.25;
}

.consent-detail-row strong {
  min-height: 23px;
  padding: 0 8px 2px;
  border-bottom: 1px dotted #111827;
  text-align: center;
  text-transform: uppercase;
}

.consent-detail-row.parent-row,
.consent-detail-row.child-row {
  grid-template-columns: 70px 1fr;
}

.consent-detail-row.parent-ic-row {
  grid-template-columns: minmax(230px, auto) auto minmax(170px, 0.45fr);
}

.consent-detail-row.child-ic-row {
  grid-template-columns: auto minmax(170px, 0.35fr) 1fr;
}

.consent-statement-text {
  text-align: justify;
  text-justify: inter-word;
}

.consent-inline-fill {
  display: inline-block;
  min-height: 23px;
  padding: 0 8px 2px;
  border-bottom: 1px dotted #111827;
  text-align: center;
  font-weight: 700;
  line-height: 1.05;
  vertical-align: baseline;
}

.consent-inline-fill.parent-name {
  min-width: 300px;
}

.consent-inline-fill.child-name {
  min-width: 360px;
}

.consent-inline-fill.ic {
  min-width: 170px;
}

.consent-standard-signature {
  width: min(390px, 100%);
  margin-top: 80px;
  line-height: 1.4;
}

.consent-signature-stamp {
  display: grid;
  gap: 1px;
  min-height: 58px;
  align-content: end;
  padding: 0 24px 8px;
  text-align: center;
  font-weight: 700;
  line-height: 1.18;
}

.consent-signature-stamp strong,
.consent-signature-stamp span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.consent-signature-stamp strong {
  text-transform: uppercase;
  font-size: 0.92rem;
}

.consent-signature-stamp span {
  font-size: 0.9rem;
}

.consent-sign-line {
  min-height: 0;
  height: 0;
  border-bottom: 1px dotted #111827;
}

.consent-bracket {
  min-height: 22px;
  margin-top: 4px;
  text-align: left;
}

.consent-bracket span {
  display: inline-block;
  min-width: 270px;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
}

.consent-meta-row {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 6px;
  min-height: 24px;
  align-items: end;
}

.consent-meta-row span {
  white-space: nowrap;
}

.consent-meta-row strong {
  display: block;
  min-height: 20px;
  border-bottom: 1px dotted #111827;
  text-transform: uppercase;
  font-weight: 700;
}

.evidence-page {
  font-size: 13px;
}

.evidence-attachment-page {
  padding: 28px 34px 32px;
  font-size: 12px;
}

.evidence-attachment-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border-bottom: 3px double #111827;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.evidence-attachment-head span {
  display: block;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evidence-attachment-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: 0.03em;
  text-align: left;
}

.evidence-attachment-head > strong {
  border: 1px solid #111827;
  border-radius: 4px;
  padding: 8px 12px;
  text-transform: uppercase;
}

.evidence-attachment-meta {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #111827;
  margin-bottom: 12px;
  table-layout: fixed;
}

.evidence-attachment-meta th,
.evidence-attachment-meta td {
  border: 1px solid #111827;
  padding: 7px 8px;
  vertical-align: top;
}

.evidence-attachment-meta th {
  width: 24%;
  background: #f3f4f6;
  text-align: left;
  font-weight: 700;
}

.evidence-attachment-frame {
  min-height: 535px;
  border: 1px solid #111827;
  display: grid;
  place-items: center;
  padding: 10px;
  margin-top: 10px;
  background: #ffffff;
}

.evidence-attachment-frame img {
  max-width: 100%;
  max-height: 555px;
  object-fit: contain;
}

.evidence-attachment-frame.is-missing {
  border-style: dashed;
  background: #f9fafb;
}

.evidence-file-embed {
  width: 100%;
  height: 540px;
  border: 0;
  background: #ffffff;
}

.evidence-file-placeholder {
  display: grid;
  gap: 10px;
  text-align: center;
  color: #4b5563;
  max-width: 520px;
  line-height: 1.45;
}

.evidence-file-placeholder strong {
  color: #111827;
  font-size: 18px;
}

.evidence-file-placeholder span {
  font-size: 12px;
}

.evidence-file-placeholder a {
  color: #2563eb;
  font-weight: 800;
  text-decoration: underline;
}

.evidence-file-placeholder.missing strong {
  color: #b91c1c;
}

.evidence-official-file-note {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 7px;
  align-items: center;
  margin-top: 6px;
  padding: 5px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
}

.evidence-official-file-note.missing {
  grid-template-columns: 1fr;
  border-style: dashed;
  color: #991b1b;
  background: #fff7ed;
}

.evidence-official-file-note span,
.evidence-official-file-note small {
  display: block;
}

.evidence-official-file-note small {
  margin-top: 2px;
  color: #4b5563;
  font-size: 10px;
  line-height: 1.25;
}

.evidence-official-thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border: 1px solid #9ca3af;
  border-radius: 3px;
  background: #ffffff;
}

.evidence-attachment-note-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 10px;
  margin-top: 12px;
}

.evidence-attachment-note-grid > div {
  border: 1px solid #111827;
  min-height: 54px;
  padding: 8px 10px;
  line-height: 1.5;
}

.evidence-attachment-note-grid strong,
.evidence-attachment-note-grid span {
  display: block;
}

.evidence-attachment-note-grid strong {
  margin-bottom: 4px;
}

.evidence-form-page {
  padding: 38px 30px 32px;
  font-size: 12px;
}

.evidence-form-page h3 {
  margin-bottom: 28px;
}

.evidence-official-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.evidence-official-table {
  min-width: 0;
  border: 1px solid #111827;
  font-size: 11px;
}

.evidence-official-table th,
.evidence-official-table td {
  border: 1px solid #111827;
  padding: 6px;
  vertical-align: top;
}

.evidence-monitor-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid #111827;
  font-size: 10.6px;
}

.evidence-monitor-table th,
.evidence-monitor-table td {
  border: 1px solid #111827;
  padding: 6px 7px;
  vertical-align: middle;
  line-height: 1.35;
}

.evidence-monitor-table th:nth-child(1),
.evidence-monitor-table td:nth-child(1) {
  width: 38px;
  text-align: center;
}

.evidence-monitor-table th:nth-child(2),
.evidence-monitor-table td:nth-child(2) {
  width: 54%;
}

.evidence-monitor-table th:nth-child(3),
.evidence-monitor-table td:nth-child(3),
.evidence-monitor-table th:nth-child(4),
.evidence-monitor-table td:nth-child(4) {
  width: 42px;
  text-align: center;
}

.evidence-monitor-table th:nth-child(5),
.evidence-monitor-table td:nth-child(5) {
  width: 18%;
}

.evidence-monitor-table td {
  height: 34px;
}

.evidence-monitor-table th {
  background: #f6f3fb;
  color: #5b4b75;
  font-size: 10px;
  text-transform: uppercase;
}

.evidence-monitor-table .monitor-mark {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.evidence-monitor-sign {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  font-size: 12px;
}

.evidence-monitor-sign span {
  display: block;
  min-height: 34px;
  border-bottom: 1px dotted #111827;
}

.evidence-official-summary {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #111827;
  line-height: 1.4;
  text-align: justify;
}

.signature-line {
  width: 260px;
  max-width: 100%;
  height: 54px;
  border-bottom: 1px solid var(--ink);
}

.consent-signature-block {
  width: min(310px, 100%);
  margin-top: 54px;
}

.consent-signature-line {
  display: grid;
  gap: 3px;
  align-items: end;
  min-height: 68px;
  padding: 0 8px 4px;
  border-bottom: 1px dotted var(--ink);
  text-align: center;
  line-height: 1.15;
}

.consent-signature-line strong,
.consent-signature-line span {
  display: block;
  overflow-wrap: anywhere;
}

.consent-signature-line strong {
  text-transform: uppercase;
  font-size: 0.88rem;
}

.consent-signature-line span {
  font-size: 0.8rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
}

@media (max-width: 860px) {
  .mysql-loading-page {
    grid-template-columns: 1fr;
  }

  .mysql-loading-hero,
  .mysql-loading-panel {
    padding: 24px 18px;
  }

  .mysql-loading-brand {
    margin-bottom: 20px;
  }

  .teacher-confirm-row {
    grid-template-columns: 1fr;
  }

  .ppd-review-picker {
    grid-template-columns: 1fr;
  }

  .parent-rpi-picker {
    grid-template-columns: 1fr;
  }

  .login-page,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .login-page {
    min-height: auto;
  }

  .brand-panel {
    min-height: auto;
    padding: 28px 20px;
    gap: 22px;
  }

  .brand-cta-strip {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  .brand-cta-strip .cta-actions {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .brand-panel h1 {
    font-size: 2.4rem;
  }

  .brand-highlights {
    grid-template-columns: 1fr;
  }

  .login-card {
    width: calc(100% - 24px);
    margin: 18px auto;
    padding: 20px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 12px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 22px rgba(23, 32, 51, 0.06);
  }

  .sidebar-brand {
    gap: 10px;
  }

  .sidebar-brand .muted {
    display: none;
  }

  .sidebar h1 {
    font-size: 1.05rem;
  }

  .teacher-pill {
    margin: 8px 0 10px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-inline: -12px;
    padding: 0 12px 6px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .nav button,
  .nav-link-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 118px;
    min-height: 42px;
    justify-content: center;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .sidebar-credit {
    display: none;
  }

  .content {
    padding: 14px 12px 34px;
  }

  .stats-grid,
  .form-grid,
  .profile-summary-grid,
  .official-grid.two,
  .signature-grid,
  .achievement-layout,
  .achievement-column,
  .rpi-workspace,
  .rpi-meta-grid,
  .rpi-compliance,
  .evidence-summary,
  .report-layout,
  .report-action-item,
  .signature-upload-card,
  .backup-restore,
  .report-mini-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-title h2 {
    line-height: 1.2;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .toolbar .btn,
  .toolbar .search,
  .field .btn {
    width: 100%;
  }

  .search {
    min-width: 0;
    min-height: 46px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat {
    padding: 12px;
  }

  .rpi-list-pane,
  .rpi-detail-pane {
    position: static;
    max-height: none;
  }

  .rpi-detail-card {
    min-height: 0;
  }

  .rpi-list-metrics {
    grid-template-columns: 1fr;
  }

  .rpi-compact-table th:nth-child(1),
  .rpi-compact-table th:nth-child(2),
  .rpi-compact-table th:nth-child(5) {
    width: auto;
  }

  .rpi-table-actions {
    min-width: 190px;
  }

  .rpi-preview-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .stat strong {
    font-size: 1.45rem;
  }

  .table-wrap {
    border-radius: 7px;
    background: #ffffff;
    box-shadow: inset 0 -8px 14px rgba(23, 32, 51, 0.03);
  }

  .table-wrap::before {
    content: "Leret ke kiri/kanan untuk lihat semua lajur";
    display: block;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 0.82rem;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 11px 10px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .actions .btn {
    width: 100%;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    padding: 18px 14px 24px;
    border-radius: 12px 12px 0 0;
  }

  .modal .topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -18px -14px 14px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
  }

  .rpi-card {
    padding: 13px;
  }

  .rpi-card + .rpi-card {
    margin-top: 2px;
  }

  .achievement-toolbar .form-grid {
    gap: 0;
  }

  .achievement-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .achievement-toolbar .search {
    width: 100%;
    min-height: 48px;
  }

  .achievement-search-row {
    grid-template-columns: 1fr auto auto;
  }

  .achievement-search-row .btn {
    min-height: 48px;
    padding-inline: 12px;
  }

  .mobile-achievement-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.05);
  }

  .mobile-achievement-card strong,
  .mobile-achievement-card span {
    display: block;
  }

  .mobile-achievement-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .mobile-achievement-card a {
    flex: 0 0 auto;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    background: #f8fafc;
  }

  .achievement-form {
    padding-bottom: 86px;
  }

  .achievement-form textarea[name="teacherText"] {
    min-height: 150px;
  }

  .achievement-form textarea[name="standardText"] {
    min-height: 112px;
  }

  .achievement-save-row {
    position: sticky;
    bottom: 0;
    z-index: 9;
    margin: 14px -13px -13px;
    padding: 10px 13px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 24px rgba(23, 32, 51, 0.08);
  }

  .objective-reference {
    margin: 10px 0 14px;
  }

  .restore-row {
    align-items: stretch;
    flex-direction: column;
  }

  .print-picker {
    display: grid;
    grid-template-columns: 1fr;
    max-height: 220px;
    overflow: auto;
  }

  .print-dashboard,
  .print-tools {
    grid-template-columns: 1fr;
  }

  .print-form-options {
    display: grid;
    grid-template-columns: 1fr;
  }

  .forms-workspace {
    grid-template-columns: 1fr;
  }

  .forms-browser-panel {
    position: static;
    max-height: none;
  }

  .forms-preview-panel {
    max-height: none;
    overflow: visible;
    padding: 10px;
  }

  .forms-preview-panel .official-stack {
    min-width: 0;
  }

  .evidence-template-row {
    grid-template-columns: 1fr;
  }

  .print-student-row {
    grid-template-columns: 1fr;
  }

  .official-stack {
    justify-items: stretch;
  }

  .sop-page {
    width: 100%;
    min-height: auto;
    padding: 20px 14px;
    overflow-x: auto;
    font-size: 13px;
  }

  .sop-line {
    grid-template-columns: 24px 1fr;
    gap: 5px 8px;
    min-height: auto;
    margin-bottom: 12px;
    font-size: 14px;
  }

  .sop-colon {
    display: none;
  }

  .sop-value {
    grid-column: 1 / -1;
  }

  .rpi-page-two,
  .rpi-page-three,
  .consent-page {
    padding: 20px 14px;
    font-size: 12px;
  }

  .rpi-ms2-grid,
  .rpi-ms3-table,
  .ms3-dates {
    min-width: 620px;
  }

  .perakuan {
    grid-template-columns: 1fr;
  }

  .official-row {
    grid-template-columns: 28px 1fr;
  }

  .official-row span:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  body {
    background: #f8fafc;
  }

  .brand-panel h1 {
    font-size: 2rem;
  }

  .school-crest {
    width: 48px;
    height: 48px;
  }

  .brand-panel p {
    line-height: 1.55;
  }

  .btn {
    min-height: 44px;
    padding: 11px 12px;
  }

  .sidebar {
    padding: 10px 10px 8px;
  }

  .sidebar-brand {
    align-items: flex-start;
  }

  .school-crest.small {
    width: 36px;
    height: 36px;
  }

  .teacher-pill {
    max-width: 100%;
    margin: 6px 0 8px;
  }

  .nav button,
  .nav-link-btn {
    min-width: 108px;
    min-height: 42px;
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  .achievement-action-row,
  .achievement-save-row {
    grid-template-columns: 1fr;
  }

  .achievement-search-row {
    grid-template-columns: 1fr;
  }

  .brand-cta-strip .cta-actions {
    grid-template-columns: 1fr;
  }

  .achievement-save-row {
    gap: 8px;
  }

  .mobile-achievement-card {
    align-items: flex-start;
  }

  .section-title h2,
  .modal h2 {
    font-size: 1.18rem;
  }

  .muted,
  .field-hint {
    font-size: 0.9rem;
  }

  .content {
    padding: 12px 9px 30px;
  }

  .topbar {
    gap: 8px;
  }

  .toolbar {
    gap: 7px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat {
    padding: 11px 12px;
  }

  .stat strong {
    font-size: 1.35rem;
  }

  .field {
    margin-top: 12px;
  }

  .field input,
  .field select,
  .field textarea,
  .search {
    min-height: 48px;
    border-radius: 8px;
  }

  .rpi-card,
  .achievement-entry,
  .mobile-achievement-card {
    border-radius: 8px;
  }

  .achievement-entry .topbar.compact {
    gap: 8px;
  }

  .table-wrap {
    margin-inline: -2px;
  }

  table {
    min-width: 620px;
    font-size: 0.92rem;
  }

  .official-form {
    padding: 14px;
  }

  .signature-grid {
    gap: 8px;
  }

  .rpi-ms2-grid,
  .rpi-ms3-table,
  .ms3-dates {
    min-width: 580px;
  }

  .worksheet-meta {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 640px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    background: #f8fafc;
  }

  .app-shell,
  .dashboard,
  .content,
  .content > div {
    min-width: 0;
  }

  .login-page {
    display: block;
  }

  .brand-panel {
    padding: 22px 16px;
  }

  .brand-copy {
    gap: 10px;
  }

  .brand-copy h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.08;
  }

  .brand-highlights {
    gap: 8px;
  }

  .login-card {
    width: calc(100% - 20px);
    margin: 10px auto 22px;
    padding: 18px 14px;
  }

  .worksheet-meta,
  .worksheet-sign-row {
    grid-template-columns: 1fr;
  }

  .worksheet-saved-item {
    grid-template-columns: 1fr;
  }

  .worksheet-saved-actions {
    justify-content: stretch;
  }

  .worksheet-saved-actions .btn {
    width: 100%;
  }

  .worksheet-a4-preview {
    padding: 16px;
  }

  .sidebar {
    max-height: 44vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar-brand {
    min-width: 0;
  }

  .sidebar-brand h1,
  .teacher-pill {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav {
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button,
  .nav-link-btn {
    min-width: max-content;
    padding-inline: 13px;
  }

  .content {
    padding: 10px 8px 28px;
  }

  .section-title h2 {
    font-size: 1.28rem;
  }

  .section-title .muted {
    line-height: 1.45;
  }

  .toolbar,
  .filter-bar,
  .topbar .actions {
    width: 100%;
  }

  .filter-bar {
    gap: 8px;
  }

  .search,
  .toolbar input,
  .toolbar select,
  .toolbar button,
  .topbar .actions .btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    min-height: 82px;
  }

  .stat .muted {
    font-size: 0.82rem;
  }

  .rpi-card,
  .parent-consent-panel,
  .parent-alert,
  .admin-reset-panel {
    padding: 12px;
    border-radius: 8px;
  }

  .rpi-card h3 {
    font-size: 1rem;
    line-height: 1.25;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    vertical-align: top;
  }

  .actions,
  .parent-consent-actions,
  .signature-upload-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .actions .btn,
  .parent-consent-actions .btn,
  .signature-upload-actions .btn {
    width: 100%;
  }

  .print-dashboard,
  .print-form-options,
  .parent-rpi-picker {
    gap: 8px;
  }

  .print-form-options {
    grid-template-columns: 1fr;
  }

  .modal {
    max-height: 94vh;
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .brand-copy h1 {
    font-size: 1.78rem;
  }

  .nav button,
  .nav-link-btn {
    font-size: 0.86rem;
  }
}

@media print {
  @page {
    size: Letter;
    margin: 0;
  }

  @page official-letter {
    size: 215.9mm 279.4mm;
    margin: 0;
  }

  @page consent-a4 {
    size: A4;
    margin: 0;
  }

  body {
    background: #ffffff;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .content > div > .topbar,
  .forms-browser-panel,
  .print-dashboard,
  .print-form-options,
  .print-picker,
  .topbar .toolbar,
  .nav,
  .teacher-pill,
  .task-summary-card {
    display: none;
  }

  body.printing-official-forms #app,
  body.printing-official-forms .dashboard,
  body.printing-official-forms .content,
  body.printing-official-forms .content > div,
  body.printing-official-forms .forms-workspace,
  body.printing-official-forms .forms-preview-panel,
  body.printing-official-forms .official-stack {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  body.printing-official-forms .content > div > :not(.forms-workspace),
  body.printing-official-forms .forms-workspace > :not(.forms-preview-panel),
  body.printing-official-forms .forms-preview-panel > :not(.official-stack) {
    display: none !important;
  }

  .dashboard {
    display: block;
  }

  .content {
    padding: 0;
  }

  .forms-workspace,
  .forms-preview-panel {
    display: block;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 0;
    border: 0;
  }

  .forms-preview-panel .official-stack {
    min-width: 0;
  }

  .official-stack {
    display: block;
    gap: 0;
  }

  .official-form {
    break-after: page;
    border-radius: 0;
    box-shadow: none;
  }

  .sop-page {
    page: official-letter;
    width: 215.9mm;
    height: 279.4mm;
    min-height: 279.4mm;
    margin: 0 auto;
    padding: 14.8mm 11.1mm;
    border: 0;
    box-shadow: none;
    break-after: page;
    overflow: hidden;
    page-break-after: always;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.24;
  }

  .prasidang-page {
    padding-top: 16.9mm;
  }

  .prasidang-page h3 {
    margin-bottom: 46px;
  }

  .sop-line {
    display: grid;
    grid-template-columns: 28px 210px 22px 1fr;
    min-height: 38px;
    margin-bottom: 0;
    align-items: start;
    font-size: 17px;
  }

  .sop-colon {
    display: block;
  }

  .sop-value {
    grid-column: auto;
    min-height: 26px;
  }

  .sop-box-line {
    min-height: 128px;
  }

  .sop-box-line .sop-value {
    min-height: 110px;
  }

  .rpi-page-two {
    padding: 10.6mm 9.5mm;
    font-size: 14px;
  }

  .rpi-ms2-grid {
    grid-template-columns: 1.15fr 0.7fr 1fr;
    min-width: 0;
  }

  .rpi-ms2-grid .cell {
    min-height: 34px;
    padding: 7px 8px;
  }

  .rpi-ms2-grid .tall {
    min-height: 66px;
  }

  .rpi-ms3-table,
  .ms3-dates {
    min-width: 0;
  }

  .rpi-page-three {
    padding: 13.2mm 11.1mm 8.5mm;
    font-size: 11.2px;
  }

  .rpi-ms3-table {
    grid-template-columns: 0.92fr 1.28fr 0.78fr;
  }

  .rpi-page-three .ms3-body {
    min-height: 88mm;
  }

  .ms3-dates {
    grid-template-columns: 1fr 1fr;
  }

  .rpi-page-three .perakuan {
    grid-template-columns: 1fr 1fr;
    gap: 7px 20px;
  }

  .rpi-page-three .perakuan div {
    min-height: 48px;
    line-height: 1.5 !important;
  }

  .rpi-page-three .perakuan .wide {
    min-height: 20px;
  }

  .rpi-page-three .dots {
    margin-top: 28px !important;
  }

  .consent-page .consent-second-paragraph {
    line-height: 1.5 !important;
    margin-top: 12px;
    margin-bottom: 18px;
  }

  .consent-page {
    page: consent-a4;
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    padding: 20mm 18mm;
  }

  .consent-standard-page {
    padding: 20mm 27mm 18mm;
    font-size: 12.5pt;
  }

  .evidence-page {
    page: official-letter;
    padding: 13mm 11mm;
    font-size: 11px;
  }

  .evidence-attachment-page {
    page: official-letter;
    padding: 11mm 11.5mm;
  }

  .evidence-attachment-frame {
    min-height: 150mm;
    max-height: 154mm;
    overflow: hidden;
  }

  .evidence-attachment-frame img {
    max-height: 154mm;
  }

  .evidence-file-embed {
    height: 152mm;
  }

  .evidence-official-file-note {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .evidence-official-table {
    width: 100%;
    min-width: 0;
    font-size: 9.5px;
  }

  .official-row {
    grid-template-columns: 34px minmax(150px, 0.45fr) 1fr;
  }

  .official-row span:last-child {
    grid-column: auto;
  }

  .signature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* === RPI Online v2: Lampiran 3 Transisi Kerjaya Sekolah Menengah === */
.transition-career-rpi-modal textarea {
  min-height: 96px;
}
.transition-career-rpi-modal .transition-section-break h3 {
  margin: 8px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--active-line);
  border-radius: 8px;
  background: var(--action-soft);
  color: var(--primary-dark);
}
.transition-career-rpi-modal .modal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}
.transition-career-official-page {
  padding: 18px 16px 18px !important;
  font-size: 11px !important;
  line-height: 1.05 !important;
  min-height: auto !important;
}
.transition-career-official-page .pre-transition-table .ms3-head {
  min-height: 30px !important;
  padding: 6px 5px !important;
  font-size: 10.5px !important;
}
.transition-career-official-page .pre-transition-table .ms3-body {
  min-height: 84px !important;
  padding: 6px !important;
}
.transition-career-official-page .official-date-row {
  border: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 !important;
  margin: 10px 0 6px !important;
}
.transition-career-official-page .official-date-row div {
  min-height: 23px !important;
  border: 0 !important;
  padding: 0 !important;
  font-weight: 700 !important;
}
.transition-career-official-page .official-date-row span {
  display: inline-block !important;
  min-width: 44mm !important;
  min-height: 8mm !important;
  margin-left: 5px !important;
  border: 1px solid #111827 !important;
  vertical-align: middle !important;
  text-align: center !important;
  line-height: 7mm !important;
  font-weight: 700 !important;
}
.transition-career-official-page .transition-title {
  margin: 4px 0 8px !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
  text-transform: uppercase !important;
}
.transition-career-official-page .transition-section {
  margin: 20px 0 14px !important;
  font-weight: 800 !important;
}
.transition-career-official-page .transition-field-row {
  display: grid !important;
  grid-template-columns: 34% 12px 1fr !important;
  align-items: start !important;
  gap: 4px !important;
  margin-bottom: 8px !important;
}
.transition-career-official-page .transition-label,
.transition-career-official-page .transition-colon {
  font-weight: 700 !important;
}
.transition-career-official-page .transition-box {
  min-height: 18mm !important;
  border: 1px solid #111827 !important;
  padding: 4px 6px !important;
  white-space: pre-wrap !important;
  text-align: justify !important;
}
.transition-career-official-page .transition-subtitle {
  margin: 8px 0 6px !important;
  font-weight: 800 !important;
}
.transition-career-official-page .transition-line {
  margin: 4px 0 6px !important;
  padding-left: 10mm !important;
}
.transition-career-official-page .transition-line strong {
  display: block !important;
  margin-bottom: 2px !important;
}
.transition-career-official-page .transition-line span {
  display: block !important;
  min-height: 8mm !important;
  border: 1px solid #111827 !important;
  padding: 3px 5px !important;
  white-space: pre-wrap !important;
  font-weight: 700 !important;
}
.transition-career-official-page .transition-c-table {
  display: grid !important;
  grid-template-columns: 1fr 1.05fr 0.92fr !important;
  border-top: 1px solid #111827 !important;
  border-left: 1px solid #111827 !important;
  margin-top: 10px !important;
}
.transition-career-official-page .tc-head,
.transition-career-official-page .tc-body {
  border-right: 1px solid #111827 !important;
  border-bottom: 1px solid #111827 !important;
  padding: 6px !important;
}
.transition-career-official-page .tc-head {
  min-height: 13mm !important;
  text-align: center !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.transition-career-official-page .tc-body {
  min-height: 24mm !important;
  white-space: pre-wrap !important;
  text-align: justify !important;
  text-justify: inter-word !important;
  overflow-wrap: anywhere !important;
}
.transition-career-official-page .transition-achievement-cell {
  min-height: 24mm !important;
  max-height: none !important;
}
.transition-career-official-page .transition-date-row {
  margin-top: 10px !important;
}
.transition-career-official-page .transition-perakuan {
  margin-top: 4px !important;
  gap: 6px 24px !important;
}
.transition-career-official-page .transition-perakuan > div:not(.wide) {
  min-height: 18mm !important;
  height: auto !important;
}
@media print {
  .transition-career-official-page {
    page-break-inside: auto !important;
  }
  .transition-career-official-page .transition-c-table,
  .transition-career-official-page .transition-perakuan {
    break-inside: avoid;
  }
}

/* === RPI Online v2 commercial print polish === */
@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body.printing-official-forms .sop-page,
  body.printing-official-forms .rpi-page-two,
  body.printing-official-forms .rpi-page-three,
  body.printing-official-forms .consent-page,
  body.printing-official-forms .evidence-page,
  body.printing-official-forms .evidence-attachment-page,
  body.printing-official-forms .evidence-form-page {
    width: 210mm !important;
    min-height: 297mm !important;
    height: 297mm !important;
    margin: 0 auto !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    break-after: page;
    page-break-after: always;
  }

  body.printing-official-forms .sop-page {
    padding: 17mm 13mm 13mm !important;
    font-size: 12.2pt !important;
    line-height: 1.22 !important;
  }

  body.printing-official-forms .rpi-page-two {
    padding: 13mm 11mm !important;
    font-size: 10.8pt !important;
  }

  body.printing-official-forms .rpi-page-three {
    padding: 12mm 10mm 9mm !important;
    font-size: 9.4pt !important;
  }

  body.printing-official-forms .rpi-ms2-grid .cell,
  body.printing-official-forms .ms3-head,
  body.printing-official-forms .ms3-body,
  body.printing-official-forms .ms3-block {
    line-height: 1.18 !important;
    overflow-wrap: anywhere !important;
  }

  body.printing-official-forms .rpi-page-three .ms3-body {
    min-height: 76mm !important;
  }

  body.printing-official-forms .print-footer {
    bottom: 5mm !important;
    font-size: 8.5pt !important;
  }
}

/* Patch: Borang rasmi SR/SM dan Transisi Kerjaya - ikut Lampiran 2/3, A4 kemas */
.official-form-header-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #111827;
}
.official-form-lampiran {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.official-form-header-line .sop-code {
  margin-bottom: 0 !important;
}
.transition-official-header {
  margin-bottom: 8px;
}
.transition-career-official-page h3 {
  margin: 0 0 16px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-transform: uppercase !important;
}
.official-note-panel {
  border: 1px dashed rgba(83, 42, 127, 0.35);
  border-radius: 8px;
  background: #fffdf5;
  padding: 10px 12px;
}
.transition-career-official-page .transition-col-27-cell {
  padding: 0 !important;
}
.transition-career-official-page .transition-layer {
  min-height: 12mm;
  padding: 5px 6px;
  border-bottom: 1px solid #111827;
  white-space: pre-wrap;
  text-align: justify;
  text-justify: inter-word;
  overflow-wrap: anywhere;
}
.transition-career-official-page .transition-layer:last-child {
  border-bottom: 0;
}
.transition-career-official-page .transition-layer strong {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  text-transform: uppercase;
}
.transition-career-official-page .transition-c-table {
  grid-template-columns: 1fr 1.22fr 0.9fr !important;
}
.transition-career-official-page .tc-body {
  min-height: 32mm !important;
  line-height: 1.18 !important;
}
.transition-career-official-page .transition-achievement-cell .achievement-report-item {
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px dotted #9ca3af;
}
.transition-career-official-page .transition-achievement-cell .achievement-report-item:last-child {
  border-bottom: 0;
}
@media print {
  .official-form-header-line {
    margin-bottom: 8px !important;
  }
  .transition-career-official-page .transition-layer {
    break-inside: avoid;
  }
}

/* === Patch 20260613: Borang rasmi A4 profesional, buang halaman kosong cetakan === */
.official-stack > .sop-page,
.official-stack > .official-form,
.official-stack > .consent-page,
.official-stack > .evidence-page,
.official-stack > .evidence-attachment-page,
.official-stack > .evidence-form-page {
  break-inside: avoid;
  page-break-inside: avoid;
}

.transition-career-official-page,
.transition-career-perakuan-page {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  padding: 14mm 13mm 12mm;
  font-size: 10.2pt;
  line-height: 1.22;
}

.transition-career-official-page .transition-c-table {
  grid-template-columns: 1.04fr 1.42fr 0.9fr !important;
  align-items: stretch;
}

.transition-career-official-page .tc-head {
  line-height: 1.14 !important;
  padding: 6px 5px !important;
}

.transition-career-official-page .tc-body {
  min-height: 42mm !important;
  height: auto !important;
  padding: 7px !important;
  line-height: 1.25 !important;
}

.transition-career-official-page .transition-col-27-cell {
  display: grid !important;
  grid-template-rows: auto auto auto;
  padding: 0 !important;
}

.transition-career-official-page .transition-layer {
  min-height: 16mm !important;
  padding: 6px 7px !important;
  line-height: 1.2 !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}

.transition-career-official-page .transition-layer strong {
  font-size: 8.6pt !important;
  letter-spacing: 0.01em;
}

.transition-achievement-cell .achievement-report-item {
  margin-bottom: 4px !important;
  padding-bottom: 4px !important;
}

.transition-career-perakuan-page .transition-title {
  margin-top: 16mm;
  margin-bottom: 8mm;
}

.transition-career-perakuan-page .transition-perakuan-official {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9mm 18mm;
  align-items: start;
}

.transition-career-perakuan-page .transition-perakuan-official > div {
  min-height: 27mm;
  break-inside: avoid;
  page-break-inside: avoid;
}

.transition-career-perakuan-page .transition-perakuan-official > .wide {
  grid-column: 1 / -1;
  min-height: 10mm;
  padding: 4px 0;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body.printing-official-forms {
    background: #ffffff !important;
  }

  body.printing-official-forms .official-stack {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.printing-official-forms .print-footer {
    display: none !important;
  }

  body.printing-official-forms .official-stack > .sop-page,
  body.printing-official-forms .official-stack > .official-form,
  body.printing-official-forms .official-stack > .consent-page,
  body.printing-official-forms .official-stack > .evidence-page,
  body.printing-official-forms .official-stack > .evidence-attachment-page,
  body.printing-official-forms .official-stack > .evidence-form-page {
    width: 210mm !important;
    min-height: 296.5mm !important;
    height: auto !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    background: #ffffff !important;
    break-before: page !important;
    page-break-before: always !important;
    break-after: auto !important;
    page-break-after: auto !important;
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  body.printing-official-forms .official-stack > .sop-page:first-child,
  body.printing-official-forms .official-stack > .official-form:first-child,
  body.printing-official-forms .official-stack > .consent-page:first-child,
  body.printing-official-forms .official-stack > .evidence-page:first-child {
    break-before: auto !important;
    page-break-before: auto !important;
  }

  body.printing-official-forms .prasidang-page,
  body.printing-official-forms .rpi-page-two,
  body.printing-official-forms .rpi-page-three,
  body.printing-official-forms .transition-career-official-page,
  body.printing-official-forms .transition-career-perakuan-page {
    padding: 13mm 12mm 11mm !important;
    font-size: 9.6pt !important;
    line-height: 1.22 !important;
  }

  body.printing-official-forms .rpi-page-two h3,
  body.printing-official-forms .rpi-page-three h3,
  body.printing-official-forms .transition-career-official-page h3,
  body.printing-official-forms .transition-career-perakuan-page h3 {
    font-size: 11.2pt !important;
    line-height: 1.18 !important;
    margin: 0 0 6mm !important;
  }

  body.printing-official-forms .rpi-ms2-grid .cell,
  body.printing-official-forms .ms3-head,
  body.printing-official-forms .ms3-body,
  body.printing-official-forms .tc-head,
  body.printing-official-forms .tc-body,
  body.printing-official-forms .transition-box,
  body.printing-official-forms .transition-line span {
    line-height: 1.18 !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: auto !important;
  }

  body.printing-official-forms .transition-career-official-page .transition-c-table,
  body.printing-official-forms .rpi-ms3-table,
  body.printing-official-forms .rpi-ms2-grid {
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  body.printing-official-forms .transition-career-official-page .tc-body {
    min-height: 40mm !important;
    height: auto !important;
    max-height: none !important;
  }

  body.printing-official-forms .transition-career-official-page .transition-layer {
    min-height: 15mm !important;
    padding: 5px 6px !important;
  }

  body.printing-official-forms .transition-career-perakuan-page .transition-perakuan-official > div {
    min-height: 25mm !important;
  }
}

/* === Patch 20260614: Susun semula cetakan rasmi RPI SR/SM ikut muka surat A4 === */
.forms-preview-panel .official-stack {
  align-items: center;
}

.official-stack > .sop-page,
.official-stack > .official-form,
.official-stack > .consent-page,
.official-stack > .evidence-page,
.official-stack > .evidence-attachment-page,
.official-stack > .evidence-form-page {
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
}

.sop-page.rpi-page-one,
.sop-page.rpi-page-three,
.transition-career-official-page,
.transition-career-perakuan-page {
  width: 210mm !important;
  min-height: 297mm !important;
  max-width: 100%;
  padding: 13mm 12mm 11mm !important;
  box-sizing: border-box !important;
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  color: #111827;
}

.rpi-page-one .official-form-header-line,
.rpi-page-three .official-form-header-line,
.transition-career-official-page .official-form-header-line,
.transition-career-perakuan-page .official-form-header-line {
  margin-bottom: 5mm !important;
  font-size: 9.2pt !important;
}

.rpi-page-one h3,
.rpi-page-three h3,
.transition-career-official-page h3,
.transition-career-perakuan-page h3 {
  margin: 0 0 6mm !important;
  font-size: 11.2pt !important;
  line-height: 1.18 !important;
  text-align: center !important;
  text-transform: uppercase !important;
}

.rpi-page-one .sop-section-title,
.rpi-page-three .sop-section-title,
.transition-career-official-page .transition-title {
  margin: 4mm 0 2mm !important;
  font-size: 9.8pt !important;
  font-weight: 800 !important;
}

.rpi-page-one .rpi-ms2-grid,
.rpi-page-three .rpi-ms2-grid,
.rpi-page-three .rpi-ms3-table,
.transition-career-official-page .transition-c-table {
  width: 100%;
}

.rpi-page-one .rpi-ms2-grid .cell,
.rpi-page-three .rpi-ms2-grid .cell,
.rpi-page-three .ms3-head,
.rpi-page-three .ms3-body,
.transition-career-official-page .tc-head,
.transition-career-official-page .tc-body,
.transition-career-official-page .transition-box,
.transition-career-official-page .transition-line span {
  font-size: 9.2pt !important;
  line-height: 1.18 !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}

.sm-page-a .rpi-ms2-grid .cell {
  min-height: 10mm !important;
  padding: 2.5mm 2.8mm !important;
}

.sm-page-a .rpi-ms2-grid .program-cell,
.sr-page-a .rpi-ms2-grid .program-cell {
  min-height: 24mm !important;
}

.sm-page-a .rpi-ms2-grid .tall {
  min-height: 31mm !important;
}

.sr-page-a .rpi-ms2-grid .cell {
  min-height: 7.5mm !important;
  padding: 2mm 2.4mm !important;
}

.sr-page-a .rpi-ms2-grid .tall,
.sr-page-a .focus-grid .tall {
  min-height: 20mm !important;
}

.rpi-sr-page-goals,
.rpi-sm-page-b {
  display: flex;
  flex-direction: column;
}

.rpi-sr-page-goals .rpi-ms3-table,
.rpi-sm-page-b .rpi-ms3-table {
  flex: 1 1 auto;
  align-content: start;
}

.rpi-sr-page-goals .rpi-ms3-table {
  grid-template-columns: 1fr 1.35fr 0.9fr !important;
  grid-template-rows: auto 1fr !important;
}

.rpi-sr-page-goals .ms3-head {
  min-height: 10mm !important;
  height: auto !important;
  padding: 2.2mm 2.4mm !important;
  align-content: center !important;
}

.rpi-sr-page-goals .ms3-body {
  min-height: 224mm !important;
  padding: 3mm !important;
}

.rpi-sm-page-b .sm-focus-grid .cell {
  min-height: 9mm !important;
  padding: 2mm 2.4mm !important;
}

.rpi-sm-page-b .sm-focus-grid .tall {
  min-height: 18mm !important;
}

.rpi-sm-page-b .rpi-sm-ms3-table {
  grid-template-columns: 1fr 1.38fr 0.9fr !important;
  grid-template-rows: auto 1fr !important;
  margin-top: 4mm !important;
}

.rpi-sm-page-b .ms3-head {
  min-height: 10mm !important;
  height: auto !important;
  padding: 2mm 2.4mm !important;
  align-content: center !important;
}

.rpi-sm-page-b .ms3-body {
  min-height: 126mm !important;
  padding: 2.5mm !important;
}

.rpi-sm-page-b .ms3-dates,
.rpi-sr-page-sign .ms3-dates {
  margin-top: 0 !important;
}

.rpi-sr-page-sign {
  padding-top: 28mm !important;
}

.rpi-sr-page-sign .ms3-dates div,
.rpi-sr-page-sign .ms3-imk {
  min-height: 13mm !important;
  font-size: 9.6pt !important;
}

.rpi-sr-page-sign .perakuan-title {
  margin: 10mm 0 5mm !important;
  font-size: 10pt !important;
  font-weight: 800 !important;
}

.rpi-sr-page-sign .perakuan {
  gap: 8mm 16mm !important;
}

.rpi-sr-page-sign .perakuan > div {
  min-height: 27mm !important;
  font-size: 9.4pt !important;
}

.rpi-sr-page-sign .perakuan > .wide {
  min-height: 9mm !important;
}

.transition-career-official-page .transition-section {
  margin: 5mm 0 3mm !important;
}

.transition-career-official-page .transition-field-row {
  grid-template-columns: 34% 12px 1fr !important;
  margin-bottom: 3mm !important;
}

.transition-career-official-page .transition-box {
  min-height: 18mm !important;
}

.transition-career-official-page .transition-line {
  margin: 2mm 0 2.4mm !important;
  padding-left: 8mm !important;
}

.transition-career-official-page .transition-line span {
  min-height: 8mm !important;
}

.transition-career-official-page .transition-c-table {
  grid-template-columns: 1fr 1.42fr 0.9fr !important;
  margin-top: 4mm !important;
}

.transition-career-official-page .tc-head {
  min-height: 13mm !important;
  padding: 2mm !important;
}

.transition-career-official-page .tc-body {
  min-height: 58mm !important;
  padding: 2.4mm !important;
}

.transition-career-official-page .transition-layer {
  min-height: 19mm !important;
  padding: 2mm 2.4mm !important;
}

.transition-career-perakuan-page .transition-title {
  margin-top: 18mm !important;
}

.transition-career-perakuan-page .transition-perakuan-official {
  gap: 9mm 18mm !important;
}

.transition-career-perakuan-page .transition-perakuan-official > div {
  min-height: 27mm !important;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body.printing-official-forms .official-stack > .sop-page,
  body.printing-official-forms .official-stack > .official-form,
  body.printing-official-forms .official-stack > .consent-page,
  body.printing-official-forms .official-stack > .evidence-page,
  body.printing-official-forms .official-stack > .evidence-attachment-page,
  body.printing-official-forms .official-stack > .evidence-form-page {
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    break-before: page !important;
    page-break-before: always !important;
    break-after: auto !important;
    page-break-after: auto !important;
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  body.printing-official-forms .official-stack > .sop-page:first-child,
  body.printing-official-forms .official-stack > .official-form:first-child,
  body.printing-official-forms .official-stack > .consent-page:first-child,
  body.printing-official-forms .official-stack > .evidence-page:first-child {
    break-before: auto !important;
    page-break-before: auto !important;
  }

  body.printing-official-forms .sop-page.rpi-page-one,
  body.printing-official-forms .sop-page.rpi-page-three,
  body.printing-official-forms .transition-career-official-page,
  body.printing-official-forms .transition-career-perakuan-page {
    padding: 13mm 12mm 11mm !important;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  }
}

/* Patch: no-popup evidence print must not inherit global official-form page-before rules. */
@media print {
  body.printing-current-page-only .current-page-print-root,
  body.printing-current-page-only .current-page-print-root .official-stack {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.printing-current-page-only .current-page-print-root .official-stack > .sop-page,
  body.printing-current-page-only .current-page-print-root .official-stack > .official-form,
  body.printing-current-page-only .current-page-print-root .official-stack > .consent-page,
  body.printing-current-page-only .current-page-print-root .official-stack > .evidence-page,
  body.printing-current-page-only .current-page-print-root .official-stack > .evidence-attachment-page,
  body.printing-current-page-only .current-page-print-root .official-stack > .evidence-form-page {
    break-before: auto !important;
    page-break-before: auto !important;
    break-after: page !important;
    page-break-after: always !important;
    margin: 0 auto !important;
  }

  body.printing-current-page-only .current-page-print-root .official-stack > :first-child {
    break-before: auto !important;
    page-break-before: auto !important;
  }

  body.printing-current-page-only .current-page-print-root .official-stack > :last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
}
