/* ==========================================================================
   Certificate Generator Portal - Modern Glassmorphic Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800&family=Great+Vibes&family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400;1,600&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Dark Theme Palette (Default) */
  --bg-base: #0a0d18;
  --bg-surface: rgba(18, 24, 43, 0.75);
  --bg-card: rgba(22, 30, 56, 0.65);
  --bg-card-hover: rgba(28, 38, 70, 0.8);
  --bg-input: rgba(14, 20, 36, 0.7);
  --bg-table-stripe: rgba(255, 255, 255, 0.02);
  
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-focus: rgba(99, 102, 241, 0.6);
  --border-glass-hover: rgba(255, 255, 255, 0.2);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-teal: #14b8a6;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;
  --accent-gold-dark: #b45309;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #d97706 100%);
  --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);

  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.15);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.15);
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.15);
  --status-info: #3b82f6;
  --status-info-bg: rgba(59, 130, 246, 0.15);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
  --shadow-gold: 0 0 25px rgba(245, 158, 11, 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-base: #f0f4f9;
  --bg-surface: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(241, 245, 249, 0.85);
  --bg-table-stripe: rgba(0, 0, 0, 0.02);

  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glass-focus: rgba(99, 102, 241, 0.7);
  --border-glass-hover: rgba(0, 0, 0, 0.15);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(99, 102, 241, 0.1);
  --shadow-lg: 0 20px 35px -10px rgba(99, 102, 241, 0.15);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.18);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==========================================================================
   Background Animated Blobs (Deep Indigo -> Violet -> Teal)
   ========================================================================== */
.blob-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  mix-blend-mode: screen;
  will-change: transform;
}

[data-theme="light"] .blob {
  mix-blend-mode: multiply;
  opacity: 0.35;
  filter: blur(100px);
}

.blob-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #4f46e5 0%, #312e81 100%);
  top: -100px;
  left: -100px;
  animation: floatBlob1 24s ease-in-out infinite alternate;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #8b5cf6 0%, #4c1d95 100%);
  bottom: -150px;
  right: -100px;
  animation: floatBlob2 28s ease-in-out infinite alternate;
}

.blob-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #0d9488 0%, #064e3b 100%);
  top: 40%;
  left: 60%;
  animation: floatBlob3 32s ease-in-out infinite alternate;
}

@keyframes floatBlob1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(120px, 140px) scale(1.15); }
  100% { transform: translate(60px, -60px) scale(0.95); }
}

@keyframes floatBlob2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-140px, -100px) scale(1.2); }
  100% { transform: translate(-80px, 80px) scale(0.9); }
}

@keyframes floatBlob3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-100px, 100px) scale(0.85); }
  100% { transform: translate(100px, -80px) scale(1.1); }
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Navigation Bar & Header
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.4));
  transition: transform var(--transition-normal);
}

.brand-wrapper:hover .brand-logo {
  transform: rotate(-6deg) scale(1.05);
}

.brand-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--status-info-bg);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
}

.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-glass);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-1px);
}

.btn-outline-danger {
  background: transparent;
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-outline-danger:hover:not(:disabled) {
  background: var(--status-danger-bg);
  border-color: var(--status-danger);
}

.btn-gold {
  background: var(--gradient-gold);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.btn-gold:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Spinner for buttons */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Glassmorphic Cards & Containers
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.glass-card-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ==========================================================================
   Authentication / Login View
   ========================================================================== */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 2rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.75rem 2.25rem;
  border-radius: var(--radius-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header .logo-large {
  width: 68px;
  height: 68px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.5));
  animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4)); }
  100% { transform: scale(1.04); filter: drop-shadow(0 6px 18px rgba(139, 92, 246, 0.6)); }
}

.auth-header h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

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

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input-icon {
  padding-right: 2.75rem;
}

.input-toggle-icon {
  position: absolute;
  right: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

.input-toggle-icon:hover {
  color: var(--text-primary);
}

.form-row-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.demo-credentials-box {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.demo-credentials-box code {
  color: var(--accent-cyan);
  font-weight: 600;
  font-family: monospace;
}

/* ==========================================================================
   Dashboard View & Multi-step Stepper
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem 4rem;
}

/* Stepper Component */
.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}

.stepper-progress-bg {
  position: absolute;
  top: 24px;
  left: 60px;
  right: 60px;
  height: 3px;
  background: var(--border-glass);
  z-index: 1;
}

.stepper-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  min-width: 120px;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-glass);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.step-item.active .step-circle {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  transform: scale(1.1);
}

.step-item.completed .step-circle {
  background: var(--status-success);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.step-item.active .step-label {
  color: var(--text-primary);
}

.step-item.completed .step-label {
  color: var(--status-success);
}

/* Step Views Animation */
.step-content {
  display: none;
  animation: fadeInView 0.35s ease-out forwards;
}

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

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Step 1: Excel Upload & Drag-and-Drop
   ========================================================================== */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.dropzone-container {
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  background: rgba(22, 30, 56, 0.35);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dropzone-container:hover,
.dropzone-container.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 0 0 30px rgba(99, 102, 241, 0.15);
  transform: scale(1.005);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  color: var(--accent-primary);
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.4));
  transition: transform var(--transition-normal);
}

.dropzone-container:hover .dropzone-icon {
  transform: translateY(-4px);
}

.dropzone-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dropzone-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.chip-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.format-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--accent-cyan);
}

/* Upload Top Controls */
.upload-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-card-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.mini-stat-card {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Data Table Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table th {
  background: rgba(14, 20, 36, 0.9);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

[data-theme="light"] .custom-table th {
  background: rgba(241, 245, 249, 0.95);
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: var(--bg-card-hover);
}

.custom-table tr.row-invalid td {
  background: rgba(239, 68, 68, 0.04);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.badge-valid {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-invalid {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-duplicate {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-pending {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-sending {
  background: var(--status-info-bg);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-sent {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-failed {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   Step 2: Certificate Live Preview & Customization
   ========================================================================== */
/* ==========================================================================
   Step 2: Candidate Roster Table & Live Certificate Inspector
   ========================================================================== */
.step2-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.step2-stats-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.step2-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
}

.step2-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.step2-view-tabs {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.step2-view-tab {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.step2-view-tab:hover {
  color: var(--text-primary);
}

.step2-view-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Step 2 Table Card */
.step2-table-card {
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.step2-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.step2-search-input {
  max-width: 320px;
  width: 100%;
}

.step2-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.step2-table th {
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-glass);
  text-align: left;
}

.step2-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.step2-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.step2-table tr.active-preview-row td {
  background: rgba(99, 102, 241, 0.1) !important;
  border-top: 1px solid rgba(99, 102, 241, 0.4);
  border-bottom: 1px solid rgba(99, 102, 241, 0.4);
}

.step2-table tr.active-preview-row td:first-child {
  border-left: 4px solid var(--accent-primary);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.step2-table tr.active-preview-row td:last-child {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

/* Action Buttons inside Step 2 Table */
.btn-pdf-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-pdf-row:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-preview-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-preview-row:hover {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-approve-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-approve-row:hover {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-approve-row.is-approved {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #10b981;
}

.btn-revoke-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-revoke-row:hover {
  background: #f43f5e;
  color: #ffffff;
}

/* Certificate Inspector Stage */
.cert-inspector-card {
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.inspector-nav-bar {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.flash-pulse {
  animation: pulseGlow 0.8s ease-out;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6); }
  50% { box-shadow: 0 0 25px 6px rgba(99, 102, 241, 0.35); }
  100% { box-shadow: none; }
}

/* All Certificates Multi-Gallery View */
.certs-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  align-items: center;
}

.gallery-cert-card {
  width: 100%;
  max-width: 940px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.gallery-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
}

/* ==========================================================================
/* ==========================================================================
   Certificate Template (IIM Indore Official Landscape A4 Layout)
   ========================================================================== */
.certificate-frame-wrap {
  width: 100%;
  max-width: 900px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

/* Printable Certificate Canvas (Standard A4 Landscape) */
.certificate-canvas {
  width: 100%;
  aspect-ratio: 1.414 / 1;
  background: #ffffff;
  color: #1e293b;
  position: relative;
  box-sizing: border-box;
  padding: 32px 36px 28px;
  user-select: none;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* Stepped Magenta Double Border (Matching IIM Indore Reference) */
.cert-iim-border-outer {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 2px solid #db2777;
  pointer-events: none;
}

.cert-iim-border-inner {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  bottom: 18px;
  border: 1.5px solid #be185d;
  pointer-events: none;
}

/* Stepped Corner Brackets */
.cert-corner-step {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.cert-corner-step-tl { top: 12px; left: 12px; border-top: 3.5px solid #db2777; border-left: 3.5px solid #db2777; }
.cert-corner-step-tr { top: 12px; right: 12px; border-top: 3.5px solid #db2777; border-right: 3.5px solid #db2777; }
.cert-corner-step-bl { bottom: 12px; left: 12px; border-bottom: 3.5px solid #db2777; border-left: 3.5px solid #db2777; }
.cert-corner-step-br { bottom: 12px; right: 12px; border-bottom: 3.5px solid #db2777; border-right: 3.5px solid #db2777; }

/* Subtle Diagonal Watermark */
.cert-sample-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-family: 'Inter', sans-serif;
  font-size: 7.5rem;
  font-weight: 900;
  color: rgba(148, 163, 184, 0.14);
  letter-spacing: 0.15em;
  pointer-events: none;
  z-index: 1;
  text-transform: uppercase;
}

/* Top Header Grid (Logo Left, Titles Center, Photo + QR Right) */
.cert-top-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 110px 1fr 100px;
  align-items: start;
  gap: 0.75rem;
  margin-top: 2px;
}

.cert-header-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cert-inst-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.cert-header-center {
  text-align: center;
  padding-top: 4px;
}

.cert-title-hindi {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 1.42rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 2px;
}

.cert-title-english {
  font-family: 'Inter', 'Cinzel', serif;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #1e293b;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cert-header-rule {
  width: 220px;
  height: 1.5px;
  background: #475569;
  margin: 0 auto;
}

.cert-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

/* Candidate Photo Frame */
.cert-photo-frame {
  width: 68px;
  height: 84px;
  border: 1.5px solid #0284c7;
  border-radius: 2px;
  background: #f8fafc;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Scannable QR Code Frame */
.cert-qr-frame {
  width: 68px;
  height: 68px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-qr-frame canvas,
.cert-qr-frame img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

/* ==========================================================================
   Bilingual Certificate Body Content
   ========================================================================== */
.cert-bilingual-body {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 10px 0;
  padding: 0 15px;
}

/* Hindi Section */
.cert-section-hindi {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #1e293b;
  margin-bottom: 12px;
}

.cert-pname-hindi {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0;
}

.cert-prog-hindi {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0;
}

/* English Section */
.cert-section-english {
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #334155;
}

.cert-pname-english {
  font-family: 'Playfair Display', serif;
  font-size: 1.48rem;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0 3px;
  letter-spacing: 0.01em;
}

.cert-prog-english {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0;
}

.cert-highlight {
  font-weight: 700;
  color: #0f172a;
}

/* ==========================================================================
   Three Institutional Signatures
   ========================================================================== */
.cert-signatures-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: flex-end;
  text-align: center;
  padding: 0 10px;
  margin-bottom: 6px;
  gap: 1.5rem;
}

.cert-sig-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cert-sig-script {
  font-family: 'Great Vibes', cursive;
  font-size: 1.7rem;
  color: #1e3a8a;
  line-height: 1;
  min-height: 30px;
  display: flex;
  align-items: flex-end;
}

.cert-sig-divider {
  width: 140px;
  height: 1px;
  background: #64748b;
  margin: 3px 0 5px;
}

.cert-sig-hindi {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
}

.cert-sig-english {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  color: #475569;
  line-height: 1.25;
}

/* Bottom Reg / Credential Bar */
.cert-bottom-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  color: #64748b;
  padding: 0 10px;
  border-top: 1px dashed rgba(219, 39, 119, 0.25);
  padding-top: 3px;
}

/* ==========================================================================
   Admin Approval & Validation Control Panel
   ========================================================================== */
.admin-validation-card {
  padding: 1.15rem 1.4rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.approval-badge-approved {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.approval-badge-pending {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.btn-approve {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-approve:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* ==========================================================================
   Step 3: Dispatch & Live Email Sending Queue
   ========================================================================== */
.dispatch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.quota-banner {
  padding: 1.15rem 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.quota-info-text {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.quota-badge {
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--bg-card);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.progress-section {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.progress-track {
  height: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease-out;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.dispatch-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Summary Cards */
.summary-results-card {
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
}

.summary-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.summary-count-box {
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
}

.summary-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.summary-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.88rem;
  animation: slideToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.toast-hiding {
  animation: slideToastOut 0.25s forwards;
}

@keyframes slideToastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success .toast-icon { color: var(--status-success); }
.toast-error .toast-icon { color: var(--status-danger); }
.toast-warning .toast-icon { color: var(--status-warning); }
.toast-info .toast-icon { color: var(--status-info); }

.toast-body {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.toast-close-btn:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Utilities & Responsiveness
   ========================================================================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--status-success); }
.text-danger { color: var(--status-danger); }
.text-warning { color: var(--status-warning); }
.text-cyan { color: var(--accent-cyan); }
.font-mono { font-family: monospace; }

@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  .main-content {
    padding: 1.25rem 1rem 3rem;
  }
  .stepper-nav {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }
  .stepper-progress-bg {
    display: none;
  }
  .step-item {
    min-width: 90px;
  }
  .upload-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .stats-card-group {
    justify-content: space-between;
  }
  .cert-recipient-name {
    font-size: 2.2rem;
  }
  .cert-title-text {
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   DTAI Launchpad & ARK Lab (Adani-Style) Attribution Branding
   ========================================================================== */
.brand-rocket-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 3px 8px rgba(99, 102, 241, 0.45));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-wrapper:hover .brand-rocket-icon {
  transform: translateY(-3px) scale(1.12) rotate(8deg);
}

.portal-title-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.18rem;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 45%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.launchpad-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Bodhidharma Lab Visionary Attribution Bar */
.bodhidharma-footer-attribution,
.ark-footer-attribution {
  margin-top: auto;
  padding: 1.25rem 1.75rem;
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  z-index: 10;
}

.bodhidharma-footer-badge,
.ark-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: #ffffff;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.28);
  box-shadow: 0 3px 14px rgba(79, 70, 229, 0.12);
  transition: all var(--transition-fast);
  text-decoration: none;
}

[data-theme="dark"] .bodhidharma-footer-badge,
[data-theme="dark"] .ark-footer-badge {
  background: #ffffff;
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.bodhidharma-footer-badge:hover,
.ark-footer-badge:hover {
  transform: translateY(-2px);
  border-color: #8b5cf6;
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.38);
}

.bodhidharma-logo-img,
.ark-logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.bodhidharma-icon-inline {
  height: 20px;
  width: 20px;
  vertical-align: middle;
  display: inline-block;
}

/* ==========================================================================
   Certificate Template Selector Modal
   ========================================================================== */
.template-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.template-selector-btn:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.template-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.template-modal-card {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.template-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1rem;
}

.template-modal-header .btn-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color 0.2s;
}

.template-modal-header .btn-close:hover {
  color: var(--text-primary);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.template-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.template-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.22);
}

.template-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3), 0 8px 24px rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.05);
}

.template-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #ffffff;
  letter-spacing: 0.5px;
}

.template-card-badge.badge-visionary {
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.template-card-badge.badge-gold {
  background: linear-gradient(135deg, #b45309, #d97706);
}

.template-thumb {
  height: 110px;
  border-radius: 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  overflow: hidden;
}

.thumb-iim {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.thumb-iim .thumb-inner-border {
  position: absolute;
  inset: 6px;
  border: 1.5px solid #db2777;
  pointer-events: none;
}

.thumb-visionary {
  background: linear-gradient(135deg, #090d16, #0f172a 60%, #1e1b4b);
  color: #ffffff;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.thumb-visionary .thumb-inner-border {
  position: absolute;
  inset: 6px;
  border: 1.5px solid #6366f1;
  box-shadow: inset 0 0 8px rgba(99, 102, 241, 0.5);
  pointer-events: none;
}

.thumb-gold {
  background: #fdfaf3;
  color: #1e293b;
  border: 1px solid #e5d8b8;
}

.thumb-gold .thumb-inner-border {
  position: absolute;
  inset: 6px;
  border: 1.5px solid #d97706;
  pointer-events: none;
}

.thumb-header-text {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.thumb-sub-text {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-top: 3px;
}

.template-card-body h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.template-card-body p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.template-modal-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
}

/* ==========================================================================
   Certificate Template Dynamic Themes
   ========================================================================== */

/* Template 2: Boddhidharma Visionary Tech Theme */
.certificate-canvas[data-template="bodhidharma-visionary"] {
  background: linear-gradient(135deg, #090d16 0%, #0f172a 45%, #18182b 100%) !important;
  color: #f1f5f9 !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-iim-border-outer {
  border-color: #6366f1 !important;
  box-shadow: inset 0 0 25px rgba(99, 102, 241, 0.25), 0 0 15px rgba(99, 102, 241, 0.3) !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-iim-border-inner {
  border-color: #06b6d4 !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-corner-step {
  border-color: #a855f7 !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-title-hindi,
.certificate-canvas[data-template="bodhidharma-visionary"] .cert-pname-hindi,
.certificate-canvas[data-template="bodhidharma-visionary"] .cert-prog-hindi,
.certificate-canvas[data-template="bodhidharma-visionary"] .cert-pname-english {
  color: #ffffff !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-title-english {
  color: #38bdf8 !important;
  letter-spacing: 0.12em !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-section-english,
.certificate-canvas[data-template="bodhidharma-visionary"] .cert-section-hindi {
  color: #cbd5e1 !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-highlight {
  color: #22d3ee !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-sig-script {
  color: #c084fc !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-sig-english,
.certificate-canvas[data-template="bodhidharma-visionary"] .cert-sig-hindi {
  color: #94a3b8 !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-sig-divider {
  background: rgba(148, 163, 184, 0.4) !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-bottom-bar {
  color: #94a3b8 !important;
  border-top-color: rgba(99, 102, 241, 0.3) !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-header-rule {
  background: linear-gradient(90deg, transparent, #818cf8, transparent) !important;
}

.certificate-canvas[data-template="bodhidharma-visionary"] .cert-sample-watermark {
  color: rgba(139, 92, 246, 0.1) !important;
}

/* Template 3: Imperial Gold Crest Theme */
.certificate-canvas[data-template="executive-gold"] {
  background: radial-gradient(ellipse at center, #ffffff 0%, #fefcf8 60%, #f5efe1 100%) !important;
  color: #1e293b !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-iim-border-outer {
  border: 3px solid #b45309 !important;
  box-shadow: inset 0 0 12px rgba(180, 83, 9, 0.15) !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-iim-border-inner {
  border: 1px solid #d97706 !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-corner-step {
  border-color: #d97706 !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-title-hindi,
.certificate-canvas[data-template="executive-gold"] .cert-pname-hindi {
  color: #78350f !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-title-english {
  color: #92400e !important;
  font-family: 'Cinzel', serif !important;
  letter-spacing: 0.14em !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-pname-english {
  color: #0f172a !important;
  font-family: 'Playfair Display', serif !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-prog-english,
.certificate-canvas[data-template="executive-gold"] .cert-prog-hindi {
  color: #451a03 !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-highlight {
  color: #b45309 !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-sig-script {
  color: #1e3a8a !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-header-rule {
  background: linear-gradient(90deg, transparent, #d97706, transparent) !important;
}

.certificate-canvas[data-template="executive-gold"] .cert-sample-watermark {
  color: rgba(180, 83, 9, 0.08) !important;
}

/* ==========================================================================
   Mobile Browser Responsiveness & Touch Optimization
   ========================================================================== */

/* Inspector search input */
.inspector-search-container {
  min-width: 200px;
  flex: 1 1 auto;
}

.mobile-scale-btn {
  display: none;
}

@media (max-width: 900px) {
  .mobile-scale-btn {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  /* Navbar */
  .navbar {
    padding: 0.65rem 0.85rem !important;
    gap: 0.5rem !important;
  }

  .brand-wrapper {
    gap: 0.5rem !important;
  }

  .brand-rocket-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .portal-title-text {
    font-size: 1.05rem !important;
  }

  .launchpad-badge {
    font-size: 0.6rem !important;
    padding: 0.1rem 0.4rem !important;
  }

  .user-profile-badge {
    display: none !important;
  }

  .template-btn-label strong {
    max-width: 90px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }

  /* Stepper Navigation */
  .stepper-nav {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0.5rem 0.25rem !important;
    gap: 0.5rem !important;
    justify-content: flex-start !important;
    scrollbar-width: none !important;
  }

  .stepper-nav::-webkit-scrollbar {
    display: none;
  }

  .stepper-progress-bg {
    display: none !important;
  }

  .step-item {
    flex: 0 0 auto !important;
    min-width: auto !important;
    padding: 0.45rem 0.75rem !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-full) !important;
    gap: 0.4rem !important;
  }

  .step-number {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.75rem !important;
  }

  .step-label {
    font-size: 0.78rem !important;
    white-space: nowrap !important;
  }

  /* Step 1 Dropzone & Stats */
  .dropzone-container {
    padding: 1.5rem 1rem !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }

  .stat-card {
    padding: 0.75rem !important;
  }

  .stat-number {
    font-size: 1.4rem !important;
  }

  /* Step 2 Toolbar & Header */
  .step2-header-card {
    padding: 1rem !important;
  }

  .step2-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
  }

  .step2-view-tabs {
    width: 100% !important;
    display: flex !important;
  }

  .step2-view-tab {
    flex: 1 1 50% !important;
    justify-content: center !important;
    padding: 0.6rem !important;
  }

  .step2-toolbar .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 42px !important;
  }

  /* Inspector Nav Bar */
  .inspector-nav-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .inspector-search-container {
    width: 100% !important;
  }

  .inspector-search-container input {
    width: 100% !important;
  }

  /* Certificate Frame on Mobile */
  .cert-inspector-card {
    padding: 1rem 0.5rem !important;
  }

  .cert-preview-stage-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0.5rem 0 !important;
  }

  .certificate-frame-wrap {
    min-width: 680px;
    margin: 0 auto;
    transition: all 0.3s ease;
  }

  /* Fit to mobile screen class */
  .certificate-frame-wrap.mobile-cert-fit {
    min-width: 100% !important;
    width: 100% !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .certificate-canvas {
    padding: 18px 16px 14px !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-title-hindi {
    font-size: 0.95rem !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-title-english {
    font-size: 0.75rem !important;
    margin-bottom: 2px !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-header-left .cert-inst-logo {
    width: 38px !important;
    height: 38px !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-photo-frame {
    width: 44px !important;
    height: 54px !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-qr-frame {
    width: 44px !important;
    height: 44px !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-section-hindi,
  .certificate-frame-wrap.mobile-cert-fit .cert-section-english {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-pname-english {
    font-size: 1.1rem !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-pname-hindi {
    font-size: 0.85rem !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-prog-english,
  .certificate-frame-wrap.mobile-cert-fit .cert-prog-hindi {
    font-size: 0.76rem !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-sig-script {
    font-size: 0.9rem !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-sig-hindi,
  .certificate-frame-wrap.mobile-cert-fit .cert-sig-english {
    font-size: 0.6rem !important;
  }

  .certificate-frame-wrap.mobile-cert-fit .cert-bottom-bar {
    font-size: 0.65rem !important;
  }

  /* Touch buttons */
  .btn {
    min-height: 42px;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .portal-title-text {
    font-size: 0.95rem !important;
  }

  .template-selector-btn .template-btn-label strong {
    max-width: 65px;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .bodhidharma-footer-attribution {
    padding: 0.85rem !important;
    font-size: 0.78rem !important;
  }
}



