/* Admission Fee Exemption Order Styles */
:root {
  --primary: #1e3a8a;
  --text: #1f2937;
  --bg: #f3f4f6;
  --border: #374151;
}

body {
  margin: 0;
  padding: 20px 20px 80px 20px;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Mukta', 'Noto Sans Devanagari', 'Poppins', sans-serif;
  line-height: 1.6;
}

/* Editable Elements Indication */
[contenteditable="true"] {
  outline: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  border-radius: 4px;
  padding: 1px 4px;
}

[contenteditable="true"]:hover {
  background-color: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
  cursor: text;
}

[contenteditable="true"]:focus {
  background-color: #ffffff;
  box-shadow: 0 0 0 2px #2563eb, 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* Top Sticky Editor Bar */
.top-editor-toolbar {
  position: sticky;
  top: 10px;
  z-index: 999;
  max-width: 900px;
  margin: 0 auto 16px auto;
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid #334155;
}

.editor-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.editor-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.76rem;
}

.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.76rem;
  transition: all 0.2s;
}

.cloud-connected {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.cloud-offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.current-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1e293b;
  color: #93c5fd;
  border: 1px solid #3b82f6;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  font-family: inherit;
}

.tb-btn-primary {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.tb-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
}

.tb-btn-cloud {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.tb-btn-cloud:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.tb-btn-history {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  border: 1px solid #818cf8;
}

.tb-btn-history:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  transform: translateY(-1px);
}

.tb-btn-success {
  background: #16a34a;
  color: #ffffff;
}

.tb-btn-success:hover {
  background: #15803d;
}

.tb-btn-secondary {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
}

.tb-btn-secondary:hover {
  background: #475569;
  color: #ffffff;
}

.tb-btn-danger {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #991b1b;
}

.tb-btn-danger:hover {
  background: #991b1b;
  color: #ffffff;
}

/* Document Paper */
.document-paper {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  padding: 40px 50px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  position: relative;
}

.header-banner {
  text-align: center;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.header-logo-left,
.header-logo-right {
  flex-shrink: 0;
  width: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.school-logo,
.pac-logo {
  height: 76px;
  width: auto;
  max-width: 85px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.header-title-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.school-title {
  font-size: 1.54rem;
  font-weight: 800;
  color: #1e3a8a;
  margin: 0;
  line-height: 1.28;
}

.school-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: #374151;
  margin: 4px 0 0;
  line-height: 1.25;
}

/* Single Line Meta Bar: Dispatch No (Left), Order Badge (Center), Date (Right) */
.header-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.5px solid #e2e8f0;
}

.meta-item-left,
.meta-item-right {
  font-size: 1.05rem;
  color: #1e293b;
  font-weight: 600;
  white-space: nowrap;
}

.meta-item-left p,
.meta-item-right p {
  margin: 0;
  padding: 0;
  text-indent: 0;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e3a8a;
  color: #ffffff;
  padding: 5px 28px;
  border-radius: 4px;
  margin: 0;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

.order-badge h2 {
  margin: 0;
  font-size: 1.24rem;
  letter-spacing: 3px;
  font-weight: 700;
  line-height: 1.2;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 1rem;
  color: #4b5563;
}

.content-body p {
  text-align: justify;
  text-indent: 2.4rem;
  margin-bottom: 14px;
  font-size: 1.06rem;
  color: #1f2937;
  line-height: 1.64;
}

.content-body p.no-indent {
  text-indent: 0;
}

.member-list, .styled-list {
  list-style: none;
  padding-left: 12px;
  margin: 10px 0 14px;
}

.member-list li, .styled-list li {
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.52;
}

/* Committee Toolbar & Member Controls */
.committee-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 5px 12px;
  margin: 6px 0 10px 0;
}

.committee-toolbar-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.committee-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.cm-btn-add {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.25);
}

.cm-btn-add:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.cm-btn-renumber {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.cm-btn-renumber:hover {
  background: #e2e8f0;
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 4px;
  padding: 2px 6px;
  transition: background 0.15s ease;
  position: relative;
}

.member-item:hover {
  background: rgba(241, 245, 249, 0.75);
}

.member-content {
  flex: 1;
  min-width: 0;
  outline: none;
}

.member-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.35;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.member-item:hover .member-actions {
  opacity: 1;
}

.member-action-btn {
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.member-dup-btn {
  color: #0284c7;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

.member-dup-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

.member-del-btn {
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.member-del-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.section-subheading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 16px;
  margin-bottom: 8px;
}

/* Order Signatory Toolbar & Free Draggable Canvas */
.signatory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  margin-bottom: 8px;
  padding: 6px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  width: 100%;
  box-sizing: border-box;
}

.sig-align-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.sig-align-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.signatory-block {
  position: relative;
  min-height: 260px;
  width: 100%;
  margin: 18px 0 26px 0;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px dashed #cbd5e1;
  background: rgba(248, 250, 252, 0.4);
  box-sizing: border-box;
  overflow: visible;
  transition: border-color 0.2s ease;
}

.signatory-block:hover,
.signatory-block:focus-within {
  border-color: #93c5fd;
  background: rgba(239, 246, 255, 0.35);
}

.signatory-box {
  text-align: center;
  min-width: 220px;
  font-size: 1rem;
  line-height: 1.4;
}

.signatory-title {
  font-weight: 700;
  margin-bottom: 4px;
}

/* Pratilipi Section & Draggable Card inside Canvas */
.pratilipi-section {
  width: 100%;
  border-top: 1px dashed #cbd5e1;
  padding-top: 14px;
  margin-top: 16px;
  font-size: 0.96rem;
  line-height: 1.52;
  box-sizing: border-box;
}

.pratilipi-card {
  position: absolute;
  width: 510px;
  max-width: 550px;
  border: 1.5px solid transparent;
  outline: none;
  border-radius: 8px;
  padding: 6px 12px 10px 12px;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  touch-action: none;
  cursor: default;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  z-index: 10;
  border-top: none;
  margin-top: 0;
}

.pratilipi-card:hover {
  border-color: #93c5fd;
  background: rgba(248, 250, 252, 0.75);
}

.pratilipi-card.is-card-moving {
  z-index: 100 !important;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.3) !important;
  border-color: #2563eb !important;
  background: #eff6ff !important;
  cursor: grabbing !important;
}

.pratilipi-card .pratilipi-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 0;
  margin-bottom: 7px;
  line-height: 1.35;
  text-align: left !important;
  text-indent: 0 !important;
}

.pratilipi-card .member-list {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.pratilipi-card .member-list li {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 4.5px;
  text-align: left !important;
  text-indent: 0 !important;
}

.section-divider {
  border: 0;
  border-top: 2px dashed #94a3b8;
  margin: 32px 0;
}

/* Report Section & Student Table */
.report-section {
  margin-top: 20px;
}

.report-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a8a;
  text-align: justify;
  line-height: 1.5;
  margin-bottom: 12px;
}

.table-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 10px;
  background: #f8fafc;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}

.table-action-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #475569;
}

.table-action-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.add-row-btn:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.renumber-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}

.renumber-btn:hover {
  background: #e2e8f0;
}

.table-container {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 10px 0 20px 0;
  border-radius: 6px;
  border: 1.5px solid #1e3a8a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.table-container::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #ffffff;
}

.student-table thead tr {
  background: #f1f5f9;
}

.student-table th {
  border: 1px solid #64748b;
  padding: 9px 8px;
  font-weight: 700;
  color: #1e3a8a;
  text-align: center;
  vertical-align: middle;
}

.student-table td {
  border: 1px solid #94a3b8;
  padding: 7px 8px;
  color: #1f2937;
  vertical-align: middle;
  line-height: 1.4;
}

.student-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.student-table tbody tr:hover {
  background-color: #f0fdf4;
}

.fee-waiver-highlight {
  color: #b91c1c;
  font-weight: 600;
}

.row-action-cell {
  text-align: center;
  width: 65px;
  white-space: nowrap;
}

.row-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.72rem;
  cursor: pointer;
  margin: 0 1px;
  transition: all 0.15s ease;
}

.row-del-btn {
  color: #dc2626;
  background: #fee2e2;
  border-color: #fca5a5;
}

.row-del-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.row-dup-btn {
  color: #0284c7;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.row-dup-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Signature Grid & Drag-Move System */
.sig-section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  margin-bottom: 12px;
  padding: 8px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}

.sig-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sig-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sig-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.sig-add-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.sig-paste-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.sig-paste-btn:not(:disabled):hover {
  background: #e2e8f0;
  color: #1e3a8a;
}

.sig-paste-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sig-drag-hint {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Movable & Resizable Signature Canvas Wrapper */
.sig-canvas-wrapper {
  position: relative;
  margin-top: 14px;
  margin-bottom: 18px;
  border: 1.5px dashed #3b82f6;
  border-radius: 12px;
  padding: 12px 14px 18px 14px;
  background: rgba(248, 250, 252, 0.7);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  min-width: 260px;
  max-width: 100%;
  box-sizing: border-box;
}

.sig-canvas-wrapper:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.15);
}

.sig-canvas-wrapper.is-moving {
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.3) !important;
  border-color: #1d4ed8 !important;
  background: #f0f7ff !important;
  z-index: 100;
  user-select: none;
}

.sig-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: grab;
  user-select: none;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sig-canvas-header:active {
  cursor: grabbing;
}

.sig-canvas-drag-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.sig-canvas-btn {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sig-canvas-btn:hover {
  background: #475569;
  color: #ffffff;
}

/* Resize Handle */
.sig-canvas-resize-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: se-resize;
  user-select: none;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.sig-canvas-resize-handle:hover {
  transform: scale(1.15);
  background: #1d4ed8;
}

/* Page Breaks (Section Divider & Signature Grid Page Break) */
.document-page-break,
.section-divider {
  page-break-after: always;
  break-after: page;
  clear: both;
  height: 0;
  margin: 0;
  padding: 0;
  border: none;
}

@media screen {
  .document-page-break,
  .section-divider {
    height: 32px;
    margin: 36px 0 28px 0;
    border-top: 2px dashed #64748b;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .document-page-break::after {
    content: "✂️ पृष्ठ विराम (Page Break - यहाँ से अगला पृष्ठ प्रारम्भ होगा)";
    background: #ffffff;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 16px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }

  .section-divider {
    border-top: 2px dashed #0284c7;
    margin: 40px 0 32px 0;
  }

  .section-divider::after {
    content: "📄 पृष्ठ 1 समाप्त | ✂️ पृष्ठ विराम (Page Break - यहाँ से समिति आख्या एवं तालिका पृष्ठ 2 पर प्रारम्भ होगी)";
    background: #f0fdf4;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 18px;
    border-radius: 20px;
    border: 1px solid #86efac;
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.1);
  }
}

.signature-grid {
  position: relative;
  min-height: 380px;
  display: block;
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}

.sig-card {
  position: absolute;
  width: 240px;
  border: 1.5px solid transparent;
  outline: none;
  border-radius: 8px;
  padding: 6px 8px 10px 8px;
  text-align: center !important;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  touch-action: none;
  cursor: default;
  transition: background-color 0.15s ease;
}

.sig-card:hover {
  border-color: #93c5fd;
  background: rgba(248, 250, 252, 0.75);
}

.sig-card.is-card-moving {
  z-index: 100 !important;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.3) !important;
  border-color: #2563eb !important;
  background: #eff6ff !important;
  cursor: grabbing !important;
}

.sig-card.is-card-moving .sig-handle {
  cursor: grabbing !important;
  background: #2563eb !important;
  color: #ffffff !important;
}

/* Force Perfect Center Alignment & Zero Indent for all Sig-Cards */
.content-body .sig-card,
.sig-card {
  text-align: center !important;
}

.content-body .sig-card p,
.sig-card p {
  text-align: center !important;
  text-indent: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.25 !important;
}

.sig-card [contenteditable="true"] {
  user-select: text;
  cursor: text;
  text-align: center !important;
}

/* Sig Card Top Controls */
.sig-card-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 6px;
  margin-bottom: 8px;
  cursor: grab;
}

.sig-card-controls:active {
  cursor: grabbing;
}

.sig-handle {
  cursor: grab;
  color: #1e3a8a;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e0f2fe;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  border: 1px solid #bae6fd;
  transition: all 0.15s ease;
}

.sig-handle:hover {
  background: #2563eb;
  color: #ffffff;
}

.sig-handle:active {
  cursor: grabbing;
}

.sig-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sig-card-btn {
  border: none;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sig-copy-btn {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.sig-copy-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

.sig-del-btn {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.sig-del-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.sig-move-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.sig-move-btn:hover {
  background: #475569;
  color: #ffffff;
}

.sig-sign-space {
  height: 54px;
}

.sig-name,
.content-body .sig-card .sig-name,
.sig-card .sig-name {
  font-weight: 700 !important;
  color: #1e3a8a !important;
  font-size: 1.12rem !important;
  line-height: 1.3 !important;
  margin: 0 0 4px 0 !important;
  text-align: center !important;
  text-indent: 0 !important;
}

.sig-role,
.content-body .sig-card .sig-role,
.sig-card .sig-role {
  font-weight: 600 !important;
  font-size: 1.02rem !important;
  color: #334155 !important;
  line-height: 1.25 !important;
  margin: 0 0 2px 0 !important;
  text-align: center !important;
  text-indent: 0 !important;
}

.sig-dept,
.content-body .sig-card .sig-dept,
.sig-card .sig-dept {
  font-size: 0.95rem !important;
  color: #64748b !important;
  line-height: 1.22 !important;
  margin: 1px 0 0 0 !important;
  text-align: center !important;
  text-indent: 0 !important;
}

/* Floating Print Button */
.floating-print-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999;
}

.print-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s;
  font-family: inherit;
}

.print-btn:hover {
  transform: translateY(-2px);
}

/* Modals & Cloud UI */
.pms-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: pmsFadeIn 0.18s ease-out;
}

.pms-modal-backdrop.flex-show {
  display: flex !important;
}

.pms-modal-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
  color: #f8fafc;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.order-history-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-history-card:hover {
  border-color: #38bdf8;
  background: #243247;
  transform: translateX(2px);
}

.order-history-card.active-order {
  border-color: #10b981;
  background: #064e3b33;
}

/* Toast Message */
.pms-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #334155;
}

.pms-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes pmsFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Print Media Styles */
@media print {
  @page {
    size: A4 portrait;
    margin: 9mm 12mm 9mm 12mm;
  }

  body {
    background: transparent;
    padding: 0;
    margin: 0;
  }

  .document-paper {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
  }

  .header-banner {
    border-bottom: 2px solid #1e3a8a !important;
    padding-bottom: 7px !important;
    margin-bottom: 11px !important;
  }

  .header-top-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    margin-bottom: 6px !important;
  }

  .header-logo-left,
  .header-logo-right {
    width: 74px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .school-logo,
  .pac-logo {
    height: 70px !important;
    width: auto !important;
    object-fit: contain !important;
  }

  .school-title {
    font-size: 17pt !important;
    line-height: 1.28 !important;
    margin: 0 !important;
    font-weight: 800 !important;
  }

  .school-subtitle {
    font-size: 13pt !important;
    line-height: 1.25 !important;
    margin: 4px 0 0 !important;
    font-weight: 600 !important;
  }

  .header-meta-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 8px !important;
    padding-top: 7px !important;
    border-top: 1.5px solid #cbd5e1 !important;
  }

  .meta-item-left,
  .meta-item-right {
    font-size: 10.8pt !important;
    font-weight: 600 !important;
    color: #1e293b !important;
  }

  .meta-item-left p,
  .meta-item-right p {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
  }

  .order-badge {
    padding: 4px 26px !important;
    background: #1e3a8a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border-radius: 4px !important;
  }

  .order-badge h2 {
    font-size: 13.5pt !important;
    letter-spacing: 3px !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
  }

  .content-body p {
    font-size: 10.8pt !important;
    line-height: 1.54 !important;
    margin-bottom: 9px !important;
    text-indent: 2.2rem !important;
  }

  .content-body p.no-indent {
    text-indent: 0 !important;
  }

  .member-list, .styled-list {
    padding-left: 10px !important;
    margin: 6px 0 9px !important;
  }

  .member-list li, .styled-list li {
    font-size: 10.2pt !important;
    line-height: 1.48 !important;
    margin-bottom: 4.5px !important;
  }

  .member-item {
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .member-content {
    display: inline !important;
  }

  .section-subheading {
    font-size: 11.2pt !important;
    font-weight: 700 !important;
    margin-top: 10px !important;
    margin-bottom: 6px !important;
  }

  .no-print,
  .floating-print-btn,
  .top-editor-toolbar,
  .table-action-bar,
  .sig-section-toolbar,
  .signatory-toolbar,
  .sig-card-controls,
  .sig-canvas-header,
  .sig-canvas-resize-handle,
  .row-action-cell,
  .pms-modal-backdrop,
  .pms-toast {
    display: none !important;
  }

  [contenteditable="true"] {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .sig-canvas-wrapper {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .document-page-break,
  .section-divider {
    page-break-after: always !important;
    break-after: page !important;
    display: block !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  .document-page-break::after,
  .section-divider::after {
    display: none !important;
  }

  /* Disable all scrollbars completely in print preview and print output */
  * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  *::-webkit-scrollbar,
  .table-container::-webkit-scrollbar,
  .student-table::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
  }

  .table-container {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 6px 0 14px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    scrollbar-width: none !important;
  }

  .student-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    font-size: 8.5pt !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
    overflow: visible !important;
    margin: 0 !important;
  }

  .student-table thead {
    display: table-header-group !important;
  }

  .student-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .student-table th,
  .student-table td {
    border: 1px solid #000000 !important;
    padding: 4.5px 5px !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }

  .student-table th {
    background: #f1f5f9 !important;
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 8.8pt !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .pratilipi-section {
    width: 100% !important;
    font-size: 10pt !important;
    line-height: 1.44 !important;
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .pratilipi-card {
    position: absolute !important;
    left: 0 !important;
    width: 450px !important;
    top: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .pratilipi-card .pratilipi-title,
  .pratilipi-title {
    font-size: 10.6pt !important;
    font-weight: 700 !important;
    margin-bottom: 5px !important;
    line-height: 1.35 !important;
    text-align: left !important;
  }

  .pratilipi-card .member-list li,
  .member-list li {
    font-size: 9.8pt !important;
    line-height: 1.44 !important;
    margin-bottom: 3.5px !important;
    text-align: left !important;
  }

  .signatory-block {
    position: relative !important;
    display: block !important;
    min-height: 220px !important;
    width: 100% !important;
    margin: 14px 0 8px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .signature-grid {
    position: relative !important;
    display: block !important;
  }

  .sig-card {
    position: absolute !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    text-align: center !important;
  }

  #page1SignatoryBlock .sig-card {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    width: 240px !important;
    top: 0 !important;
  }

  .content-body .sig-card p,
  .sig-card p {
    text-align: center !important;
    text-indent: 0 !important;
    margin: 0 !important;
    line-height: 1.25 !important;
  }

  .sig-card .sig-name {
    font-size: 11.8pt !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    margin: 0 0 4px 0 !important;
    text-align: center !important;
  }

  .sig-card .sig-role {
    font-size: 10.6pt !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    margin: 0 0 2px 0 !important;
    text-align: center !important;
  }

  .sig-card .sig-dept {
    font-size: 9.8pt !important;
    line-height: 1.22 !important;
    margin: 1px 0 0 0 !important;
    text-align: center !important;
  }

  .sig-sign-space {
    height: 56px !important;
  }
}
