/* ==========================================================================
   CSS STYLESHEET - SISTEM PENERIMAAN MURID BARU (SPMB) SMP
   Aesthetic: Modern, Professional, Responsive, Mobile-First, Premium
   ========================================================================== */



:root {
  /* Color Palette - Vibrant Indigo/Teal Modern Theme */
  --primary-color: #0f172a;      /* Deep Slate */
  --primary-light: #4f46e5;      /* Vibrant Indigo */
  --primary-ultra-light: rgba(79, 70, 229, 0.1);
  --secondary-color: #0d9488;    /* Deep Teal */
  --secondary-light: #14b8a6;    /* Vibrant Teal */
  --success-color: #10b981;      
  --success-light: rgba(16, 185, 129, 0.1);
  --error-color: #ef4444;        
  --error-light: rgba(239, 68, 68, 0.1);
  --dark-text: #1e293b;          
  --medium-text: #475569;        
  --light-text: #94a3b8;         
  
  /* Modern Gradients & Backgrounds */
  --bg-gradient: linear-gradient(-45deg, #f0f9ff, #e0e7ff, #c7d2fe, #ccfbf1);
  --bg-gradient-size: 400% 400%;
  --card-bg: rgba(255, 255, 255, 0.65);
  --border-color: rgba(255, 255, 255, 0.5);
  --border-focus: #4f46e5;
  
  /* Layout & Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-lg: 0 20px 25px -5px rgba(79, 70, 229, 0.1), 0 10px 10px -5px rgba(79, 70, 229, 0.04);
  --shadow-premium: 0 25px 50px -12px rgba(79, 70, 229, 0.15);
  --border-radius-sm: 12px;
  --border-radius-md: 20px;
  --border-radius-lg: 30px;
  
  /* Font Families */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Transitions */
  --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

@keyframes floatAnim {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* ==========================================================================
   1. RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-size: var(--bg-gradient-size);
  animation: gradientBG 15s ease infinite;
  background-attachment: fixed;
  color: var(--dark-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

/* Container Utility */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
}

/* ==========================================================================
   2. LAYOUT & SIDEBAR (MOBILE-FIRST)
   ========================================================================== */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Sidebar Hidden on Mobile Default */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: linear-gradient(135deg, #10b981 0%, #fbbf24 100%);
  color: #fff;
  z-index: 1000;
  transition: left var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.sidebar.active {
  left: 0;
}

.sidebar-brand {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.sidebar-logo-icon svg {
  width: 36px;
  height: 36px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-school-name {
  font-weight: 800;
  font-size: 1.1rem;
  font-family: var(--font-heading);
}

.sidebar-school-tagline {
  font-size: 0.7rem;
  opacity: 0.8;
}

.sidebar-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 0 20px;
}

#nav-menu {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.sidebar-nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.6;
  margin: 10px 0 5px 10px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
  font-weight: 500;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: #fff;
}

.sidebar-footer {
  padding: 20px;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

/* Mobile Topbar */
.topbar {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: var(--shadow-sm);
}

.hamburger {
  background: transparent;
  border: none;
  width: 24px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  margin-right: 15px;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--dark-text);
  border-radius: 2px;
}

.topbar-title {
  font-weight: 700;
  color: var(--dark-text);
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

/* Backdrop Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 999;
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   3. SECTIONS & LAYOUT SYSTEM
   ========================================================================== */
main {
  flex-grow: 1;
  position: relative;
}

section {
  display: none; /* Controlled by SPA Router */
  padding: 2.5rem 0;
  animation: fadeIn var(--transition-normal) forwards;
}

section.active {
  display: block;
}

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

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background-color: var(--secondary-light);
  border-radius: 2px;
}

.section-title p {
  color: var(--medium-text);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 12px auto 0 auto;
}

/* Cards & Layout Elements */
.card {
  background-color: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-premium);
  border-color: rgba(255, 255, 255, 0.9);
}

/* Button UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.8rem 1.6rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  font-size: 0.95rem;
  width: 100%; /* Mobile full width */
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light) 0%, #3730a3 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background-color: var(--secondary-light);
  color: white;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}

.btn-secondary:hover {
  background-color: var(--secondary-color);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-light);
  border: 1px solid var(--primary-light);
}

.btn-outline:hover {
  background-color: var(--primary-ultra-light);
}

.btn-disabled {
  background-color: var(--border-color);
  color: var(--light-text);
  cursor: not-allowed;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
}

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

.badge-warning {
  background-color: #fffbeb;
  color: #d97706;
}

/* ==========================================================================
   4. TAB 1: BERANDA (HOME)
   ========================================================================== */
.hero {
  text-align: center;
  padding: 4rem 1.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(79, 70, 229, 0.8) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border-radius: var(--border-radius-lg);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: floatAnim 6s ease-in-out infinite;
}

.hero h2 {
  color: white;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 15px;
  line-height: 1.1;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 25px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.hero-buttons .btn-secondary {
  animation: pulseGlow 2s infinite;
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--secondary-color) 100%);
  border: none;
}

/* Info Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  background-color: var(--primary-ultra-light);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 26px;
  height: 26px;
  fill: var(--primary-light);
}

.stat-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-info p {
  color: var(--medium-text);
  font-size: 0.85rem;
}

/* Alur PPDB (Process flow) */
.flow-container {
  position: relative;
  padding-left: 36px;
  margin-top: 1.5rem;
}

.flow-container::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 5px;
  width: 2px;
  height: calc(100% - 25px);
  background: linear-gradient(to bottom, var(--primary-light), var(--secondary-light));
  opacity: 0.5;
}

.flow-step {
  position: relative;
  margin-bottom: 2rem;
}

.flow-number {
  position: absolute;
  left: -36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--primary-light);
  transition: transform var(--transition-fast);
}

.flow-step:hover .flow-number {
  transform: scale(1.2);
}

.flow-content h4 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.flow-content p {
  color: var(--medium-text);
  font-size: 0.85rem;
}

/* Jadwal Pendaftaran */
.schedule-list {
  margin-top: 1rem;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.schedule-item:last-child {
  border-bottom: none;
}

.schedule-date {
  font-weight: 600;
  color: var(--primary-light);
  font-size: 0.85rem;
  text-align: right;
  min-width: 110px;
}

/* ==========================================================================
   5. TAB 2: FORMULIR PENDAFTARAN (MULTI-STEP WIZARD)
   ========================================================================== */
/* Progress Bar Form */
.form-progress {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 0 auto 2.5rem auto;
  max-width: 720px;
}

.form-progress::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #e2e8f0;
  z-index: 1;
}

.progress-line {
  position: absolute;
  top: 17px;
  left: 0;
  width: 0%; /* Dynamic control */
  height: 3px;
  background-color: var(--primary-light);
  z-index: 1;
  transition: width var(--transition-normal);
}

.progress-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 3px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--light-text);
  transition: all var(--transition-normal);
}

.progress-step.active .step-dot {
  border-color: var(--primary-light);
  background-color: var(--primary-ultra-light);
  color: var(--primary-light);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.progress-step.completed .step-dot {
  border-color: var(--success-color);
  background-color: var(--success-color);
  color: white;
}

.progress-step.active .step-label {
  color: var(--primary-light);
}

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

.step-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--light-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  transition: color var(--transition-normal);
}

/* Form Container & Step Transitions */
.form-step-content {
  display: none;
}

.form-step-content.active {
  display: block;
  animation: fadeIn var(--transition-normal) forwards;
}

/* Form Grid & Input Fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-bottom: 2px;
  display: inline-block;
}

.form-group label span.required {
  color: var(--error-color);
  margin-left: 2px;
}

.form-control {
  padding: 0.75rem 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  outline: none;
  background-color: #f8fafc;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--dark-text);
  font-size: 0.95rem;
}

.form-control:hover {
  border-color: #94a3b8;
}

.form-control:focus {
  border-color: var(--primary-light);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.form-control.error {
  border-color: var(--error-color);
  background-color: var(--error-light);
}

.form-error-msg {
  font-size: 0.75rem;
  color: var(--error-color);
  margin-top: 2px;
  font-weight: 500;
  display: none; /* JS toggles */
}

/* Select Styling Wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--medium-text);
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Form Navigation Buttons */
.form-buttons {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.form-buttons .btn {
  width: auto;
  flex: 1;
}

/* Custom File Upload Button style */
.file-upload-container {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background-color: #fafbfc;
  transition: var(--transition-fast);
}

.file-upload-container:hover {
  border-color: var(--primary-light);
  background-color: var(--primary-ultra-light);
}

.file-upload-container svg {
  width: 36px;
  height: 36px;
  fill: var(--light-text);
  margin-bottom: 8px;
}

.file-upload-container input[type="file"] {
  display: none;
}

.file-upload-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--medium-text);
}

.file-upload-preview {
  font-size: 0.8rem;
  color: var(--primary-light);
  margin-top: 8px;
  word-break: break-all;
  display: none;
}

.review-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 1rem;
}

.review-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.65);
}

.review-item span:first-child {
  font-size: 0.8rem;
  color: var(--medium-text);
  font-weight: 600;
}

.review-item span:last-child {
  font-size: 0.85rem;
  color: var(--dark-text);
  font-weight: 600;
  text-align: right;
}

/* ==========================================================================
   6. TAB 3: STATUS PENDAFTARAN & BUKTI DAFTAR
   ========================================================================== */
.search-container {
  max-width: 500px;
  margin: 0 auto 2rem auto;
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box .form-control {
  flex-grow: 1;
}

.search-box .btn {
  width: auto;
}

/* Status Result Dashboard */
.status-result-card {
  display: none; /* Dynamic visibility */
  animation: fadeIn var(--transition-normal) forwards;
}

.result-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.result-header h3 {
  font-size: 1.3rem;
}

.result-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--light-text);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.detail-value {
  font-weight: 600;
  color: var(--dark-text);
}

/* Printable Bukti Pendaftaran - PREMIUM REDESIGN */
/* Printable Bukti Pendaftaran - PREMIUM REDESIGN */
.bukti-cetak-wrapper {
  background-color: #ffffff;
  border: none;
  outline: none;
  border-radius: 4px;
  padding: 35px 40px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 680px;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  color: #1e293b;
}

/* Watermark */
.bukti-cetak-wrapper::before {
  content: 'OFFICIAL PPDB';
  position: absolute;
  font-size: 6rem;
  font-weight: 800;
  color: rgba(30, 58, 138, 0.03);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 2px;
}

.bukti-header {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 16px;
  margin-bottom: 24px;
  position: relative;
}

/* Subtle gold line accent under header */
.bukti-header::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #d97706;
}

.bukti-header-logo {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bukti-header-logo img, .bukti-header-logo svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  fill: #1e3a8a;
}

.bukti-school-info {
  flex: 1;
}

.bukti-school-info h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #d97706;
  font-weight: 600;
  margin: 0 0 4px 0;
  letter-spacing: 1.5px;
}

.bukti-school-info h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1e3a8a;
  margin: 0 0 6px 0;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.bukti-school-info p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.bukti-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 25px;
  color: #1e3a8a;
  background-color: #f1f5f9;
  padding: 8px 12px;
  border-radius: 4px;
  letter-spacing: 1px;
  border-left: 4px solid #d97706;
}

.bukti-content-grid {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.bukti-photo-box {
  width: 120px;
  height: 160px;
  border: 2px dashed #cbd5e1;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  flex-shrink: 0;
  border-radius: 6px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.bukti-photo-box::before {
  content: '\f290'; /* Camera representation / placeholder icon if styled */
  font-family: 'Phosphor';
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
}

.bukti-data-table {
  flex: 1;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.bukti-data-table td {
  padding: 10px 8px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.bukti-data-table tr:last-child td {
  border-bottom: none;
}

.bukti-data-table td.label-td {
  width: 38%;
  color: #64748b;
  font-weight: 500;
}

.bukti-data-table td.colon-td {
  width: 4%;
  color: #64748b;
  text-align: center;
}

.bukti-data-table td.value-td {
  width: 58%;
  font-weight: 600;
  color: #1e293b;
}

.bukti-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.85rem;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.bukti-barcode {
  border: 1px solid #e2e8f0;
  padding: 6px;
  background-color: white;
  width: 85px;
  height: 85px;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.bukti-barcode svg {
  width: 100%;
  height: 100%;
}

.bukti-signature {
  text-align: right;
  min-width: 200px;
}

.bukti-signature p {
  color: #475569;
  margin: 0 0 50px 0;
  line-height: 1.5;
}

.bukti-signature span {
  font-weight: 700;
  color: #0f172a;
  text-decoration: underline;
  font-size: 0.95rem;
  display: block;
}

.bukti-signature .nip {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
  text-decoration: none;
  font-weight: normal;
  display: block;
}

.result-not-found {
  text-align: center;
  padding: 2rem;
  display: none;
}

.result-not-found svg {
  width: 50px;
  height: 50px;
  fill: var(--light-text);
  margin-bottom: 10px;
}

/* ==========================================================================
   7. TAB 4: HUBUNGI KAMI & FAQ ACCORDION
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.contact-info-item {
  display: flex;
  gap: 12px;
}

.contact-info-icon {
  background-color: var(--primary-ultra-light);
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--primary-light);
}

.contact-info-content h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.contact-info-content p {
  font-size: 0.85rem;
  color: var(--medium-text);
}

/* Map Mockup iframe container */
.map-container {
  width: 100%;
  height: 180px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin-top: 1.25rem;
  border: 1px solid var(--border-color);
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1.25rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background-color: var(--card-bg);
}

.faq-question {
  width: 100%;
  padding: 1rem;
  background: none;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-color);
  cursor: pointer;
  outline: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  background-color: #fafbfc;
  transition: max-height var(--transition-normal), padding var(--transition-normal);
  font-size: 0.85rem;
  color: var(--medium-text);
  border-top: 1px solid transparent;
}

.faq-item.active .faq-answer {
  max-height: 200px;
  padding: 1rem;
  border-top-color: var(--border-color);
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
footer {
  background-color: var(--primary-color);
  color: white;
  padding: 2rem 0;
  margin-top: auto;
  border-top: 4px solid var(--secondary-light);
  font-size: 0.85rem;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-school-brand h3 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.footer-school-brand p {
  opacity: 0.7;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links h4 {
  color: var(--secondary-light);
  font-size: 0.95rem;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.footer-links a {
  opacity: 0.8;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--secondary-light);
  padding-left: 4px;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1.5rem;
  opacity: 0.6;
}

/* ==========================================================================
   9. MEDIA QUERIES (TABLET & DESKTOP)
   ========================================================================== */

/* Tablet & Desktop Layouts (768px and up) */
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
  
  .form-header {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 24px;
  }

  .form-header-content {
    text-align: left;
  }

  .form-header-content h4 {
    font-size: 1rem;
  }

  .form-header-content h3 {
    font-size: 1.6rem;
    letter-spacing: 1px;
  }

  .form-header-content p.school-year {
    font-size: 0.9rem;
  }

  .form-header-content p.school-addr {
    font-size: 0.8rem;
  }
  
  .form-header-logo {
    width: 100px;
    height: 100px;
    padding: 12px;
    border-radius: 12px;
  }
  
  .container {
    max-width: 720px;
  }
  
  /* Sidebar on Desktop */
  .topbar {
    display: none;
  }
  
  .sidebar {
    left: 0; /* Always visible */
    position: sticky;
    top: 0;
    box-shadow: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Remove overlay on desktop */
  .nav-overlay {
    display: none !important;
  }
  
  /* Reset container centering since flex wrapper handles layout */
  .container {
    margin: 0 auto;
  }

  /* Hero */
  .hero {
    padding: 4rem 2rem;
  }

  .hero h2 {
    font-size: 2.8rem;
  }

  .hero-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 15px;
  }

  .hero-buttons .btn {
    width: auto;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Form & Grid */
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn {
    width: auto;
  }

  /* Status Result and Bukti */
  .result-header {
    flex-direction: row;
    align-items: center;
  }

  .result-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bukti-cetak-wrapper {
    padding: 2.5rem;
  }

  .bukti-title {
    font-size: 1.3rem;
  }

  .bukti-data-table {
    font-size: 0.95rem;
  }

  /* Contacts & Footer */
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-container {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Large Desktop (1024px and up) */
@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }

  .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .form-grid .form-group.dob-group {
    grid-column: span 1;
  }
}

/* Admin Table styling */
#admin-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.75rem;
}

#admin-table tbody tr {
  transition: background-color var(--transition-fast);
}

#admin-table tbody tr:hover {
  background-color: #f8fafc;
}

#admin-table tbody td {
  padding: 14px 15px;
  vertical-align: middle;
}

.admin-action-btns button {
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* ==========================================================================
   10. PRINT MEDIA STYLES (@media print)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: white !important;
    display: block !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
  
  /* Hide the main layout wrapper and modals to isolate the print container */
  .layout-wrapper {
    display: none !important;
  }
  
  .admin-modal:not(#admin-form-preview-modal) {
    display: none !important;
  }
  
  /* Ensure print temp containers are visible and styled properly to fit A4 */
  #print-temp-container,
  .bukti-cetak-wrapper,
  #print-card-content,
  .html2pdf-clone {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 680px !important;
    margin: 0 auto !important;
    z-index: 9999999 !important;
    background-color: #ffffff !important;
    box-sizing: border-box !important;
  }

  /* Support direct print of preview modal when open */
  body.modal-preview-open #admin-form-preview-modal {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    z-index: 9999999 !important;
    background: #ffffff !important;
  }
  
  body.modal-preview-open #admin-form-preview-modal .admin-modal-backdrop,
  body.modal-preview-open #admin-form-preview-modal .admin-modal-header,
  body.modal-preview-open #admin-form-preview-modal .admin-modal-footer {
    display: none !important;
  }
  
  body.modal-preview-open #admin-form-preview-modal .admin-modal-content,
  body.modal-preview-open #admin-form-preview-modal .admin-modal-body {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    display: block !important;
    overflow: visible !important;
  }


  /* Adjust styles for grey/black and white printing */
  :root {
    --primary-color: #000000 !important;
    --medium-text: #333333 !important;
    --dark-text: #000000 !important;
  }
  .bukti-title { color: #000 !important; }
  .bukti-header { border-bottom: 2px solid #000 !important; }
  .bukti-header-logo svg { fill: #000 !important; }
  .bukti-barcode { border: 1px solid #000 !important; }
.digit-box { border: 1px solid #000 !important; width: 12px; height: 18px; display: inline-block; text-align: center; line-height: 18px; }
.print-line-field, .print-line-inline { border-bottom: 1px dotted #000 !important; }
  /* Additional print helpers */
  .digit-box-wrapper .digit-box { border: 1px solid #000 !important; }
  .print-line-field, .print-line-inline { display: block !important; }
  body.modal-preview-open #admin-form-preview-modal { overflow: visible !important; }
}

/* ==========================================================================
   11. ADMIN MODE OVERRIDES & MAP STYLES
   ========================================================================== */
/* Sidebar Admin */
body.admin-mode .sidebar {
  background: linear-gradient(135deg, #10b981 0%, #fbbf24 100%) !important;
  color: #fff !important;
}
body.admin-mode .sidebar .nav-link:hover, 
body.admin-mode .sidebar .nav-link.active {
  background-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
body.admin-mode .sidebar-brand {
  border-bottom: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 10px;
}
body.admin-mode .sidebar-nav-label {
  color: rgba(255,255,255,0.9);
}

/* Dashboard Stats Cards Admin */
body.admin-mode .stats-grid .stat-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 100%);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.admin-mode .stats-grid .stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.25);
}
body.admin-mode .stat-info h3 {
  background: linear-gradient(90deg, #10b981, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.admin-mode .stat-icon {
  background-color: rgba(16, 185, 129, 0.1);
}
body.admin-mode .stat-icon svg, body.admin-mode .stat-icon i {
  color: #10b981;
}

/* Map Container */
#map-container {
  height: 300px;
  width: 100%;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  margin-top: 10px;
  z-index: 1; /* Keep leaflet under other overlays */
}

/* Admin Modal Styles */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.admin-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.admin-modal-content {
  position: relative;
  background-color: #ffffff;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-premium);
  border: 1px solid rgba(255, 255, 255, 0.7);
  max-width: 600px;
  width: 90%;
  z-index: 2001;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(241, 245, 249, 1);
}

.admin-modal-header h3 {
  font-size: 1.15rem;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--light-text);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--error-color);
}

.admin-modal-body {
  padding: 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
}

.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(241, 245, 249, 1);
  background-color: #f8fafc;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   12. FORMULIR PENDAFTARAN OFFLINE & PRINT STYLES (MODERN GRID DESIGN)
   ========================================================================== */
.printable-form-sheet {
  background-color: #ffffff;
  width: 100%;
  max-width: 816px; /* Legal size width (8.5 inches) at 96 DPI */
  margin: 0 auto;
  padding: 10mm 15mm;
  color: #000000;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  line-height: 1.4;
}

.form-print-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  margin-bottom: 4px;
}

.print-form-code-box {
  border: 2px solid #000000;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 10pt;
  line-height: 1;
  text-align: center;
}

.form-print-divider {
  border-bottom: 3px double #000000;
  margin-bottom: 8px;
  width: 100%;
}

.form-print-logo {
  width: 50px !important;
  height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

.form-print-logo img {
  width: 50px !important;
  height: 50px !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

.form-print-logo svg {
  width: 50px !important;
  height: 50px !important;
  max-width: 100% !important;
  max-height: 100% !important;
  fill: #000000 !important;
}

.form-print-school-info {
  text-align: center;
  flex-grow: 1;
}

.form-print-school-info h4 {
  font-size: 9.5pt;
  margin: 0;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.3px;
}

.form-print-school-info h3 {
  font-size: 12pt;
  margin: 1px 0;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.3px;
}

.form-print-school-info .school-year {
  font-size: 9pt;
  font-weight: 700;
  margin: 0;
  color: #000000;
}

.form-print-school-info .school-addr {
  font-size: 7pt;
  margin: 2px 0 0 0;
  color: #333333;
  font-weight: 500;
}

.form-print-title {
  text-align: center;
  font-size: 11pt;
  font-weight: 800;
  text-transform: uppercase;
  margin: 10px 0;
  color: #000000;
  letter-spacing: 0.5px;
  text-decoration: underline;
}

.form-print-meta-box {
  display: flex;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  margin-bottom: 12px;
  font-size: 8pt;
  border-radius: 4px;
}

.form-print-meta-box .meta-item {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.meta-label {
  font-size: 6.5pt;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1px;
}

.meta-value {
  font-weight: 700;
  font-size: 8.5pt;
  color: #0f172a;
}

.form-print-section {
  margin-bottom: 10px;
}

.form-print-section-title {
  font-size: 8.5pt;
  font-weight: 700;
  border-left: 3px solid #1e3a8a;
  padding-left: 8px;
  margin-bottom: 6px;
  color: #1e3a8a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Kemdikbud table styling */
.form-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  border: 1px solid #000000 !important;
  table-layout: fixed;
}

.form-print-table td {
  padding: 5px 8px;
  vertical-align: middle;
  font-size: 8pt;
  border: 1px solid #000000 !important;
  color: #000000;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.form-print-table td.field-label {
  font-weight: 600;
  background-color: #f8fafc;
  width: 32%;
}

.form-print-table td.field-value {
  font-weight: 700;
  background-color: #ffffff;
}

/* Empty text fields handwriting guide */
.print-line-field {
  border-bottom: 1px dotted #000000;
  display: block;
  width: 100%;
  height: 18px;
  margin-top: 1px;
}

.print-line-inline {
  border-bottom: 1px dotted #000000;
  display: inline-block;
  height: 14px;
  vertical-align: bottom;
}

.checkbox-option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8pt;
  cursor: default;
}

.checkbox-box {
  width: 11px;
  height: 11px;
  border: 1px solid #000000;
  border-radius: 2px;
  display: inline-block;
  position: relative;
  background-color: #ffffff;
  flex-shrink: 0;
}

.checkbox-box.checked::after {
  content: '✓';
  font-size: 9px;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.digit-box-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  padding-top: 1px;
}

.digit-box {
  width: 16px;
  height: 17px;
  border: 1px solid #000000;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5pt;
  font-weight: 700;
  font-family: monospace;
  background-color: #ffffff;
  text-align: center;
}

/* Pathways display */
.print-form-pathways {
  border: 1px solid #000000;
  background-color: #ffffff;
  padding: 6px 10px;
  font-size: 8pt;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pathway-detail-row {
  padding: 3px 0;
}

/* Footer layout inside print form */
.form-print-footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 15px;
  margin-top: 5px;
}

.form-print-berkas-table {
  width: 48%;
  border-collapse: collapse;
  border: 1px solid #000000;
  font-size: 7.5pt;
}

.form-print-berkas-table th {
  border: 1px solid #000000;
  padding: 4px;
  font-weight: 700;
  background-color: #f1f5f9;
  text-align: center;
}

.form-print-berkas-table td {
  border: 1px solid #000000;
  padding: 4px;
  vertical-align: middle;
  text-align: center;
}

.form-print-berkas-table td:nth-child(2) {
  text-align: left;
}

.form-print-photo-box {
  width: 66px;
  height: 88px;
  border: 1px dashed #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 6pt;
  color: #333333;
  font-weight: 700;
  line-height: 1.2;
  background-color: #fafafa;
  flex-shrink: 0;
  margin: 0 5px;
}

.form-print-signatures {
  display: flex;
  width: 45%;
  font-size: 7.5pt;
  justify-content: space-between;
}

.sig-col {
  width: 48%;
  display: flex;
  flex-direction: column;
}

.sig-title {
  margin: 0;
  font-weight: bold;
}

.sig-role {
  margin: 0;
}

.sig-space {
  height: 35px;
}

.sig-name {
  margin: 0;
}

.form-print-statement {
  font-size: 7pt;
  margin-top: 6px;
  text-align: justify;
  line-height: 1.3;
  color: #475569;
  border-top: 1px solid #e2e8f0;
  padding-top: 4px;
}

/* Styling for screen-mode PDF generation state */
body.html2pdf-printing #printable-form-sheet {
  width: 800px !important;
  max-width: none !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  background: #ffffff !important;
  z-index: 9999999 !important;
  padding: 4mm 8mm !important;
  box-sizing: border-box !important;
}

body.html2pdf-printing #print-card-content {
  width: 680px !important;
  max-width: none !important;
  box-sizing: border-box !important;
  padding: 20px !important;
  border: none !important;
}

body.html2pdf-printing .admin-modal,
body.html2pdf-printing .admin-modal-content,
body.html2pdf-printing .admin-modal-body {
  position: static !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  width: 100% !important;
  max-width: none !important;
  display: block !important;
  transform: none !important;
}

body.html2pdf-printing .layout-wrapper,
body.html2pdf-printing .admin-modal-backdrop,
body.html2pdf-printing .admin-modal-header,
body.html2pdf-printing .admin-modal-footer {
  display: none !important;
}

@media print {
  /* When print preview modal is open, we hide all other page content except the PDF clone or the modal */
  body.modal-preview-open > *:not(#admin-form-preview-modal):not(.html2pdf-clone) {
    display: none !important;
  }
  
  .html2pdf-clone {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  body.modal-preview-open #admin-form-preview-modal {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    z-index: 9999999 !important;
  }
  body.modal-preview-open #admin-form-preview-modal .admin-modal-backdrop,
  body.modal-preview-open #admin-form-preview-modal .admin-modal-header,
  body.modal-preview-open #admin-form-preview-modal .admin-modal-footer {
    display: none !important;
  }
  body.modal-preview-open #admin-form-preview-modal .admin-modal-content,
  body.modal-preview-open #admin-form-preview-modal .admin-modal-body {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    display: block !important;
    overflow: visible !important;
  }


  body.print-window-body {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Optimized styling for the printable form sheet to prevent spilling over to page 2 */
  .printable-form-sheet {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 2mm 5mm !important; /* Reduced padding to fit perfectly on a single page */
    margin: 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 7.5pt !important;
    line-height: 1.3 !important;
  }
  
  .form-print-header {
    margin-bottom: 6px !important;
    padding-bottom: 4px !important;
  }
  
  .form-print-title {
    margin: 6px 0 !important;
    font-size: 10.5pt !important;
  }
  
  .form-print-meta-box {
    margin-bottom: 8px !important;
    padding: 4px 10px !important;
  }
  
  .form-print-section {
    margin-bottom: 5px !important;
  }
  
  .form-print-section-title {
    font-size: 7.5pt !important;
    margin-bottom: 3px !important;
    border-left: 3px solid #1e3a8a !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  .form-print-table {
    margin-bottom: 6px !important;
    border: 1px solid #000000 !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
  }

  .form-print-table td {
    padding: 3px 6px !important;
    font-size: 7.5pt !important;
    border: 1px solid #000000 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  .form-print-table td.field-label {
    width: 32% !important;
    background-color: #f8fafc !important;
  }

  .form-print-berkas-table {
    border: 1px solid #000000 !important;
    border-collapse: collapse !important;
  }

  .form-print-berkas-table th, 
  .form-print-berkas-table td {
    padding: 2px 4px !important;
    border: 1px solid #000000 !important;
  }

  .form-print-berkas-table th {
    background-color: #f1f5f9 !important;
  }
  
  .form-print-photo-box {
    height: 72px !important; /* Compact photo box to fit on A4 */
    width: 54px !important;
    border: 1px dashed #000000 !important;
  }

  .sig-space {
    height: 25px !important; /* Compact spacing */
  }
}

/* ==========================================================================
   13. JURNAL HARIAN LAPORAN PENERIMAAN
   ========================================================================== */
.journal-timeline {
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  padding-left: 20px;
  margin-top: 15px;
}

.journal-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 10px;
  width: 2px;
  height: calc(100% - 20px);
  background-color: rgba(15, 23, 42, 0.1);
}

.journal-day-item {
  position: relative;
}

.journal-day-dot {
  position: absolute;
  left: -20px;
  top: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-light);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px var(--primary-light);
  transition: var(--transition-fast);
  z-index: 2;
}

.journal-day-header {
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  transition: all var(--transition-fast);
}

.journal-day-header:hover {
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.journal-day-header:hover ~ .journal-day-dot {
  background-color: var(--secondary-light);
  box-shadow: 0 0 0 1px var(--secondary-light);
}

.journal-day-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-color);
  font-family: var(--font-heading);
}

.journal-day-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.journal-stat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--medium-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.journal-stat-badge.primary {
  background-color: var(--primary-ultra-light);
  color: var(--primary-light);
}

.journal-stat-badge.success {
  background-color: var(--success-light);
  color: var(--success-color);
}

.journal-stat-badge.warning {
  background-color: #fffbeb;
  color: #d97706;
}

.journal-day-header::after {
  content: '▼';
  font-size: 0.75rem;
  color: var(--medium-text);
  transition: transform var(--transition-normal);
  font-weight: bold;
}

.journal-day-item.active .journal-day-header::after {
  transform: rotate(-180deg);
}

.journal-day-item.active .journal-day-dot {
  background-color: var(--success-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.journal-day-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-in-out;
  padding: 0 10px;
}

.journal-day-item.active .journal-day-detail {
  max-height: 2000px; /* Large enough for daily list */
  padding: 10px 5px 5px 15px;
}

.journal-student-list {
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.journal-student-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: all var(--transition-fast);
  flex-wrap: wrap;
  gap: 10px;
}

.journal-student-row:hover {
  background-color: rgba(255, 255, 255, 1);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.journal-student-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.journal-student-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--dark-text);
}

.journal-student-meta {
  font-size: 0.75rem;
  color: var(--medium-text);
}

.journal-student-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.journal-student-actions button {
  font-size: 0.7rem !important;
  padding: 4px 10px !important;
  height: 28px;
}

/* ==========================================================================
   14. SINGLE-PAGE FORMULIR OFFLINE/ONLINE (EX. formulir.php)
   ========================================================================== */
.form-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 15px;
  border-bottom: 3px double var(--primary-color);
  text-align: left;
  gap: 16px;
}

.form-header-logo {
  width: clamp(65px, 12vw, 85px);
  height: clamp(65px, 12vw, 85px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-ultra-light);
  border-radius: 12px;
  padding: 10px;
  transition: all var(--transition-fast) ease;
}

.form-header-logo svg, .form-header-logo img {
  width: 100%;
  height: 100%;
  fill: var(--primary-color);
  object-fit: contain;
}

.form-header-content {
  flex-grow: 1;
  text-align: left;
}

@media (max-width: 576px) {
  .form-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 12px;
  }
  .form-header-logo {
    width: 75px;
    height: 75px;
    border-radius: 50%;
  }
  .form-header-content {
    text-align: center;
  }
}

.form-header-content h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark-text);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.form-header-content h3 {
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.form-header-content p.school-year {
  color: var(--dark-text);
  font-weight: 700;
  font-size: 0.75rem;
  margin: 0;
}

.form-header-content p.school-addr {
  color: var(--medium-text);
  font-size: 0.65rem;
  margin-top: 3px;
}

.form-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 2rem;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
.form-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 10%;
  width: 80%;
  height: 3px;
  background: var(--primary-light);
  border-radius: 2px;
}

.form-section {
  margin-bottom: 2.5rem;
  animation: fadeIn 0.4s ease forwards;
}

.form-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  background: linear-gradient(90deg, var(--primary-ultra-light) 0%, transparent 100%);
  padding: 0.6rem 1rem;
  border-left: 4px solid var(--primary-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.print-only-options {
  display: none;
}

.statement-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 1rem 1.2rem;
  border-radius: var(--border-radius-sm);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: inset 0 2px 4px rgba(239, 68, 68, 0.05);
}

.statement-box label {
  font-size: 0.85rem;
  color: #7f1d1d;
  cursor: pointer;
  line-height: 1.5;
  font-weight: 500;
}

/* =========================================
   CSS KHUSUS CETAK / PRINT (Ctrl+P) UTK SINGLE-PAGE
   ========================================= */
@media print {
  body {
    background-color: white;
    padding: 0;
    margin: 0;
    color: #000;
  }

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

  .form-header {
    border-bottom: 3px double #000;
  }

  .form-header-content h3, .form-header-content h4, .form-header-content p, .form-title {
    color: #000;
  }

  .form-header-logo svg {
    fill: #000;
  }

  .form-section-title {
    background: none;
    color: #000;
    border-bottom: 2px solid #000;
    border-left: none;
    padding: 0 0 5px 0;
    margin-bottom: 15px;
  }

  .form-control {
    border: none;
    border-bottom: 1px dotted #000;
    border-radius: 0;
    background: transparent !important;
    padding: 0.2rem 0;
    color: #000;
    box-shadow: none !important;
    min-height: 28px;
  }

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

  .statement-box {
    border: 1px solid #000;
    background: transparent;
    color: #000;
  }
  
  .statement-box label {
    color: #000;
  }
  
  .form-section {
    page-break-inside: avoid;
  }

  select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  
  select.form-control:invalid {
    display: none !important;
  }
  
  select.form-control:invalid + .print-only-options {
    display: flex !important;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.9rem;
  }

  input:invalid::placeholder, textarea:invalid::placeholder {
    color: transparent;
  }
  
  input[type="date"]:invalid {
    color: transparent;
  }

  /* =========================================
     CSS KHUSUS CETAK KARTU (TANPA DOWNLOAD)
     ========================================= */
  body.print-native-mode > *:not(#print-temp-container) {
    display: none !important;
  }

  /* Comprehensive Print Fallbacks */
  @media print {
    /* Hide layout wrappers, menus, sidebars, headers, cards, and buttons */
    .sidebar, 
    .topbar, 
    .nav-overlay, 
    .search-box, 
    .result-header, 
    .result-detail-grid, 
    .print-action-buttons, 
    .hero-section, 
    .features-section, 
    .steps-section, 
    .footer,
    .swal2-container,
    .admin-modal,
    aside,
    header,
    footer,
    .btn,
    button {
      display: none !important;
    }

    /* Force the wrapper layout-wrapper to not render background or flex grid */
    .layout-wrapper, .content-wrapper, .container, section {
      display: block !important;
      background: none !important;
      padding: 0 !important;
      margin: 0 !important;
      border: none !important;
      box-shadow: none !important;
    }

    /* Ensure ONLY the bukti-print-area or print-temp-container is shown */
    #bukti-print-area, #print-temp-container {
      display: block !important;
      visibility: visible !important;
      position: static !important;
      width: 100% !important;
      max-width: 680px !important;
      margin: 0 auto !important;
      padding: 30px !important;
      border: 1px solid #1e3a8a !important;
      outline: 3px double #1e3a8a !important;
      outline-offset: -8px !important;
      box-shadow: none !important;
      background: #ffffff !important;
    }
  }

  body.print-native-mode .layout-wrapper,
  body.print-native-mode .sidebar,
  body.print-native-mode .content-wrapper,
  body.print-native-mode .admin-modal,
  body.print-native-mode .nav-overlay,
  body.print-native-mode .swal2-container,
  body.print-native-mode #admin-card-preview-modal,
  body.print-native-mode #admin-form-preview-modal {
    display: none !important;
  }
  body.print-native-mode {
    background-color: white !important;
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #print-temp-container {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 30px !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    z-index: 99999999 !important;
  }
/* ==== PRINT FORM LINE & DIGIT BOX STYLES ==== */
.print-line-field {
  border-bottom: 1px solid #000;
  min-height: 1.2rem;
  margin: 2px 0;
}

.print-line-inline {
  border-bottom: 1px solid #000;
  display: inline-block;
  vertical-align: bottom;
}

.digit-box {
  width: 20px;
  height: 28px;
  border: 1px solid #000;
  display: inline-block;
  margin: 1px;
  box-sizing: border-box;
}
}
