:root {
  --sidebar-width: 218px;
  --brand: #0d6efd;
  --brand-dark: #0a58ca;
}

/* Tampilan ringkas: skala dasar diperkecil agar lebih banyak informasi terlihat */
html { font-size: 15px; }

body {
  background: #f4f6f9;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0b2e59, #123a72);
  color: #fff;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  font-weight: 700;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.sidebar-brand i { font-size: 1.15rem; color: #7cc4ff; }

.sidebar-nav { padding: 6px 0 24px; }
.sidebar-nav .nav-section {
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  padding: 11px 14px 3px;
}
.sidebar-nav .nav-link {
  color: rgba(255,255,255,0.85);
  padding: 6px 14px;
  font-size: 0.8rem;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-link i { width: 18px; display: inline-block; font-size: 0.85rem; }
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,0.14);
  border-left-color: #7cc4ff;
  color: #fff;
  font-weight: 600;
}

/* ---------- Layout utama ---------- */
.main-content {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  padding: 7px 16px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-weight: 600; font-size: 0.95rem; margin-left: 6px; }
.topbar .dropdown > a { font-size: 0.82rem; }

.notif-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  font-size: 0.55rem;
}

.page-content {
  padding: 14px 16px;
  flex-grow: 1;
}

.page-footer {
  padding: 9px 16px;
  font-size: 0.72rem;
  color: #6b7280;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

/* ---------- Kartu & KPI ---------- */
.card-kpi {
  border: none;
  border-radius: 9px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.card-kpi .card-body { padding: 0.7rem 0.85rem; }

.card-kpi .kpi-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}
.card-kpi .kpi-value { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.card-kpi .kpi-label { font-size: 0.68rem; color: #6b7280; line-height: 1.25; }

/* ---------- Grafik ---------- */
.chart-box { position: relative; height: 230px; }
.chart-box-sm { position: relative; height: 210px; }
.chart-box-wide { position: relative; height: 190px; }

/* ---------- Tabel & form ---------- */
.table { font-size: 0.8rem; margin-bottom: 0.5rem; }
.table > :not(caption) > * > * { padding: 0.4rem 0.5rem; }
.table thead th {
  background: #f1f5f9;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  white-space: nowrap;
}
.badge { font-size: 0.66rem; font-weight: 600; }

.form-label { font-size: 0.76rem; margin-bottom: 0.2rem; font-weight: 500; }
.form-control, .form-select { font-size: 0.82rem; padding: 0.28rem 0.55rem; }
.btn { font-size: 0.8rem; padding: 0.3rem 0.65rem; }
.btn-sm { font-size: 0.75rem; padding: 0.22rem 0.5rem; }
.alert { font-size: 0.8rem; padding: 0.55rem 0.85rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.85rem; }
.modal-title { font-size: 0.95rem; }
.dropdown-menu { font-size: 0.82rem; }

/* ---------- Halaman login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b2e59, #1b5fa8 60%, #3fa9f5);
}
.login-card {
  width: 100%;
  max-width: 360px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}

@media print {
  .sidebar, .topbar, .page-footer, .no-print { display: none !important; }
  .main-content { width: 100%; }
  .page-content { padding: 0; }
}

@media (max-width: 991px) {
  .sidebar { position: fixed; left: -230px; z-index: 1000; transition: left 0.2s; height: 100vh; }
  .sidebar.show { left: 0; }
}
