/* ================================================================
   SMAN 1 Bojonegoro — Sistem Keterlambatan
   Design System / Custom CSS
   ================================================================ */

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

/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
  --primary:        #1e40af;
  --primary-light:  #3b82f6;
  --primary-dark:   #1e3a8a;
  --primary-glow:   rgba(59,130,246,.25);
  --accent:         #06b6d4;
  --accent-dark:    #0891b2;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #6366f1;

  --bg:             #f8fafc;
  --bg-secondary:   #f1f5f9;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --surface-hover:  #f1f5f9;
  --border:         #e2e8f0;
  --border-active:  rgba(59,130,246,.5);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;

  --sidebar-width:      260px;
  --sidebar-collapsed:  70px;
  --header-height:      64px;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow:     0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.5);
  --shadow-glow:0 0 20px var(--primary-glow);

  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ════════════════════════════════════════════════════════════════
   AUTH LAYOUT
   ════════════════════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.auth-brand {
  width: 45%;
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1d4ed8 50%, var(--accent-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.auth-brand::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,.12) 0%, transparent 70%);
  bottom: -50px; right: -50px;
}
.auth-brand-content { position: relative; z-index: 1; text-align: center; }
.auth-brand-logo {
  width: 90px; height: 90px;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 40px;
  backdrop-filter: blur(10px);
}
.auth-brand h1 { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.auth-brand p  { color: rgba(255,255,255,.7); font-size: 15px; }
.auth-brand-features { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.auth-feature {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 12px 16px;
  backdrop-filter: blur(4px);
  color: rgba(255,255,255,.9);
  font-size: 13px;
  transition: var(--transition);
}
.auth-feature:hover { background: rgba(255,255,255,.14); }
.auth-feature i { color: var(--accent); font-size: 18px; }

.auth-form-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp .5s ease both;
}
.auth-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auth-card .subtitle { color: var(--text-secondary); margin-bottom: 32px; }

/* Floating Label Input */
.form-floating-custom { position: relative; margin-bottom: 20px; }
.form-floating-custom input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 48px 6px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.form-floating-custom input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-floating-custom label {
  position: absolute;
  top: 50%; left: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: var(--transition);
}
.form-floating-custom input:focus ~ label,
.form-floating-custom input:not(:placeholder-shown) ~ label {
  top: 10px; transform: none;
  font-size: 11px; color: var(--primary-light);
}
.form-floating-custom .input-icon {
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px; cursor: pointer;
}
.form-floating-custom input:focus ~ .input-icon { color: var(--primary-light); }

/* ════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ════════════════════════════════════════════════════════════════ */
.layout-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: #0f172a;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
  min-height: var(--header-height);
}
.sidebar-logo {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white; font-weight: 800;
}
.sidebar-title { 
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}
.sidebar-title h3 { font-size: 13px; font-weight: 700; color: #f8fafc; line-height: 1.2; }
.sidebar-title span { font-size: 11px; color: #94a3b8; }
.sidebar.collapsed .sidebar-title { opacity: 0; width: 0; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }

.nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  color: #64748b; text-transform: uppercase;
  padding: 8px 20px 4px;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  margin: 2px 8px;
  border-radius: var(--radius);
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  background: #1e293b;
  color: #f8fafc;
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(30,64,175,.5), rgba(6,182,212,.2));
  color: var(--primary-light);
  border: 1px solid rgba(59,130,246,.3);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--primary-light);
  border-radius: var(--radius-full);
}
.nav-item i { font-size: 18px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item span { font-size: 13px; font-weight: 500; }
.sidebar.collapsed .nav-item span { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px; }
.sidebar.collapsed .nav-item.active::before { display: none; }

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .nav-item { overflow: visible; }
.nav-tooltip {
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 4px);
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 12px; font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 200;
  box-shadow: var(--shadow);
}
.sidebar.collapsed .nav-item:hover .nav-tooltip { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid #1e293b;
}

/* ── Header ────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

.top-header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--surface-hover); color: var(--primary-light); }

.datetime-widget {
  display: flex; align-items: center; gap: 16px;
}
.datetime-date {
  font-size: 12px; color: var(--text-secondary);
}
.datetime-time {
  font-size: 18px; font-weight: 700;
  color: var(--primary-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.header-user {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.header-user:hover { border-color: var(--primary-light); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
}
.user-info { line-height: 1.2; }
.user-name  { font-size: 13px; font-weight: 600; }
.user-role  { font-size: 11px; color: var(--text-muted); }

/* User dropdown */
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 100;
}
.header-user.open .user-dropdown { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary); font-size: 13px;
  transition: var(--transition); cursor: pointer;
}
.dropdown-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,.15); color: var(--danger); }

/* ── Page Content ───────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

/* ── Breadcrumb ─────────────────────────────────────────────────── */
.breadcrumb-modern {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 20px; font-size: 13px;
}
.breadcrumb-modern a { color: var(--text-secondary); }
.breadcrumb-modern a:hover { color: var(--primary-light); }
.breadcrumb-modern .sep { color: var(--text-muted); font-size: 10px; }
.breadcrumb-modern .current { color: var(--text-primary); font-weight: 500; }

/* ── Page Header ────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════
   COMPONENTS
   ════════════════════════════════════════════════════════════════ */

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: var(--transition);
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--card-color-a), var(--card-color-b));
  opacity: .07;
  transition: opacity var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card:hover::before { opacity: .12; }

.stat-card.blue   { --card-color-a: #1e40af; --card-color-b: #3b82f6; }
.stat-card.green  { --card-color-a: #065f46; --card-color-b: #10b981; }
.stat-card.orange { --card-color-a: #92400e; --card-color-b: #f59e0b; }
.stat-card.purple { --card-color-a: #4c1d95; --card-color-b: #8b5cf6; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.stat-card.blue .stat-icon   { background: rgba(59,130,246,.2);  color: #60a5fa; }
.stat-card.green .stat-icon  { background: rgba(16,185,129,.2);  color: #34d399; }
.stat-card.orange .stat-icon { background: rgba(245,158,11,.2);  color: #fbbf24; }
.stat-card.purple .stat-icon { background: rgba(139,92,246,.2);  color: #a78bfa; }

.stat-value {
  font-size: 32px; font-weight: 800;
  line-height: 1; margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-trend {
  position: absolute; top: 16px; right: 16px;
  font-size: 11px; color: var(--text-muted);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary-light); }
.card-body { padding: 20px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500; font-family: inherit;
  border: none; cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 4px 16px rgba(30,64,175,.4);
  transform: translateY(-1px);
}
.btn-success {
  background: linear-gradient(135deg, #065f46, var(--success));
  color: white;
}
.btn-success:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(16,185,129,.35); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #7f1d1d, var(--danger));
  color: white;
}
.btn-danger:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(239,68,68,.35); transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, #92400e, var(--warning));
  color: white;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); background: rgba(59,130,246,.07); }
.btn-outline.btn-danger { border-color: rgba(239,68,68,.4); color: var(--danger); }
.btn-outline.btn-danger:hover { border-color: var(--danger); background: rgba(239,68,68,.08); color: var(--danger); }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--radius);
  justify-content: center;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-loading { pointer-events: none; }
.btn-loading i { animation: spin .8s linear infinite; }

/* ── Form Controls ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control, .form-select {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 13px; font-family: inherit;
  outline: none;
  transition: var(--transition);
  appearance: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color: var(--text-muted); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select option { background: var(--surface); }

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

.input-group {
  display: flex; gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.input-group:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-glow); }
.input-group .form-control, .input-group .form-select { border: none; border-radius: 0; }
.input-group .form-control:focus, .input-group .form-select:focus { box-shadow: none; }
.input-group-text {
  background: var(--surface-2); border-right: 1px solid var(--border);
  padding: 9px 12px; color: var(--text-muted); display: flex; align-items: center;
}

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
}
.badge-primary { background: rgba(59,130,246,.2);  color: #60a5fa; }
.badge-success { background: rgba(16,185,129,.2);  color: #34d399; }
.badge-warning { background: rgba(245,158,11,.2);  color: #fbbf24; }
.badge-danger  { background: rgba(239,68,68,.2);   color: #f87171; }
.badge-info    { background: rgba(99,102,241,.2);   color: #818cf8; }
.badge-muted   { background: rgba(100,116,139,.2); color: #94a3b8; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table th {
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148,163,184,.08);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-primary);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover td { background: var(--surface-hover); }

/* DataTables overrides */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info { color: var(--text-secondary); font-size: 13px; }
.dataTables_wrapper .dataTables_length select { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary); border-radius: var(--radius-sm); padding: 4px 8px; }
.dataTables_wrapper .dataTables_filter input { background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text-primary); border-radius: var(--radius); padding: 7px 12px; outline: none; }
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--primary-light); }
.dataTables_wrapper .dataTables_paginate .paginate_button { color: var(--text-secondary) !important; border-radius: var(--radius-sm) !important; border: 1px solid transparent !important; padding: 5px 10px !important; margin: 0 2px; font-size: 13px; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--surface-hover) !important; color: var(--text-primary) !important; border-color: var(--border) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: linear-gradient(135deg,var(--primary),var(--primary-light)) !important; color: white !important; border-color: transparent !important; }

/* ── Step Progress ──────────────────────────────────────────────── */
.step-progress {
  display: flex; align-items: center;
  padding: 24px 0; margin-bottom: 24px;
  position: relative;
}
.step-item {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; position: relative;
}
.step-connector {
  flex: 1; height: 2px;
  background: var(--border);
  transition: background .4s ease;
  margin-top: -24px;
}
.step-connector.active { background: var(--primary-light); }
.step-dot {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  color: var(--text-muted);
  transition: all .3s ease;
  z-index: 1;
}
.step-dot.active { border-color: var(--primary-light); background: var(--primary); color: white; box-shadow: 0 0 14px var(--primary-glow); }
.step-dot.done   { border-color: var(--success); background: var(--success); color: white; }
.step-label { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--text-muted); text-align: center; }
.step-item.active .step-label { color: var(--primary-light); }
.step-item.done   .step-label { color: var(--success); }

/* ── Slide Over Panel ───────────────────────────────────────────── */
.slide-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.slide-overlay.open { opacity: 1; pointer-events: all; }

.slide-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 95vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.4);
}
.slide-panel.open { transform: translateX(0); }
.slide-panel-header {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.slide-panel-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ── Skeleton Loading ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
.skeleton-text   { height: 14px; margin-bottom: 8px; }
.skeleton-title  { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-stat   { height: 80px; }
.skeleton-chart  { height: 200px; }
.skeleton-row    { height: 48px; margin-bottom: 4px; }

/* ── Toast Notifications ────────────────────────────────────────── */
#toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  min-width: 280px; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight .3s ease;
  position: relative; overflow: hidden;
}
.toast::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: var(--radius) 0 0 var(--radius);
}
.toast.success::before { background: var(--success); }
.toast.error::before   { background: var(--danger); }
.toast.warning::before { background: var(--warning); }
.toast.info::before    { background: var(--primary-light); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--primary-light); }
.toast-content { flex: 1; }
.toast-title   { font-weight: 600; font-size: 13px; }
.toast-message { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close   { cursor: pointer; color: var(--text-muted); padding: 2px; font-size: 14px; }
.toast-close:hover { color: var(--text-primary); }

/* ── Drag & Drop Upload ─────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary-light);
  background: rgba(59,130,246,.06);
}
.drop-zone-icon { font-size: 48px; color: var(--text-muted); margin-bottom: 12px; }
.drop-zone h4 { font-size: 15px; margin-bottom: 6px; }
.drop-zone p  { font-size: 12px; color: var(--text-secondary); }

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center;
}
.empty-state-icon {
  width: 80px; height: 80px;
  background: var(--surface-2);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--text-muted);
  margin-bottom: 20px;
}
.empty-state h4 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.empty-state p  { color: var(--text-secondary); font-size: 13px; max-width: 300px; }

/* ── Siswa Card (step 2) ────────────────────────────────────────── */
.siswa-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.siswa-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
}
.siswa-card:hover { border-color: var(--primary-light); background: var(--surface-hover); }
.siswa-card.selected { border-color: var(--primary-light); background: rgba(59,130,246,.12); }
.siswa-avatar {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white;
  flex-shrink: 0;
}
.siswa-info { flex: 1; }
.siswa-info .name { font-weight: 600; font-size: 13px; }
.siswa-info .meta { font-size: 11px; color: var(--text-secondary); }

/* ── Section Tabs (Pengaturan) ──────────────────────────────────── */
.section-tabs { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.section-tab {
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
  background: var(--surface-2);
  display: flex; align-items: center; gap: 8px;
}
.section-tab:hover { color: var(--text-primary); background: var(--surface-hover); }
.section-tab.active {
  background: rgba(30,64,175,.2);
  border-color: rgba(59,130,246,.4);
  color: var(--primary-light);
}


/* ── Custom Modals ──────────────────────────────────────────────── */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1060;
  opacity: 0;
  transition: opacity .3s ease;
}
.custom-modal-backdrop.show {
  display: flex;
  opacity: 1;
}
.custom-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform .3s ease;
}
.custom-modal-backdrop.show .custom-modal {
  transform: translateY(0);
}
.custom-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.custom-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.custom-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
}
.custom-modal-close:hover {
  background: var(--surface-2);
  color: var(--danger);
}
.custom-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.custom-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── Misc ───────────────────────────────────────────────────────── */
.divider {
  height: 1px; background: var(--border); margin: 20px 0;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.flex    { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2   { gap: 8px; }
.gap-3   { gap: 12px; }
.gap-4   { gap: 16px; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }

/* Avatar colours (by name initial) */
.av-blue   { background: linear-gradient(135deg,#1e40af,#3b82f6); }
.av-green  { background: linear-gradient(135deg,#065f46,#10b981); }
.av-purple { background: linear-gradient(135deg,#4c1d95,#8b5cf6); }
.av-orange { background: linear-gradient(135deg,#92400e,#f59e0b); }
.av-red    { background: linear-gradient(135deg,#7f1d1d,#ef4444); }
.av-teal   { background: linear-gradient(135deg,#134e4a,#14b8a6); }

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
  0%   { transform: scale(.9); box-shadow: 0 0 0 0 var(--primary-glow); }
  70%  { transform: scale(1);  box-shadow: 0 0 0 10px transparent; }
  100% { transform: scale(.9); box-shadow: 0 0 0 0 transparent; }
}

.animate-fadeInUp { animation: fadeInUp .4s ease both; }
.animate-delay-1  { animation-delay: .1s; }
.animate-delay-2  { animation-delay: .2s; }
.animate-delay-3  { animation-delay: .3s; }
.animate-delay-4  { animation-delay: .4s; }

/* ── Progress Bar ───────────────────────────────────────────────── */
.progress { height: 6px; background: var(--surface-2); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width .4s ease;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stat-cards { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .auth-brand { display: none; }
  .auth-form-section { padding: 24px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .slide-panel { width: 100%; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .datetime-widget { display: none; }
}

/* ── SweetAlert2 Override ───────────────────────────────────────── */
.swal2-container {
  z-index: 10000 !important;
}
