:root {
  --sismat-primary: #2f6f4f;
  --sismat-primary-dark: #21503a;
  --sismat-accent: #e8a33d;
  --sismat-bg: #f4f7f5;
}

body {
  background: var(--sismat-bg);
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.sismat-navbar {
  background: linear-gradient(135deg, var(--sismat-primary), var(--sismat-primary-dark));
}

/* ===== SIDEBAR LAYOUT ===== */
.sismat-wrapper {
  display: flex;
  min-height: 100vh;
}

.sismat-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sismat-primary), var(--sismat-primary-dark));
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 0;
}

.sidebar-heading {
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .05em;
  color: rgba(255,255,255,.55);
  padding: 1rem 1.25rem .35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1.25rem;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .93rem;
  border-left: 3px solid transparent;
  transition: background .15s ease;
}

.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-left-color: var(--sismat-accent);
  font-weight: 600;
}

.sidebar-footer {
  padding: .75rem 0 1rem;
  border-top: 1px solid rgba(255,255,255,.15);
}

.sismat-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sismat-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #fff;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid #e3e8e5;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.sismat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1030;
}

@media (max-width: 991.98px) {
  .sismat-sidebar {
    transform: translateX(-100%);
  }
  .sismat-sidebar.show {
    transform: translateX(0);
  }
  .sismat-main {
    margin-left: 0;
  }
  .sismat-overlay.show {
    display: block;
  }
}

.sismat-content {
  min-height: 80vh;
}

.card-stat {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: transform .15s ease;
}
.card-stat:hover { transform: translateY(-3px); }

.card-stat .icon-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #fff;
}

.bg-hadir { background: #2f6f4f !important; }
.bg-sakit { background: #e8a33d !important; }
.bg-izin  { background: #3d7ce8 !important; }
.bg-alpa  { background: #c0392b !important; }

.materi-card {
  border-radius: 14px;
  border: 1px solid #e3e8e5;
  transition: box-shadow .15s ease;
}
.materi-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sismat-primary), var(--sismat-primary-dark));
}

.login-card {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}

#qr-reader {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.badge-status-hadir { background: #2f6f4f; }
.badge-status-sakit { background: #e8a33d; }
.badge-status-izin  { background: #3d7ce8; }
.badge-status-alpa  { background: #c0392b; }