/* ===== CERIA THEME — HIJAU · KUNING · BIRU MUDA ===== */
:root {
  --primary: #2ecc71;
  --primary-light: #e8f8f5;
  --primary-dark: #1b9b5c;
  --accent-yellow: #f1c40f;
  --accent-blue: #3498db;
  --sky-light: #d4e6f1;
  --soft-cream: #fef9e7;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(46, 204, 113, 0.25);
  --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.05), 0 5px 12px rgba(46, 204, 113, 0.1);
  --text-main: #1e2b3a;
  --text-muted: #5d6d7e;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --border-radius-card: 28px;
  --border-radius-sm: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(145deg, #e9f7ef 0%, #fef9e7 100%);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  margin: 0;
  color: var(--text-main);
  position: relative;
  flex-direction: column;
}




body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: -10%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle at 30% 30%, rgba(46, 204, 113, 0.12), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  bottom: -10%;
  right: -5%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle at 70% 80%, rgba(52, 152, 219, 0.1), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.content-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-card);
  box-shadow: var(--card-shadow);
  padding: 30px 28px;
  transition: all 0.3s ease;
}

/* HEADER */
.school-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 20px;
}

.school-logo {
  width: 85px;
  height: 85px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(46, 204, 113, 0.2));
}

.school-title h2 {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1b9b5c, #2e86c1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
  text-align: center;
}

.school-title h3 {
  color: #2c3e50;
  font-weight: 600;
  font-size: 1.3rem;
  text-align: center;
}

.school-title i {
  color: var(--accent-yellow);
  margin-right: 8px;
}

/* TEXT CENTER */
.text-center {
  text-align: center;
}

/* SEARCH BAR */
.search-wrapper {
  margin: 20px 0 10px;
}

.search-box {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

.search-box i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  border-radius: 60px;
  border: 1.5px solid rgba(46, 204, 113, 0.3);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
  outline: none;
}

.search-input::placeholder {
  color: #a0b0c0;
}

.search-result-count {
  text-align: center;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* GRID KELAS */
.kelas-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin: 20px 0 10px;
}

.kelas-grid-item {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(46, 204, 113, 0.2);
  border-radius: 20px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.kelas-grid-item::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 20px;
  background: linear-gradient(45deg,
      #ff6b6b, #feca57, #48dbfb, #1dd1a1,
      #ff9ff3, #54a0ff, #5f27cd);
  background-size: 400% 400%;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  animation: gradientShift 3s ease infinite;
}

.kelas-grid-item:hover::before {
  opacity: 1;
}

.kelas-grid-item:hover {
  transform: scale(1.02);
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.kelas-grid-item i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.kelas-grid-item h5 {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.kelas-grid-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.kelas-grid-item .badge-kelas {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  display: inline-block;
}

/* DROPDOWN (disembunyikan) */
.dropdown-container {
  display: none;
}

/* SECTION TITLE */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  flex-wrap: wrap;
}

.section-title i {
  color: var(--accent-yellow);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1rem;
}

.kelas-badge {
  background: rgba(241, 196, 15, 0.2);
  color: #7d6608;
  padding: 6px 18px;
  border-radius: 40px;
  font-weight: 600;
  border: 1px solid rgba(241, 196, 15, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* HEADER MAPEL DENGAN TOMBOL KEMBALI */
.mapel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 15px;
}

.mapel-header .section-title {
  margin-bottom: 0;
}

.btn-back-mapel {
  background: linear-gradient(145deg, var(--accent-blue), #5dade2);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 60px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-back-mapel:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(52, 152, 219, 0.25);
  background: linear-gradient(145deg, #5dade2, var(--accent-blue));
}

.btn-back-mapel i {
  font-size: 1rem;
}

/* MAPEL GRID */
.mapel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.mapel-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(46, 204, 113, 0.2);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 8px 20px rgba(46, 204, 113, 0.06);
  transition: all 0.25s ease;
  overflow: hidden;
  cursor: pointer;
}

.mapel-card:focus {
  outline: 4px solid var(--primary);
  outline-offset: 2px;
}

.mapel-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 20px 30px rgba(46, 204, 113, 0.12);
  background: rgba(255, 255, 255, 0.95);
}

.mapel-card-inner {
  display: flex;
  align-items: center;
  padding: 18px 18px 10px;
  gap: 16px;
}

.mapel-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(145deg, #e8f8f5, #d5f5e3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.7rem;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 4px 8px rgba(46, 204, 113, 0.1);
  flex-shrink: 0;
}

.mapel-content {
  flex: 1;
}

.mapel-content h4 {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
  font-size: 1rem;
  line-height: 1.4;
}

.mapel-content h4 .angka-kkm {
  display: none;
}

.mapel-content .kkm-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 3px;
}

.mapel-content small {
  color: var(--text-muted);
  display: none;
}

.status-belum-merah {
  background: #fdeded;
  color: #c0392b;
  font-style: italic;
  padding: 4px 12px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.8rem;
  border-left: 3px solid #e74c3c;
}

.mapel-status {
  font-size: 1.6rem;
  margin-left: 5px;
  flex-shrink: 0;
}

/* PROGRESS BAR */
.progress-container {
  padding: 0 18px 18px;
}

.progress {
  height: 8px;
  border-radius: 20px;
  background: #e2f0e6;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.progress-bar {
  border-radius: 20px;
  background: linear-gradient(90deg, #1a5276, #2980b9, #1a5276);
  background-size: 200% 100%;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.3) 8px,
      rgba(255, 255, 255, 0.3) 16px);
  animation: moveStripes 1.5s linear infinite;
}

@keyframes moveStripes {
  0% { background-position: 0 0; }
  100% { background-position: 32px 0; }
}

.progress-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}



/* ===== INFO BAR (Mata Pelajaran & KKM) - TETAP HORIZONTAL ===== */
.info-bar {
  display: flex !important;
  flex-direction: row !important;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: nowrap !important;
  width: 100%;
}

.info-item {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(46, 204, 113, 0.2);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  display: flex !important;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.info-mapel {
  flex: 1.5 !important;
  min-width: 0;
}

.info-kkm {
  flex: 0.2 !important;
  min-width: 0;
}

.info-guru {
  flex: 2.2 !important;
  min-width: 0;
}

.info-guru .info-value {
  display: flex;
  align-items: center;
  gap: 2px;
}

.info-guru .info-value select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  cursor: pointer;
  transition: all 0.3s;
  appearance: auto;
  -webkit-appearance: auto;
}

.info-guru .info-value select:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.95);
}

.info-guru .info-value select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
  background: white;
}

#guruStatus, #guruStatusMobile {
  font-size: 0.75rem !important;
  white-space: nowrap;
  color: var(--text-muted);
}

.info-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.info-label i {
  color: var(--primary);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.info-label span {
  display: inline;
}

.info-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-kkm .info-value {
  color: var(--primary-dark);
  font-size: 1.4rem;
  text-align: center;
  font-weight: 700;
}

.info-item:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(46, 204, 113, 0.1);
  background: rgba(255, 255, 255, 0.85);
}

/* ===== GURU MOBILE (Hanya tampil di HP) ===== */
.info-guru-mobile {
  margin-bottom: 20px;
}

/* ===== PROGRESS MINI ===== */
.progress-search-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.mapel-progress-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(46, 204, 113, 0.2);
  border-radius: 16px;
  padding: 10px 15px;
  flex: 1;
  min-width: 250px;
}

.progress-mini-bar {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  min-width: 60px;
}

.progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-mini-text {
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 5px 0;
  flex-wrap: wrap;
}


/* ================================================================ */
/*                        RESPONSIVE                                */
/* ================================================================ */

/* ===================== */
/* DESKTOP & TABLET (>480px) - 3 KOLOM SEJAJAR */
/* ===================== */
@media (min-width: 481px) {
  /* Guru di info-bar tampil */
  .info-guru-desktop {
    display: flex !important;
  }
  
  /* Guru mobile disembunyikan */
  .info-guru-mobile {
    display: none !important;
  }
}


/* ===================== */
/* MOBILE (≤480px) */
/* ===================== */
@media (max-width: 480px) {
  /* Sembunyikan guru di info-bar */
  .info-guru-desktop {
    display: none !important;
  }
  
  /* Tampilkan guru mobile di bawah */
  .info-guru-mobile {
    display: block !important;
  }
  
  .info-bar {
    gap: 4px;
    flex-wrap: nowrap !important;
  }
  
  .info-item {
    padding: 2px 2px;
    border-radius: 12px;
  }
  
  .info-label {
    font-size: 0.55rem;
    letter-spacing: 0.1px;
    gap: 2px;
    justify-content: center;
    margin-bottom: 2px;
  }
  
  .info-label i {
    font-size: 0.65rem;
  }
  
  .info-label span {
    display: none;
  }
  
  .info-value {
    font-size: 0.7rem;
    text-align: center;
  }
  
  .info-kkm .info-value {
    font-size: 2rem !important;
    text-align: center !important;
  }

  /* Mapel 65%, KKM 35% */
  .info-mapel {
    flex: 0 0 65% !important;
    max-width: 65%;
  }
  
  .info-kkm {
    flex: 0 0 35% !important;
    max-width: 30%;
  }
  
  /* Guru mobile styling */
  .info-guru-mobile .info-item {
    padding: 6px 8px;
  }
  
  .info-guru-mobile .info-label {
    font-size: 0.55rem;
    gap: 4px;
    justify-content: flex-start;
  }
  
  .info-guru-mobile .info-label span {
    display: inline;
  }
  
  .info-guru-mobile .info-value select {
    font-size: 0.75rem;
    padding: 6px 8px;
  }
  
  /* Progress bar */
  .mapel-progress-mini {
    display: none !important;
  }
}


/* ===================== */
/* VERY SMALL (≤360px) */
/* ===================== */
@media (max-width: 360px) {
  .info-bar {
    gap: 3px;
  }
  
  .info-item {
    padding: 4px 4px;
    border-radius: 10px;
  }
  
  .info-label {
    font-size: 0.45rem;
    gap: 1px;
    margin-bottom: 1px;
  }
  
  .info-label i {
    font-size: 0.55rem;
  }
  
  .info-value {
    font-size: 0.6rem;
  }
  
  .info-kkm .info-value {
    font-size: 1.5rem !important;
  }

  .info-mapel {
    flex: 0 0 65% !important;
    max-width: 65%;
  }
  
  .info-kkm {
    flex: 0 0 35% !important;
    max-width: 25%;
  }
}


/* ===================== */
/* EXTRA SMALL (≤320px) */
/* ===================== */
@media (max-width: 320px) {
  .info-bar {
    gap: 2px;
  }
  
  .info-item {
    padding: 3px 3px;
    border-radius: 8px;
  }
  
  .info-label {
    font-size: 0.4rem;
  }
  
  .info-label i {
    font-size: 0.5rem;
  }
  
  .info-value {
    font-size: 0.55rem;
  }
  
  .info-kkm .info-value {
    font-size: 1rem !important;
  }

  .info-mapel {
    flex: 0 0 65% !important;
    max-width: 65%;
  }
  
  .info-kkm {
    flex: 0 0 35% !important;
    max-width: 20%;
  }
}


/* TABLE */
.table-wrapper {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 20px;
  border: 1px solid rgba(46, 204, 113, 0.2);
  max-height: 480px;
  overflow-y: auto;
  margin: 20px 0;
  overflow-x: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #e0e0e0;
}

.table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

#tabelBA {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  white-space: nowrap;
}

#tabelBA th,
#tabelBA td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid #deedd9;
  background: transparent;
}

#tabelBA th {
  background: linear-gradient(145deg, #2ecc71, #27ae60);
  color: white;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 30;
  white-space: nowrap;
}

#tabelBA th:first-child,
#tabelBA td:first-child {
  position: sticky;
  left: 0;
  z-index: 25;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#tabelBA th:nth-child(3),
#tabelBA td:nth-child(3) {
  position: sticky;
  left: 65px;
  z-index: 25;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#tabelBA thead tr th:first-child,
#tabelBA thead tr th:nth-child(3) {
  z-index: 35;
  background: linear-gradient(145deg, #2ecc71, #27ae60);
}

#tabelBA tbody tr:hover td {
  background: #eafaf1;
}

#tabelBA tbody tr:hover td:first-child,
#tabelBA tbody tr:hover td:nth-child(3) {
  background: #d5f5e3;
}

/* INPUT NILAI */
.input-nilai {
  width: 95px;
  padding: 12px;
  border-radius: 40px;
  border: 1.5px solid #d4e6d8;
  background: white;
  text-align: center;
  font-weight: 600;
  transition: all 0.15s ease;
  font-size: 0.95rem;
}

.input-nilai:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.2);
  outline: none;
  background: #fffff0;
}

.input-nilai.below-kkm {
  background: #8b0000 !important;
  border-color: #8b0000 !important;
  color: #ffeb3b !important;
  font-style: italic;
  font-weight: 700;
}

.input-nilai.equal-kkm {
  background: #fff3cd !important;
  border-color: var(--warning) !important;
  color: #856404 !important;
  font-weight: 700;
}

.input-nilai.normal-value {
  background: #eafaf1 !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
  font-weight: 700;
}

.empty-field {
  animation: pulseRed 1.5s infinite;
  border-color: #e74c3c !important;
  background: #fdeded !important;
}

/* STATUS ICON */
.status-badge {
  font-size: 1.8rem;
  text-align: center;
}

.status-badge .fa-check-circle {
  color: #2ecc71;
  filter: drop-shadow(0 2px 4px rgba(46, 204, 113, 0.3));
}

.status-badge .fa-times-circle {
  color: #e74c3c;
  filter: drop-shadow(0 2px 4px rgba(231, 76, 60, 0.3));
}

/* BUTTONS */
.btn {
  padding: 14px 32px;
  border-radius: 60px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
  border: none;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  margin: 5px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn i {
  font-size: 1rem;
}

.btn-success {
  background: linear-gradient(145deg, var(--primary), #58d68d);
  color: white;
}

.btn-info {
  background: linear-gradient(145deg, var(--accent-blue), #5dade2);
  color: white;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(46, 204, 113, 0.25);
}

.btn:active {
  transform: translateY(-1px);
}

/* LOADING */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a1929;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.win-loader {
  text-align: center;
}

.win-spinner {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 30px;
}

.win-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2ecc71;
  animation: winBounce 1.4s infinite ease-in-out both;
}

.win-dot:nth-child(1) { animation-delay: -0.32s; background: #3498db; }
.win-dot:nth-child(2) { animation-delay: -0.16s; background: #f1c40f; }
.win-dot:nth-child(3) { background: #2ecc71; }
.win-dot:nth-child(4) { animation-delay: -0.48s; background: #e74c3c; }
.win-dot:nth-child(5) { animation-delay: -0.24s; background: #9b59b6; }

@keyframes winBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.win-text {
  color: white;
  font-size: 1.3rem;
  letter-spacing: 2px;
  font-weight: 300;
  text-transform: uppercase;
}

.win-text i {
  margin-right: 10px;
  color: #2ecc71;
}

/* PASTE HINT */
.paste-hint {
  text-align: center;
  margin: 15px 0 20px;
  padding: 10px 20px;
  background: linear-gradient(145deg, #e8f8f5, #d5f5e3);
  border-radius: 40px;
  font-size: 0.9rem;
  color: var(--primary-dark);
  border: 1px solid rgba(46, 204, 113, 0.2);
  display: inline-block;
  width: auto;
  margin-left: auto;
  margin-right: auto;
}

.paste-hint i {
  color: var(--primary);
  margin-right: 8px;
}

/* FOOTER */
.footer {
  margin-top: 15px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 5px;
}

.footer i.fa-heart {
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.last-update-info {
  background: #e8f8f5;
  border-radius: 40px;
  padding: 10px 22px;
  display: inline-block;
  color: var(--primary-dark);
  font-size: 0.9rem;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.last-update-info i {
  margin-right: 8px;
  color: var(--primary);
}

/* ANIMATIONS */
@keyframes pulseRed {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    border-color: #e74c3c;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(231, 76, 60, 0);
    border-color: #ff6b6b;
  }
}

/* FLEX UTILITIES */
.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.me-1 { margin-right: 0.25rem; }

/* FORM CONTROL */
.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(46, 204, 113, 0.3);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
  outline: none;
}

.form-control:disabled {
  background: #f5f5f5;
  color: #888;
  cursor: not-allowed;
}

label {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  display: block;
  font-size: 0.9rem;
}

/* ROW & COL */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.col-md-3,
.col-md-6 {
  padding: 0 10px;
  flex: 1;
}

.g-3 { gap: 1rem; }

/* RESPONSIVE STYLES */

/* Tablet */
@media (max-width: 992px) {
  .kelas-grid { grid-template-columns: repeat(3, 1fr); }
  .school-title h2 { font-size: 1.8rem; }
  
  .info-bar { gap: 15px; }
  .info-mapel { min-width: 200px; }
}

/* Mobile Landscape */
@media (max-width: 768px) {
  body { padding: 12px 8px; }
  .content-card { padding: 20px 15px; }
  .school-header { gap: 12px; }
  .school-logo { width: 65px; height: 65px; }
  .school-title h2 { font-size: 1.5rem; }
  .school-title h3 { font-size: 1rem; }
  .section-title { font-size: 1.3rem; }
  .section-subtitle { font-size: 0.9rem; }
  .btn { padding: 10px 20px; font-size: 0.8rem; }
  
  .kelas-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .kelas-grid-item {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 16px 20px;
  }
  
  .kelas-grid-item i {
    margin-bottom: 0;
    margin-right: 15px;
    font-size: 2.2rem;
  }
  
  .kelas-grid-item .content-mobile { flex: 1; }
  .kelas-grid-item h5 { margin-bottom: 2px; }
  .kelas-grid-item .badge-kelas {
    margin-top: 0;
    margin-left: auto;
  }
  
  .mapel-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .mapel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .btn-back-mapel {
    padding: 8px 16px;
    font-size: 0.85rem;
    width: 100%;
    justify-content: center;
  }
  
  .info-bar { gap: 12px; }
  .info-item { padding: 12px 16px; }
  .info-mapel { flex: 2; min-width: 180px; }
  .info-kkm { flex: 1; min-width: 100px; }
  .info-value { font-size: 1.1rem; }
  .info-kkm .info-value { font-size: 1.4rem; }
  
  .paste-hint {
    font-size: 0.8rem;
    padding: 8px 15px;
  }
  
  #tabelBA th,
  #tabelBA td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }
  
  .input-nilai {
    width: 75px;
    padding: 8px;
    font-size: 0.8rem;
  }
  
  .status-badge { font-size: 1.4rem; }
  
  #tabelBA th:nth-child(3),
  #tabelBA td:nth-child(3) {
    white-space: normal !important;
    word-break: break-word;
    max-width: 120px;
    min-width: 100px;
    text-align: left !important;
  }
  
  #tabelBA { white-space: nowrap; }
  #tabelBA td:nth-child(3) { white-space: normal !important; }
  .table-wrapper { max-height: 400px; }
  .win-text { font-size: 1rem; }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  body { padding: 8px 4px; }
  .content-card { padding: 15px 10px; }
  .school-title h2 { font-size: 1.2rem; }
  .school-title h3 { font-size: 0.9rem; }
  .section-title { font-size: 1rem; }
  
  .search-input {
    padding: 10px 15px 10px 40px;
    font-size: 0.9rem;
  }
  
  .search-box i {
    left: 14px;
    font-size: 0.9rem;
  }
  
  .kelas-grid-item { padding: 12px 15px; }
  .kelas-grid-item i { font-size: 1.8rem; }
  .kelas-grid-item h5 { font-size: 1rem; }
  
  
  .info-mapel,
  .info-kkm {
    flex: 1;
    width: 100%;
  }
  .info-value { font-size: 1rem; }
  .info-kkm .info-value {
    font-size: 1.3rem;
    text-align: left;
  }
  
  .mapel-card-inner {
    padding: 14px 14px 8px;
    gap: 12px;
  }
  
  .mapel-icon {
    width: 45px;
    height: 45px;
    font-size: 1.4rem;
  }
  
  .mapel-content h4 { font-size: 0.9rem; }
  
  .mapel-content .kkm-badge {
    font-size: 0.8rem;
    padding: 3px 10px;
  }
  
  .mapel-status { font-size: 1.3rem; }
  .progress-container { padding: 0 14px 14px; }
  
  #tabelBA th,
  #tabelBA td {
    font-size: 0.75rem;
    padding: 8px 5px;
  }
  
  .input-nilai {
    width: 65px;
    padding: 6px;
    font-size: 0.75rem;
  }
  
  #tabelBA th:nth-child(3),
  #tabelBA td:nth-child(3) {
    max-width: 99px;
    min-width: 89px;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 0.75rem;
    margin: 3px 5px;
  }
  
  .footer { font-size: 0.8rem; }
  
  .last-update-info {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  
  .win-dot { width: 14px; height: 14px; }
  .win-spinner { gap: 8px; }
}

/* Print Styles */
@media print {
  body::before,
  body::after { display: none; }
  
  .content-card {
    background: white;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .btn,
  .search-wrapper,
  .btn-back-mapel,
  .paste-hint,
  .footer,
  .info-bar { display: none !important; }
  
  .input-nilai {
    border: none;
    background: transparent !important;
    box-shadow: none;
    color: black !important;
  }
  
  .table-wrapper {
    overflow: visible;
    max-height: none;
  }
  
  #tabelBA th {
    background: #ddd !important;
    color: black;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Visible */
*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}

::-moz-selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}


/* Animasi untuk input yang baru dikoreksi */
.input-nilai.corrected {
    animation: flashYellow 0.5s ease;
}

@keyframes flashYellow {
    0%, 100% { background: white; }
    50% { background: #fff3cd; }
}



/* ===== KELAS & MAPEL NAVIGATOR ===== */
.kelas-mapel-navigator {
  margin-bottom: 20px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(46, 204, 113, 0.2);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Base Navigator Styles */
.kelas-navigator,
.mapel-navigator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-wrap: nowrap; /* PENTING: Mencegah wrap ke bawah */
}

.kelas-navigator {
  background: rgba(46, 204, 113, 0.08);
  border-bottom: 1px solid rgba(46, 204, 113, 0.15);
}

/* Label */
.navigator-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.navigator-label span {
  display: inline;
}

.kelas-navigator .navigator-label {
  min-width: 55px;
}

.mapel-navigator .navigator-label {
  min-width: 60px;
}

.navigator-label i {
  color: var(--primary);
  font-size: 1rem;
}

/* Select Wrapper - Flex 1 agar mengisi sisa ruang */
.navigator-select-wrapper {
  flex: 1;
  min-width: 150px;
}

.navigator-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(46, 204, 113, 0.3);
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232ecc71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}

.navigator-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
  outline: none;
}

/* Actions (Tombol Panah) - Selalu di samping */
.navigator-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-nav {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid rgba(46, 204, 113, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-nav:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(46, 204, 113, 0.2);
}

.btn-nav:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Info (X/Y) */
.navigator-info {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  line-height: 28px;
  flex-shrink: 0;
}

/* Progress Mini */
.kelas-progress-mini,
.mapel-progress-mini {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
}

.progress-mini-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.progress-mini-text i {
  color: var(--primary);
}

.progress-mini-bar {
  flex: 1;
  height: 6px;
  background: #e2f0e6;
  border-radius: 10px;
  overflow: hidden;
}

.progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablet */
@media (max-width: 768px) {
  .kelas-navigator,
  .mapel-navigator {
    padding: 10px 12px;
    gap: 8px;
  }
  
  .navigator-label {
    font-size: 0.85rem;
  }
  
  .kelas-navigator .navigator-label {
    min-width: 45px;
  }
  
  .mapel-navigator .navigator-label {
    min-width: 50px;
  }
  
  .navigator-select {
    padding: 10px 12px;
    font-size: 16px; /* Mencegah zoom di iOS */
  }
  
  .btn-nav {
    width: 40px;
    height: 40px;
  }
  
  .navigator-info {
    font-size: 0.75rem;
    padding: 3px 8px;
  }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  .kelas-mapel-navigator {
    border-radius: 12px;
  }
  
  .kelas-navigator,
  .mapel-navigator {
    padding: 8px 10px;
    gap: 6px;
  }
  
  /* Sembunyikan label di mobile, hanya tampilkan ikon */
  .navigator-label span {
    display: none;
  }
  
  .navigator-label i {
    font-size: 1.2rem;
  }
  
  .kelas-navigator .navigator-label,
  .mapel-navigator .navigator-label {
    min-width: auto;
  }
  
  .navigator-label i {
    font-size: 1.1rem;
  }
  
  .navigator-select {
    padding: 8px 10px;
    font-size: 14px;
    background-position: right 8px center;
    padding-right: 30px;
  }
  
  .btn-nav {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  
  /* Sembunyikan info X/Y di mobile jika terlalu sempit */
  .navigator-info {
    display: none;
  }
  
  .progress-mini-text {
    font-size: 0.7rem;
  }
}

/* Very Small Devices */
@media (max-width: 360px) {
  .kelas-navigator,
  .mapel-navigator {
    padding: 6px 8px;
    gap: 5px;
  }
  
  .navigator-select {
    padding: 7px 8px;
    font-size: 13px;
    padding-right: 26px;
    background-size: 12px;
  }
  
  .btn-nav {
    width: 34px;
    height: 34px;
  }
  
  .navigator-actions {
    gap: 4px;
  }
}

/* Jika layar sangat sempit, tombol tetap di samping */
@media (max-width: 320px) {
  .btn-nav {
    width: 32px;
    height: 32px;
  }
  
  .navigator-select {
    padding: 6px 6px;
    font-size: 12px;
    padding-right: 24px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn-nav {
    min-width: 44px;
    min-height: 44px;
  }
  
  .navigator-select {
    min-height: 44px;
  }
  
  .btn-nav:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    border-color: rgba(46, 204, 113, 0.3);
  }
  
  .btn-nav:active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }
}



/* ===== WAVES 3 LAPIS ===== */
.waves-wrapper-inline {
  width: 100%;
  margin: 0 0 -20px 0; /* Hapus margin atas */
  line-height: 0;
  border-radius: 0 0 var(--border-radius-card) var(--border-radius-card);
  overflow: hidden;
}

.waves-svg-inline {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100px;
}

@media (max-width: 768px) {
  .waves-wrapper-inline { margin: 0 0 -20px 0; }
  .waves-svg-inline { max-height: 80px; }
}

@media (max-width: 480px) {
  .waves-wrapper-inline { margin: 0 0 -15px 0; }
  .waves-svg-inline { max-height: 60px; }
}






/* ===== PROGRESS + SEARCH ROW ===== */
.progress-search-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.progress-search-row .mapel-progress-mini {
  flex: 2;
  margin-bottom: 0;
  min-width: 200px;
}

/* Search Siswa */
.search-siswa-wrapper {
  flex: 1;
  min-width: 200px;
}

.search-siswa-box {
  position: relative;
  width: 100%;
}

.search-siswa-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-siswa-input {
  width: 100%;
  padding: 8px 35px 8px 35px;
  border-radius: 30px;
  border: 1.5px solid rgba(46, 204, 113, 0.3);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.search-siswa-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
  outline: none;
}

.search-siswa-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 5px;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.search-siswa-clear:hover {
  color: #e74c3c;
}

.search-siswa-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .progress-search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 5px;
  }
  
  .search-siswa-wrapper {
    width: 100%;
  }
}



/* Parent - centerkan */
.semester-info {
    text-align: center;
    animation: semesterGlow 3s infinite;
}

/* Animasi untuk span */
.semester-value, .tahun-value {
    display: inline-block;
    animation: bounceWord 2s ease-in-out infinite alternate;
    color: #1a5276;
    font-weight: 600;
}

.semester-value { animation-delay: 0s; }
.tahun-value { animation-delay: 1s; }

@keyframes bounceWord {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(2px); }
}