/* assets/css/app.css */
:root {
  --mar:        #2D5A1B;  /* hijau hutan tua */
  --mar-dark:   #1E3D12;  /* hijau gelap */
  --mar-light:  #3D7A26;  /* hijau terang */
  --mar-pale:   #F1F7EE;  /* hijau pucat */
  --sidebar-w:  350px;
  --topbar-h:   52px;
}

body { overflow: hidden; }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--mar-dark);
  overflow-y: auto;
  flex-shrink: 0;
  transition: width .25s ease, padding .25s ease;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px 13px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sb-logo {
  width: 100px; height: 100px; border-radius: 9px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-left: -20px;
  margin-right: -15px;
}
.sb-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sb-name { font-size: 20px; font-weight: 600; color: #fff; }
.sb-org  { font-size: 14px; color: rgba(255,255,255,.45); }

.sb-user {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sb-avatar {
  width: 45px; height: 45px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sb-uname { font-size: 18px; font-weight: 500; color: #fff; }

.sb-section {
  padding: 10px 14px 3px;
  margin-top: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: .9px;
  text-transform: uppercase; color: rgba(255,255,255,.3);
}

.nav-item, a.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin: 1px 6px;
  border-radius: 7px; cursor: pointer;
  color: rgba(255,255,255,.62); font-size: 18px;
  text-decoration: none; transition: background .15s, color .15s;
}
.nav-item i { font-size: 22px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.17); color: #fff; }
.nav-item.locked { opacity: .35; pointer-events: none; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: #fff; border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
  flex-shrink: 0;
}
.topbar-title { font-size: 16px; font-weight: 600; }

/* ── MAIN ── */
#mainContent { height: 100vh; overflow: hidden; }
main { overflow-y: auto; height: calc(100vh - var(--topbar-h) - 42px); }

/* ── CARD ── */
.card { border: 1px solid #e5e7eb; border-radius: 12px; }
.card-header { background: #f9fafb; font-weight: 600; font-size: 14px; }

/* ── TABLE ── */
.table th { font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: .5px; color: #6b7280; background: #f9fafb; }
.table td { font-size: 13px; vertical-align: middle; }
.table tbody tr:hover td { background: var(--mar-pale); }

/* ── BUTTON PRIMARY OVERRIDE ── */
.btn-primary { background: var(--mar); border-color: var(--mar); }
.btn-primary:hover { background: var(--mar-light); border-color: var(--mar-light); }

/* ── FORM ── */
.form-label { font-size: 12px; font-weight: 600; color: #4b5563; }
.form-control:focus, .form-select:focus {
  border-color: var(--mar); box-shadow: 0 0 0 .2rem rgba(107,26,26,.15);
}

/* ── STAT CARDS ── */
.stat-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 18px; background: #fff; }
.stat-label { font-size: 11px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-val { font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.stat-sub { font-size: 12px; color: #9ca3af; margin-top: 3px; }

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: var(--mar-dark);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 16px 30px 32px;
  width: 450px; box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.login-logo {
  width: 200px; height: 200px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin-top: -25px;
  margin-bottom: -25px;
  margin-left: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── PIPELINE STATUS ── */
.pipeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipe-step {
  flex: 1; min-width: 90px; text-align: center;
  padding: 10px 6px; border-radius: 8px; font-size: 12px;
  border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280;
}
.pipe-step.done { background: #E1F5EE; border-color: #9FE1CB; color: #085041; }
.pipe-step.curr { background: var(--mar); border-color: var(--mar); color: #fff; }
.pipe-step i { display: block; font-size: 18px; margin-bottom: 4px; }
.pipe-arrow { color: #d1d5db; font-size: 18px; }

/* ── MISC ── */
.trend-up { color: #059669; }
.trend-dn { color: #dc2626; }
.text-mar  { color: var(--mar); }
.bg-mar    { background: var(--mar); }

/* Sidebar collapsed */
#sidebar.sb-collapsed {
  width: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  min-width: 0 !important;
}

#sidebar.sb-collapsed .sb-brand,
#sidebar.sb-collapsed .sb-user,
#sidebar.sb-collapsed .sb-section,
#sidebar.sb-collapsed .nav-item {
  opacity: 0;
  pointer-events: none;
}

#sidebar {
  transition: width .25s ease, padding .25s ease;
}

/* ── SIDEBAR TOGGLE ── */
#sidebar.sb-collapsed {
  width: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  min-width: 0 !important;
}

#sidebar.sb-collapsed .sb-brand,
#sidebar.sb-collapsed .sb-user,
#sidebar.sb-collapsed .sb-section,
#sidebar.sb-collapsed .nav-item {
  opacity: 0;
  pointer-events: none;
}
