/* ==========================================================================
   Bimbel Portal - Modern Design System & Stylesheet
   Designed with Google Fonts Outfit & Plus Jakarta Sans, Sleek Glassmorphism,
   Harmonious Indigo & Emerald Palettes, Micro-animations, and Print Support.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-dark: #3730a3;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.88);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #818cf8;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 25px -3px rgba(79, 70, 229, 0.35);
  --shadow-glow-success: 0 0 20px -2px rgba(16, 185, 129, 0.3);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.06) 0px, transparent 50%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-item {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-btn {
  background: var(--primary-gradient);
  color: white !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* ==========================================================================
   Main Container & Layout
   ========================================================================== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* ==========================================================================
   Hero Section (Portal Wali Murid)
   ========================================================================== */
.hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem auto;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ==========================================================================
   Search Card & Quick Demo
   ========================================================================== */
.search-card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  margin: 0 auto 2.5rem auto;
  transition: var(--transition);
}

.search-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

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

.input-wrapper {
  position: relative;
  flex: 1;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  padding: 0.95rem 1rem 0.95rem 2.8rem;
  font-size: 1.05rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  font-size: 1.05rem;
  padding: 1rem 1.75rem;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
  width: 100%;
}

.btn-whatsapp:hover {
  background: #20BA59;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: var(--text-muted);
}

.btn-success {
  background: var(--success);
  color: white;
}

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

.demo-chips {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chip {
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-main);
}

.chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   Student Information Header
   ========================================================================== */
.student-header-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  gap: 1.25rem;
}

.student-meta-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.student-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.student-name {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.student-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-id {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.badge-grade {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-program {
  background: #f3e8ff;
  color: #7e22ce;
}

.badge-paid {
  background: var(--success-light);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-unpaid {
  background: var(--danger-light);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   Report & Payment Layout (2-Column Grid)
   ========================================================================== */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Sections */
.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  transition: var(--transition);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.card-title {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-title-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.icon-report {
  background: #eef2ff;
  color: var(--primary);
}

.icon-spp {
  background: #ecfdf5;
  color: var(--success);
}

/* ==========================================================================
   SPP Payment Card Details
   ========================================================================== */
.spp-status-banner {
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.spp-status-banner.unpaid {
  background: linear-gradient(135deg, #fff1f2 0%, #fffbeb 100%);
  border: 1.5px solid #fecdd3;
}

.spp-status-banner.paid {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid #a7f3d0;
}

.spp-status-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.spp-status-banner.unpaid .spp-status-label {
  color: #e11d48;
}

.spp-status-banner.paid .spp-status-label {
  color: #059669;
}

.spp-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.spp-due-date {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.spp-due-date.urgent {
  color: #dc2626;
  font-weight: 600;
}

.bank-info-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.bank-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.bank-row:last-child {
  margin-bottom: 0;
}

.bank-label {
  color: var(--text-muted);
}

.bank-value {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}

.copy-btn:hover {
  background: var(--primary-light);
}

/* ==========================================================================
   Learning Evaluation Report Card
   ========================================================================== */
.report-period-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.evaluation-summary-box {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.evaluation-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.evaluation-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1e293b;
}

.report-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 600px) {
  .report-details-grid {
    grid-template-columns: 1fr;
  }
}

.detail-card {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.detail-card.strengths {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.detail-card.improvements {
  background: #fefce8;
  border-color: #fef08a;
}

.detail-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-card.strengths .detail-card-title {
  color: #15803d;
}

.detail-card.improvements .detail-card-title {
  color: #a16207;
}

.detail-card-content {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.6;
}

.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.attendance-pill {
  background: #f1f5f9;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Admin Dashboard Specifics
   ========================================================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
}

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

/* Data Table */
.table-responsive {
  overflow-x: auto;
}

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

.custom-table th {
  background: #f8fafc;
  padding: 0.9rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border);
}

.custom-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.custom-table tr:hover {
  background: #f8fafc;
}

/* Modal Windows */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.25rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.5rem;
}

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

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Notification Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Responsive Multi-Device Styling (Handphone & Laptop)
   ========================================================================== */

/* Utility Show/Hide Perangkat */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

/* Mobile Student Cards (Admin di HP) */
.mobile-student-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.mobile-student-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.m-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.m-student-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
}

.m-student-phone {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
}

.m-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.m-act-btn {
  width: 100%;
  justify-content: center;
  padding: 0.55rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Media Query untuk Handphone (Layar <= 768px) */
@media screen and (max-width: 768px) {
  .mobile-only {
    display: flex !important;
    flex-direction: column;
    gap: 0.85rem;
  }

  .desktop-only {
    display: none !important;
  }

  /* Body & Layout */
  body {
    font-size: 15px;
    overflow-x: hidden;
  }

  .container {
    padding: 1.25rem 1rem;
  }

  /* Navbar */
  .navbar {
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .nav-links {
    gap: 0.4rem;
  }

  .nav-item {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
  }

  /* Hero Section */
  .hero {
    margin-bottom: 1.75rem;
  }

  .hero h1 {
    font-size: 1.75rem;
    line-height: 1.25;
  }

  .hero p {
    font-size: 0.95rem;
  }

  /* Search Card */
  .search-card {
    padding: 1.25rem;
    margin-bottom: 1.75rem;
    border-radius: var(--radius-md);
  }

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

  .search-input {
    font-size: 16px; /* Mencegah auto zoom di iOS Safari */
    padding: 0.85rem 1rem 0.85rem 2.6rem;
  }

  .btn-primary {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
  }

  .demo-chips {
    gap: 0.4rem;
  }

  .chip {
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
  }

  /* Student Header Card */
  .student-header-card {
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .student-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.35rem;
  }

  .student-name {
    font-size: 1.25rem;
  }

  /* Portal Grid: Rapor di Atas, SPP di Bawah */
  .portal-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
  }

  .card-title {
    font-size: 1.15rem;
  }

  .report-details-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .evaluation-summary-box {
    padding: 1.15rem;
  }

  .evaluation-text {
    font-size: 0.98rem;
  }

  .spp-amount {
    font-size: 1.95rem;
  }

  .btn-whatsapp {
    padding: 0.9rem;
    font-size: 0.95rem;
  }

  /* Admin Stats */
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-card {
    padding: 0.9rem;
    gap: 0.65rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* Modals on Mobile */
  .modal-backdrop {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .modal-dialog {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .form-control {
    font-size: 16px; /* Mencegah auto zoom */
  }
}

/* ==========================================================================
   Print Styles (Untuk Cetak Rapor / Kuitansi)
   ========================================================================== */
@media print {
  body {
    background: white;
    color: black;
  }
  .navbar, .search-card, .btn-whatsapp, .btn-print, .demo-chips, .nav-btn, .modal-backdrop, .mobile-student-cards {
    display: none !important;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
  .card, .student-header-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  .portal-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Modul Presensi Foto & Linimasa Pertemuan (Watermark & Camera)
   ========================================================================== */

/* Badge Status Presensi */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-status.hadir {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-status.izin {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-status.sakit {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Grid & Linimasa Kartu Presensi */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.attendance-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.attendance-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

/* Container Foto Sesi Belajar */
.attendance-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
}

.attendance-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.attendance-card-img-wrap:hover .attendance-card-img {
  transform: scale(1.05);
}

.attendance-card-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  gap: 0.4rem;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}

.attendance-card-img-wrap:hover .attendance-card-img-overlay {
  opacity: 1;
}

.attendance-watermark-tag {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  color: #38bdf8;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.attendance-card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.65rem;
}

.attendance-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.attendance-date-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.attendance-subject-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.attendance-topic-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: #f8fafc;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.attendance-teacher-note {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.4;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  display: flex;
  gap: 0.4rem;
}

/* Modal Lightbox Foto Ukuran Penuh */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-backdrop.active {
  display: flex;
}

.lightbox-container {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-close-btn {
  position: absolute;
  top: -2.75rem;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

.lightbox-caption {
  margin-top: 0.85rem;
  color: #f1f5f9;
  text-align: center;
  font-size: 0.95rem;
}

/* Kamera & Widget Unggah Presensi */
.camera-widget-box {
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-bottom: 1rem;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-video-element {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: none;
}

.camera-preview-img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: none;
}

.camera-placeholder {
  color: #94a3b8;
  text-align: center;
  padding: 2rem 1rem;
}

.camera-action-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.watermark-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: #eef2ff;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

