:root {
  --primary: #2563EB;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg: #F8FAFC;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1e293b;
}

/* ---------- Top bar ---------- */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.navbar-brand { font-weight: 700; color: var(--primary) !important; }
.badge-role {
  background: #eff6ff;
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.btn-user { background: none; border: none; font-weight: 500; }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: calc(100vh - 56px); }

.app-sidebar {
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding-top: 1rem;
  flex-shrink: 0;
}
.app-sidebar .nav-link {
  color: #475569;
  padding: 0.7rem 1.3rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.app-sidebar .nav-link i { width: 20px; margin-right: 0.5rem; color: #94a3b8; }
.app-sidebar .nav-link:hover { background: #f1f5f9; color: var(--primary); }
.app-sidebar .nav-link.active {
  background: #eff6ff;
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.app-sidebar .nav-link.active i { color: var(--primary); }

.app-content { flex: 1; padding: 1.75rem; max-width: 100%; overflow-x: hidden; }

@media (max-width: 991px) {
  .app-sidebar { position: fixed; left: -260px; top: 56px; height: 100%; z-index: 1020; transition: left .2s; }
  .app-sidebar.show { left: 0; }
}

/* ---------- Cards ---------- */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  height: 100%;
}
.stat-card .stat-label { color: #64748b; font-size: 0.85rem; font-weight: 500; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; margin-top: 0.25rem; }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
}
.icon-primary { background: var(--primary); }
.icon-success { background: var(--success); }
.icon-warning { background: var(--warning); }
.icon-danger { background: var(--danger); }

.panel {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.panel-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 1rem; }

/* ---------- Badges ---------- */
.badge-status {
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }

/* ---------- Semakan Ahli ---------- */
.semakan-box {
  max-width: 480px;
  margin: 2rem auto;
  text-align: center;
}
.semakan-result {
  max-width: 560px;
  margin: 1.5rem auto 0;
}
.semakan-result .row-line {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.semakan-result .row-line .label { color: #64748b; font-size: 0.85rem; }
.semakan-result .row-line .value { font-weight: 600; }

/* ---------- Login page ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563EB 0%, #1e40af 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-card .app-logo {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin: 0 auto 1rem;
}

/* ---------- Table ---------- */
table.dataTable { font-size: 0.9rem; }
