:root {
  --ink: #132835;
  --forest: #2f6488;
  --forest-700: #1d4460;
  --forest-900: #122f45;
  --accent: #ef8f2d;
  --accent-100: #fbe6cd;
  /* nuansa compro/pitch deck */
  --off: #f7f9fb;
  --tint: #e9f1f7;
  --line: #dfe6ec;
  --muted: #68747d;
  --ff-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ff-head: "Plus Jakarta Sans", system-ui, sans-serif;
  --ff-display: "Marcellus", Georgia, "Times New Roman", serif;
  --sidebar-width: 264px;
}

body {
  background: var(--off);
  font-family: var(--ff-body);
  color: #20323e;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.fw-semibold, .card-header, .nav-section, thead th {
  font-family: var(--ff-head);
}

a { color: var(--forest); }
a:hover { color: var(--forest-700); }

/* ============================================================
   NAVIGASI (dipakai sidebar desktop & drawer mobile)
   ============================================================ */
.erp-nav {
  background: linear-gradient(180deg, var(--forest-900) 0%, var(--ink) 100%);
  color: #d7e2ec;
}

.erp-nav .brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.05rem 1.15rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.erp-nav .brand img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
}

.erp-nav .brand .title {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .02em;
  line-height: 1.15;
  color: #fff;
}

.erp-nav .brand .subtitle {
  font-size: .66rem;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.erp-nav .nav-section {
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(239, 143, 45, .85); /* gold section labels */
  padding: 1.15rem 1.2rem .4rem;
}

.erp-nav .nav-link {
  color: rgba(217, 229, 222, .85);
  margin: .1rem .6rem .1rem .5rem;
  padding: .5rem .7rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .9rem;
  border-radius: .55rem;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.erp-nav .nav-link i {
  font-size: 1.02rem;
  width: 1.25rem;
  text-align: center;
  color: rgba(217, 229, 222, .6);
  transition: color .15s ease;
}

.erp-nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
  transform: translateX(2px);
}

.erp-nav .nav-link:hover i { color: var(--accent); }

.erp-nav .nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(47, 100, 136, .9), rgba(47, 100, 136, .45));
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
}

.erp-nav .nav-link.active i { color: var(--accent); }

.erp-nav .badge { font-size: .68rem; }

/* ---- Sidebar desktop: permanen & BISA DI-SCROLL ---- */
.erp-sidebar {
  width: var(--sidebar-width);
  height: 100vh;      /* dikunci setinggi layar... */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
}

.erp-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;   /* ...menunya scroll di dalam sini */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}

.erp-nav-scroll::-webkit-scrollbar { width: 6px; }
.erp-nav-scroll::-webkit-scrollbar-track { background: transparent; }
.erp-nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }
.erp-nav-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .38); }

/* ---- Drawer mobile ---- */
.offcanvas-erp { width: 288px !important; border-right: none; }

.offcanvas-erp .offcanvas-header {
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.offcanvas-erp .offcanvas-header .brand { border-bottom: none; flex: 1; }
.offcanvas-erp .offcanvas-header .btn-close { margin-right: 1rem; }

.offcanvas-erp .offcanvas-body {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}

.offcanvas-erp .offcanvas-body::-webkit-scrollbar { width: 6px; }
.offcanvas-erp .offcanvas-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }

/* ============================================================
   AREA UTAMA
   ============================================================ */
.erp-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 991.98px) {
  .erp-main { margin-left: 0; }
  .erp-content { padding: .9rem; }
}

.erp-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: .55rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.btn-menu {
  padding: .28rem .55rem;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: .45rem;
}

.erp-content { padding: 1.4rem; flex: 1; }

.min-w-0 { min-width: 0; }

/* ============================================================
   KOMPONEN
   ============================================================ */
.btn-forest {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.btn-forest:hover, .btn-forest:focus {
  background: var(--forest-700);
  border-color: var(--forest-700);
  color: #fff;
}

.text-forest { color: var(--forest); }
.bg-forest { background: var(--forest); }

.card {
  border: 1px solid var(--line);
  border-radius: .8rem;
  box-shadow: 0 2px 8px rgba(18, 33, 26, .06);
}
.card > .table-responsive:last-child { border-radius: 0 0 .8rem .8rem; overflow: hidden; }
.card-header { background: #fff; border-bottom-color: var(--line) !important; }
.card-footer { border-top-color: var(--line) !important; }

/* header tabel bernuansa tint hijau muda compro */
.table-light, .table > thead.table-light > tr > th {
  --bs-table-bg: var(--tint);
  background-color: var(--tint);
  color: var(--ink);
}

.stat-card .stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.stat-card .stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
}

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--forest-900) 0%, var(--forest) 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  border: none;
  border-radius: 14px;
}

.table > :not(caption) > * > * { vertical-align: middle; }

.badge-status { font-weight: 500; }

/* ---- Cetak (laporan) ---- */
@media print {
  .erp-sidebar, .erp-topbar, .d-print-none, .alert-dismissible, .offcanvas-erp { display: none !important; }
  .erp-main { margin-left: 0 !important; }
  .erp-content { padding: 0 !important; }
  .card { border: none !important; box-shadow: none !important; }
  body { background: #fff; }
}

/* ---- Selaraskan komponen biru bawaan Bootstrap ke hijau brand ---- */
.nav-pills .nav-link { color: var(--forest); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background-color: var(--forest); }
.text-bg-primary { background-color: var(--forest) !important; }
.btn-primary { --bs-btn-bg: var(--forest); --bs-btn-border-color: var(--forest);
  --bs-btn-hover-bg: var(--forest-700); --bs-btn-hover-border-color: var(--forest-700);
  --bs-btn-active-bg: var(--forest-700); --bs-btn-active-border-color: var(--forest-700); }
.form-control:focus, .form-select:focus {
  border-color: var(--forest); box-shadow: 0 0 0 .25rem rgba(47, 100, 136, .12); }
.form-check-input:checked { background-color: var(--forest); border-color: var(--forest); }
.form-check-input:focus { border-color: var(--forest); box-shadow: 0 0 0 .25rem rgba(47, 100, 136, .12); }
.page-link { color: var(--forest); }
.pagination .active > .page-link, .page-link.active {
  background-color: var(--forest); border-color: var(--forest); }
.dropdown-item.active, .dropdown-item:active { background-color: var(--forest); }
