/* =============================================
   CEKLIS UJIAN - Main Stylesheet
   ============================================= */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #0891b2;
  --info-light: #ecfeff;
  --dark: #1e293b;
  --gray: #64748b;
  --gray-light: #f1f5f9;
  --white: #ffffff;
  --border: #e2e8f0;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  color: var(--dark);
  min-height: 100vh;
}

/* ─── NAVBAR ─────────────────────────── */

.navbar {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 0 1.5rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1050;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand .logo-icon {
  background: rgba(255,255,255,0.15);
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.navbar .nav-link {
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  background: rgba(255,255,255,0.1);
}

/* ─── SIDEBAR ────────────────────────── */

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 64px);
  width: 260px;
  padding: 1.25rem 0;
  position: sticky;
  top: 64px;
}

.sidebar .nav-item {
  padding: 0 1rem;
  margin-bottom: 2px;
}

.sidebar .nav-link {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  font-size: 0.925rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar .nav-link .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #94a3b8;
  padding: 1rem 2rem 0.5rem;
  font-weight: 600;
}

/* ─── MAIN CONTENT ───────────────────── */

.main-content {
  padding: 1.75rem;
  flex: 1;
  min-height: calc(100vh - 64px);
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h4 {
  font-weight: 700;
  color: var(--dark);
}

.page-header p {
  color: var(--gray);
  margin: 0;
  font-size: 0.9rem;
}

/* ─── STAT CARDS ─────────────────────── */

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: all 0.25s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

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

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.stat-card.kelas .stat-icon { background: #dbeafe; }
.stat-card.siswa .stat-icon { background: #dcfce7; }
.stat-card.mapel .stat-icon { background: #fffbeb; }
.stat-card.sesi   .stat-icon { background: #ecfeff; }

.stat-card.kelas .stat-value { color: #2563eb; }
.stat-card.siswa .stat-value { color: #16a34a; }
.stat-card.mapel .stat-value { color: #f59e0b; }
.stat-card.sesi   .stat-value { color: #0891b2; }

/* ─── CARDS ──────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 1.5rem;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 1.25rem; }

/* ─── TABLE ──────────────────────────── */

.table {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.table th {
  font-weight: 600;
  color: var(--gray);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  padding: 0.8rem 1rem;
}

.table-hover tbody tr:hover {
  background: var(--gray-light);
}

/* ─── BADGES ─────────────────────────── */

.badge-hadir      { background: #dcfce7; color: #166534; }
.badge-tidak_hadir { background: #fee2e2; color: #991b1b; }
.badge-izin       { background: #fffbeb; color: #92400e; }
.badge-sakit      { background: #f3e8ff; color: #6b21a8; }
.badge-terlambat  { background: #fef9c3; color: #854d0e; }
.badge-aktif      { background: #dcfce7; color: #166534; }
.badge-terkunci   { background: #fee2e2; color: #991b1b; }

/* ─── BUTTONS ────────────────────────── */

.btn { font-weight: 500; border-radius: 8px; padding: 0.5rem 1rem; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-action {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
}

/* ─── FORMS ──────────────────────────── */

.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

/* ─── SESSION CARDS (Pengawas) ───────── */

.sesi-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: all 0.25s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.sesi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

.sesi-card .sesi-meta {
  color: var(--gray);
  font-size: 0.8rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.sesi-card .sesi-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── CEKLIS TABLE ───────────────────── */

.ceklis-table select {
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  min-width: 140px;
}

.ceklis-table textarea {
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

/* ─── IMPORT BOX ─────────────────────── */

.import-box {
  background: var(--gray-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 2px dashed var(--border);
}

/* ─── ALERTS ─────────────────────────── */

.alert {
  border-radius: var(--radius);
  border: none;
  font-size: 0.9rem;
}

/* ─── RESPONSIVE ─────────────────────── */

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.3s;
    height: 100vh;
    top: 0;
  }
  .sidebar.show { transform: translateX(0); }
  .main-content { padding: 1.25rem; }
  
  .ceklis-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 576px) {
  .stat-card { padding: 1rem; }
  .stat-card .stat-value { font-size: 1.3rem; }
}
