/* =============================================
   MTs Miftahul Hidayah - Sistem Absensi
   Modern Green Theme CSS - Full Responsive
   ============================================= */

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

:root {
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-300: #6ee7b7;
  --green-200: #a7f3d0;
  --green-100: #d1fae5;
  --green-50:  #ecfdf5;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --warning: #f59e0b;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white: #ffffff;
  --sidebar-w: 260px;
  --header-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition: all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 50%, var(--green-500) 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before { display: none; }

.login-bg-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.login-bg-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(4, 60, 35, 0.72);
  z-index: 1;
}

.login-bg-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.login-bg-shapes .shape { position: absolute; border-radius: 50%; background: rgba(255,255,255,.06); }
.shape-1 { width: 400px; height: 400px; top: -100px; right: -100px; }
.shape-2 { width: 300px; height: 300px; bottom: -80px; left: -80px; }
.shape-3 { width: 150px; height: 150px; top: 40%; left: 10%; }

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: white;
  position: relative;
  z-index: 2;
}

.login-left-content { max-width: 420px; }

.login-left-content .school-logo-big {
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,.15);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,.25);
  overflow: hidden;
}

.login-left-content .school-logo-big img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.login-left-content h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
}

.login-left-content p {
  font-size: 1rem;
  opacity: .85;
  line-height: 1.7;
}

.login-right {
  width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 2;
}

.login-card { width: 100%; max-width: 380px; }

.login-card .card-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-card .card-logo {
  width: 72px;
  height: 72px;
  background: var(--green-50);
  border: 3px solid var(--green-200);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  overflow: hidden;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.login-card .subtitle { color: var(--gray-500); font-size: .875rem; }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.input-wrap { position: relative; }

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1rem;
}

.form-control {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  transition: var(--transition);
}

.password-toggle:hover { color: var(--green-600); }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(5,150,105,.3);
  margin-top: 6px;
}

.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(5,150,105,.4); }

.login-role-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.role-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  border: none;
  background: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
}

.role-tab.active {
  background: white;
  color: var(--green-700);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.pw-info {
  margin-top: 14px;
  font-size: .78rem;
  color: var(--gray-400);
  text-align: center;
  line-height: 1.8;
}
.pw-info strong { color: var(--gray-600); }

/* =============================================
   LAYOUT - SIDEBAR + MAIN
   ============================================= */
.app-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 100%);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.2);
  overflow: hidden;
}

.brand-logo img { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }

.brand-text .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  color: white;
  line-height: 1.2;
}

.brand-text .sub { font-size: .68rem; color: var(--green-300); }

.sidebar-user {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--green-500);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: white;
  flex-shrink: 0;
}

.user-info .u-name { font-size: .78rem; font-weight: 600; color: white; line-height: 1.2; }
.user-info .u-role { font-size: .68rem; color: var(--green-300); }

.sidebar-nav { flex: 1; padding: 10px; overflow-y: auto; }

.nav-section-label {
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green-400);
  padding: 8px 8px 4px;
  margin-top: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: rgba(255,255,255,.12); color: white; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--green-400);
  border-radius: 0 4px 4px 0;
}
.nav-item i { width: 18px; text-align: center; font-size: .9rem; }

.sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.btn-logout:hover { background: rgba(239,68,68,.2); color: #fecaca; }

/* MAIN CONTENT */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

/* TOP HEADER */
.top-header {
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--gray-600);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.hamburger:hover { background: var(--gray-100); }

.page-title { flex: 1; min-width: 0; }
.page-title h1 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-title .breadcrumb { font-size: .72rem; color: var(--gray-400); margin-top: 1px; }

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.header-date {
  font-size: .78rem;
  color: var(--gray-500);
  background: var(--gray-50);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  white-space: nowrap;
}

/* PAGE CONTENT */
.page-content { padding: 20px; flex: 1; }

/* =============================================
   CARDS & STATS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.green { background: var(--green-100); color: var(--green-700); }
.stat-icon.blue  { background: var(--info-light); color: var(--info); }
.stat-icon.yellow{ background: var(--accent-light); color: var(--accent); }
.stat-icon.red   { background: var(--danger-light); color: var(--danger); }

.stat-info .value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}
.stat-info .label { font-size: .78rem; color: var(--gray-500); margin-top: 4px; }

/* =============================================
   CARD
   ============================================= */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-900);
}

.card-body { padding: 20px; }

/* =============================================
   TABLE
   ============================================= */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 500px;
}

.table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.table tbody tr:hover { background: var(--green-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm  { padding: 6px 12px; font-size: .78rem; }
.btn-xs  { padding: 4px 10px; font-size: .75rem; }
.btn-lg  { padding: 10px 20px; font-size: .9rem; }

.btn-primary { background: linear-gradient(135deg, var(--green-700), var(--green-500)); color: white; box-shadow: 0 2px 8px rgba(5,150,105,.25); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(5,150,105,.35); transform: translateY(-1px); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-warning { background: var(--accent-light); color: #92400e; }
.btn-warning:hover { background: #fde68a; }
.btn-info { background: var(--info-light); color: var(--info); }
.btn-info:hover { background: #bfdbfe; }
.btn-success { background: var(--green-100); color: var(--green-700); }
.btn-success:hover { background: var(--green-200); }
.btn-white { background: white; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-white:hover { background: var(--gray-50); }
.btn-excel { background: #16a34a; color: white; }
.btn-excel:hover { background: #15803d; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
}

.badge-success { background: var(--green-100); color: var(--green-700); }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--accent-light); color: #92400e; }
.badge-info    { background: var(--info-light); color: var(--info); }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }

/* =============================================
   FORMS
   ============================================= */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.form-control-plain {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .875rem;
  color: var(--gray-800);
  background: white;
  transition: var(--transition);
  outline: none;
}

.form-control-plain:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,.1);
}

select.form-control-plain { cursor: pointer; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .25s ease;
  margin: auto;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-header h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  width: 30px;
  height: 30px;
  background: var(--gray-100);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

.modal-body { padding: 18px 20px; }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-200); }
.alert-danger  { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--accent-light); color: #92400e; border: 1px solid #fcd34d; }

/* =============================================
   TABS (kelas)
   ============================================= */
.kelas-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.kelas-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  transition: var(--transition);
  text-decoration: none;
}

.kelas-tab:hover { border-color: var(--green-400); color: var(--green-700); }
.kelas-tab.active { background: var(--green-600); border-color: var(--green-600); color: white; box-shadow: 0 2px 8px rgba(5,150,105,.3); }

/* =============================================
   ABSENSI RADIO BUTTONS
   ============================================= */
.absensi-options { display: flex; gap: 4px; }

.abs-opt { position: relative; }
.abs-opt input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.abs-opt label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  color: var(--gray-500);
  transition: var(--transition);
}

.abs-opt input[value="Hadir"]:checked + label { background: var(--green-500); border-color: var(--green-500); color: white; }
.abs-opt input[value="Izin"]:checked  + label { background: var(--info);       border-color: var(--info);       color: white; }
.abs-opt input[value="Sakit"]:checked + label { background: var(--warning);    border-color: var(--warning);    color: white; }
.abs-opt input[value="Alfa"]:checked  + label { background: var(--danger);     border-color: var(--danger);     color: white; }
.abs-opt label:hover { border-color: var(--green-400); }

/* =============================================
   FILTER BAR
   ============================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--green-50);
  border-radius: var(--radius);
  border: 1px solid var(--green-100);
}

.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-group label { font-size: .72rem; font-weight: 600; color: var(--gray-600); }

/* =============================================
   SEARCH BOX
   ============================================= */
.search-box { position: relative; }
.search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: .85rem; }
.search-box input {
  padding: 8px 12px 8px 32px;
  border: 2px solid var(--gray-200);
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--gray-800);
  background: white;
  outline: none;
  transition: var(--transition);
  width: 100%;
  min-width: 160px;
}
.search-box input:focus { border-color: var(--green-400); box-shadow: 0 0 0 3px rgba(16,185,129,.08); }

/* =============================================
   REKAP TABLE COLORS
   ============================================= */
.col-hadir { color: var(--green-700); font-weight: 600; }
.col-izin  { color: var(--info);      font-weight: 600; }
.col-sakit { color: var(--warning);   font-weight: 600; }
.col-alfa  { color: var(--danger);    font-weight: 600; }

.progress-bar { height: 6px; background: var(--gray-200); border-radius: 10px; overflow: hidden; width: 60px; }
.progress-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--green-500), var(--green-400)); transition: width .6s ease; }

/* =============================================
   DASHBOARD WELCOME
   ============================================= */
.welcome-banner {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  color: white;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}

.welcome-banner h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.welcome-banner p  { opacity: .8; font-size: .85rem; }

/* =============================================
   IMPORT ZONE
   ============================================= */
.import-zone {
  border: 2px dashed var(--green-300);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  background: var(--green-50);
  cursor: pointer;
  transition: var(--transition);
}
.import-zone:hover { border-color: var(--green-500); background: var(--green-100); }
.import-zone i { font-size: 2rem; color: var(--green-400); margin-bottom: 10px; display: block; }
.import-zone p { color: var(--gray-600); font-size: .85rem; }
.import-zone span { color: var(--green-600); font-weight: 600; }

/* =============================================
   SIDEBAR OVERLAY (mobile)
   ============================================= */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* =============================================
   UTILITIES
   ============================================= */
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-muted  { color: var(--gray-400); font-size: .8rem; }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }

/* Toast */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .3s ease;
  pointer-events: all;
  min-width: 240px;
  max-width: 320px;
}
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
.toast-success { background: var(--green-700); color: white; }
.toast-error   { background: var(--danger);    color: white; }
.toast-info    { background: var(--info);       color: white; }

/* Mapel checkbox */
.mapel-checkbox-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mapel-check-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 2px solid var(--gray-200);
  border-radius: 20px; cursor: pointer; transition: all .2s;
  font-size: .82rem; user-select: none;
}
.mapel-check-item input { display: none; }
.mapel-check-item.checked { background: var(--green-600); border-color: var(--green-600); color: white; font-weight: 600; }
.mapel-check-item:hover { border-color: var(--green-400); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: .875rem; }

/* =============================================
   RESPONSIVE - TABLET (max 1024px)
   ============================================= */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header-date { display: none; }
}

/* =============================================
   RESPONSIVE - MOBILE (max 768px)
   ============================================= */
@media (max-width: 768px) {
  /* Login */
  .login-left { display: none; }
  .login-right { width: 100%; padding: 32px 20px; min-height: 100vh; }
  .login-card { max-width: 100%; }

  /* Sidebar */
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  .sidebar-overlay.open { display: block; }
  .hamburger { display: flex; }
  .main-content { margin-left: 0; }

  /* Header */
  .top-header { padding: 0 14px; gap: 10px; }
  .page-title h1 { font-size: .95rem; }

  /* Page content */
  .page-content { padding: 14px; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px 16px; gap: 12px; }
  .stat-icon { width: 42px; height: 42px; font-size: 1.1rem; }
  .stat-info .value { font-size: 1.5rem; }

  /* Cards */
  .card-header { padding: 12px 16px; gap: 8px; }
  .card-header h3 { font-size: .88rem; }
  .card-body { padding: 14px; }

  /* Filter bar */
  .filter-bar { flex-direction: column; align-items: stretch; padding: 12px 14px; gap: 10px; }
  .filter-group { width: 100%; }
  .filter-group select,
  .filter-group input { width: 100%; }

  /* Form */
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .form-control-plain { font-size: .875rem; padding: 10px 12px; }

  /* Buttons */
  .header-right { gap: 6px; }
  .header-right .btn { padding: 6px 10px; font-size: .78rem; }
  .header-right .btn span { display: none; }

  /* Tables */
  .table { font-size: .78rem; min-width: 400px; }
  .table th, .table td { padding: 8px 10px; }

  /* Modal */
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius) var(--radius) 0 0; max-height: 95vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-header { padding: 16px; }
  .modal-body   { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; }

  /* Welcome banner */
  .welcome-banner { padding: 18px 20px; }
  .welcome-banner h2 { font-size: 1.1rem; }

  /* Kelas tabs */
  .kelas-tabs { gap: 4px; }
  .kelas-tab  { padding: 5px 12px; font-size: .76rem; }

  /* Search */
  .card-header { flex-direction: column; align-items: flex-start; }
  .search-box { width: 100%; }
  .search-box input { min-width: unset; }

  /* Absensi options */
  .abs-opt label { width: 30px; height: 26px; font-size: .68rem; }

  /* Import zone */
  .import-zone { padding: 18px; }
  .import-zone i { font-size: 1.6rem; }

  /* Toast */
  .toast-container { top: 10px; right: 10px; left: 10px; }
  .toast { min-width: unset; max-width: 100%; }
}

/* =============================================
   RESPONSIVE - SMALL MOBILE (max 480px)
   ============================================= */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 1rem; border-radius: 10px; }
  .stat-info .value { font-size: 1.3rem; }
  .stat-info .label { font-size: .72rem; }

  .page-content { padding: 10px; }
  .welcome-banner { padding: 14px 16px; border-radius: var(--radius); }
  .welcome-banner h2 { font-size: 1rem; }
  .welcome-banner p  { font-size: .8rem; }

  .kelas-tab { padding: 5px 10px; font-size: .73rem; }

  .btn-lg { padding: 10px 16px; font-size: .85rem; }

  .table { font-size: .74rem; }
  .table th, .table td { padding: 7px 8px; }
}