/* ============================================================
   PORTAL SISWA - STYLE (DARK GLASSMORPHISM)
   ============================================================ */

:root {
  --glass-bg: rgba(30, 30, 45, 0.55);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.4);
  --glass-highlight: inset 0 1px 1px 0 rgba(255, 255, 255, 0.25);
  --accent-gradient: linear-gradient(135deg, #ff1b6b 0%, #45c4ff 100%);
  --text-main: #ffffff;
  --text-muted: #94a3b8;
}

/* PENTING: Definisi class hidden agar elemen benar-benar disembunyikan */
.hidden {
  display: none !important;
}

/* 1. Latar Belakang Gelap Gradasi Warna-Warni */
body {
  background: radial-gradient(circle at 20% 20%, #4a0e4e 0%, transparent 40%),
              radial-gradient(circle at 80% 80%, #0c2042 0%, transparent 40%),
              radial-gradient(circle at 50% 50%, #290828 0%, #090d16 100%) !important;
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  /* CATATAN: display: flex DIHAPUS dari body agar tidak mengganggu layout */
}

/* Pembungkus Utama Area Login & Dashboard (yang mengatur layout) */
.login-wrapper,
.dashboard-wrapper {
  width: 100%;
  min-height: calc(100vh - 40px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 20px;
}

/* 2. Kartu Efek Kaca (Glass Card) */
.card-glass {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-radius: 28px !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow), var(--glass-highlight) !important;
  padding: 30px;
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;
}

/* 3. Kolom Input / Form Fields (Dark Glass Input) */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
  background: rgba(15, 23, 42, 0.4) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
  background: rgba(15, 23, 42, 0.7) !important;
  border-color: rgba(255, 27, 107, 0.8) !important;
  box-shadow: 0 0 15px rgba(255, 27, 107, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Label Teks Form */
label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* 4. Tombol Utama */
.btn-primary {
  background: linear-gradient(90deg, #ff1b6b 0%, #764ba2 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 25px rgba(255, 27, 107, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 20px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
  text-align: center;
  display: block;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(255, 27, 107, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-weight: 500;
  font-size: 13px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
  width: 100%;
}
.btn-danger-outline:hover {
  background: #ef4444;
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* 5. Navigasi Tab */
.dashboard-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.tab-btn.active {
  background: linear-gradient(90deg, #ff1b6b 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 27, 107, 0.3);
}

/* 6. Profil Box */
.profile-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff1b6b, #45c4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
}
.profile-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.info-row {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.6;
}
.info-label { color: #94a3b8; }
.info-colon { color: #64748b; }
.info-value { color: #e2e8f0; font-weight: 500; }

/* 7. Statistik Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.stat-card .stat-number {
  font-size: 22px;
  font-weight: 700;
  color: white;
}
.stat-card .stat-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.stat-card.hadir .stat-number { color: #22c55e; }
.stat-card.izin .stat-number { color: #f59e0b; }
.stat-card.sakit .stat-number { color: #3b82f6; }
.stat-card.alpa .stat-number { color: #ef4444; }
.stat-card.total .stat-number { color: #8b5cf6; }

/* 8. Badge Status */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-hadir { background: #dcfce7; color: #15803d; }
.badge-izin { background: #fef3c7; color: #92400e; }
.badge-sakit { background: #dbeafe; color: #1d4ed8; }
.badge-alpa { background: #fee2e2; color: #991b1b; }
.badge-selesai { background: #dcfce7; color: #15803d; }
.badge-belum { background: #fef3c7; color: #92400e; }
.badge-tugas { background: #ede9fe; color: #6d28d9; }
.badge-catatan { background: #f3e8ff; color: #6b21a8; }

/* 9. Riwayat Item */
.item-riwayat {
  background: rgba(255, 255, 255, 0.05);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s;
}
.item-riwayat:hover {
  background: rgba(255, 255, 255, 0.08);
}
.item-riwayat .riwayat-detail {
  font-size: 13px;
  color: #e2e8f0;
}
.item-riwayat .riwayat-detail strong {
  color: #94a3b8;
  font-weight: 600;
}

/* 10. Filter Row */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 15px;
}
.filter-row .form-group {
  margin-bottom: 0;
  flex: 1 0 120px;
}
.filter-row .form-group label {
  font-size: 10px;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}
.filter-row .form-group input,
.filter-row .form-group select {
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 0;
  margin-bottom: 0;
}
.filter-row .btn {
  padding: 8px 14px;
  font-size: 12px;
  width: auto;
  height: 40px;
}

/* 11. Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}
.pagination-wrapper {
  display: flex;
  gap: 4px;
}
.btn-page {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.btn-page:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.btn-page.active-page {
  background: linear-gradient(90deg, #ff1b6b, #764ba2);
  color: white;
  border-color: transparent;
}
.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 12. Alert / Error */
.error-msg {
  color: #ef4444;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
}
.success-msg {
  color: #22c55e;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
}

/* 13. Tab Content */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* 14. Section Title */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

/* 15. Notifikasi */
.notification-item {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #f59e0b;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #e2e8f0;
}
.notification-item.danger {
  border-left-color: #ef4444;
}
.notification-item.success {
  border-left-color: #22c55e;
}
.notification-item.info {
  border-left-color: #3b82f6;
}

/* 16. Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #ff1b6b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 17. Responsive */
@media (max-width: 480px) {
  .card-glass { padding: 20px; max-width: 100%; }
  .profile-box { flex-direction: column; text-align: center; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-nav { gap: 4px; }
  .tab-btn { padding: 6px 10px; font-size: 11px; }
  .filter-row .form-group { flex: 1 0 100%; }
}