body {
  margin: 0;
  color: #10233a;
  background:
    radial-gradient(
      circle at top left,
      rgba(245, 158, 11, 0.2),
      transparent 30%
    ),
    radial-gradient(
      circle at top right,
      rgba(37, 99, 235, 0.16),
      transparent 34%
    ),
    linear-gradient(135deg, #fffaf0, #eef6ff 54%, #ffffff);
}

body.theme-light {
  --text-main: #172033;
  --text-muted: #64748b;
  --input-bg: #ffffff;
  --input-color: #0f172a;
}

.cw-school-strip.erp-page-topbar,
.erp-page-purpose,
.erp-breadcrumbs {
  color: #172033 !important;
  -webkit-text-fill-color: initial !important;
}

.cw-school-strip.erp-page-topbar .cw-school-brand h2,
.cw-school-strip.erp-page-topbar .cw-school-brand h2 *,
.erp-page-purpose h1,
.erp-page-purpose h1 *,
.erp-breadcrumbs strong {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
}

.cw-school-strip.erp-page-topbar .cw-school-brand span,
.cw-school-strip.erp-page-topbar .cw-school-brand span *,
.erp-page-purpose p,
.erp-page-purpose p *,
.erp-breadcrumbs,
.erp-breadcrumbs span:not(.erp-breadcrumbs__sep) {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

.erp-breadcrumbs a,
.erp-breadcrumbs a * {
  color: #2563eb !important;
  -webkit-text-fill-color: #2563eb !important;
}

.erp-breadcrumbs__sep {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

.tc-page .btn-secondary,
.erp-page-purpose__actions .btn-secondary,
.tc-panel .btn-secondary,
.tc-modal .btn-secondary {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  -webkit-text-fill-color: #1e293b !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

.tc-page .btn-secondary:hover:not(:disabled),
.erp-page-purpose__actions .btn-secondary:hover:not(:disabled),
.tc-panel .btn-secondary:hover:not(:disabled),
.tc-modal .btn-secondary:hover:not(:disabled) {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  -webkit-text-fill-color: #1d4ed8 !important;
}

.tc-page .btn-secondary:disabled,
.erp-page-purpose__actions .btn-secondary:disabled,
.tc-panel .btn-secondary:disabled {
  background: #f8fafc !important;
  border-color: #dbe3ef !important;
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  opacity: 0.72 !important;
}

.tc-top {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tc-logo {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #f59e0b, #2563eb);
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
}

.tc-brand p,
.tc-brand h1,
.tc-brand span {
  margin: 0;
}

.tc-brand p {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #b45309;
  text-transform: uppercase;
}

.tc-brand h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.tc-brand span {
  color: #61748c;
  font-weight: 600;
}

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

.tc-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.tc-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.tc-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 9px 13px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.tc-tab.is-active {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, #fff, #eff6ff);
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.tc-tab-panel {
  display: none;
}

.tc-tab-panel.is-active {
  display: block;
}

.tc-tab-panel:not(.is-active) {
  display: none !important;
}

.tc-shell {
  display: grid;
  grid-template-columns: minmax(380px, 560px) minmax(0, 1fr);
  gap: 18px;
}

.tc-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 26px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
}

.tc-panel-head,
.tc-register-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tc-panel h2,
.tc-panel p {
  margin: 0;
}

.tc-panel p {
  color: #64748b;
}

#tc-mode-chip,
#tc-preview-id {
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 8px 12px;
  font-weight: 900;
}

.tc-search-row,
.tc-register-head > div,
.tc-issued-filters,
.tc-save-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tc-search-row input,
.tc-register-head input,
.tc-register-head select,
.tc-issued-filters input,
.tc-issued-filters select,
.tc-form input,
.tc-form select,
.tc-form textarea,
.tc-bulk-form input,
.tc-bulk-form select,
.tc-bulk-form textarea {
  border: 1px solid #d7e1ef;
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  color: #0f172a;
}

.tc-search-row input {
  flex: 1;
  min-width: 240px;
}

.tc-student-list,
.tc-register-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  max-height: 260px;
  overflow: auto;
}

.tc-student-card,
.tc-register-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  cursor: pointer;
}

.tc-student-card:hover,
.tc-register-card:hover {
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.tc-card-meta {
  color: #64748b;
  font-size: 0.86rem;
  margin-top: 4px;
}

.tc-issued-alert {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #78350f;
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
  display: grid;
  gap: 6px;
}

.tc-issued-alert.hidden {
  display: none;
}

.tc-issued-alert button {
  width: fit-content;
  border: 0;
  border-radius: 10px;
  background: #92400e;
  color: #fff;
  padding: 8px 10px;
  font-weight: 900;
  cursor: pointer;
}

.tc-issued-pill {
  float: right;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

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

.tc-form label,
.tc-bulk-form label {
  display: grid;
  gap: 6px;
  font-weight: 900;
  color: #334155;
}

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

.tc-checkbox {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #d7e1ef;
  background: #f8fafc;
}

.tc-issued-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tc-issued-summary span {
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #eff6ff);
  color: #64748b;
  font-weight: 800;
}

.tc-issued-summary strong {
  display: block;
  color: #1d4ed8;
  font-size: 1.5rem;
}

.tc-issued-table-wrap {
  overflow: auto;
  border: 1px solid #d7e1ef;
  border-radius: 18px;
  background: #fff;
}

.tc-issued-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.tc-issued-table th,
.tc-issued-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.9rem;
}

.tc-issued-table th {
  color: #475569;
  background: #f8fafc;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tc-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 900;
}

.tc-type-pill.duplicate {
  background: #fef3c7;
  color: #92400e;
}

.tc-row-action {
  border: 0;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 7px 9px;
  font-weight: 900;
  cursor: pointer;
}

.tc-bulk-result {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tc-bulk-student-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 140px 130px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.tc-bulk-student-row small {
  color: #64748b;
  font-weight: 800;
}

.tc-bulk-print-area {
  display: none;
}

.tc-print-log {
  display: grid;
  gap: 5px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.84rem;
}

.tc-print-log strong {
  color: #334155;
}

.tc-certificate {
  position: relative;
}

.tc-certificate[data-watermark]:not([data-watermark=""])::after,
.tc-bulk-print-page::after {
  content: attr(data-watermark);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(148, 163, 184, 0.16);
  font-size: clamp(3rem, 11vw, 8rem);
  font-weight: 900;
  transform: rotate(-24deg);
  pointer-events: none;
  letter-spacing: 0.08em;
}

.tc-print-mode {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #eff6ff);
}

.tc-print-mode label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-weight: 900;
}

.tc-print-mode select {
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 8px 10px;
  color: #0f172a;
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.tc-print-mode span {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 700;
}

.tc-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
}

.tc-modal.hidden {
  display: none;
}

.tc-modal-card {
  width: min(1100px, 96vw);
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(219, 234, 254, 0.5);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.tc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #fff, #eff6ff);
}

.tc-modal-head h2,
.tc-modal-head p {
  margin: 0;
}

.tc-modal-head p {
  margin-top: 4px;
  color: #64748b;
}

.tc-modal-close {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d7e1ef;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.tc-modal-body {
  overflow: auto;
  padding: 16px;
}

.span-2,
.tc-save-row {
  grid-column: 1 / -1;
}

.tc-optional-section {
  border: 1px solid #d7e1ef;
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
}

.tc-optional-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tc-optional-head h3 {
  margin: 0;
}

.tc-optional-head span {
  color: #64748b;
  font-size: 0.86rem;
}

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

.tc-optional-field {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
}

.tc-optional-field span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-size: 0.8rem;
}

.tc-certificate {
  background: #fff;
  border-radius: 22px;
  padding: 16px;
  border: 1px solid #e2e8f0;
}

.tc-cert-border {
  border: 0;
  border-radius: 0;
  padding: 20px 34px;
  min-height: 620px;
  background: #fff;
}

.tc-cert-kicker {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #92400e !important;
  font-weight: 900;
}

.tc-cert-border h2 {
  text-align: center;
  font-size: 2.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tc-cert-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
  font-weight: 800;
}

.tc-cert-table {
  width: 100%;
  border-collapse: collapse;
}

.tc-cert-table td {
  padding: 5px 8px;
  border-bottom: 0;
  vertical-align: top;
  color: #111827;
}

.tc-cert-table td:first-child.tc-row-no {
  width: 32px;
  color: #111827;
  font-weight: 500;
}

.tc-cert-table td:nth-child(2) {
  width: 46%;
  color: #111827;
  font-weight: 900;
}

.tc-cert-table td:nth-child(3) {
  text-decoration: underline;
  font-weight: 700;
}

.tc-cert-note {
  margin-top: 20px !important;
  color: #334155 !important;
  line-height: 1.7;
}

.tc-sign-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 68px;
}

.tc-sign-row div {
  border-top: 1px solid #92400e;
  text-align: center;
  padding-top: 8px;
  font-weight: 900;
}

/* Fixed A4 print sheets; the workspace never participates in pagination. */
.tc-school-header {
  text-align: center;
  border-bottom: 1px solid #111827;
  padding-bottom: 12px;
  margin-bottom: 14px;
  color: #111827;
  line-height: 1.4;
}
.tc-school-header strong {
  display: block;
  font-size: 22px;
}
.tc-school-header div {
  font-size: 12px;
}
.tc-letterhead .tc-school-header {
  display: none;
}
.tc-letterhead .tc-cert-border {
  padding-top: var(--tc-letterhead-space, 35mm);
}
#tc-print-root {
  position: absolute;
  left: -100000px;
  top: 0;
  background: white;
}
.tc-output-root .tc-paper {
  width: 190mm;
  height: 276mm;
  box-sizing: border-box;
}
.tc-output-root .tc-certificate {
  width: 190mm;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #111827;
  font:
    11pt Arial,
    sans-serif;
}
.tc-output-root .tc-cert-border {
  min-height: 0;
  padding: 4mm;
}
.tc-output-root .tc-letterhead .tc-cert-border {
  padding-top: var(--tc-letterhead-space, 35mm);
}
.tc-output-root .tc-cert-border h2 {
  font-size: 20pt;
  margin: 3mm 0;
}
.tc-output-root .tc-cert-kicker {
  font-size: 9pt;
  margin: 2mm 0;
}
.tc-output-root .tc-cert-meta {
  margin: 3mm 0;
  font-size: 10pt;
}
.tc-output-root .tc-cert-table {
  table-layout: fixed;
}
.tc-output-root .tc-cert-table td {
  padding: 1.2mm 2mm;
  font-size: 10pt;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tc-output-root .tc-cert-table .tc-row-no {
  width: 9mm;
  padding-left: 0;
  padding-right: 1mm;
  white-space: nowrap;
  overflow-wrap: normal;
}
.tc-output-root .tc-cert-note {
  margin-top: 3mm !important;
  font-size: 10pt;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tc-output-root .tc-sign-row {
  margin-top: 12mm;
  gap: 20mm;
  font-size: 10pt;
}
/* Zero browser page margins suppress Chrome's automatic URL/date footers.
   The sheet provides the certificate's own safe printer margins. */
@page {
  size: A4 portrait;
  margin: 0;
}
@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    min-height: 0 !important;
    height: auto !important;
  }
  body > :not(#tc-print-root) {
    display: none !important;
  }
  #tc-print-root {
    display: block !important;
    position: static;
  }
  #tc-print-root .tc-paper {
    width: 210mm;
    height: 297mm;
    padding: 10mm;
    break-after: page;
    page-break-after: always;
  }
  #tc-print-root .tc-paper:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}

@media (max-width: 980px) {
  .tc-shell {
    grid-template-columns: 1fr;
  }

  .tc-form,
  .tc-bulk-form,
  .tc-issued-summary {
    grid-template-columns: 1fr;
  }

  .tc-optional-grid {
    grid-template-columns: 1fr;
  }

  .tc-bulk-student-row {
    grid-template-columns: 1fr;
  }
}

/* Certificate workflow and accessible output dialogs. */
.tc-workflow {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.tc-workflow button {
  flex: 1;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.tc-workflow button b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}
.tc-workflow button.is-current {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e40af;
}
.tc-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.tc-summary h2 {
  margin: 0;
  font-size: 22px;
}
.tc-summary p {
  margin: 4px 0;
  color: #475569;
}
.tc-avatar {
  position: relative;
  width: 64px;
  height: 72px;
  flex: none;
  background: #dbeafe;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.tc-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.tc-avatar img[hidden] {
  display: none;
}
.tc-status-badge {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 24px;
  font-weight: 800;
  background: #dcfce7;
  color: #166534;
}
.tc-status-badge.draft {
  background: #fef3c7;
  color: #92400e;
}
.tc-status-badge.cancelled {
  background: #fee2e2;
  color: #991b1b;
}
.tc-status-badge.duplicate {
  background: #ede9fe;
  color: #5b21b6;
}
.tc-checklist {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 18px;
}
.tc-checklist h3 {
  margin: 0 0 10px;
}
.tc-checklist > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tc-checklist span {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.tc-checklist .ready {
  background: #dcfce7;
  color: #166534;
}
.tc-checklist .needs-review {
  background: #fff1e0;
  color: #9a3412;
}
.tc-validation {
  background: #fef2f2;
  color: #991b1b;
  padding: 16px;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  margin-bottom: 16px;
}
.tc-validation[hidden] {
  display: none;
}
.tc-validation button {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-align: left;
  cursor: pointer;
}
.tc-field-error {
  display: block;
  color: #b91c1c;
  font-size: 13px;
}
[aria-invalid="true"] {
  outline: 2px solid #dc2626;
  outline-offset: 1px;
}
#tc-optional-fields {
  display: block;
}
.tc-field-group {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
}
.tc-field-group summary,
.tc-history summary {
  cursor: pointer;
  font-weight: 700;
  color: #1e3a5f;
}
.tc-field-group[open] > div {
  margin-top: 12px;
}
.tc-history {
  padding: 14px;
  background: #f8fafc;
  border-radius: 10px;
  margin: 12px 0;
}
.tc-history dd {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0 0 10px;
  color: #475569;
}
.tc-history dt {
  font-weight: 700;
}
.tc-default-controls > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tc-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}
.tc-preview-actions span {
  font-size: 13px;
  color: #475569;
}
.tc-preview-actions .tc-small-text {
  color: #9a3412;
  font-weight: 700;
}
.tc-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid #cbd5e1;
  box-shadow: 0 -4px 18px #0f172a0d;
}
.tc-sticky-actions > span {
  margin-right: auto;
  color: #475569;
}
.tc-other-tab .tc-sticky-actions {
  display: none;
}
.tc-output-dialog,
.tc-share-dialog {
  margin: auto;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #fff;
  color: #172033;
  padding: 20px;
  max-height: 94vh;
  overflow: auto;
}
.tc-output-dialog {
  width: min(1250px, 96vw);
}
.tc-share-dialog {
  width: min(600px, 96vw);
}
dialog::backdrop {
  background: #0f172a99;
}
.tc-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.tc-dialog-head h2 {
  margin: 0;
  font-size: 23px;
}
.tc-dialog-head button {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}
.tc-output-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}
.tc-output-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tc-output-settings .tc-print-mode {
  flex-direction: column;
  align-items: stretch;
  margin: 0;
}
.tc-output-settings label,
.tc-share-dialog label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  margin-bottom: 10px;
}
.tc-output-settings input,
.tc-share-dialog input,
.tc-share-dialog select,
.tc-share-dialog textarea {
  font: inherit;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  padding: 10px;
  color: #172033;
  background: #fff;
}
.tc-output-settings p,
.tc-share-dialog p {
  font-size: 14px;
  line-height: 1.5;
}
.tc-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tc-a4-viewport {
  padding: 16px;
  background: #e2e8f0;
  overflow: hidden;
  box-sizing: content-box;
}
.tc-output-root .tc-paper {
  background: #fff;
  box-shadow: 0 2px 8px #0f172a20;
}
.tc-pdf-render {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  background: white;
  width: 190mm;
}
.tc-bulk-review-list {
  max-height: 440px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  margin: 14px 0;
}
.tc-bulk-review-row {
  display: grid;
  grid-template-columns: 24px minmax(160px, 1fr) minmax(180px, 2fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.tc-bulk-review-row input {
  width: 18px;
  height: 18px;
}
.tc-bulk-review-row small {
  display: block;
  color: #475569;
}
.tc-output-root .tc-school-header {
  display: block !important;
  text-align: center !important;
  border: 0 !important;
  border-bottom: 1px solid #111827 !important;
  background: #fff !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 0 3mm !important;
  margin: 0 0 3mm !important;
  min-height: 0 !important;
  color: #111827 !important;
}
.tc-output-root .tc-school-header strong {
  display: block;
  font-size: 16pt;
}
.tc-output-root .tc-school-header div {
  font-size: 9pt;
  line-height: 1.3;
}
.tc-output-root .tc-letterhead .tc-school-header {
  display: none !important;
}
.tc-output-root .tc-cert-table tr {
  background: #fff !important;
}
.tc-output-root .tc-cert-table td {
  background: #fff !important;
  white-space: pre-wrap;
}
.tc-output-root .tc-cert-table .tc-row-no {
  white-space: nowrap;
}
.tc-output-root .tc-cert-border {
  position: relative;
}
.tc-output-root .tc-qr {
  display: flex;
  align-items: center;
  gap: 3mm;
  font-size: 8pt;
  min-height: 23mm;
  margin-top: 2mm;
}
.tc-output-root .tc-qr img {
  width: 23mm;
  height: 23mm;
  object-fit: contain;
}
.tc-output-root .tc-sign-row {
  margin-top: 10mm;
}
.tc-output-root .tc-certificate[data-watermark="CANCELLED"]::after {
  color: #b91c1c44;
  font-size: 52pt;
}
.tc-output-root .tc-certificate[data-watermark="DRAFT"]::after {
  color: #47556933;
  font-size: 60pt;
}
.tc-output-root .tc-certificate::after {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.tc-qr {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.tc-qr img {
  width: 86px;
  height: 86px;
}
@media (max-width: 800px) {
  .tc-workflow {
    flex-direction: column;
  }
  .tc-summary {
    flex-wrap: wrap;
  }
  .tc-output-layout {
    grid-template-columns: 1fr;
  }
  .tc-default-controls > div {
    grid-template-columns: 1fr;
  }
  .tc-sticky-actions {
    padding: 10px;
  }
  .tc-sticky-actions > span {
    width: 100%;
  }
  .tc-bulk-review-row {
    grid-template-columns: 24px 1fr;
  }
  .tc-bulk-review-row > span:last-child {
    grid-column: 2;
  }
}
@media print {
  .tc-output-root .tc-paper {
    box-shadow: none;
  }
  .tc-output-root .tc-certificate {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .tc-output-root .tc-cert-border {
    overflow-wrap: anywhere;
  }
  body > dialog {
    display: none !important;
  }
}

.tc-header-logo {
  display: block !important;
  width: auto !important;
  height: 68px !important;
  max-width: 150px !important;
  object-fit: contain !important;
  margin: 0 auto 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.tc-output-root .tc-header-logo {
  height: 18mm !important;
  max-width: 42mm !important;
  margin: 0 auto 2mm !important;
}
.tc-logo-controls {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tc-logo-controls legend {
  font-weight: 700;
}
.tc-logo-controls small {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}
.tc-logo-controls .tc-logo-toggle {
  flex-direction: row;
  align-items: center;
}
.tc-logo-controls .tc-logo-toggle input {
  width: 18px;
  height: 18px;
}
.tc-logo-controls input[type="file"] {
  font-size: 12px;
  padding: 5px;
}

.tc-output-settings [hidden] { display: none !important; }
