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

:root {
  --purple:       #534AB7;
  --purple-dark:  #26215C;
  --purple-light: #EEEDFE;
  --teal:         #1D9E75;
  --teal-light:   #E1F5EE;
  --amber:        #EF9F27;
  --amber-light:  #FAEEDA;
  --error:        #E24B4A;
  --error-light:  #FCEBEB;
  --gray-50:      #F9FAFB;
  --gray-100:     #F3F4F6;
  --gray-200:     #E5E7EB;
  --gray-600:     #4B5563;
  --gray-900:     #111827;
  --card-shadow:  0 10px 30px rgba(83, 74, 183, 0.05);
  --glass-bg:     rgba(255, 255, 255, 0.85);
  --glass-border: rgba(83, 74, 183, 0.1);
  --transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--gray-50);
}
::-webkit-scrollbar-thumb {
  background: var(--purple-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--purple);
}

/* Sidebar Styling */
.sidebar {
  background: linear-gradient(180deg, var(--purple-dark) 0%, #15113A 100%);
  min-height: 100vh;
  width: 260px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 4px 0 25px rgba(21, 17, 58, 0.15);
  transition: var(--transition);
  padding: 1.5rem 1rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.5rem;
}

.sidebar-brand i {
  color: var(--teal);
  filter: drop-shadow(0 0 8px rgba(29, 158, 117, 0.5));
}

.sidebar .nav-item {
  margin-bottom: 0.35rem;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
}

.sidebar .nav-link i {
  font-size: 1.1rem;
  transition: var(--transition);
}

.sidebar .nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--purple) 0%, #685FD4 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(83, 74, 183, 0.35);
  font-weight: 600;
}

.sidebar .nav-link.active i {
  color: white;
  transform: scale(1.1);
}

/* Content Layout */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.top-navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 990;
}

.content-body {
  flex: 1;
  padding: 2rem;
}

.footer {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1.25rem 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray-600);
}

/* Card Styling */
.card-premium {
  background: white;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.card-premium:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(83, 74, 183, 0.08);
}

.card-stat {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
}

.card-stat::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: 0.03;
  pointer-events: none;
}

.card-stat-siswa::after { background: var(--purple); }
.card-stat-guru::after { background: var(--teal); }
.card-stat-kuis::after { background: var(--amber); }
.card-stat-nilai::after { background: var(--purple-dark); }

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.stat-icon-purple { background: var(--purple-light); color: var(--purple); }
.stat-icon-teal { background: var(--teal-light); color: var(--teal); }
.stat-icon-amber { background: var(--amber-light); color: var(--amber); }
.stat-icon-dark { background: rgba(38, 33, 92, 0.08); color: var(--purple-dark); }

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Form Styles */
.form-premium .form-control, 
.form-premium .form-select {
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 0.75rem 1rem;
  font-weight: 500;
  transition: var(--transition);
}

.form-premium .form-control:focus, 
.form-premium .form-select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(83, 74, 183, 0.15);
}

.btn-premium {
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-premium-primary {
  background: linear-gradient(135deg, var(--purple) 0%, #685FD4 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(83, 74, 183, 0.25);
}

.btn-premium-primary:hover {
  background: linear-gradient(135deg, #463DA6 0%, var(--purple) 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(83, 74, 183, 0.35);
}

/* Badges */
.badge-premium {
  padding: 0.45em 0.85em;
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.8rem;
}

.badge-purple { background-color: var(--purple-light); color: var(--purple); }
.badge-teal { background-color: var(--teal-light); color: var(--teal); }
.badge-amber { background-color: var(--amber-light); color: var(--amber); }
.badge-error { background-color: var(--error-light); color: var(--error); }

/* Table custom overrides */
.table-premium {
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table-premium tr {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
  transition: var(--transition);
}

.table-premium tr:hover td {
  background-color: var(--purple-light) !important;
}

.table-premium td, .table-premium th {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.table-premium td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.table-premium td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* Login Page Glass Layout */
.auth-body {
  background: radial-gradient(circle at 10% 20%, rgba(38, 33, 92, 1) 0%, rgba(21, 17, 58, 1) 90%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  color: white;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo i {
  font-size: 3rem;
  color: var(--teal);
  filter: drop-shadow(0 0 12px rgba(29, 158, 117, 0.6));
  margin-bottom: 0.75rem;
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}

.login-logo span {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* Responsive sidebar trigger behavior */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
}

/* Absensi Grid Color Coding */
.cell-hadir { background-color: var(--teal-light) !important; color: var(--teal); font-weight: 700; text-align: center; border-radius: 6px; }
.cell-sakit { background-color: var(--purple-light) !important; color: var(--purple); font-weight: 700; text-align: center; border-radius: 6px; }
.cell-izin { background-color: var(--amber-light) !important; color: var(--amber); font-weight: 700; text-align: center; border-radius: 6px; }
.cell-alpa { background-color: var(--error-light) !important; color: var(--error); font-weight: 700; text-align: center; border-radius: 6px; }
