/* ===================================================================
   Suchana Certificate Studio - Complete Styling System
   =================================================================== */

:root {
  /* Dashboard Theme */
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #243247;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.15);
  --accent-gold: #d4af37;
  --accent-gold-light: #fef08a;
  --border-color: #334155;
  --input-bg: #0f172a;
  --success: #10b981;
  --danger: #ef4444;

  /* Certificate Specific Palette (Faithful to the original) */
  --cert-bg: #ffffff;
  --cert-blue-dark: #022353;
  --cert-blue-navy: #002b66;
  --cert-blue-ribbon: #001f4c;
  --cert-gold: #c59b27;
  --cert-gold-bright: #dfb73a;
  --cert-red-title: #ab121a;
  --cert-text-dark: #111827;
  --cert-border-blue: #002b66;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top App Header */
.app-header {
  height: 64px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
}

.brand-icon {
  width: 100%;
  height: 100%;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-text .badge {
  font-size: 0.68rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Button UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: #2d3e58;
  border-color: #475569;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-block {
  width: 100%;
}

.text-danger {
  color: var(--danger) !important;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  min-width: 250px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  z-index: 100;
  animation: slideDown 0.15s ease-out;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-card);
  color: var(--accent-gold-light);
}

.dropdown-item i {
  width: 16px;
  height: 16px;
  color: var(--accent-gold);
}

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

/* Main Split View Layout */
.main-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left Sidebar Form */
.sidebar-panel {
  width: 440px;
  min-width: 380px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Document Mode Switcher Card */
.doc-switcher-card {
  padding: 0.75rem;
  background: #101726;
  border-bottom: 1px solid var(--border-color);
}

.doc-switcher-btns {
  display: flex;
  background: #1e293b;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.doc-switcher-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.doc-switcher-btn i {
  width: 16px;
  height: 16px;
}

.doc-switcher-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.doc-switcher-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.tab-navigation {
  display: flex;
  background: #151e2e;
  border-bottom: 1px solid var(--border-color);
  padding: 0.35rem 0.5rem;
  gap: 0.25rem;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.4rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn i {
  width: 14px;
  height: 14px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--bg-card);
  color: #60a5fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.tab-content.active {
  display: block;
}

/* Form Styles */
.styled-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.section-title h3 {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title i {
  width: 16px;
  height: 16px;
}

/* =========================================================
   PHOTO UPLOAD SLOTS - 4 Document Photos for Verification
   ========================================================= */
.photo-upload-slot {
  background: var(--bg-surface);
  border: 1.5px dashed rgba(99,102,241,0.4);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s;
  min-height: 120px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.photo-upload-slot:hover {
  border-color: rgba(99,102,241,0.7);
}

.photo-slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.photo-slot-placeholder i {
  width: 28px;
  height: 28px;
  opacity: 0.5;
}

.photo-slot-preview {
  width: 100%;
}

.photo-slot-preview img {
  width: 100%;
  border-radius: 6px;
  object-fit: contain;
  max-height: 100px;
  display: block;
}

.photo-slot-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.col-6 {
  flex: 1;
}

label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.required {
  color: var(--danger);
}

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

.input-icon {
  position: absolute;
  left: 0.75rem;
  width: 14px;
  height: 14px;
  color: #64748b;
  pointer-events: none;
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: inherit;
  transition: all 0.2s;
}

.input-wrapper input {
  padding-left: 2.2rem;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.hint-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
}

.checkbox-wrapper label {
  color: var(--text-main);
  cursor: pointer;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.form-actions-sticky {
  position: sticky;
  bottom: 0;
  background: var(--bg-sidebar);
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-color);
  z-index: 10;
}

/* Bulk Import UI */
.bulk-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bulk-instructions h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: #60a5fa;
}

.bulk-instructions p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.drop-zone {
  border: 2px dashed #3b82f6;
  background: rgba(37, 99, 235, 0.05);
  border-radius: 10px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.drop-zone:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: #60a5fa;
}

.drop-zone .drop-icon {
  width: 38px;
  height: 38px;
  color: #60a5fa;
  margin-bottom: 0.5rem;
}

.drop-zone p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drop-zone p span {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: underline;
}

.drop-zone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.bulk-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bulk-table-wrapper {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.styled-table th,
.styled-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.styled-table th {
  background: #151e2e;
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.styled-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ===================================================================
   STUDENT VERIFICATION PORTAL & GOOGLE SHEET SYNC STYLES
   =================================================================== */

.verification-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.verify-hero-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(30, 64, 175, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 10px;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.verify-hero-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.verify-hero-text h3 {
  font-size: 0.95rem;
  color: #ffffff;
  font-weight: 700;
  margin: 0 0 0.2rem 0;
}

.verify-hero-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

.verify-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.verify-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.google-sheet-card {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 0.85rem;
}

.sheet-status-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 8px;
  border-radius: 5px;
  margin-top: 0.4rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Verification Result Card */
.verified-banner-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.verified-banner-success .badge-icon {
  width: 28px;
  height: 28px;
  color: #10b981;
  flex-shrink: 0;
}

.verified-banner-text h4 {
  font-size: 0.85rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.5px;
  margin: 0;
}

.verified-banner-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.verified-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
}

.profile-student-name {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.3rem 0;
}

.profile-course-badge {
  display: inline-block;
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meta-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.meta-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
}

/* Document Switcher Pill Buttons for Student */
.student-doc-selector-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
}

.student-doc-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.btn-doc-pill {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-doc-pill:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #60a5fa;
}

.btn-doc-pill.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.student-download-actions {
  display: flex;
  gap: 0.5rem;
}

/* History Tab UI */
.history-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header h3 {
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: #3b82f6;
  transform: translateX(2px);
}

.history-info h4 {
  font-size: 0.82rem;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.history-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.history-actions {
  display: flex;
  gap: 0.35rem;
}

/* Right Panel: Certificate Viewport */
.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #090e17;
  overflow: hidden;
}

.preview-toolbar {
  height: 48px;
  background: #162032;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.toolbar-title i {
  width: 16px;
  height: 16px;
  color: #60a5fa;
}

.preview-resolution-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #334155;
}

.btn-icon i {
  width: 16px;
  height: 16px;
}

.zoom-indicator {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 45px;
  text-align: center;
}

.preview-viewport-container {
  flex: 1;
  overflow: auto;
  padding: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: radial-gradient(circle at center, #131c2d 0%, #080c14 100%);
}

/* ===================================================================
   CERTIFICATE RENDERING ENGINE (Using Authentic Template Background)
   =================================================================== */

.certificate-wrapper {
  /* Exact 1024x682 matching the background template image */
  width: 1024px;
  height: 682px;
  min-width: 1024px;
  min-height: 682px;
  background-image: url('certificate_bg.jpg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  user-select: none;
  transform-origin: top center;
  transition: transform 0.15s ease-out;
  color: var(--cert-text-dark);
  box-sizing: border-box;
  padding: 31px 38px 12px 38px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Natural proportional flow with precise spacing */
}

/* 1. TOP BAR: Serial Number (Positioned cleanly at upper right) */
.cert-top-bar {
  position: absolute;
  top: 33px;
  right: 48px;
  z-index: 25;
  display: flex;
  justify-content: flex-end;
}

.cert-sl-no-container {
  font-family: 'Arial', sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #000000;
  letter-spacing: 0.2px;
}

.cert-sl-label {
  font-weight: 800;
}

.cert-sl-value {
  font-weight: 800;
  margin-left: 4px;
}

/* 2. HEADER SECTION (100% True Center Alignment across the certificate) */
.cert-header-section {
  position: relative;
  z-index: 15;
  margin-top: 2px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 116px;
}

.cert-logo-seal {
  position: absolute;
  left: 54px;
  top: 2px;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.seal-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.cert-title-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 auto;
}

.cert-institution-name {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 39px;
  font-weight: 900;
  color: #002663;
  letter-spacing: 0.2px;
  margin: 0;
  line-height: 1.05;
  white-space: nowrap;
}

.cert-estd-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 3px 0;
}

.estd-diamond-line {
  height: 2px;
  width: 65px;
  background: linear-gradient(90deg, transparent, #d4af37, #d4af37);
  position: relative;
}

.estd-diamond-line.right {
  background: linear-gradient(90deg, #d4af37, #d4af37, transparent);
}

.estd-diamond-line::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #d4af37;
  transform: rotate(45deg);
}

.estd-diamond-line.left::after {
  right: -4px;
}

.estd-diamond-line.right::after {
  left: -4px;
}

.cert-estd-text {
  font-family: 'Arial', sans-serif;
  font-size: 13.5px;
  font-weight: 900;
  color: #000000;
  letter-spacing: 1px;
}

.cert-office-address {
  font-family: 'Arial', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #002663;
  letter-spacing: 0.3px;
  line-height: 1.35;
  margin-top: 1px;
}

/* 3. EXAM BANNER (Grand proportions with balanced spacing) */
.cert-banner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  margin-top: 10px;
  margin-bottom: 4px;
}

.banner-wing {
  width: 52px;
  height: 28px;
}

.cert-banner-ribbon {
  background: linear-gradient(180deg, #001f4f 0%, #001230 100%);
  border: 2px solid #d4af37;
  padding: 3px 28px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.cert-banner-text {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-size: 18.5px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* 4. TRAINING PERIOD SUBTITLE */
.cert-training-period {
  text-align: center;
  font-family: 'Lora', 'Georgia', serif;
  font-style: italic;
  font-size: 14.5px;
  color: #000000;
  font-weight: 600;
  position: relative;
  z-index: 10;
  margin-top: 2px;
  margin-bottom: 2px;
}

/* 5. COURSE NAME & TRAINEE TYPE */
.cert-course-container {
  text-align: center;
  position: relative;
  z-index: 10;
  margin-top: 4px;
  margin-bottom: 4px;
}

.cert-course-name {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 40px;
  font-weight: 900;
  color: #a91d22;
  letter-spacing: 0.5px;
  line-height: 1.05;
  text-shadow: 0.5px 0.5px 1px rgba(169, 29, 34, 0.15);
}

.cert-trainee-type {
  font-family: 'Cinzel', 'Arial', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--cert-blue-navy);
  margin-top: 2px;
  letter-spacing: 0.8px;
}

/* 6. CENTRE NAME BADGE */
.cert-centre-badge-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  margin-top: 4px;
  margin-bottom: 12px;
}

.centre-badge-ornament {
  width: 36px;
  height: 18px;
}

.cert-centre-badge {
  border: 1.5px solid #d4af37;
  border-radius: 20px;
  padding: 2px 28px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(212, 175, 55, 0.15);
}

.centre-label {
  font-family: 'Lora', 'Georgia', serif;
  font-style: italic;
  font-size: 15.5px;
  font-weight: 600;
  color: #000000;
  margin-right: 6px;
}

.centre-value {
  font-family: 'Playfair Display', serif;
  font-size: 16.5px;
  font-weight: 800;
  color: #002d6b;
}

/* 7. CERTIFICATE BODY STATEMENT (Fills space with generous dotted rows) */
.cert-body-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 16px;
}

.cert-statement-row {
  display: flex;
  align-items: flex-end;
  font-family: 'Lora', 'Georgia', serif;
  font-style: italic;
  font-size: 16.5px;
  font-weight: 600;
  color: #000000;
  line-height: 1.25;
}

.statement-lead {
  white-space: nowrap;
  margin-right: 8px;
  min-width: 128px;
}

.statement-mid {
  white-space: nowrap;
  margin: 0 10px;
}

.dotted-fill-box {
  border-bottom: 1.5px dotted #222222;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
  min-height: 25px;
}

.flex-grow {
  flex: 1;
}

.col-district {
  flex: 1;
}

.col-dob {
  width: 230px;
}

.split-row .statement-lead {
  min-width: 60px;
}

.fill-value {
  font-family: 'Lora', 'Times New Roman', serif;
  font-style: normal;
  font-weight: 700;
  font-size: 16.5px;
  color: #001f4c;
  padding-left: 8px;
  letter-spacing: 0.5px;
}

.student-name-value {
  font-size: 18px;
  font-weight: 800;
  color: #001438;
  letter-spacing: 1px;
}

.cert-completion-paragraph {
  text-align: center;
  font-family: 'Lora', 'Georgia', serif;
  font-style: italic;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.48;
  color: #000000;
  margin-top: 6px;
  padding: 0 15px;
}

.highlight-inline {
  font-weight: 700;
  font-style: normal;
}

/* 8. FOOTER SECTION (Lifted up 7px safely away from bottom gold border) */
.cert-footer-section {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  z-index: 10;
  margin-top: auto;
  margin-bottom: 21px; /* Lifted up by 7px for perfect border clearance */
  padding: 0 120px;
}

.cert-signature-block {
  width: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sig-image-container {
  height: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
}

.digital-sign-font {
  font-family: 'Alex Brush', 'Great Vibes', cursive;
  font-size: 30px;
  color: #002b66;
  letter-spacing: 0.5px;
}

.official-signature-svg {
  display: block;
  height: 36px;
  width: auto;
  max-width: 140px;
  filter: drop-shadow(0 0.5px 0.5px rgba(0, 43, 102, 0.4));
  transition: transform 0.2s ease;
}

.sig-image-container:hover .official-signature-svg,
.sig-image-container:hover .signature-img {
  transform: scale(1.04);
}

.signature-img {
  max-height: 36px;
  max-width: 150px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.sig-line {
  width: 100%;
  height: 2px;
  background-color: var(--cert-blue-navy);
  margin-top: 2px;
}

.sig-title {
  font-family: 'Lora', 'Georgia', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--cert-blue-navy);
  margin-top: 4px;
}

.cert-footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 5px;
}

.cert-qr-container {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  background: #ffffff;
  padding: 4px;
  border: 1.5px solid #d4af37;
  border-radius: 4px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.cert-qr-container canvas,
.cert-qr-container img,
.cert-qr-img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.cert-qr-container canvas[style*="none"],
.cert-qr-container img[style*="none"] {
  display: none !important;
}

.cert-gold-ornament {
  width: 155px;
  height: 26px;
}

.cert-gold-ornament svg {
  width: 100%;
  height: 100%;
}

/* ===================================================================
   ADMIT CARD RENDERING ENGINE (100% Matching Authentic Master Photo)
   =================================================================== */

.admit-card-wrapper {
  width: 1024px;
  height: 682px;
  min-width: 1024px;
  min-height: 682px;
  background-image: url('admit_card_bg.png'), url('admit_card_bg.jpg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  user-select: none;
  transform-origin: top center;
  transition: transform 0.15s ease-out;
  color: #000000;
  box-sizing: border-box;
}

/* 1. TOP-LEFT LOGO SEAL (Shifted Down for Clean Border Clearance) */
.admit-logo-seal {
  position: absolute;
  left: 44px;
  top: 46px;
  width: 108px;
  height: 108px;
  z-index: 15;
}

/* 2. TOP-RIGHT DATE & PHOTO FRAME (Shifted Down for Clean Border Clearance) */
.admit-top-right-box {
  position: absolute;
  right: 44px;
  top: 44px;
  width: 130px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 15;
}

.admit-date-tag {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14.5px;
  font-weight: bold;
  color: #000000;
  margin-bottom: 5px;
  white-space: nowrap;
}

.admit-photo-frame {
  width: 122px;
  height: 138px;
  border: 1.5px solid #002663;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.admit-photo-placeholder {
  font-family: 'Times New Roman', Times, serif;
  font-size: 11.5px;
  line-height: 1.35;
  color: #000000;
  font-weight: bold;
  padding: 4px;
}

.admit-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 3. CENTER INSTITUTION HEADER (Shifted Down for Clean Border Clearance) */
.admit-header-section {
  display: contents; /* Children positioned absolutely */
}

.admit-title-group {
  position: absolute;
  left: 165px;
  right: 185px;
  top: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 15;
}

.admit-institution-name {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 40px;
  font-weight: 900;
  color: #002663;
  margin: 0;
  line-height: 1.05;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transform: scaleY(1.06);
}

.admit-estd-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px 0;
}

.admit-estd-text {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14.5px;
  font-weight: bold;
  color: #000000;
  letter-spacing: 0.5px;
}

.admit-office-address {
  font-family: 'Arial', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #002663;
  line-height: 1.35;
  letter-spacing: 0.3px;
  text-align: center;
}

.admit-header-divider {
  width: 100%;
  height: 2px;
  background-color: #002663;
  margin-top: 5px;
}

/* 4. EXAM BANNER */
.admit-banner-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 172px;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.admit-exam-box {
  background: #002663;
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 3.5px 42px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 5. RED ADMIT CARD BADGE */
.admit-card-badge-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 212px;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.admit-red-badge {
  background: #d32f2f;
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 2.5px 36px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(211, 47, 47, 0.25);
}

/* 6. COURSE & TRAINEE TYPE */
.admit-course-row {
  position: absolute;
  left: 0;
  right: 0;
  top: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}

.admit-course-text {
  font-family: 'Arial', sans-serif;
  font-size: 17px;
  font-weight: 900;
  color: #002663;
  letter-spacing: 0.5px;
}

.admit-trainee-text {
  font-family: 'Arial', sans-serif;
  font-size: 17px;
  font-weight: 900;
  color: #002663;
}

/* 7. TWO-COLUMN BODY LAYOUT */
.admit-body-layout {
  position: absolute;
  left: 44px;
  right: 44px;
  top: 284px;
  height: 242px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 22px;
  z-index: 10;
}

/* Left Column: Candidate Details (7 Evenly Spaced Rows) */
.admit-details-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.admit-field-row {
  display: flex;
  align-items: flex-end;
  font-family: 'Times New Roman', Times, serif;
  font-size: 15.5px;
  font-weight: bold;
  color: #000000;
  line-height: 1.2;
}

.admit-label {
  width: 105px;
  min-width: 105px;
  color: #000000;
  font-weight: bold;
  font-family: 'Times New Roman', serif;
}

.admit-colon {
  width: 14px;
  font-weight: bold;
  text-align: left;
}

.admit-dotted-line {
  border-bottom: 1.5px dotted #000000;
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: 0px;
  min-height: 20px;
}

.col-roll {
  width: 120px;
  flex: none;
}

.admit-bar {
  margin: 0 8px;
  font-weight: bold;
  font-family: 'Times New Roman', serif;
}

.admit-label-no {
  margin-right: 4px;
  font-weight: bold;
  font-family: 'Times New Roman', serif;
  white-space: nowrap;
}

.col-no {
  width: 120px;
  flex: none;
}

.admit-val-text {
  font-family: 'Times New Roman', serif;
  font-weight: bold;
  font-size: 15px;
  color: #000000;
  padding-left: 4px;
  letter-spacing: 0.3px;
}

.exam-row .admit-label {
  width: 105px;
  min-width: 105px;
}

.admit-exam-line-val {
  font-family: 'Times New Roman', serif;
  font-size: 13px;
  font-weight: bold;
  color: #000000;
  line-height: 1.25;
  padding-left: 2px;
  white-space: nowrap;
}

/* Right Column: Subjects Table (100% Matching Reference Photo) */
.admit-subjects-col {
  width: 320px;
  min-width: 320px;
  height: 100%;
  display: flex;
}

.admit-subjects-table {
  width: 100%;
  height: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 2px solid #002663;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.admit-subjects-table thead {
  height: 34px;
}

.admit-subjects-table th {
  background: #002663;
  color: #ffffff;
  font-family: 'Times New Roman', Times, serif;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  border: none;
  padding: 4px 0;
}

.admit-subjects-table tbody tr {
  height: 41.5px;
}

.admit-subjects-table tbody tr:not(:last-child) td {
  border-bottom: 1.5px solid #002663;
}

.admit-subjects-table td {
  padding: 0;
  font-family: 'Times New Roman', Times, serif;
  color: #002663;
  vertical-align: middle;
  white-space: nowrap;
}

/* Compact Serial Number Box (Matching Reference Photo) */
.admit-subjects-table .col-num {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  font-weight: bold;
  font-size: 16.5px;
  border-right: 1.5px solid #002663;
  color: #002663;
}

/* Wide Subject Name Column - 100% Full Text Visibility */
.admit-subjects-table .col-sub {
  padding-left: 10px;
  padding-right: 6px;
  font-size: 13.5px;
  font-weight: bold;
  color: #002663;
  letter-spacing: -0.1px;
  overflow: visible;
}

/* 8. FOOTER SIGNATURES (Shifted UP away from Bottom Guilloche Border) */
.admit-footer-section {
  position: absolute;
  left: 70px;
  right: 70px;
  bottom: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 10;
}

.admit-sig-block {
  width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.admit-sig-line {
  width: 100%;
  height: 2px;
  background-color: #002663;
  margin-top: 2px;
}

.admit-sig-title {
  font-family: 'Times New Roman', serif;
  font-size: 17.5px;
  font-weight: bold;
  color: #002663;
  margin-top: 5px;
}

/* ===================================================================
   MARK SHEET RENDERING ENGINE (100% Matching Authentic Master Photo)
   =================================================================== */

.marksheet-wrapper {
  width: 1024px;
  height: 682px;
  min-width: 1024px;
  min-height: 682px;
  background-image: url('admit_card_bg.png'), url('admit_card_bg.jpg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  user-select: none;
  transform-origin: top center;
  transition: transform 0.15s ease-out;
  color: #000000;
  box-sizing: border-box;
}

/* 1. TOP-RIGHT M. SL. NO. */
.mark-top-bar {
  position: absolute;
  right: 48px;
  top: 40px;
  z-index: 15;
  font-family: 'Times New Roman', Times, serif;
  font-size: 15.5px;
  font-weight: bold;
  color: #000000;
  letter-spacing: 0.2px;
}

.mark-sl-label {
  font-weight: bold;
}

.mark-sl-val {
  font-weight: bold;
}

/* 2. TOP-LEFT LOGO SEAL */
.mark-logo-seal {
  position: absolute;
  left: 44px;
  top: 42px;
  width: 108px;
  height: 108px;
  z-index: 15;
}

/* 3. CENTER INSTITUTION HEADER */
.mark-title-group {
  position: absolute;
  left: 165px;
  right: 140px;
  top: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 15;
}

.mark-institution-name {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 40px;
  font-weight: 900;
  color: #002663;
  margin: 0;
  line-height: 1.05;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transform: scaleY(1.06);
}

.mark-estd-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0 2px 0;
}

.mark-estd-text {
  font-family: 'Times New Roman', Times, serif;
  font-size: 15px;
  font-weight: bold;
  color: #000000;
  letter-spacing: 0.5px;
}

.mark-office-address {
  font-family: 'Arial', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #002663;
  line-height: 1.35;
  letter-spacing: 0.3px;
  text-align: center;
}

.mark-header-divider {
  width: 100%;
  height: 2px;
  background-color: #002663;
  margin-top: 5px;
}

/* 4. BANNER: FINAL EXAMINATION 2013 */
.mark-banner-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 164px;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.mark-exam-box {
  background: #002663;
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 3px 44px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 5. BADGE: MARK SHEET */
.mark-badge-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 202px;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.mark-badge-box {
  background: #002663;
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  font-size: 18.5px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 2.5px 36px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 6. TRADE & DATE ROW */
.mark-trade-row {
  position: absolute;
  left: 0;
  right: 0;
  top: 238px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-family: 'Times New Roman', Times, serif;
  font-size: 17.5px;
  font-weight: bold;
  color: #002663;
  letter-spacing: 0.3px;
}

.mark-date-tag {
  position: absolute;
  right: 48px;
  top: 236px;
  z-index: 10;
  font-family: 'Times New Roman', Times, serif;
  font-size: 16px;
  font-weight: bold;
  color: #000000;
}

/* 7. CANDIDATE STATEMENTS */
.mark-statements-block {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 268px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 10;
}

.mark-statement-row {
  display: flex;
  align-items: flex-end;
  font-family: 'Times New Roman', Times, serif;
  font-size: 16px;
  line-height: 1.25;
}

.mark-lead-italic {
  font-style: italic;
  font-weight: bold;
  color: #000000;
  margin-right: 6px;
  white-space: nowrap;
}

.mark-mid-italic {
  font-style: italic;
  font-weight: bold;
  color: #000000;
  margin: 0 8px;
  white-space: nowrap;
}

.mark-dotted-box {
  border-bottom: 1.5px dotted #000000;
  display: flex;
  align-items: flex-end;
  padding-bottom: 0px;
  min-height: 20px;
}

.mark-dotted-box.flex-grow {
  flex: 1;
}

.mark-dotted-box.col-roll {
  width: 110px;
  flex: none;
}

.mark-dotted-box.col-no {
  width: 130px;
  flex: none;
}

.mark-val-text {
  font-family: 'Times New Roman', Times, serif;
  font-style: normal;
  font-weight: bold;
  font-size: 15.5px;
  color: #000000;
  padding-left: 6px;
  letter-spacing: 0.3px;
}

.mark-val-text.name-val {
  font-size: 16.5px;
  letter-spacing: 0.5px;
}

/* 8. MARKS TABLE (8 Columns x 4 Rows) */
.mark-table-container {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 356px;
  z-index: 10;
}

.mark-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #002663;
  background: #ffffff;
}

.mark-table th {
  background: #dcedfc;
  border: 1.5px solid #002663;
  color: #002663;
  font-family: 'Arial', 'Times New Roman', sans-serif;
  font-size: 12.5px;
  font-weight: 900;
  text-align: center;
  padding: 5px 2px;
  line-height: 1.2;
  vertical-align: middle;
}

.mark-table .col-head-subject {
  width: 145px;
}

.mark-table td {
  border: 1.5px solid #002663;
  padding: 4px 6px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  color: #000000;
  vertical-align: middle;
  height: 31px;
}

.mark-table .col-label {
  text-align: center;
  font-weight: 900;
  color: #002663;
  font-size: 13.5px;
  font-family: 'Arial', sans-serif;
  letter-spacing: 0.3px;
}

.mark-table .col-total {
  font-weight: 900;
}

.mark-table .col-remarks {
  font-weight: bold;
  color: #002663;
}

/* 9. FOOTER SIGNATURES */
.mark-footer-section {
  position: absolute;
  left: 80px;
  right: 80px;
  bottom: 38px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 10;
}

.mark-sig-block {
  width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mark-sig-line {
  width: 100%;
  height: 2px;
  background-color: #002663;
  margin-top: 2px;
}

.mark-sig-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 17.5px;
  font-weight: bold;
  color: #002663;
  margin-top: 5px;
}

/* ===================================================================
   REGISTRATION CERTIFICATE RENDERING ENGINE (100% Authentic Replication)
   =================================================================== */

.registration-wrapper {
  width: 1024px;
  height: 682px;
  min-width: 1024px;
  min-height: 682px;
  background-image: url('admit_card_bg.png'), url('admit_card_bg.jpg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  user-select: none;
  transform-origin: top center;
  transition: transform 0.15s ease-out;
  color: #000000;
  box-sizing: border-box;
}

/* 1. TOP-LEFT LOGO SEAL */
.reg-logo-seal {
  position: absolute;
  left: 44px;
  top: 42px;
  width: 108px;
  height: 108px;
  z-index: 15;
}

/* 2. CENTER INSTITUTION HEADER (100% Exact Horizontal Middle) */
.reg-title-group {
  position: absolute;
  left: 0;
  right: 0;
  top: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto;
  z-index: 15;
}

.reg-institution-name {
  font-family: 'Playfair Display', 'Times New Roman', serif;
  font-size: 44px;
  font-weight: 900;
  color: #002663;
  margin: 0;
  line-height: 1.05;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transform: scaleY(1.06);
}

.reg-estd-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0 2px 0;
}

.reg-estd-text {
  font-family: 'Times New Roman', Times, serif;
  font-size: 16.5px;
  font-weight: bold;
  color: #000000;
  letter-spacing: 0.5px;
}

.reg-office-address {
  font-family: 'Arial', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  color: #002663;
  line-height: 1.35;
  letter-spacing: 0.3px;
  text-align: center;
}

.reg-header-divider {
  width: 680px;
  height: 2px;
  background-color: #002663;
  margin-top: 6px;
}

/* 3. BANNER: REGISTRATION CERTIFICATE */
.reg-banner-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 166px;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.reg-exam-box {
  background: #002663;
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  font-size: 22.5px;
  font-weight: 900;
  letter-spacing: 2.5px;
  padding: 3.5px 48px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

/* 4. TRAINEE SUBTITLE: [Private Trainee ] */
.reg-trainee-row {
  position: absolute;
  left: 0;
  right: 0;
  top: 206px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-family: 'Times New Roman', Times, serif;
  font-size: 19px;
  font-weight: bold;
  color: #002663;
  letter-spacing: 0.5px;
}

/* 5. REGISTRATION NO & DATE ROW */
.reg-meta-row {
  position: absolute;
  left: 54px;
  right: 54px;
  top: 238px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  font-family: 'Times New Roman', Times, serif;
  font-size: 18px;
  font-weight: bold;
  color: #002663;
}

.reg-meta-left, .reg-meta-right {
  display: flex;
  align-items: center;
}

.reg-meta-label {
  font-weight: bold;
  color: #002663;
}

.reg-meta-val {
  font-weight: bold;
  color: #000000;
  padding-left: 4px;
}

/* 6. CANDIDATE STATEMENTS (5 Rows with Dotted Lines - Enhanced Size & Spacing) */
.reg-statements-block {
  position: absolute;
  left: 54px;
  right: 54px;
  top: 278px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 10;
}

.reg-statement-row {
  display: flex;
  align-items: flex-end;
  font-family: 'Times New Roman', Times, serif;
  font-size: 19.5px;
  line-height: 1.25;
}

.reg-lead-italic {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-weight: bold;
  color: #7b2222;
  margin-right: 6px;
  white-space: nowrap;
  font-size: 19.5px;
}

.reg-mid-italic {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-weight: bold;
  color: #7b2222;
  margin: 0 6px;
  white-space: nowrap;
  font-size: 19.5px;
}

.reg-dotted-box {
  border-bottom: 2px dotted #000000;
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
  min-height: 26px;
}

.reg-dotted-box.flex-grow {
  flex: 1;
}

.reg-dotted-box.col-addr {
  flex: 1;
}

.reg-dotted-box.col-branch {
  width: 280px;
  flex: none;
}

.reg-dotted-box.col-reg-no {
  width: 270px;
  flex: none;
}

.reg-val-text {
  font-family: 'Times New Roman', Times, serif;
  font-style: normal;
  font-weight: bold;
  font-size: 18px;
  color: #000000;
  padding-left: 6px;
  letter-spacing: 0.3px;
}

.reg-val-text.name-val {
  font-size: 19.5px;
  letter-spacing: 0.5px;
}

.reg-course-highlight {
  font-family: 'Times New Roman', Times, serif;
  font-style: normal;
  font-weight: 900;
  font-size: 21.5px;
  color: #002663;
  margin: 0 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.reg-comma, .reg-dot {
  font-family: 'Times New Roman', Times, serif;
  font-weight: bold;
  font-style: normal;
  color: #7b2222;
  margin-left: 2px;
  font-size: 19.5px;
}

/* 7. FOOTER SIGNATURES */
.reg-footer-section {
  position: absolute;
  left: 70px;
  right: 70px;
  bottom: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 10;
}

.reg-sig-block {
  width: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reg-sig-line {
  width: 100%;
  height: 2px;
  background-color: #002663;
  margin-top: 2px;
}

.reg-sig-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 18.5px;
  font-weight: bold;
  color: #002663;
  margin-top: 5px;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.85rem;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 18px;
  height: 18px;
  color: #10b981;
}

/* PRINT MEDIA QUERY FOR HIGH RESOLUTION PHYSICAL PRINTING */
@media print {
  html, body {
    background: #ffffff !important;
    background-color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Hide all website navigation, headers, forms, status cards, toolbars, buttons, footers */
  .app-header,
  .sidebar-panel,
  .preview-toolbar,
  .toast,
  .public-nav,
  .public-portal-header,
  .portal-brand,
  .verify-search-section,
  .verify-status-banner,
  .verify-toolbar,
  .public-portal-footer,
  .portal-footer-inner,
  #verifySearchBox,
  #verifyStatus,
  #verifyToolbar,
  .action-btn,
  .zoom-controls,
  .doc-tab-btn,
  .btn-primary,
  .btn-secondary,
  .btn-outline,
  header,
  footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .main-layout,
  .preview-panel,
  .preview-viewport-container,
  .verify-main,
  .verify-container,
  .doc-preview-wrapper,
  .doc-viewport-container {
    background: transparent !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .doc-scale-wrapper {
    transform: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
  }

  /* Full A4 Page for Certificate (Landscape) */
  .certificate-wrapper {
    box-shadow: none !important;
    transform: none !important;
    margin: 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    width: 297mm !important;
    height: 210mm !important;
    max-width: 297mm !important;
    max-height: 210mm !important;
  }

  /* Top Half of A4 for Admit Card, Mark Sheet & Registration Certificate */
  .admit-card-wrapper,
  .marksheet-wrapper,
  .registration-wrapper {
    box-shadow: none !important;
    transform: none !important;
    margin: 6mm auto 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    width: 200mm !important;
    height: 133.3mm !important;
    max-width: 200mm !important;
    max-height: 133.3mm !important;
  }

  /* Any document wrapper that has display:none remains hidden */
  .certificate-wrapper[style*="display: none"],
  .marksheet-wrapper[style*="display: none"],
  .admit-card-wrapper[style*="display: none"],
  .registration-wrapper[style*="display: none"] {
    display: none !important;
  }

  body.mode-cert,
  body.mode-certificate {
    @page {
      size: A4 landscape;
      margin: 0;
    }
  }

  body.mode-admit,
  body.mode-marksheet,
  body.mode-registration {
    @page {
      size: A4 portrait;
      margin: 0;
    }
  }

  @page {
    size: auto;
    margin: 0;
  }
}

/* ===================================================================
   Certificate Studio Authentication Gate (Security Modal)
   =================================================================== */
.cert-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, #0c1a3a 0%, #030816 100%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cert-auth-overlay.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cert-auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(10, 20, 45, 0.94);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(250, 204, 21, 0.15);
  padding: 36px 32px;
  box-sizing: border-box;
  text-align: center;
  position: relative;
  animation: authCardPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cert-auth-logo-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #000000;
  border: 2px solid var(--brand-yellow, #facc15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.4);
}

.cert-auth-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.cert-auth-title {
  font-family: 'Cinzel', serif;
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: 0.03em;
}

.cert-auth-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 26px;
}

.cert-auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.cert-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cert-auth-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
}

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

.cert-auth-input {
  width: 100%;
  height: 44px;
  background: rgba(3, 9, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14.5px;
  color: #ffffff;
  box-sizing: border-box;
  font-family: inherit;
  transition: all 0.25s ease;
  outline: none;
}

.cert-auth-input:focus {
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.2);
  background: rgba(4, 12, 32, 0.9);
}

.btn-toggle-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: color 0.2s ease;
}

.btn-toggle-eye:hover {
  color: #ffffff;
}

.cert-auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
}

.cert-auth-submit-btn {
  height: 46px;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  color: #000000;
  border: none;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(250, 204, 21, 0.3);
}

.cert-auth-submit-btn:hover {
  background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(250, 204, 21, 0.45);
}

.cert-auth-submit-btn:active {
  transform: translateY(1px);
}

.cert-auth-back-row {
  margin-top: 14px;
  text-align: center;
}

.cert-auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cert-auth-back-link:hover {
  color: #facc15;
}

/* ===================================================================
   Google Sheet Link & Settings Modal Styling
   =================================================================== */
.sheet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(14px);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeInModal 0.25s ease forwards;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.sheet-modal-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.sheet-modal-header {
  padding: 1.15rem 1.4rem;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-modal-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.sheet-modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.sheet-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sheet-modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sheet-modal-body {
  padding: 1.35rem 1.4rem;
  overflow-y: auto;
}

.sheet-modal-field {
  margin-bottom: 1rem;
}

.sheet-modal-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.sheet-modal-input-row {
  display: flex;
  gap: 0.5rem;
}

.sheet-modal-input {
  flex: 1;
  height: 42px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.85rem;
  color: #ffffff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.sheet-modal-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.sheet-modal-code-box {
  background: #090e1a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.sheet-modal-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.sheet-modal-pre {
  margin: 0;
  padding: 0.75rem 0.85rem;
  font-size: 0.72rem;
  color: #cbd5e1;
  max-height: 150px;
  overflow-y: auto;
  font-family: monospace;
  line-height: 1.45;
  user-select: all;
}

.sheet-modal-steps {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

/* =============================================================
   MOBILE & TABLET RESPONSIVE OPTIMIZATIONS (Certificate Studio)
   ============================================================= */
@media (max-width: 900px) {
  /* Header */
  .app-header {
    height: auto !important;
    padding: 0.65rem 0.85rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  .header-brand {
    justify-content: center;
    text-align: center;
  }

  .header-brand .brand-text h1 {
    font-size: 1.05rem;
  }

  .header-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 0.4rem;
    width: 100%;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions .btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 0.78rem !important;
    padding: 0.45rem 0.7rem !important;
  }

  /* Main Workspace Layout */
  .main-layout {
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 60px) !important;
    overflow: visible !important;
  }

  .sidebar-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    overflow: visible !important;
  }

  .panel-body {
    max-height: 520px;
    overflow-y: auto;
  }

  .doc-switcher-btns {
    flex-wrap: wrap;
  }

  .doc-switcher-btn {
    min-width: 110px;
  }

  .tab-navigation {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tab-navigation::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .form-row {
    flex-direction: column;
    gap: 0.65rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }

  /* Preview Panel */
  .preview-panel {
    width: 100% !important;
    min-height: 480px !important;
    height: auto !important;
    overflow: visible !important;
  }

  .preview-toolbar {
    flex-wrap: wrap !important;
    height: auto !important;
    padding: 0.65rem 0.85rem !important;
    gap: 0.5rem !important;
  }

  .toolbar-left {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .preview-viewport-container {
    padding: 1rem 0.25rem 2rem 0.25rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex;
    justify-content: center;
  }

  /* Auth Overlay Card on Mobile */
  .cert-auth-card {
    width: calc(100% - 2rem) !important;
    max-width: 380px !important;
    padding: 1.5rem 1.25rem !important;
    margin: 1rem auto;
  }

  .cert-auth-input {
    font-size: 16px !important;
  }

  /* Modal Dialogs */
  .sheet-modal-dialog {
    width: calc(100% - 1.5rem) !important;
    max-width: 100% !important;
    margin: 1rem auto;
  }
}

@media (max-width: 480px) {
  .doc-switcher-btn {
    flex: 1 1 45%;
    font-size: 0.76rem;
  }

  .student-download-actions {
    flex-direction: column;
  }

  .student-download-actions .btn {
    width: 100%;
  }
}

