:root {
  --sidebar-w: 250px;
  --brand: #0d6efd;
  --brand-dark: #0a4fb8;
  --bg: #f4f6fb;
}

body { background: var(--bg); font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #111b2e;
  color: #cbd5e1;
  overflow-y: auto;
  z-index: 1040;
  transition: transform .25s ease;
}
.sidebar .brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.1rem 1.25rem;
  color: #fff; font-weight: 600; font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}
.sidebar .brand i { font-size: 1.5rem; color: #5aa2ff; }
.sidebar .menu-label {
  padding: 1rem 1.25rem .4rem;
  font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #64748b;
}
.sidebar .nav-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1.25rem;
  color: #cbd5e1; font-size: .92rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link i { font-size: 1.05rem; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: rgba(90,162,255,.14); color: #fff; border-left-color: #5aa2ff; }

.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid #e5e9f2;
  padding: .7rem 1.5rem; position: sticky; top: 0; z-index: 1030;
}
.page-content { padding: 1.5rem; flex: 1; }
.page-footer { padding: 1rem 1.5rem; font-size: .8rem; color: #8492a6; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main-wrap { margin-left: 0; }
}

/* ---------- Komponen ---------- */
.card { border: 0; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: transparent; border-bottom: 1px solid #eef1f6; font-weight: 600; padding: 1rem 1.25rem; }

.stat-card .icon-box {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.stat-card .stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: #6b7a90; font-size: .85rem; }

.table > :not(caption) > * > * { padding: .75rem 1rem; vertical-align: middle; }
.table thead th { background: #f8fafc; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; border-bottom: 1px solid #e5e9f2; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }

.badge-hadir { background: #d1fae5; color: #065f46; }
.badge-izin { background: #dbeafe; color: #1e40af; }
.badge-sakit { background: #fef3c7; color: #92400e; }
.badge-alpa { background: #fee2e2; color: #991b1b; }
.badge-terlambat { background: #ffedd5; color: #9a3412; }
.badge-dinas { background: #ede9fe; color: #5b21b6; }
.badge-menunggu { background: #fef3c7; color: #92400e; }
.badge-disetujui { background: #d1fae5; color: #065f46; }
.badge-ditolak { background: #fee2e2; color: #991b1b; }

.status-radio .btn { font-size: .78rem; padding: .25rem .6rem; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0a4fb8 0%, #111b2e 100%);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.login-card { width: 100%; max-width: 430px; border-radius: 16px; }
.login-logo {
  width: 64px; height: 64px; border-radius: 16px; background: #e8f1ff; color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-size: 2rem;
}

/* ---------- Jadwal grid ---------- */
.jadwal-cell { background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 6px; padding: .4rem .6rem; font-size: .8rem; margin-bottom: .4rem; }
.jadwal-cell .mapel { font-weight: 600; }

@media print {
  .sidebar, .topbar, .no-print, .page-footer { display: none !important; }
  .main-wrap { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
