@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:400;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFC;}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:400;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:500;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFC;}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:500;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:600;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFC;}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:600;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:700;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FEFC;}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-weight:700;font-display:block;src:url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

/* نظام قيد طلاب مواليد الداخل المحتل */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --text: #172033;
  --muted: #667085;
  --primary: #0f766e;
  --primary-2: #115e59;
  --primary-soft: #e6fffb;
  --gold: #c88900;
  --border: #e4e7ec;
  --danger: #b42318;
  --warning: #b54708;
  --success: #067647;
  --shadow: 0 18px 55px rgba(16, 24, 40, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(15,118,110,0.08), transparent 35%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 40%, var(--bg) 100%);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  line-height: 1.75;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img { max-width: 100%; }

button,
input,
select,
textarea {
  font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #912018;
  color: #fff;
}

.inline-delete-form {
  display: inline-flex;
  margin: 0;
}

.action-btn,
.action-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: 0.18s ease;
  white-space: nowrap;
}

.action-btn:hover,
.action-btn-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.action-view {
  color: #175cd3;
  background: #eff8ff;
  border-color: #b2ddff;
}

.action-edit {
  color: var(--primary-2);
  background: var(--primary-soft);
  border-color: #99f6e4;
}

.action-print {
  color: #93370d;
  background: #fffaeb;
  border-color: #fedf89;
}

.action-delete {
  color: var(--danger);
  background: #fef3f2;
  border-color: #fecdca;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(228,231,236,0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.nav a {
  color: #344054;
  padding: 9px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.nav .danger-link {
  color: var(--danger);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--border);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(15,118,110,0.97), rgba(17,94,89,0.98)),
    radial-gradient(circle at left, rgba(200,137,0,0.3), transparent 45%);
  color: white;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.25;
}

.hero p {
  max-width: 700px;
  margin: 0;
  color: rgba(255,255,255,0.84);
}

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 190px;
}

.hero-clean {
  grid-template-columns: 1fr auto;
  min-height: 190px;
}

.hero-clean h1 {
  margin: 0;
}

.hero-clean .hero-actions .btn-add {
  min-height: 52px;
  font-size: 17px;
}

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

.stat-card,
.panel,
.form-card,
.table-card,
.details-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  color: var(--primary-2);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 24px;
}

.panel-title,
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h1,
.panel h2,
.form-section h2 {
  margin: 0;
  line-height: 1.35;
}

.page-head p,
.muted,
.form small,
.hint {
  color: var(--muted);
}

.serial-box {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: var(--primary-soft);
  border: 1px solid #b9f4e8;
}

.serial-box strong {
  font-size: 30px;
  direction: ltr;
  text-align: right;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
}

.mini-item:hover {
  border-color: #9ce3d6;
  background: #f8fffd;
}

.mini-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.mini-item b {
  color: var(--primary);
  direction: ltr;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-2);
  color: white;
}

.btn-add {
  background: #175cd3;
  color: #fff;
  border-color: #175cd3;
  box-shadow: 0 12px 28px rgba(23, 92, 211, 0.22);
}

.btn-add:hover {
  background: #1849a9;
  color: #fff;
  border-color: #1849a9;
}

.btn-dark {
  background: #101828;
  color: white;
}

.btn-light {
  background: white;
  color: var(--text);
  border-color: var(--border);
}

.btn-light:hover {
  background: var(--surface-2);
}

.btn-block {
  width: 100%;
}

.alert {
  margin: 0 0 16px;
  padding: 13px 16px;
  border-radius: 16px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: white;
}

.alert-success {
  color: var(--success);
  background: #ecfdf3;
  border-color: #abefc6;
}

.alert-error {
  color: var(--danger);
  background: #fef3f2;
  border-color: #fecdca;
}

.login-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  width: 150px;
  max-height: 140px;
  object-fit: contain;
  margin-bottom: 8px;
}

.login-card h1 {
  margin: 0;
  line-height: 1.35;
}

.form {
  text-align: right;
  display: grid;
  gap: 10px;
}

.form-card {
  padding: 28px;
}

.form-section {
  padding: 0 0 24px;
  margin: 0 0 24px;
  border-bottom: 1px dashed var(--border);
}

.form-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

.form-section h2 {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 999px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.section-registry h2 {
  background: linear-gradient(135deg, #0f766e, #115e59);
}

.section-student h2 {
  background: linear-gradient(135deg, #175cd3, #1849a9);
}

.section-family h2 {
  background: linear-gradient(135deg, #93370d, #b54708);
}

.section-notes h2 {
  background: linear-gradient(135deg, #475467, #344054);
}

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

.span-2 {
  grid-column: span 2;
}

label {
  display: block;
  font-weight: 900;
  color: #344054;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 13px;
  min-height: 44px;
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15,118,110,0.12);
}

input[readonly] {
  background: #f9fafb;
  color: var(--primary);
  font-weight: 900;
}

.ltr-input,
.digits-only {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.form-actions,
.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-bar {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1fr 1fr 1fr auto auto;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.table-card {
  overflow: hidden;
}

.table-meta {
  padding: 14px 18px;
  color: var(--muted);
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  text-align: right;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
}

.data-table tr:hover td {
  background: #fbfefd;
}

.empty {
  text-align: center !important;
  color: var(--muted);
  padding: 30px !important;
}

.actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.students-page-table .table-responsive {
  overflow-x: visible;
}

.students-page-table .data-table {
  table-layout: fixed;
  white-space: normal;
  font-size: 12.5px;
}

.students-page-table .data-table th,
.students-page-table .data-table td {
  padding: 9px 8px;
  line-height: 1.55;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.students-page-table .col-serial { width: 10%; direction: ltr; text-align: right; }
.students-page-table .col-name { width: 16%; }
.students-page-table .col-school { width: 19%; }
.students-page-table .col-grade { width: 11%; }
.students-page-table .col-date { width: 10%; }
.students-page-table .col-guardian { width: 13%; }
.students-page-table .col-status { width: 8%; }
.students-page-table .col-actions { width: 18%; }

.students-page-table .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.students-page-table .action-btn {
  min-height: 30px;
  padding: 6px 7px;
  font-size: 11.5px;
  border-radius: 9px;
}


/* إصلاح شكل أزرار الإجراءات داخل جدول الطلاب */
.students-page-table .actions {
  width: 100%;
  min-width: 112px;
  display: grid;
  grid-template-columns: repeat(2, minmax(50px, 1fr));
  gap: 5px;
  align-items: stretch;
}

.students-page-table .actions > a,
.students-page-table .actions > form,
.students-page-table .inline-delete-form {
  display: flex;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.students-page-table .actions .action-btn,
.students-page-table .actions .action-btn-link {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 6px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.students-page-table .col-actions {
  width: 18%;
  min-width: 118px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 900;
  font-size: 12px;
}

.badge-success {
  color: var(--success);
  background: #ecfdf3;
}

.badge-warning {
  color: var(--warning);
  background: #fffaeb;
}

.badge-muted {
  color: #475467;
  background: #f2f4f7;
}

.details-card {
  padding: 26px;
  display: grid;
  gap: 18px;
}

.detail-section {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
}

.detail-section dl {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 18px;
  margin: 14px 0 0;
}

.detail-section dt {
  color: var(--muted);
  font-weight: 900;
}

.detail-section dd {
  margin: 0;
  font-weight: 800;
}

.soft-panel {
  background: #f8fffd;
}

.narrow-form {
  max-width: 520px;
}

.inline-form {
  display: inline;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.print-body {
  background: #e9edf5;
}

.print-toolbar {
  width: min(900px, calc(100% - 24px));
  margin: 20px auto;
  display: flex;
  gap: 10px;
}

.certificate {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 30px;
  padding: 18mm;
  background: white;
  color: #111827;
  border: 1px solid #d0d5dd;
  box-shadow: 0 25px 80px rgba(0,0,0,0.12);
}

.cert-header {
  text-align: center;
  border-bottom: 3px double var(--gold);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.cert-header img {
  width: 148px;
  max-height: 160px;
  object-fit: contain;
}

.cert-header h1 {
  margin: 8px 0 2px;
  font-size: 30px;
}

.cert-intro {
  padding: 16px 18px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 17px;
  margin-bottom: 18px;
}

.cert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.cert-table th,
.cert-table td {
  border: 1px solid #cfd6e3;
  padding: 12px;
  text-align: right;
}

.cert-table th {
  background: #f3f6fa;
  width: 20%;
  font-weight: 400;
  color: #344054;
}

.cert-table td {
  font-weight: 800;
  color: #111827;
}

.cert-notes {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed #cfd6e3;
  border-radius: 14px;
}

.cert-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 42px;
  text-align: center;
}

.cert-footer div {
  padding-top: 16px;
  border-top: 1px solid #111827;
}

.cert-footer span,
.cert-footer strong {
  display: block;
}

.cert-footer span {
  font-weight: 400;
}

.cert-footer strong {
  font-weight: 800;
}

.cert-small {
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 980px) {
  .hero,
  .panel-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .nav {
    display: none;
    position: absolute;
    top: 86px;
    left: 16px;
    right: 16px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
  }

  .nav.is-open {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .students-page-table .table-responsive { overflow-x: auto; }
  .students-page-table .data-table { min-width: 1080px; }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand span {
    font-size: 12px;
  }

  .container {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero {
    border-radius: 24px;
  }

  .form-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .page-head,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-section dl {
    grid-template-columns: 1fr;
  }

  .certificate {
    width: 100%;
    min-height: auto;
    padding: 14mm 8mm;
  }

  .cert-footer {
    grid-template-columns: 1fr;
  }
}

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

  body {
    background: white !important;
  }

  .no-print,
  .print-toolbar {
    display: none !important;
  }

  .certificate {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    border: 0;
  }
}

/* توسعة بوابة الأنظمة وأداة الكاميرات */
.portal-hero {
  padding: clamp(28px, 5vw, 54px);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,0.18), transparent 32%),
    linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.portal-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.25;
}

.portal-hero p {
  margin: 0;
  color: rgba(255,255,255,0.84);
  font-weight: 600;
}

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

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 360px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow);
}

.tool-card h2 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.35;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-2);
  font-weight: 900;
  letter-spacing: .03em;
}

.tool-cameras .tool-icon { background: #eff8ff; color: #175cd3; }
.tool-schools .tool-icon { background: #fffaeb; color: #b54708; }

.tool-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 18px;
  background: var(--surface-2);
}

.tool-stat span {
  color: var(--muted);
  font-weight: 700;
}

.tool-stat strong {
  font-size: 28px;
  color: var(--text);
  line-height: 1;
}

.tool-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.setup-warning {
  background: #fff;
  border: 1px solid #fedf89;
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.setup-warning h1 { margin-top: 0; }
.setup-warning code {
  display: inline-block;
  direction: ltr;
  background: #111827;
  color: #fff;
  padding: 7px 12px;
  border-radius: 10px;
}

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

.quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
}

.quick-action:hover {
  background: var(--primary-soft);
  color: var(--primary-2);
}

.section-camera h2 { background: #eff8ff; color: #175cd3; }
.section-school h2 { background: #ecfdf3; color: #067647; }

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

.read-grid div {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
}

.read-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.read-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
}

.ltr-cell,
.ltr-input,
.ltr-inline,
.password-visible {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
  font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}

.password-visible {
  font-weight: 800;
  color: #111827;
}

.cameras-table th,
.cameras-table td {
  font-size: 12.5px;
  padding: 8px 9px;
  white-space: nowrap;
}

.schools-table th,
.schools-table td {
  font-size: 12.5px;
  padding: 8px 9px;
}

.wide-table-wrap {
  overflow-x: auto;
}

.camera-report-table th {
  width: 34%;
  font-weight: 400;
}

.camera-report-table td {
  font-weight: 800;
}

.camera-print-sheet {
  max-width: 820px;
}

@media (max-width: 980px) {
  .portal-grid { grid-template-columns: 1fr; }
  .read-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: auto; }
}

@media print {
  .camera-print-sheet { box-shadow: none; max-width: 100%; }
}
.badge-danger {
  background: #fef3f2;
  color: #b42318;
}
.action-stack {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 170px;
}
.action-stack .inline-delete-form { display: inline-flex; margin: 0; }
.action-stack .action-btn { min-width: 58px; }
@media (max-width: 760px) {
  .action-stack { flex-wrap: wrap; }
}

/* Camera module v2 refinements */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.section-recorder h2 { background: #fff7ed; color: #c2410c; }
.section-network h2 { background: #f5f3ff; color: #6d28d9; }

.camera-form-card .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cameras-table-v2 th,
.cameras-table-v2 td {
  font-size: 11.5px;
  padding: 7px 7px;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cameras-table-v2 td:nth-child(2) {
  max-width: 210px;
}

.camera-actions {
  min-width: 330px;
  justify-content: flex-start;
  gap: 5px;
}

.camera-actions .action-btn {
  min-width: auto;
  padding: 6px 8px;
  font-size: 11.5px;
  border-radius: 10px;
}

.action-delete-soft {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
}

.action-delete-soft:hover {
  background: #ffedd5;
  color: #9a3412;
}

.report-polished {
  padding: 18mm 17mm;
  border-radius: 0;
  background: #fff;
}

.official-print-header {
  border-bottom: 3px solid #0f766e;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.official-print-header h1 {
  font-size: 25px;
  margin: 0;
  color: #111827;
}

.official-print-header p {
  margin: 5px 0 0;
  color: #475467;
  font-weight: 700;
}

.report-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1.5px solid #99f6e4;
  background: #f0fdfa;
  border-radius: 16px;
  padding: 12px 16px;
  margin: 12px 0 14px;
}

.report-title-box strong {
  font-size: 21px;
  color: #0f172a;
}

.report-title-box span {
  color: #334155;
  font-weight: 500;
}

.print-section {
  margin-top: 11px;
  break-inside: avoid;
}

.print-section h2 {
  margin: 0 0 7px;
  padding: 7px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.camera-report-table {
  width: 100%;
  table-layout: fixed;
}

.camera-report-table th {
  width: 18%;
  font-weight: 400;
  color: #475467;
  background: #fafafa;
}

.camera-report-table td {
  width: 32%;
  font-weight: 800;
  color: #111827;
}

.official-print-footer {
  margin-top: 18px;
  border-top: 1.5px solid #d0d5dd;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #344054;
  font-weight: 700;
}

.multi-print-page {
  page-break-after: always;
  break-after: page;
}
.multi-print-page:last-child {
  page-break-after: auto;
  break-after: auto;
}

@media (max-width: 1050px) {
  .camera-form-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .camera-form-card .form-grid { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 100%; }
  .camera-actions { min-width: auto; flex-wrap: wrap; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  body.print-body { background: #fff; }
  .report-polished { box-shadow: none !important; max-width: none !important; min-height: 297mm; }
  .camera-report-table th,
  .camera-report-table td {
    border: 1px solid #333 !important;
    padding: 7px 9px !important;
  }
}

/* Camera report print redesign - matched with student certificate visual system */
.camera-certificate {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 30px;
  padding: 18mm;
  background: #fff;
  color: #111827;
  border: 1px solid #d0d5dd;
  box-shadow: 0 25px 80px rgba(0,0,0,0.12);
}

.camera-cert-header {
  text-align: center;
  border-bottom: 3px double var(--gold);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.camera-cert-header img {
  width: 126px;
  max-height: 138px;
  object-fit: contain;
}

.camera-cert-header h1 {
  margin: 8px 0 2px;
  font-size: 26px;
  font-weight: 900;
  color: #111827;
}

.camera-cert-header p {
  margin: 0;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
}

.camera-cert-intro {
  padding: 13px 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 14px;
}

.cert-section-title.camera-section-title {
  margin: 14px 0 7px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #eefaf8;
  color: #0f766e;
  border: 1px solid #c6f3ea;
  font-size: 15px;
  font-weight: 900;
}

.cert-section-title.recorder-title {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.cert-section-title.network-title {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.camera-cert-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  margin-bottom: 0;
}

.camera-cert-table th,
.camera-cert-table td {
  border: 1px solid #cfd6e3;
  padding: 8px 10px;
  text-align: right;
  vertical-align: middle;
  line-height: 1.65;
}

.camera-cert-table th {
  width: 20%;
  background: #f3f6fa;
  color: #475467;
  font-weight: 400;
}

.camera-cert-table td {
  width: 30%;
  background: #fff;
  color: #111827;
  font-weight: 800;
  word-break: break-word;
}

.camera-cert-table .ltr-cell,
.camera-cert-table .password-visible {
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
  font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}

.camera-cert-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 30px;
  text-align: center;
}

.camera-cert-footer div {
  padding-top: 14px;
  border-top: 1px solid #111827;
}

.camera-cert-footer span,
.camera-cert-footer strong {
  display: block;
}

.camera-cert-footer span {
  color: #475467;
  font-weight: 500;
}

.camera-cert-footer strong {
  color: #111827;
  font-weight: 800;
}

.camera-cert-small {
  margin-top: 24px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

@media print {
  .camera-certificate {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    border: 0;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .camera-cert-header img {
    width: 118px;
    max-height: 130px;
  }

  .camera-cert-header h1 {
    font-size: 24px;
  }

  .camera-cert-table {
    font-size: 12.3px;
  }

  .camera-cert-table th,
  .camera-cert-table td {
    padding: 7px 9px;
  }

  .multi-print-page {
    page-break-after: always;
    break-after: page;
  }

  .multi-print-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

/* Laptop custody module */
.tool-laptops .tool-icon { background: #eef2ff; color: #4338ca; }
.laptop-hero {
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,0.16), transparent 30%),
    linear-gradient(135deg, #4338ca, #1e3a8a);
}
.laptop-panel-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.laptop-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.laptop-split div {
  padding: 18px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.laptop-split span { display: block; color: var(--muted); font-weight: 800; }
.laptop-split strong { display: block; font-size: 34px; color: #4338ca; line-height: 1; margin-top: 8px; }
.type-bars { display: grid; gap: 12px; }
.type-bar-row { display: grid; gap: 8px; }
.type-bar-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.type-bar-row strong { color: var(--text); }
.type-bar-row span { color: var(--muted); font-weight: 700; }
.type-bar { height: 11px; border-radius: 999px; background: #eef2ff; overflow: hidden; }
.type-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4f46e5, #06b6d4); }
.laptop-quick .quick-action:hover { background: #eef2ff; color: #4338ca; }
.laptop-school-summary { margin-top: 18px; }
.laptop-filter-bar { grid-template-columns: 2fr 1.5fr 1.6fr 1fr 1fr 1fr auto auto; }
.laptops-table th,
.laptops-table td { font-size: 11.5px; padding: 7px 7px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.laptops-table td:nth-child(2) { max-width: 230px; }
.laptops-table .spec-cell { direction: ltr; text-align: left; unicode-bidi: plaintext; font-size: 11px; color: #475467; }
.laptop-actions { min-width: 285px; gap: 5px; }
.laptop-actions .action-btn { min-width: auto; padding: 6px 8px; font-size: 11.5px; border-radius: 10px; }
.action-transfer { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }
.section-laptop-device h2 { background: linear-gradient(135deg, #4338ca, #1e40af); }
.section-laptop-specs h2 { background: linear-gradient(135deg, #0891b2, #0e7490); }
.laptop-form-card .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.laptop-details .detail-section h2 { margin: 0 0 14px; }
.laptop-certificate { width: 210mm; min-height: 297mm; margin: 0 auto 30px; padding: 18mm; background: #fff; color: #111827; border: 1px solid #d0d5dd; box-shadow: 0 25px 80px rgba(0,0,0,0.12); }
.laptop-cert-header { text-align: center; border-bottom: 3px double var(--gold); padding-bottom: 12px; margin-bottom: 16px; }
.laptop-cert-header img { width: 126px; max-height: 138px; object-fit: contain; }
.laptop-cert-header h1 { margin: 8px 0 2px; font-size: 26px; font-weight: 900; color: #111827; }
.laptop-cert-header p { margin: 0; color: #475467; font-size: 13px; font-weight: 600; }
.laptop-cert-intro { padding: 13px 16px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--border); font-size: 14px; line-height: 1.9; margin-bottom: 14px; }
.laptop-section-title { margin: 14px 0 7px; padding: 8px 12px; border-radius: 12px; background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; font-size: 15px; font-weight: 900; }
.laptop-section-title.custody-title { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.laptop-section-title.disposal-title { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.laptop-cert-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.laptop-cert-table th,
.laptop-cert-table td { border: 1px solid #cfd6e3; padding: 8px 10px; text-align: right; vertical-align: middle; line-height: 1.65; }
.laptop-cert-table th { width: 20%; background: #f3f6fa; color: #475467; font-weight: 400; }
.laptop-cert-table td { width: 30%; background: #fff; color: #111827; font-weight: 800; word-break: break-word; }
.laptop-cert-footer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; text-align: center; }
.laptop-cert-footer div { padding-top: 14px; border-top: 1px solid #111827; }
.laptop-cert-footer span { color: #475467; font-weight: 500; display: block; }
.laptop-cert-footer strong { color: #111827; font-weight: 800; display: block; }
.laptop-cert-small { margin-top: 24px; color: var(--muted); font-size: 11.5px; text-align: center; }
@media (max-width: 1050px) { .laptop-form-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .laptop-panel-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .laptop-form-card .form-grid, .laptop-split { grid-template-columns: 1fr; } .laptop-filter-bar { grid-template-columns: 1fr; } .laptop-actions { min-width: auto; flex-wrap: wrap; } }
@media print {
  .laptop-certificate { width: 210mm; min-height: 297mm; margin: 0; box-shadow: none; border: 0; page-break-inside: avoid; break-inside: avoid; }
  .laptop-cert-header img { width: 118px; max-height: 130px; }
  .laptop-cert-header h1 { font-size: 24px; }
  .laptop-cert-table { font-size: 12.3px; }
  .laptop-cert-table th, .laptop-cert-table td { padding: 7px 9px; }
}

/* Unified professional print header across all tools */
@media print, screen {
  .certificate .cert-header,
  .cert-header,
  .print-header,
  .report-header {
    display: grid !important;
    grid-template-columns: 1fr 64px !important;
    grid-template-rows: auto auto !important;
    column-gap: 14px !important;
    align-items: start !important;
    text-align: left !important;
    direction: rtl !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #dfe7ef !important;
  }
  .certificate .cert-header img,
  .cert-header img,
  .print-header img,
  .report-header img {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    width: 58px !important;
    max-width: 58px !important;
    height: auto !important;
    justify-self: end !important;
    margin: 0 !important;
  }
  .certificate .cert-header h1,
  .cert-header h1,
  .print-header h1,
  .report-header h1 {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 0 3px 0 !important;
    text-align: left !important;
    font-size: 20px !important;
    line-height: 1.35 !important;
  }
  .certificate .cert-header p,
  .cert-header p,
  .print-header p,
  .report-header p,
  .certificate .cert-header .subtitle,
  .cert-header .subtitle {
    grid-column: 1 !important;
    grid-row: 2 !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    color: #475569 !important;
  }
  .cert-table th { font-weight: 400 !important; }
  .cert-table td { font-weight: 700 !important; }
}

/* Better editing forms for displays/laptops and similar inventory pages */
.form-card.display-form-card,
.form-card.laptop-form-card,
.display-form-card,
.laptop-form-card {
  max-width: 1180px;
  margin-inline: auto;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #e3e8ef;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .07);
}
.display-form-card .form-section,
.laptop-form-card .form-section,
.form-section.professional-section {
  padding: 22px 24px 24px;
  border-bottom: 1px solid #e8eef5;
  background: #fff;
}
.display-form-card .form-section h2,
.laptop-form-card .form-section h2,
.form-section.professional-section h2 {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 14px;
  margin: 0 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  background: linear-gradient(90deg, #e0f2fe, #eef2ff);
  border: 1px solid #d7e7ff;
}
.section-display-school h2,
.section-school h2 { background: linear-gradient(90deg, #dcfce7, #eff6ff) !important; }
.section-display-device h2,
.section-laptop-device h2 { background: linear-gradient(90deg, #e0f2fe, #f0f9ff) !important; }
.section-display-notes h2,
.section-laptop-specs h2 { background: linear-gradient(90deg, #fff7ed, #fefce8) !important; }
.section-laptop-procurement h2 { background: linear-gradient(90deg, #f3e8ff, #eef2ff) !important; }
.display-form-card .form-grid,
.laptop-form-card .form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.display-form-card label,
.laptop-form-card label,
.display-form-card .form-grid > div,
.laptop-form-card .form-grid > div {
  min-width: 0;
}
.display-form-card label span,
.laptop-form-card label,
.laptop-form-card .form-grid label {
  font-weight: 700;
  color: #334155;
}
.display-form-card input,
.display-form-card select,
.display-form-card textarea,
.laptop-form-card input,
.laptop-form-card select,
.laptop-form-card textarea {
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  background: #fbfdff;
  min-height: 44px;
}
.display-form-card input:focus,
.display-form-card select:focus,
.display-form-card textarea:focus,
.laptop-form-card input:focus,
.laptop-form-card select:focus,
.laptop-form-card textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
  outline: none;
}
.display-form-card .form-actions,
.laptop-form-card .form-actions {
  padding: 18px 24px 24px;
  background: #f8fafc;
  border-top: 1px solid #e8eef5;
}
.wide-field,
.full-field,
.span-2 { grid-column: span 2; }
@media (max-width: 900px) {
  .display-form-card .form-grid,
  .laptop-form-card .form-grid { grid-template-columns: 1fr; }
  .wide-field,
  .full-field,
  .span-2 { grid-column: span 1; }
}

/* V5 unified printed-document header and footer */
@media print, screen {
  .certificate .cert-header,
  .cert-header,
  .camera-cert-header,
  .laptop-cert-header,
  .display-cert-header,
  .print-header,
  .report-header {
    display: grid !important;
    grid-template-columns: 72px 1fr !important;
    grid-template-areas: "logo title" "logo subtitle" !important;
    column-gap: 16px !important;
    align-items: start !important;
    direction: rtl !important;
    text-align: left !important;
    border-bottom: 1px solid #d9e2ec !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
  }
  .certificate .cert-header img,
  .cert-header img,
  .camera-cert-header img,
  .laptop-cert-header img,
  .display-cert-header img,
  .print-header img,
  .report-header img {
    grid-area: logo !important;
    width: 58px !important;
    max-width: 58px !important;
    max-height: 68px !important;
    object-fit: contain !important;
    justify-self: end !important;
    align-self: start !important;
    margin: 0 !important;
  }
  .certificate .cert-header h1,
  .cert-header h1,
  .camera-cert-header h1,
  .laptop-cert-header h1,
  .display-cert-header h1,
  .print-header h1,
  .report-header h1 {
    grid-area: title !important;
    margin: 0 0 2px !important;
    text-align: left !important;
    font-size: 20px !important;
    line-height: 1.32 !important;
    font-weight: 900 !important;
    color: #111827 !important;
  }
  .certificate .cert-header p,
  .cert-header p,
  .camera-cert-header p,
  .laptop-cert-header p,
  .display-cert-header p,
  .print-header p,
  .report-header p,
  .cert-header .subtitle {
    grid-area: subtitle !important;
    margin: 0 !important;
    text-align: left !important;
    font-size: 11.5px !important;
    line-height: 1.45 !important;
    color: #475569 !important;
    font-weight: 600 !important;
  }
  .official-doc-footer {
    margin-top: 12px;
    padding-top: 7px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 10.5px;
    line-height: 1.7;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    justify-content: space-between;
    align-items: center;
  }
  .official-doc-footer strong { color: #4b5563; font-weight: 700; }
}
@media print {
  .official-doc-footer {
    position: absolute;
    left: 18mm;
    right: 18mm;
    bottom: 8mm;
  }
  .certificate { position: relative; padding-bottom: 24mm !important; }
}

/* V6 compact one-page print sizing: body 12, section titles 14, report title 14 */
@media print, screen {
  .certificate,
  .report-polished,
  .camera-report-card,
  .laptop-cert,
  .display-cert,
  .print-document,
  .official-print-page {
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  .certificate .cert-header h1,
  .cert-header h1,
  .camera-cert-header h1,
  .laptop-cert-header h1,
  .display-cert-header h1,
  .print-header h1,
  .report-header h1,
  .report-title,
  .print-title,
  .document-title {
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
  }

  .section-title,
  .laptop-section-title,
  .display-section-title,
  .camera-section-title,
  .report-section-title,
  .certificate h2,
  .report-polished h2,
  .print-section-title,
  .document-section-title {
    font-size: 14px !important;
    line-height: 1.35 !important;
    padding: 6px 10px !important;
    margin: 8px 0 5px !important;
  }

  .cert-table,
  .camera-report-table,
  .laptop-cert-table,
  .display-cert-table,
  .print-table,
  .report-table,
  .certificate table,
  .report-polished table {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .cert-table th,
  .cert-table td,
  .camera-report-table th,
  .camera-report-table td,
  .laptop-cert-table th,
  .laptop-cert-table td,
  .display-cert-table th,
  .display-cert-table td,
  .print-table th,
  .print-table td,
  .report-table th,
  .report-table td,
  .certificate table th,
  .certificate table td,
  .report-polished table th,
  .report-polished table td {
    font-size: 12px !important;
    padding: 5px 7px !important;
    line-height: 1.35 !important;
  }

  .cert-intro,
  .laptop-cert-intro,
  .display-cert-intro,
  .camera-cert-intro,
  .report-intro,
  .print-intro {
    font-size: 12px !important;
    line-height: 1.55 !important;
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
  }

  .official-doc-footer {
    font-size: 10px !important;
    line-height: 1.45 !important;
    margin-top: 7px !important;
    padding-top: 5px !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 9mm 8mm 9mm;
  }

  html, body {
    width: 210mm !important;
    min-height: 297mm !important;
    font-size: 12px !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .no-print,
  .print-actions,
  .navbar,
  .topbar,
  .app-header,
  .sidebar,
  .btn,
  button {
    display: none !important;
  }

  .certificate,
  .report-polished,
  .camera-report-card,
  .laptop-cert,
  .display-cert,
  .print-document,
  .official-print-page {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 16mm 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
  }

  .certificate .cert-header,
  .cert-header,
  .camera-cert-header,
  .laptop-cert-header,
  .display-cert-header,
  .print-header,
  .report-header {
    margin-bottom: 6px !important;
    padding-bottom: 5px !important;
  }

  .certificate .cert-header img,
  .cert-header img,
  .camera-cert-header img,
  .laptop-cert-header img,
  .display-cert-header img,
  .print-header img,
  .report-header img {
    width: 48px !important;
    max-width: 48px !important;
    max-height: 56px !important;
  }

  .signature-area,
  .cert-signatures,
  .print-signatures,
  .report-signatures {
    margin-top: 8px !important;
    padding-top: 6px !important;
  }

  .page-break,
  .print-page-break {
    page-break-after: always !important;
    break-after: page !important;
  }
}

/* V7 print refinements: compact footer, margins, no URL/path area */
@media print {
  @page { size: A4 portrait; margin: 7mm 7mm 7mm 7mm !important; }
  html, body { margin: 0 !important; padding: 0 !important; width: 100% !important; background: #fff !important; }
  body.print-body { margin: 0 !important; padding: 0 !important; }
  .print-actions, .no-print, .site-print-path, .breadcrumb, .page-url, .print-url { display: none !important; }
  .certificate, .camera-certificate, .display-certificate, .laptop-certificate, .report-polished {
    width: auto !important;
    max-width: none !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 6mm 7mm !important;
    box-shadow: none !important;
    border: none !important;
    page-break-inside: avoid !important;
  }
  .cert-header, .camera-cert-header, .display-cert-header, .laptop-cert-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 8mm !important;
    margin-bottom: 4mm !important;
    padding-bottom: 2mm !important;
  }
  .cert-header img, .camera-cert-header img, .display-cert-header img, .laptop-cert-header img {
    order: 1 !important;
    width: 48px !important;
    height: auto !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
  }
  .cert-header h1, .camera-cert-header h1, .display-cert-header h1, .laptop-cert-header h1,
  .cert-header p, .camera-cert-header p, .display-cert-header p, .laptop-cert-header p {
    order: 2 !important;
    text-align: left !important;
    margin-right: auto !important;
  }
  .cert-header h1, .camera-cert-header h1, .display-cert-header h1, .laptop-cert-header h1 { font-size: 14px !important; line-height: 1.4 !important; margin-top: 0 !important; margin-bottom: 2px !important; }
  .cert-header p, .camera-cert-header p, .display-cert-header p, .laptop-cert-header p { font-size: 10px !important; line-height: 1.4 !important; margin: 0 !important; }
  .cert-intro, .camera-cert-intro, .display-cert-intro, .laptop-cert-intro { padding: 5px 8px !important; margin-bottom: 5px !important; font-size: 12px !important; line-height: 1.45 !important; }
  .cert-section-title, .camera-section-title, .display-section-title, .laptop-section-title { font-size: 14px !important; margin: 6px 0 4px !important; padding: 4px 7px !important; }
  .cert-table, .camera-cert-table, .display-cert-table, .laptop-cert-table { margin-bottom: 5px !important; font-size: 12px !important; }
  .cert-table th, .cert-table td,
  .camera-cert-table th, .camera-cert-table td,
  .display-cert-table th, .display-cert-table td,
  .laptop-cert-table th, .laptop-cert-table td { padding: 4px 6px !important; font-size: 12px !important; line-height: 1.35 !important; }
  .cert-footer, .camera-cert-footer, .display-cert-footer, .laptop-cert-footer { margin-top: 6px !important; padding-top: 4px !important; }
  .cert-small, .camera-cert-small, .display-cert-small, .laptop-cert-small { font-size: 10px !important; margin-top: 4px !important; }
  .official-doc-footer {
    margin-top: 5px !important;
    padding-top: 4px !important;
    border-top: 1px solid #e5e7eb !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px 10px !important;
    color: #6B7280 !important;
    font-size: 10px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    text-align: center !important;
  }
  .official-doc-footer * { color: #6B7280 !important; font-size: 10px !important; font-weight: 400 !important; }
  .official-doc-footer strong { font-weight: 500 !important; }
  .print-school-section, .school-title, .school-print-only { display: none !important; }
}

/* V8 unified print fix: readable one-page reports and no blank trailing page */
@media print {
  @page { size: A4 portrait; margin: 8mm 8mm 8mm 8mm !important; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.print-body { margin: 0 !important; padding: 0 !important; }
  .print-actions, .print-toolbar, .no-print, .site-print-path, .breadcrumb, .page-url, .print-url { display: none !important; }

  .certificate,
  .camera-certificate,
  .display-certificate,
  .laptop-certificate,
  .report-polished,
  .print-document,
  .official-print-page {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 4mm 5mm 7mm 5mm !important;
    box-shadow: none !important;
    border: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: visible !important;
  }

  .cert-header,
  .camera-cert-header,
  .display-cert-header,
  .laptop-cert-header,
  .print-header,
  .report-header {
    display: block !important;
    text-align: center !important;
    margin: 0 0 5mm 0 !important;
    padding: 0 0 2mm 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
  }

  .cert-header img,
  .camera-cert-header img,
  .display-cert-header img,
  .laptop-cert-header img,
  .print-header img,
  .report-header img {
    display: block !important;
    width: 58px !important;
    max-width: 58px !important;
    height: auto !important;
    margin: 0 auto 3mm auto !important;
  }

  .cert-header h1,
  .camera-cert-header h1,
  .display-cert-header h1,
  .laptop-cert-header h1,
  .print-header h1,
  .report-header h1 {
    font-size: 18px !important;
    line-height: 1.35 !important;
    margin: 0 0 2px 0 !important;
    text-align: center !important;
  }

  .cert-header p,
  .camera-cert-header p,
  .display-cert-header p,
  .laptop-cert-header p,
  .print-header p,
  .report-header p,
  .cert-intro,
  .camera-cert-intro,
  .display-cert-intro,
  .laptop-cert-intro,
  .cert-small,
  .camera-cert-small,
  .display-cert-small,
  .laptop-cert-small {
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .cert-section-title,
  .camera-section-title,
  .display-section-title,
  .laptop-section-title,
  .section-title,
  .print-section-title {
    font-size: 16px !important;
    line-height: 1.35 !important;
    margin: 5px 0 4px !important;
    padding: 4px 7px !important;
  }

  .cert-table,
  .camera-cert-table,
  .display-cert-table,
  .laptop-cert-table,
  .print-table,
  .report-table {
    width: 100% !important;
    margin-bottom: 5px !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
  }

  .cert-table th, .cert-table td,
  .camera-cert-table th, .camera-cert-table td,
  .display-cert-table th, .display-cert-table td,
  .laptop-cert-table th, .laptop-cert-table td,
  .print-table th, .print-table td,
  .report-table th, .report-table td {
    font-size: 14px !important;
    line-height: 1.32 !important;
    padding: 3px 5px !important;
    vertical-align: middle !important;
  }

  .official-doc-footer {
    margin-top: 5px !important;
    padding-top: 4px !important;
    border-top: 1px solid #e5e7eb !important;
    color: #6B7280 !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
    font-weight: 400 !important;
    text-align: center !important;
    display: block !important;
    white-space: normal !important;
  }
  .official-doc-footer *, .official-doc-footer span, .official-doc-footer strong {
    color: #6B7280 !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
    font-weight: 400 !important;
  }
  .official-doc-footer span, .official-doc-footer strong { display: inline-block !important; margin: 0 4px 2px !important; }

  .multi-print-page { page-break-after: always !important; break-after: page !important; }
  .multi-print-page:last-child { page-break-after: auto !important; break-after: auto !important; }
  .page-break:last-child, .print-page-break:last-child { page-break-after: auto !important; break-after: auto !important; }
}


/* ===== Print unification V9: all tools ===== */
@media screen {
  .print-toolbar.no-print,
  .print-actions.no-print {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 10px auto 14px !important;
    padding: 8px !important;
  }
}

.print-body {
  background: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
}

.certificate,
.student-certificate,
.camera-certificate,
.laptop-certificate,
.display-certificate,
.disposal-certificate {
  width: 190mm !important;
  max-width: 190mm !important;
  min-height: auto !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 6mm 7mm 5mm !important;
  box-sizing: border-box !important;
  background: #fff !important;
  box-shadow: none !important;
  border: 0 !important;
  overflow: visible !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.cert-header,
.camera-cert-header,
.laptop-cert-header,
.display-cert-header,
.print-header,
.official-print-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 2px !important;
  margin: 0 0 5mm !important;
  padding: 0 !important;
  border: 0 !important;
}

.cert-header img,
.camera-cert-header img,
.laptop-cert-header img,
.display-cert-header img,
.print-header img,
.official-print-header img {
  display: block !important;
  width: 42px !important;
  height: auto !important;
  margin: 0 auto 3px !important;
  float: none !important;
  position: static !important;
}

.cert-header h1,
.camera-cert-header h1,
.laptop-cert-header h1,
.display-cert-header h1,
.print-title,
.official-print-title {
  font-size: 18px !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  font-weight: 800 !important;
  text-align: center !important;
}

.cert-header p,
.camera-cert-header p,
.laptop-cert-header p,
.display-cert-header p,
.cert-intro,
.cert-small,
.cert-notes,
.official-print-subtitle {
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.cert-intro {
  margin: 3mm 0 !important;
  padding: 3mm !important;
}

.cert-section-title,
.camera-section-title,
.laptop-section-title,
.display-section-title {
  font-size: 16px !important;
  line-height: 1.25 !important;
  margin: 4mm 0 2mm !important;
  padding: 2mm 3mm !important;
  font-weight: 800 !important;
}

.cert-table,
.camera-cert-table,
.laptop-cert-table,
.display-cert-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 0 2.5mm !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.cert-table th,
.cert-table td,
.camera-cert-table th,
.camera-cert-table td,
.laptop-cert-table th,
.laptop-cert-table td,
.display-cert-table th,
.display-cert-table td {
  font-size: 14px !important;
  line-height: 1.35 !important;
  padding: 2mm 2.5mm !important;
  vertical-align: middle !important;
  word-break: break-word !important;
}

.cert-footer,
.camera-cert-footer,
.laptop-cert-footer,
.display-cert-footer {
  margin-top: 4mm !important;
  padding-top: 3mm !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 4mm !important;
  font-size: 14px !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.official-doc-footer {
  margin-top: 4mm !important;
  padding-top: 2mm !important;
  border-top: 1px solid #e5e7eb !important;
  color: #6b7280 !important;
  font-size: 10px !important;
  line-height: 1.45 !important;
  text-align: center !important;
  display: block !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  clear: both !important;
}

.official-doc-footer .official-footer-line,
.official-doc-footer span,
.official-doc-footer strong {
  color: #6b7280 !important;
  font-size: 10px !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
  display: block !important;
  white-space: normal !important;
  margin: 0 !important;
}

.official-doc-footer strong { font-weight: 600 !important; }

.page-break,
.print-page-break { display: none !important; page-break-after: auto !important; break-after: auto !important; }
.multi-print-page { page-break-after: auto !important; break-after: auto !important; }
.print-all .multi-print-page:not(:last-of-type) { page-break-after: always !important; break-after: page !important; }
.print-all .multi-print-page:last-of-type { page-break-after: auto !important; break-after: auto !important; }

@page {
  size: A4 portrait;
  margin: 7mm 7mm 7mm 7mm;
}

@media print {
  html, body {
    width: 210mm !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  .print-actions,
  .print-toolbar,
  .no-print,
  .site-print-path,
  .breadcrumb,
  .page-url,
  .print-url,
  nav,
  .navbar,
  .sidebar {
    display: none !important;
  }

  .certificate,
  .student-certificate,
  .camera-certificate,
  .laptop-certificate,
  .display-certificate,
  .disposal-certificate {
    width: auto !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    box-shadow: none !important;
    border: 0 !important;
    transform: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .cert-header,
  .camera-cert-header,
  .laptop-cert-header,
  .display-cert-header,
  .print-header,
  .official-print-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 0 4mm !important;
  }

  .cert-header img,
  .camera-cert-header img,
  .laptop-cert-header img,
  .display-cert-header img,
  .print-header img,
  .official-print-header img {
    width: 40px !important;
    margin: 0 auto 2mm !important;
    float: none !important;
    position: static !important;
  }

  .cert-header h1,
  .camera-cert-header h1,
  .laptop-cert-header h1,
  .display-cert-header h1,
  .print-title,
  .official-print-title { font-size: 18px !important; }

  .cert-section-title,
  .camera-section-title,
  .laptop-section-title,
  .display-section-title { font-size: 16px !important; }

  .cert-table,
  .camera-cert-table,
  .laptop-cert-table,
  .display-cert-table,
  .cert-table th,
  .cert-table td,
  .camera-cert-table th,
  .camera-cert-table td,
  .laptop-cert-table th,
  .laptop-cert-table td,
  .display-cert-table th,
  .display-cert-table td,
  .cert-intro,
  .cert-small,
  .cert-notes { font-size: 14px !important; }

  .cert-table th,
  .cert-table td,
  .camera-cert-table th,
  .camera-cert-table td,
  .laptop-cert-table th,
  .laptop-cert-table td,
  .display-cert-table th,
  .display-cert-table td { padding: 1.6mm 2mm !important; }

  .official-doc-footer,
  .official-doc-footer .official-footer-line,
  .official-doc-footer span,
  .official-doc-footer strong { font-size: 10px !important; color: #6b7280 !important; line-height: 1.45 !important; }

  .multi-print-page { page-break-after: auto !important; break-after: auto !important; }
  .print-all .multi-print-page:not(:last-of-type) { page-break-after: always !important; break-after: page !important; }
  .print-all .multi-print-page:last-of-type { page-break-after: auto !important; break-after: auto !important; }
}

/* =========================================================
   Print System V10 - unified official print style
   Applies to all certificates/reports and fixes footer/table/page overflow
   ========================================================= */
:root{ --print-border:#cfd8e3; --print-soft:#eef2f7; --print-text:#111827; --print-muted:#6b7280; }
.print-body{ background:#e9eef6; }
.print-actions,.print-toolbar{ display:flex; gap:8px; justify-content:center; align-items:center; margin:10px auto; }

.certificate,
.student-certificate,
.camera-certificate,
.laptop-certificate,
.display-certificate,
.disposal-certificate{
  box-sizing:border-box !important;
  width:190mm !important;
  max-width:190mm !important;
  margin:8mm auto !important;
  padding:8mm !important;
  background:#fff !important;
  color:var(--print-text) !important;
  overflow:hidden !important;
  box-shadow:0 8px 24px rgba(15,23,42,.10) !important;
  border:0 !important;
  page-break-inside:avoid !important;
  break-inside:avoid !important;
}

.cert-header,.camera-cert-header,.laptop-cert-header,.display-cert-header,
.print-header,.official-print-header{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  gap:1.5mm !important;
  margin:0 0 4mm !important;
  padding:0 0 3mm !important;
  border-bottom:1px solid var(--print-border) !important;
}
.cert-header img,.camera-cert-header img,.laptop-cert-header img,.display-cert-header img,
.print-header img,.official-print-header img{
  display:block !important;
  float:none !important;
  position:static !important;
  width:20mm !important;
  height:auto !important;
  margin:0 auto 1mm !important;
  object-fit:contain !important;
}
.cert-header h1,.camera-cert-header h1,.laptop-cert-header h1,.display-cert-header h1,
.print-title,.official-print-title{
  font-size:18px !important;
  line-height:1.25 !important;
  margin:0 !important;
  font-weight:800 !important;
  text-align:center !important;
}
.cert-header p,.camera-cert-header p,.laptop-cert-header p,.display-cert-header p,
.official-print-subtitle{
  font-size:14px !important;
  line-height:1.25 !important;
  margin:0 !important;
  color:#334155 !important;
  text-align:center !important;
}
.cert-intro,.camera-cert-intro,.laptop-cert-intro,.display-cert-intro,
.cert-small,.cert-notes{
  font-size:14px !important;
  line-height:1.35 !important;
  margin:0 0 3mm !important;
  padding:2.5mm 3mm !important;
  border:1px solid #dbe3ee !important;
  border-radius:10px !important;
  background:#fff !important;
  text-align:right !important;
}
.cert-section-title,.camera-section-title,.laptop-section-title,.display-section-title{
  font-size:16px !important;
  line-height:1.2 !important;
  margin:3mm 0 2mm !important;
  padding:2mm 3mm !important;
  font-weight:800 !important;
  border:1px solid #bfdbfe !important;
  border-radius:10px !important;
  background:#f8fbff !important;
  text-align:right !important;
}
.cert-table,.camera-cert-table,.laptop-cert-table,.display-cert-table{
  width:100% !important;
  border-collapse:collapse !important;
  table-layout:fixed !important;
  margin:0 0 2.5mm !important;
  font-size:14px !important;
  line-height:1.25 !important;
  border:1px solid var(--print-border) !important;
  page-break-inside:avoid !important;
  break-inside:avoid !important;
}
.cert-table th,.cert-table td,
.camera-cert-table th,.camera-cert-table td,
.laptop-cert-table th,.laptop-cert-table td,
.display-cert-table th,.display-cert-table td{
  border:1px solid var(--print-border) !important;
  padding:1.8mm 2.2mm !important;
  vertical-align:middle !important;
  font-size:14px !important;
  line-height:1.25 !important;
  color:#111827 !important;
  word-break:break-word !important;
  overflow-wrap:anywhere !important;
}
.cert-table th,.camera-cert-table th,.laptop-cert-table th,.display-cert-table th{
  background:#f3f6fb !important;
  color:#334155 !important;
  font-weight:500 !important;
}
.cert-table td,.camera-cert-table td,.laptop-cert-table td,.display-cert-table td{
  font-weight:800 !important;
}
.ltr-cell{ direction:ltr !important; unicode-bidi:embed !important; }

.cert-footer,.camera-cert-footer,.laptop-cert-footer,.display-cert-footer{
  margin:3mm 0 2mm !important;
  padding-top:2mm !important;
  display:grid !important;
  grid-template-columns:repeat(3,1fr) !important;
  gap:5mm !important;
  font-size:14px !important;
  line-height:1.2 !important;
  text-align:center !important;
  page-break-inside:avoid !important;
  break-inside:avoid !important;
}
.cert-footer > div,.camera-cert-footer > div,.laptop-cert-footer > div,.display-cert-footer > div{
  border-top:1px solid #111827 !important;
  padding-top:2mm !important;
  min-height:auto !important;
}
.cert-footer span,.camera-cert-footer span,.laptop-cert-footer span,.display-cert-footer span{
  display:block !important;
  font-size:14px !important;
  line-height:1.2 !important;
  color:#334155 !important;
}
.cert-footer strong,.camera-cert-footer strong,.laptop-cert-footer strong,.display-cert-footer strong{
  display:block !important;
  font-size:14px !important;
  line-height:1.2 !important;
  margin-top:1mm !important;
}

.official-doc-footer{
  margin:2mm 0 0 !important;
  padding-top:1.5mm !important;
  border-top:1px solid #d9e0ea !important;
  text-align:center !important;
  color:var(--print-muted) !important;
  font-size:10px !important;
  line-height:1 !important;
  height:4mm !important;
  max-height:4mm !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  direction:rtl !important;
  page-break-inside:avoid !important;
  break-inside:avoid !important;
  clear:both !important;
}
.official-doc-footer .official-footer-single,
.official-doc-footer .official-footer-line,
.official-doc-footer span,
.official-doc-footer strong{
  display:inline !important;
  color:var(--print-muted) !important;
  font-size:10px !important;
  line-height:1 !important;
  font-weight:400 !important;
  white-space:nowrap !important;
  margin:0 !important;
  padding:0 !important;
  max-width:100% !important;
}
.official-doc-footer .official-footer-single{
  display:inline-block !important;
  transform:scaleX(.94) !important;
  transform-origin:center center !important;
}

.page-break,.print-page-break{ display:none !important; page-break-after:auto !important; break-after:auto !important; }
.multi-print-page{ page-break-after:auto !important; break-after:auto !important; }
.print-all .multi-print-page:not(:last-of-type){ page-break-after:always !important; break-after:page !important; }
.print-all .multi-print-page:last-of-type{ page-break-after:auto !important; break-after:auto !important; }

@page{ size:A4 portrait; margin:8mm 8mm 8mm 8mm; }
@media print{
  html,body{
    width:210mm !important;
    min-height:0 !important;
    height:auto !important;
    margin:0 !important;
    padding:0 !important;
    background:#fff !important;
    overflow:visible !important;
  }
  body{ -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
  .print-actions,.print-toolbar,.no-print,.site-print-path,.breadcrumb,.page-url,.print-url,nav,.navbar,.sidebar{ display:none !important; }
  .certificate,.student-certificate,.camera-certificate,.laptop-certificate,.display-certificate,.disposal-certificate{
    width:194mm !important;
    max-width:194mm !important;
    margin:0 auto !important;
    padding:0 !important;
    box-shadow:none !important;
    border:0 !important;
    overflow:hidden !important;
    page-break-inside:avoid !important;
    break-inside:avoid !important;
  }
  .cert-header,.camera-cert-header,.laptop-cert-header,.display-cert-header,.print-header,.official-print-header{
    margin:0 0 3mm !important;
    padding-bottom:2.5mm !important;
    text-align:center !important;
    align-items:center !important;
  }
  .cert-header img,.camera-cert-header img,.laptop-cert-header img,.display-cert-header img,.print-header img,.official-print-header img{
    width:18mm !important;
    margin:0 auto 1mm !important;
  }
  .cert-header h1,.camera-cert-header h1,.laptop-cert-header h1,.display-cert-header h1,.print-title,.official-print-title{ font-size:18px !important; }
  .cert-section-title,.camera-section-title,.laptop-section-title,.display-section-title{ font-size:16px !important; margin:2.5mm 0 1.5mm !important; padding:1.6mm 2.2mm !important; }
  .cert-table,.camera-cert-table,.laptop-cert-table,.display-cert-table{ font-size:14px !important; margin-bottom:2mm !important; }
  .cert-table th,.cert-table td,.camera-cert-table th,.camera-cert-table td,.laptop-cert-table th,.laptop-cert-table td,.display-cert-table th,.display-cert-table td{ font-size:14px !important; padding:1.25mm 1.7mm !important; line-height:1.18 !important; }
  .cert-intro,.camera-cert-intro,.laptop-cert-intro,.display-cert-intro,.cert-small,.cert-notes{ font-size:14px !important; line-height:1.25 !important; margin-bottom:2mm !important; padding:2mm 2.5mm !important; }
  .cert-footer,.camera-cert-footer,.laptop-cert-footer,.display-cert-footer{ margin:2mm 0 1.5mm !important; padding-top:1.5mm !important; gap:5mm !important; font-size:14px !important; }
  .cert-footer span,.camera-cert-footer span,.laptop-cert-footer span,.display-cert-footer span,.cert-footer strong,.camera-cert-footer strong,.laptop-cert-footer strong,.display-cert-footer strong{ font-size:14px !important; line-height:1.1 !important; }
  .official-doc-footer{ font-size:10px !important; color:#6b7280 !important; height:4mm !important; max-height:4mm !important; line-height:1 !important; margin-top:1.5mm !important; padding-top:1mm !important; white-space:nowrap !important; overflow:hidden !important; }
  .official-doc-footer .official-footer-single,.official-doc-footer span,.official-doc-footer strong{ font-size:10px !important; color:#6b7280 !important; line-height:1 !important; white-space:nowrap !important; }
  .multi-print-page{ page-break-after:auto !important; break-after:auto !important; }
  .print-all .multi-print-page:not(:last-of-type){ page-break-after:always !important; break-after:page !important; }
  .print-all .multi-print-page:last-of-type{ page-break-after:auto !important; break-after:auto !important; }
}

/* =========================================================
   V11: Unified RTL detail cards for asset view pages
   Applies to laptop custody and display/interactive screen cards.
   ========================================================= */
.page-head,
.details-card,
.details-grid,
.laptop-details,
.display-details,
.panel,
.detail-section {
  direction: rtl;
}

.page-head {
  align-items: flex-start;
  gap: 20px;
}

.page-head > div:first-child h1 {
  letter-spacing: -0.02em;
}

.page-actions {
  justify-content: flex-start;
  align-items: center;
}

.page-actions .btn,
.form-actions .btn {
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 16px;
  font-weight: 900;
}

.details-card,
.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255,255,255,0.78);
  border: 1px solid #e4e7ec;
  box-shadow: 0 20px 55px rgba(16,24,40,0.06);
}

.details-grid {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-section,
.panel.detail-section,
.panel {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid #dfe5ee;
  background: #fff;
  padding: 22px;
  box-shadow: 0 14px 38px rgba(16,24,40,0.045);
}

.detail-section::before,
.panel.detail-section::before,
.panel::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #0f766e, #14b8a6, #60a5fa);
  opacity: 0.9;
}

.detail-section h2,
.panel h2 {
  margin: 0 0 18px;
  padding: 0 0 12px;
  color: #101828;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.35;
  border-bottom: 1px solid #eef2f6;
  background: none !important;
  box-shadow: none !important;
}

.detail-section dl,
.details-list {
  display: grid !important;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr) minmax(130px, 0.42fr) minmax(0, 1fr);
  gap: 0;
  margin: 0;
  border: 1px solid #e4e7ec;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.detail-section dt,
.details-list dt,
.detail-section dd,
.details-list dd {
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  line-height: 1.55;
}

.detail-section dt,
.details-list dt {
  color: #667085;
  font-weight: 900;
  background: #f8fafc;
  justify-content: flex-start;
}

.detail-section dd,
.details-list dd {
  color: #101828;
  font-weight: 950;
  background: #fff;
  justify-content: flex-start;
  word-break: break-word;
}

.detail-section dt:nth-last-child(-n+2),
.detail-section dd:nth-last-child(-n+2),
.details-list dt:nth-last-child(-n+2),
.details-list dd:nth-last-child(-n+2) {
  border-bottom: 0;
}

.soft-panel,
.detail-section.soft-panel {
  background: linear-gradient(180deg, #f0fdfa, #ffffff);
  border-color: #b7efe5;
}

.maintenance-panel,
.detail-section.maintenance-panel,
.panel.maintenance-panel {
  background: linear-gradient(180deg, #fff7f7, #ffffff) !important;
  border-color: #fecaca !important;
}

.maintenance-panel::before {
  background: linear-gradient(90deg, #dc2626, #fb7185) !important;
}

.maintenance-panel h2 {
  color: #991b1b !important;
  background: none !important;
}

.laptop-details .form-actions,
.display-details + .panel + .maintenance-panel + .panel,
.form-actions {
  margin-top: 8px;
}

.details-card .form-actions,
.form-actions {
  justify-content: flex-start;
  padding-top: 4px;
}

.panel > p {
  margin: 0 0 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fafc;
  color: #101828;
  font-weight: 800;
  line-height: 1.8;
}

.ltr-cell {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: plaintext;
  justify-content: flex-end !important;
  font-variant-numeric: tabular-nums;
}

.badge {
  white-space: nowrap;
}

/* Better visual hierarchy for asset pages */
body:has(.laptop-details) .page-head,
body:has(.display-details) .page-head {
  padding: 16px 4px 22px;
  border-bottom: 1px solid #e4e7ec;
  margin-bottom: 20px;
}

body:has(.laptop-details) .page-head h1,
body:has(.display-details) .page-head h1 {
  font-size: clamp(30px, 3vw, 46px);
}

body:has(.laptop-details) .page-head p,
body:has(.display-details) .page-head p {
  margin-top: 8px;
  color: #667085;
  font-size: 18px;
  font-weight: 800;
}

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

@media (max-width: 900px) {
  .page-head {
    display: grid;
  }
  .page-actions {
    justify-content: stretch;
  }
  .page-actions .btn,
  .form-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .detail-section dl,
  .details-list {
    grid-template-columns: minmax(115px, 0.46fr) minmax(0, 1fr);
  }
  .detail-section dt:nth-last-child(-n+2),
  .detail-section dd:nth-last-child(-n+2),
  .details-list dt:nth-last-child(-n+2),
  .details-list dd:nth-last-child(-n+2) {
    border-bottom: 1px solid #eef2f6;
  }
  .detail-section dd:last-child,
  .details-list dd:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .details-card,
  .detail-section,
  .panel.detail-section,
  .panel {
    padding: 16px;
    border-radius: 20px;
  }
  .detail-section h2,
  .panel h2 {
    font-size: 21px;
  }
  .detail-section dl,
  .details-list {
    grid-template-columns: 1fr;
  }
  .detail-section dt,
  .details-list dt {
    min-height: auto;
    padding-bottom: 4px;
    border-bottom: 0;
  }
  .detail-section dd,
  .details-list dd {
    padding-top: 4px;
  }
}

/* =========================================================
   V12: Asset view RTL restructure + final print footer lock
   ========================================================= */
.asset-fields-grid {
  direction: rtl;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
}
.asset-field {
  border: 1px solid #e4e7ec;
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: right;
  direction: rtl;
}
.asset-field .asset-label {
  display: block;
  width: 100%;
  color: #667085;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  margin: 0 0 5px;
  text-align: right;
}
.asset-field .asset-value {
  display: block;
  width: 100%;
  color: #101828;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.55;
  text-align: right;
  direction: rtl;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.asset-field .asset-value.is-ltr,
.asset-field .asset-value.ltr-cell {
  direction: ltr !important;
  unicode-bidi: plaintext !important;
  text-align: right !important;
  justify-content: flex-start !important;
  font-variant-numeric: tabular-nums;
}
.asset-field.asset-note {
  grid-column: 1 / -1;
  min-height: 92px;
}
.asset-field.asset-note .asset-value {
  font-weight: 800;
  line-height: 1.8;
}
.asset-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  margin-top: 14px;
}
body:has(.asset-fields-grid) .detail-section dl,
body:has(.asset-fields-grid) .details-list {
  display: none !important;
}
body:has(.asset-fields-grid) .panel > p {
  text-align: right;
}
@media (max-width: 820px) {
  .asset-fields-grid { grid-template-columns: 1fr; }
  .asset-field .asset-value { font-size: 16px; }
}

/* Final print controls: fixed footer, no collision, no trailing blank page */
@media print {
  @page { size: A4 portrait; margin: 8mm 8mm 10mm 8mm !important; }
  html, body {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }
  body.print-body, body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .print-actions,
  .print-toolbar,
  .no-print,
  .site-print-path,
  .breadcrumb,
  .page-url,
  .print-url,
  nav,
  .navbar,
  .sidebar,
  .topbar,
  .app-header,
  button,
  .btn:not(.keep-print) { display: none !important; }

  .certificate,
  .student-certificate,
  .camera-certificate,
  .laptop-certificate,
  .display-certificate,
  .disposal-certificate {
    width: 194mm !important;
    max-width: 194mm !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 0 0 12mm 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .cert-header,
  .camera-cert-header,
  .laptop-cert-header,
  .display-cert-header,
  .print-header,
  .official-print-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 1mm !important;
    margin: 0 0 3mm !important;
    padding: 0 0 2mm !important;
    border-bottom: 1px solid #d9e0ea !important;
  }
  .cert-header img,
  .camera-cert-header img,
  .laptop-cert-header img,
  .display-cert-header img,
  .print-header img,
  .official-print-header img {
    display: block !important;
    width: 17mm !important;
    max-width: 17mm !important;
    height: auto !important;
    margin: 0 auto 1mm !important;
    float: none !important;
    position: static !important;
    object-fit: contain !important;
  }
  .cert-header h1,
  .camera-cert-header h1,
  .laptop-cert-header h1,
  .display-cert-header h1,
  .print-title,
  .official-print-title {
    font-size: 18px !important;
    line-height: 1.22 !important;
    margin: 0 !important;
    text-align: center !important;
    font-weight: 900 !important;
  }
  .cert-header p,
  .camera-cert-header p,
  .laptop-cert-header p,
  .display-cert-header p,
  .official-print-subtitle {
    font-size: 12px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    text-align: center !important;
  }
  .cert-intro,
  .camera-cert-intro,
  .laptop-cert-intro,
  .display-cert-intro {
    font-size: 14px !important;
    line-height: 1.35 !important;
    padding: 2mm 2.5mm !important;
    margin: 0 0 2mm !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 8px !important;
  }
  .cert-section-title,
  .camera-section-title,
  .laptop-section-title,
  .display-section-title {
    font-size: 16px !important;
    line-height: 1.25 !important;
    margin: 2mm 0 1.5mm !important;
    padding: 1.5mm 2mm !important;
  }
  .cert-table,
  .camera-cert-table,
  .laptop-cert-table,
  .display-cert-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 0 0 2mm !important;
    border: 1px solid #cfd8e3 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .cert-table th,
  .cert-table td,
  .camera-cert-table th,
  .camera-cert-table td,
  .laptop-cert-table th,
  .laptop-cert-table td,
  .display-cert-table th,
  .display-cert-table td {
    border: 1px solid #cfd8e3 !important;
    padding: 1.1mm 1.6mm !important;
    font-size: 14px !important;
    line-height: 1.18 !important;
    vertical-align: middle !important;
  }
  .cert-footer,
  .camera-cert-footer,
  .laptop-cert-footer,
  .display-cert-footer {
    margin: 2mm 0 1mm !important;
    padding-top: 1.5mm !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5mm !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .cert-footer span,
  .cert-footer strong,
  .camera-cert-footer span,
  .camera-cert-footer strong,
  .laptop-cert-footer span,
  .laptop-cert-footer strong,
  .display-cert-footer span,
  .display-cert-footer strong {
    font-size: 14px !important;
    line-height: 1.1 !important;
  }
  .cert-small,
  .camera-cert-small,
  .laptop-cert-small,
  .display-cert-small {
    margin: 1mm 0 0 !important;
    padding: 1mm 2mm !important;
    border: 0 !important;
    background: transparent !important;
    color: #6b7280 !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .official-doc-footer {
    position: fixed !important;
    left: 8mm !important;
    right: 8mm !important;
    bottom: 3mm !important;
    height: 4mm !important;
    max-height: 4mm !important;
    margin: 0 !important;
    padding: 1mm 0 0 !important;
    border-top: 1px solid #d9e0ea !important;
    background: #fff !important;
    color: #6b7280 !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    z-index: 9999 !important;
    direction: rtl !important;
  }
  .official-doc-footer .official-footer-single,
  .official-doc-footer .official-footer-line,
  .official-doc-footer span,
  .official-doc-footer strong {
    display: inline !important;
    color: #6b7280 !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .official-doc-footer .official-footer-single {
    display: inline-block !important;
    max-width: 100% !important;
    transform: scaleX(.90) !important;
    transform-origin: center center !important;
  }
  .page-break,
  .print-page-break { display: none !important; page-break-after: auto !important; break-after: auto !important; }
  .multi-print-page { page-break-after: auto !important; break-after: auto !important; }
  .print-all .multi-print-page:not(:last-of-type) { page-break-after: always !important; break-after: page !important; }
  .print-all .multi-print-page:last-of-type { page-break-after: auto !important; break-after: auto !important; }
  .multi-print-page:empty { display:none !important; }
}

/* =========================================================
   PRINT V13 — STRICT A4 / 3CM MARGINS / ONE-PAGE LAYOUT
   Applies to all printed reports across modules.
   ========================================================= */
@media print {
  @page {
    size: A4 portrait !important;
    margin: 30mm 30mm 30mm 30mm !important;
  }

  html,
  body {
    width: 150mm !important;
    min-width: 150mm !important;
    max-width: 150mm !important;
    min-height: 237mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
    direction: rtl !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body::before,
  body::after,
  html::before,
  html::after {
    display: none !important;
    content: none !important;
  }

  .print-actions,
  .print-toolbar,
  .no-print,
  .site-print-path,
  .breadcrumb,
  .page-url,
  .print-url,
  .url-footer,
  .browser-footer,
  nav,
  .navbar,
  .sidebar,
  .topbar,
  .app-header,
  .screen-only,
  button,
  .btn:not(.keep-print) {
    display: none !important;
  }

  .certificate,
  .student-certificate,
  .camera-certificate,
  .laptop-certificate,
  .display-certificate,
  .disposal-certificate,
  .official-print-page,
  .print-document,
  .print-wrapper,
  .report-container,
  main,
  .main,
  .content {
    width: 150mm !important;
    max-width: 150mm !important;
    min-height: 237mm !important;
    height: 237mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .cert-header,
  .camera-cert-header,
  .laptop-cert-header,
  .display-cert-header,
  .print-header,
  .official-print-header {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 1.5mm !important;
    margin: 0 0 4mm 0 !important;
    padding: 0 0 3mm 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #d7dee8 !important;
    flex: 0 0 auto !important;
  }

  .cert-header img,
  .camera-cert-header img,
  .laptop-cert-header img,
  .display-cert-header img,
  .print-header img,
  .official-print-header img,
  .print-logo,
  .official-logo {
    display: block !important;
    width: 20mm !important;
    max-width: 20mm !important;
    height: auto !important;
    margin: 0 auto !important;
    float: none !important;
    position: static !important;
    object-fit: contain !important;
  }

  .cert-header h1,
  .camera-cert-header h1,
  .laptop-cert-header h1,
  .display-cert-header h1,
  .print-title,
  .official-print-title,
  h1.print-title,
  .report-title {
    font-size: 18px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    font-weight: 900 !important;
    color: #111827 !important;
  }

  .cert-header p,
  .camera-cert-header p,
  .laptop-cert-header p,
  .display-cert-header p,
  .official-print-subtitle,
  .report-subtitle {
    font-size: 12px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    color: #4b5563 !important;
  }

  .print-body,
  .certificate-body,
  .cert-body,
  .report-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .cert-intro,
  .camera-cert-intro,
  .laptop-cert-intro,
  .display-cert-intro,
  .report-intro {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    padding: 2mm 2.5mm !important;
    margin: 0 0 3mm !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 6px !important;
    background: #fff !important;
    text-align: center !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .cert-section-title,
  .camera-section-title,
  .laptop-section-title,
  .display-section-title,
  .section-title,
  .print-section-title,
  h2,
  h3 {
    font-size: 16px !important;
    line-height: 1.25 !important;
    margin: 3mm 0 1.5mm !important;
    padding: 1.5mm 2mm !important;
    border-radius: 5px !important;
    font-weight: 900 !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  table,
  .cert-table,
  .camera-cert-table,
  .laptop-cert-table,
  .display-cert-table,
  .print-table,
  .report-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 0 0 2.5mm !important;
    border: 1px solid #cfd8e3 !important;
    background: #fff !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  th,
  td,
  .cert-table th,
  .cert-table td,
  .camera-cert-table th,
  .camera-cert-table td,
  .laptop-cert-table th,
  .laptop-cert-table td,
  .display-cert-table th,
  .display-cert-table td,
  .print-table th,
  .print-table td,
  .report-table th,
  .report-table td {
    border: 1px solid #cfd8e3 !important;
    padding: 1.6mm 2mm !important;
    font-size: 14px !important;
    line-height: 1.22 !important;
    vertical-align: middle !important;
    text-align: right !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    color: #111827 !important;
  }

  th,
  .label,
  .field-label,
  .report-label {
    font-weight: 500 !important;
    color: #64748b !important;
  }

  td strong,
  .value,
  .field-value,
  .report-value {
    font-weight: 800 !important;
    color: #111827 !important;
    text-align: right !important;
    direction: rtl !important;
    unicode-bidi: plaintext !important;
  }

  .cert-footer,
  .camera-cert-footer,
  .laptop-cert-footer,
  .display-cert-footer,
  .print-signatures,
  .report-signatures {
    margin-top: auto !important;
    padding-top: 4mm !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8mm !important;
    border: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    flex: 0 0 auto !important;
  }

  .cert-footer span,
  .cert-footer strong,
  .camera-cert-footer span,
  .camera-cert-footer strong,
  .laptop-cert-footer span,
  .laptop-cert-footer strong,
  .display-cert-footer span,
  .display-cert-footer strong,
  .print-signatures span,
  .print-signatures strong {
    font-size: 14px !important;
    line-height: 1.25 !important;
    text-align: center !important;
  }

  .cert-small,
  .camera-cert-small,
  .laptop-cert-small,
  .display-cert-small,
  .report-note,
  .print-note {
    width: 100% !important;
    margin: 2mm 0 1.5mm !important;
    padding: 1.5mm 2mm !important;
    box-sizing: border-box !important;
    color: #6b7280 !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    text-align: center !important;
    background: transparent !important;
    border: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    flex: 0 0 auto !important;
  }

  .official-doc-footer {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    margin: 2mm 0 0 !important;
    padding: 1.5mm 0 0 !important;
    border-top: 1px solid #d9e0ea !important;
    background: #fff !important;
    color: #6b7280 !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    direction: rtl !important;
    flex: 0 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .official-doc-footer .official-footer-single,
  .official-doc-footer .official-footer-line,
  .official-doc-footer span,
  .official-doc-footer strong {
    display: inline !important;
    color: #6b7280 !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: baseline !important;
  }

  .official-doc-footer .official-footer-single {
    display: inline-block !important;
    max-width: 150mm !important;
    transform: scaleX(.82) !important;
    transform-origin: center center !important;
  }

  .page-break,
  .print-page-break {
    display: none !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .multi-print-page {
    width: 150mm !important;
    min-height: 237mm !important;
    height: 237mm !important;
    overflow: hidden !important;
    page-break-after: auto !important;
    break-after: auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-all .multi-print-page:not(:last-of-type) {
    page-break-after: always !important;
    break-after: page !important;
  }

  .print-all .multi-print-page:last-of-type,
  .multi-print-page:last-child,
  .multi-print-page:empty {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .multi-print-page:empty,
  .print-all .multi-print-page:empty {
    display: none !important;
  }
}

/* =========================================================
   V14 - Student certificate print rebuild
   إصلاح إفادة بيانات الطالب: A4 حقيقي، شعار متوسط، فوتر ثابت داخل الصفحة،
   وتوافق أفضل مع طباعة Windows / macOS.
   ========================================================= */
.student-certificate-v14 {
  direction: rtl !important;
  box-sizing: border-box !important;
  width: 210mm !important;
  min-height: 297mm !important;
  height: 297mm !important;
  max-height: 297mm !important;
  margin: 8mm auto !important;
  padding: 20mm 22mm 16mm !important;
  background: #ffffff !important;
  color: #111827 !important;
  border: 0 !important;
  box-shadow: 0 10px 34px rgba(15, 23, 42, .10) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
}

.student-certificate-v14 .cert-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 3px !important;
  margin: 0 0 11mm !important;
  padding: 0 0 6mm !important;
  border: 0 !important;
  border-bottom: 1.4px solid #cbd5e1 !important;
}

.student-certificate-v14 .cert-header img {
  display: block !important;
  width: 31mm !important;
  max-width: 31mm !important;
  max-height: 31mm !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto 3mm !important;
  float: none !important;
  position: static !important;
}

.student-certificate-v14 .cert-header h1 {
  margin: 0 !important;
  color: #111827 !important;
  font-size: 26px !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
  text-align: center !important;
}

.student-certificate-v14 .cert-header p {
  margin: 0 !important;
  color: #475569 !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
  text-align: center !important;
}

.student-certificate-v14 .cert-intro {
  margin: 0 0 9mm !important;
  padding: 5mm 6mm !important;
  border-radius: 14px !important;
  border: 1px solid #dbe3ee !important;
  background: #f8fafc !important;
  color: #111827 !important;
  font-size: 16px !important;
  line-height: 1.65 !important;
  font-weight: 500 !important;
  text-align: right !important;
}

.student-certificate-v14 .cert-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  margin: 0 0 8mm !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  direction: rtl !important;
}

.student-certificate-v14 .cert-table th,
.student-certificate-v14 .cert-table td {
  border: 1px solid #cbd5e1 !important;
  padding: 3.2mm 3.6mm !important;
  vertical-align: middle !important;
  text-align: right !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.student-certificate-v14 .cert-table th {
  width: 21% !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  font-weight: 500 !important;
}

.student-certificate-v14 .cert-table td {
  color: #111827 !important;
  background: #ffffff !important;
  font-weight: 900 !important;
}

.student-certificate-v14 .cert-notes {
  margin: 0 0 6mm !important;
  padding: 4mm 5mm !important;
  border: 1px dashed #cbd5e1 !important;
  border-radius: 12px !important;
  background: #fff !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
}

.student-certificate-v14 .cert-signatures {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 11mm !important;
  margin: 8mm 0 0 !important;
  padding: 0 !important;
  text-align: center !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.student-certificate-v14 .cert-signatures > div {
  border-top: 1.2px solid #111827 !important;
  padding-top: 3mm !important;
  min-height: 12mm !important;
}

.student-certificate-v14 .cert-signatures span,
.student-certificate-v14 .cert-signatures strong {
  display: block !important;
  color: #111827 !important;
  font-size: 15px !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

.student-certificate-v14 .student-print-bottom {
  margin-top: auto !important;
  padding: 0 !important;
  border: 0 !important;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.student-certificate-v14 .cert-note-footer,
.student-certificate-v14 .official-doc-footer {
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 2mm 0 0 !important;
  border-top: 1px solid #e5e7eb !important;
  color: #6b7280 !important;
  background: #fff !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow: hidden !important;
  height: auto !important;
  max-height: none !important;
  transform: none !important;
}

.student-certificate-v14 .official-doc-footer {
  margin-top: 1.5mm !important;
  padding-top: 1.5mm !important;
  white-space: nowrap !important;
}

.student-certificate-v14 .official-doc-footer *,
.student-certificate-v14 .official-doc-footer .official-footer-single,
.student-certificate-v14 .official-doc-footer span,
.student-certificate-v14 .official-doc-footer strong {
  color: #6b7280 !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
  display: inline !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0 !important;
  }

  html,
  body,
  body.print-body {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-toolbar,
  .print-actions,
  .no-print,
  .site-print-path,
  .breadcrumb,
  .page-url,
  .print-url,
  nav,
  .navbar,
  .sidebar,
  .app-header,
  button {
    display: none !important;
  }

  body.print-body > .student-certificate-v14,
  .student-certificate-v14 {
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    height: 296.5mm !important;
    min-height: 296.5mm !important;
    max-height: 296.5mm !important;
    margin: 0 !important;
    padding: 18mm 20mm 13mm !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    page-break-before: avoid !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-before: avoid !important;
    break-after: avoid !important;
    break-inside: avoid !important;
  }

  .student-certificate-v14 .cert-header {
    margin-bottom: 7mm !important;
    padding-bottom: 4mm !important;
  }

  .student-certificate-v14 .cert-header img {
    width: 28mm !important;
    max-width: 28mm !important;
    max-height: 28mm !important;
    margin: 0 auto 2mm !important;
  }

  .student-certificate-v14 .cert-header h1 {
    font-size: 24px !important;
  }

  .student-certificate-v14 .cert-header p,
  .student-certificate-v14 .cert-intro,
  .student-certificate-v14 .cert-table,
  .student-certificate-v14 .cert-table th,
  .student-certificate-v14 .cert-table td {
    font-size: 15.5px !important;
  }

  .student-certificate-v14 .cert-intro {
    margin-bottom: 6mm !important;
    padding: 4mm 5mm !important;
    line-height: 1.55 !important;
  }

  .student-certificate-v14 .cert-table {
    margin-bottom: 5mm !important;
  }

  .student-certificate-v14 .cert-table th,
  .student-certificate-v14 .cert-table td {
    padding: 2.6mm 3mm !important;
    line-height: 1.28 !important;
  }

  .student-certificate-v14 .cert-signatures {
    margin-top: 6mm !important;
    gap: 10mm !important;
  }

  .student-certificate-v14 .cert-signatures > div {
    min-height: 10mm !important;
    padding-top: 2.5mm !important;
  }

  .student-certificate-v14 .cert-signatures span,
  .student-certificate-v14 .cert-signatures strong {
    font-size: 14.5px !important;
  }

  .student-certificate-v14 .cert-note-footer,
  .student-certificate-v14 .official-doc-footer,
  .student-certificate-v14 .official-doc-footer *,
  .student-certificate-v14 .official-doc-footer .official-footer-single {
    font-size: 10px !important;
    color: #6b7280 !important;
    line-height: 1.3 !important;
  }

  .student-certificate-v14::after,
  body.print-body::after {
    content: none !important;
    display: none !important;
  }
}

/* =========================================================
   V15 - Strict 3cm print margins for Student Certificate
   يجعل نقطة بداية المحتوى والطباعة بعد 3 سم من الأعلى/اليمين/اليسار/الأسفل.
   Screen preview remains a true A4 page with 3cm padding.
   ========================================================= */
@media screen {
  body.print-body > .student-certificate-v14,
  .student-certificate-v14 {
    width: 210mm !important;
    min-height: 297mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    margin: 8mm auto !important;
    padding: 30mm !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .student-certificate-v14 .cert-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin-top: 30mm !important;
    margin-right: 30mm !important;
    margin-bottom: 30mm !important;
    margin-left: 30mm !important;
  }

  html,
  body,
  body.print-body {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.print-body > .student-certificate-v14,
  .student-certificate-v14,
  #studentCertificatePrint {
    /* المساحة الفعلية داخل A4 بعد هوامش 3سم: 150mm × 237mm */
    width: 150mm !important;
    min-width: 150mm !important;
    max-width: 150mm !important;
    min-height: 237mm !important;
    height: 237mm !important;
    max-height: 237mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: hidden !important;
    page-break-before: avoid !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-before: avoid !important;
    break-after: avoid !important;
    break-inside: avoid !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .student-certificate-v14 .cert-header {
    margin: 0 0 6mm !important;
    padding: 0 0 4mm !important;
    border-bottom: 1.2px solid #cbd5e1 !important;
  }

  .student-certificate-v14 .cert-header img {
    width: 25mm !important;
    max-width: 25mm !important;
    max-height: 25mm !important;
    margin: 0 auto 2mm !important;
    display: block !important;
    float: none !important;
    position: static !important;
  }

  .student-certificate-v14 .cert-header h1 {
    font-size: 22px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }

  .student-certificate-v14 .cert-header p {
    font-size: 14px !important;
    line-height: 1.25 !important;
    margin: 1mm 0 0 !important;
  }

  .student-certificate-v14 .cert-intro {
    margin: 0 0 5mm !important;
    padding: 3mm 4mm !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .student-certificate-v14 .cert-table {
    width: 100% !important;
    margin: 0 0 4mm !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
  }

  .student-certificate-v14 .cert-table th,
  .student-certificate-v14 .cert-table td {
    padding: 2.2mm 2.5mm !important;
    font-size: 14px !important;
    line-height: 1.28 !important;
    vertical-align: middle !important;
  }

  .student-certificate-v14 .cert-table th {
    font-weight: 700 !important;
  }

  .student-certificate-v14 .cert-signatures {
    margin: 5mm 0 0 !important;
    gap: 7mm !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .student-certificate-v14 .cert-signatures > div {
    min-height: 9mm !important;
    padding-top: 2mm !important;
  }

  .student-certificate-v14 .cert-signatures span,
  .student-certificate-v14 .cert-signatures strong {
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  .student-certificate-v14 .student-print-bottom {
    margin-top: auto !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .student-certificate-v14 .cert-note-footer,
  .student-certificate-v14 .official-doc-footer,
  .student-certificate-v14 .official-doc-footer *,
  .student-certificate-v14 .official-doc-footer .official-footer-single {
    font-size: 9.5px !important;
    line-height: 1.25 !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }

  .student-certificate-v14 .cert-note-footer {
    padding-top: 1.5mm !important;
    border-top: 1px solid #e5e7eb !important;
    text-align: center !important;
  }

  .student-certificate-v14 .official-doc-footer {
    margin-top: 1mm !important;
    padding-top: 1mm !important;
    border-top: 0 !important;
    text-align: center !important;
  }

  .student-certificate-v14::after,
  body.print-body::after,
  html::after {
    content: none !important;
    display: none !important;
  }
}

/* =========================================================
   V16 - Locked physical print area 21cm × 29cm
   الهدف: تثبيت صفحة إفادة الطالب بمقاس 21سم × 29سم وهوامش داخلية 3سم
   لتقليل اختلاف الطباعة بين Windows / macOS والطابعات المختلفة.
   ملاحظة تقنية: HTML/CSS يطلبان القياسات من المتصفح، والالتزام النهائي يعتمد على إعدادات نافذة الطباعة.
   ========================================================= */
:root {
  --locked-paper-width: 210mm;
  --locked-paper-height: 290mm;
  --locked-paper-margin: 30mm;
  --locked-content-width: 150mm; /* 210 - 30 - 30 */
  --locked-content-height: 230mm; /* 290 - 30 - 30 */
}

/* معاينة الشاشة: صفحة فعلية بقياس 21×29 سم */
@media screen {
  body.print-body {
    background: #e5e7eb !important;
    margin: 0 !important;
    padding: 12mm 0 !important;
  }

  body.print-body > .student-certificate-v14,
  body.print-body > #studentCertificatePrint,
  .student-certificate-v14,
  #studentCertificatePrint {
    width: var(--locked-paper-width) !important;
    height: var(--locked-paper-height) !important;
    min-height: var(--locked-paper-height) !important;
    max-height: var(--locked-paper-height) !important;
    margin: 0 auto !important;
    padding: var(--locked-paper-margin) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16) !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

/* الطباعة: صفر هوامش للمتصفح + 3سم داخل الورقة نفسها */
@media print {
  @page {
    size: 210mm 290mm !important;
    margin: 0 !important;
  }

  * {
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

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

  body.print-body > .student-certificate-v14,
  body.print-body > #studentCertificatePrint,
  .student-certificate-v14,
  #studentCertificatePrint {
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    height: 290mm !important;
    min-height: 290mm !important;
    max-height: 290mm !important;
    margin: 0 !important;
    padding: 30mm !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    page-break-before: avoid !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-before: avoid !important;
    break-after: avoid !important;
    break-inside: avoid !important;
  }

  .student-certificate-v14 .cert-header {
    flex: 0 0 auto !important;
    margin: 0 0 7mm !important;
    padding: 0 0 5mm !important;
    text-align: center !important;
    border-bottom: 1.2px solid #cbd5e1 !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .student-certificate-v14 .cert-header img {
    display: block !important;
    float: none !important;
    position: static !important;
    width: 28mm !important;
    height: auto !important;
    max-width: 28mm !important;
    max-height: 28mm !important;
    margin: 0 auto 3mm !important;
    object-fit: contain !important;
  }

  .student-certificate-v14 .cert-header h1 {
    font-size: 22px !important;
    line-height: 1.18 !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .student-certificate-v14 .cert-header p {
    font-size: 14px !important;
    line-height: 1.25 !important;
    margin: 1.5mm 0 0 !important;
    text-align: center !important;
  }

  .student-certificate-v14 .cert-intro {
    flex: 0 0 auto !important;
    margin: 0 0 5mm !important;
    padding: 3mm 4mm !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .student-certificate-v14 .cert-table {
    flex: 0 0 auto !important;
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 0 0 4.5mm !important;
    font-size: 14px !important;
  }

  .student-certificate-v14 .cert-table th,
  .student-certificate-v14 .cert-table td {
    padding: 2.2mm 2.6mm !important;
    font-size: 14px !important;
    line-height: 1.26 !important;
    vertical-align: middle !important;
    border: 1px solid #cbd5e1 !important;
  }

  .student-certificate-v14 .cert-table th {
    font-weight: 700 !important;
    background: #f8fafc !important;
  }

  .student-certificate-v14 .cert-notes {
    flex: 0 0 auto !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    margin: 0 0 3mm !important;
    padding: 2.2mm 3mm !important;
  }

  .student-certificate-v14 .cert-footer,
  .student-certificate-v14 .cert-signatures {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 7mm !important;
    margin: 5mm 0 0 !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .student-certificate-v14 .cert-footer > div,
  .student-certificate-v14 .cert-signatures > div {
    min-height: 12mm !important;
    padding-top: 2.5mm !important;
    border-top: 1px solid #94a3b8 !important;
    text-align: center !important;
  }

  .student-certificate-v14 .cert-footer span,
  .student-certificate-v14 .cert-footer strong,
  .student-certificate-v14 .cert-signatures span,
  .student-certificate-v14 .cert-signatures strong {
    display: block !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    text-align: center !important;
  }

  .student-certificate-v14 .cert-small,
  .student-certificate-v14 .cert-note-footer {
    margin-top: auto !important;
    padding: 2mm 0 1mm !important;
    border-top: 1px solid #e5e7eb !important;
    text-align: center !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    color: #6b7280 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .student-certificate-v14 .official-doc-footer {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 1mm 0 0 !important;
    border: 0 !important;
    text-align: center !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .student-certificate-v14 .official-doc-footer,
  .student-certificate-v14 .official-doc-footer *,
  .student-certificate-v14 .official-footer-single {
    font-size: 9px !important;
    line-height: 1.18 !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
    max-width: 150mm !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    direction: rtl !important;
    unicode-bidi: plaintext !important;
  }

  .student-certificate-v14 .print-toolbar,
  .student-certificate-v14 .no-print,
  body.print-body > .print-toolbar,
  body.print-body > .no-print,
  .print-toolbar,
  .no-print {
    display: none !important;
  }

  .student-certificate-v14::before,
  .student-certificate-v14::after,
  body.print-body::before,
  body.print-body::after,
  html::before,
  html::after {
    content: none !important;
    display: none !important;
  }

  .page-break,
  .print-page-break,
  .multi-print-page:empty {
    display: none !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }
}

/* ===== السجل المركزي للأصول والتجهيزات ===== */
.tool-central-assets{border-top:4px solid #5b21b6;background:linear-gradient(180deg,#fff 0%,#faf8ff 100%)}
.tool-central-assets .tool-icon{background:#ede9fe;color:#5b21b6}
.central-assets-hero{background:linear-gradient(135deg,#1e1b4b,#5b21b6);color:#fff}
.central-assets-hero p{color:#ede9fe}
.central-stats .stat-card:nth-child(6){border-color:#fecaca;background:#fff7f7}
.central-module-list{display:grid;gap:9px}
.central-module-list a{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;text-decoration:none;color:#111827}
.central-module-list a:hover{border-color:#8b5cf6;background:#faf8ff}
.central-module-list strong{min-width:46px;text-align:center;background:#ede9fe;color:#5b21b6;padding:5px 10px;border-radius:999px}
.central-filter{display:grid;grid-template-columns:minmax(220px,2fr) repeat(6,minmax(135px,1fr)) auto auto;gap:12px;align-items:end}
.central-assets-table small,.data-table td small{display:block;margin-top:4px;color:#6b7280;font-size:12px}
.central-assets-table .row-conflict{background:#fff7f7}
.central-assets-table .row-conflict td{border-color:#fecaca}
.action-buttons{display:flex;gap:6px;flex-wrap:wrap}
.asset-profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:20px}
.asset-profile-grid .form-card:first-child{grid-column:1/-1}
.info-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.info-grid>div{padding:13px;border:1px solid #e5e7eb;border-radius:12px;background:#fafafa;min-height:72px}
.info-grid span{display:block;color:#6b7280;font-size:12px;margin-bottom:7px}
.info-grid strong{display:block;color:#111827;word-break:break-word}
.central-related-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:16px}
.central-related-grid a{display:flex;flex-direction:column;gap:5px;border:1px solid #e5e7eb;border-radius:12px;padding:12px;text-decoration:none;color:#111827;background:#fff}
.central-related-grid a:hover{border-color:#8b5cf6;background:#faf8ff}
.central-related-grid span,.central-related-grid small{color:#6b7280}
.conflict-card{border-color:#fecaca}
.conflict-card .table-header{background:#fff7f7}
.pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin:18px 0}
@media(max-width:1200px){.central-filter{grid-template-columns:repeat(3,minmax(0,1fr))}.filter-grow{grid-column:1/-1}}
@media(max-width:780px){.central-filter{grid-template-columns:1fr}.asset-profile-grid{grid-template-columns:1fr}.asset-profile-grid .form-card:first-child{grid-column:auto}.info-grid{grid-template-columns:1fr}.central-related-grid{grid-template-columns:1fr}}

/* V11 - softer, smaller portal cards */
.portal-hero{
  padding:clamp(22px,4vw,38px);
  border-radius:28px;
  margin-bottom:18px;
}
.portal-hero h1{
  font-size:clamp(24px,3.2vw,40px);
}
.portal-grid{
  gap:14px;
}
.tool-card{
  gap:12px;
  min-height:300px;
  padding:18px 18px 16px;
  border-radius:22px;
}
.tool-card h2{
  font-size:21px;
  line-height:1.3;
}
.tool-card p{
  font-size:14px;
}
.tool-icon{
  width:48px;
  height:48px;
  border-radius:16px;
  font-size:14px;
}
.tool-stat{
  padding:10px 12px;
  border-radius:16px;
  background:#f7fafc;
}
.tool-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:auto;
}
.tool-actions .btn{
  padding:10px 14px;
  font-size:14px;
}
.tool-tech-labs{border-top:5px solid #0f766e}.tool-tech-labs .tool-icon{background:#eaf8f5;color:#0f766e}.tool-science-labs{border-top:5px solid #2563eb}.tool-science-labs .tool-icon{background:#edf4ff;color:#2563eb}

/* V18 — بطاقات رئيسية أصغر وأكثر أناقة */
.portal-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:22px;
  padding:26px 30px;
  border-radius:24px;
  background:
    radial-gradient(circle at 90% 0%,rgba(255,255,255,.14),transparent 24%),
    linear-gradient(135deg,#17334d,#205f87 58%,#137f75);
  color:#fff;
  box-shadow:0 18px 42px rgba(18,48,72,.16);
}
.portal-kicker{display:block;margin-bottom:5px;font-size:12px;font-weight:800;letter-spacing:.06em;opacity:.76}
.portal-hero h1{margin:0 0 7px;font-size:clamp(26px,3vw,38px);line-height:1.25}
.portal-hero p{margin:0;max-width:760px;font-size:15px;opacity:.84}
.portal-hero-actions{display:flex;gap:8px;flex-wrap:wrap}
.portal-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:13px;
  align-items:stretch;
}
.tool-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:245px;
  padding:17px;
  border:1px solid #dce6ee;
  border-radius:20px;
  background:linear-gradient(155deg,#fff 0%,#fbfdfe 66%,#f5f9fb 100%);
  box-shadow:0 9px 24px rgba(22,50,74,.055);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
  overflow:hidden;
}
.tool-card::after{content:"";position:absolute;inset:auto -36px -48px auto;width:120px;height:120px;border-radius:50%;background:radial-gradient(circle,rgba(31,95,140,.07),transparent 68%);pointer-events:none}
.tool-card:hover{transform:translateY(-3px);box-shadow:0 16px 34px rgba(22,50,74,.10);border-color:#c8d8e4}
.tool-card h2{margin:0 0 5px;font-size:18px;line-height:1.35;color:#17334d}
.tool-card p{margin:0;font-size:12.5px;line-height:1.65;color:#68798b}
.tool-icon{width:42px;height:42px;border-radius:13px;font-size:12px;font-weight:900;background:linear-gradient(145deg,#eaf3f8,#dcebf4);color:#1f5f8c;box-shadow:inset 0 0 0 1px rgba(31,95,140,.08)}
.tool-stat{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;border-radius:13px;background:#f7fafc;border:1px solid #edf2f6}
.tool-stat span{font-size:11px;color:#728193}.tool-stat strong{font-size:18px;color:#17334d}
.tool-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:auto}.tool-actions .btn{padding:8px 11px;border-radius:11px;font-size:12px}
.tool-withdrawal .tool-icon{background:linear-gradient(145deg,#fff0d1,#f5d485);color:#8a6512}
.tool-withdrawal{border-top:3px solid #c7972f}
.tool-tech-labs{border-top:3px solid #128176}.tool-science-labs{border-top:3px solid #2d69a3}.tool-central-assets{border-top:3px solid #17334d}.tool-exams{border-top:3px solid #9b2f54}
@media(max-width:1280px){.portal-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){.portal-hero{display:grid}.portal-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.portal-grid{grid-template-columns:1fr}.tool-card{min-height:0}}
.tool-office-copiers{border-top:4px solid #b98524;background:linear-gradient(180deg,#fff,#fffaf0)}
.tool-office-copiers .tool-icon{background:#fff4d8;color:#8a5b00}
.tool-procurements{border-top:4px solid #1f5f8c;background:linear-gradient(180deg,#fff,#f3f8fc)}.tool-procurements .tool-icon{background:#e7f1f8;color:#1f5f8c}

.tool-directorate-inventory{border-top:4px solid #147d73;background:linear-gradient(180deg,#fff,#f1faf8)}.tool-directorate-inventory .tool-icon{background:#e4f5f1;color:#0f6f65}

/* V62: explicit success button contrast */
.btn-success {
  background:#166534;
  color:#ffffff;
  border-color:#166534;
}
.btn-success:hover {
  background:#14532d;
  color:#ffffff;
  border-color:#14532d;
}

.tool-desktop-computers{border-top:4px solid #0f766e;background:linear-gradient(180deg,#fff,#f0fdfa)}.tool-desktop-computers .tool-icon{background:#ccfbf1;color:#0f766e}


/* V65 — إلزام الطباعة بخط النظام في كل البطاقات والتقارير */
@media print{
  html,body,button,input,select,textarea,table,th,td,.page,.panel,.card,.report-page,.print-page,.letter-page,.document-page{
    font-family:"IBM Plex Sans Arabic",Tahoma,Arial,sans-serif!important;
  }
  table{page-break-inside:auto;break-inside:auto}
  thead{display:table-header-group}
  tr{break-inside:avoid;page-break-inside:avoid}
}


/* V67 — أساس موحد للطباعة: A4 وخط النظام وهوامش سليمة */
@media print{
  @page{size:A4 portrait;margin:12mm 12mm 15mm 12mm}
  html,body,button,input,select,textarea,table,th,td,.page,.panel,.card,.report-page,.print-page,.letter-page,.document-page{
    font-family:"IBM Plex Sans Arabic",Tahoma,Arial,sans-serif!important;
  }
  body{background:#fff!important;overflow:visible!important}
  table{page-break-inside:auto;break-inside:auto;table-layout:fixed}
  thead{display:table-header-group}
  tfoot{display:table-footer-group}
  tr{break-inside:auto;page-break-inside:auto}
  th,td{overflow-wrap:anywhere;word-break:break-word;white-space:normal}
}

/* V102 — اتجاه عربي موحد لكل مربعات الاختيار في الموقع بالكامل */
input[type="checkbox"]{
  direction:rtl!important;
  flex:0 0 auto;
  inline-size:1.15rem;
  block-size:1.15rem;
  margin:0!important;
  vertical-align:middle;
  accent-color:#0f7f76;
}
label:has(input[type="checkbox"]),
.form-check,.checkbox,.check-row,.checkbox-row,.switch-row{
  direction:rtl!important;
  text-align:right!important;
  justify-content:flex-start!important;
}
label:has(> input[type="checkbox"]){
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:.55rem!important;
  max-width:100%;
}
label:has(> input[type="checkbox"]) > input[type="checkbox"]{order:-1!important}
.form-check,.checkbox,.check-row,.checkbox-row,.switch-row{display:flex!important;align-items:center!important;gap:.55rem!important}
.form-check input[type="checkbox"],.checkbox input[type="checkbox"],.check-row input[type="checkbox"],.checkbox-row input[type="checkbox"],.switch-row input[type="checkbox"]{order:-1!important}
@media(max-width:600px){input[type="checkbox"]{inline-size:1.25rem;block-size:1.25rem}}

/* V102.1 — تثبيت مربعات الاختيار في أقصى اليمين داخل الجداول والبطاقات والحاويات */
td:has(> input[type="checkbox"]),th:has(> input[type="checkbox"]),
.card:has(> input[type="checkbox"]),.panel:has(> input[type="checkbox"]){direction:rtl!important;text-align:right!important}
td>input[type="checkbox"],th>input[type="checkbox"]{display:inline-block!important;margin-inline:0!important;margin-left:.45rem!important}
.cr-v101-checks,.cr-v101-switch,.cr-v101-savebar>label{direction:rtl!important;text-align:right!important}
.cr-v101-checks label,.cr-v101-switch,.cr-v101-savebar>label{justify-content:flex-start!important}
