/* ==========================================================================
   NC Nusantara — Design System (Bootstrap 5.3), MOBILE-FIRST.
   Pola tampilan mengikuti HAFRA (kartu lembut, sidebar gelap, app-shell di HP,
   pohon bergaris) dengan identitas NCN: HITAM & EMAS. Ganti warna cukup di :root.
   Aturan: gaya dasar = layar HP; layar lebih lebar ditambah lewat min-width.
   ========================================================================== */
:root {
  --ink: #111113;               /* hitam utama */
  --ink-2: #1d1d22;
  --ink-3: #2a2a31;
  --gold: #d4af37;              /* emas utama */
  --gold-2: #c9a227;
  --gold-3: #b38b1d;
  --gold-text: #8a6a10;         /* emas tua untuk teks di latar putih (kontras cukup) */
  --gold-light: #fbf6e6;
  --gold-border: #ecdcaa;

  --dark-gradient: linear-gradient(135deg, #0b0b0d 0%, #1d1d22 58%, #2e2716 100%);
  --gold-gradient: linear-gradient(135deg, #f0d77a 0%, #d4af37 50%, #b38b1d 100%);
  --gold-gradient-hover: linear-gradient(135deg, #f5df8c 0%, #dcb94a 50%, #c09624 100%);
  --sidebar-gradient: linear-gradient(180deg, #0c0c0e 0%, #121214 55%, #17140c 100%);
  --bar-bg: #0e0e10;

  --body-bg: #f5f5f3;
  --border-subtle: #e5e4df;
  --text-main: #141416;
  --text-muted: #6b6b73;
  --text-soft: #a1a1aa;

  --shadow-xs: 0 1px 2px 0 rgba(17, 17, 19, .05);
  --shadow-sm: 0 2px 6px 0 rgba(17, 17, 19, .06), 0 1px 2px 0 rgba(17, 17, 19, .03);
  --shadow-md: 0 6px 16px -2px rgba(17, 17, 19, .1), 0 2px 6px -1px rgba(17, 17, 19, .05);
  --shadow-gold: 0 4px 14px 0 rgba(201, 162, 39, .35);

  --radius-sm: .375rem;
  --radius-md: .625rem;
  --radius-lg: .875rem;
  --sidebar-w: 260px;
  --bottom-bar-h: 66px;

  --bs-body-bg: var(--body-bg);
  --bs-body-color: var(--text-main);
  --bs-primary: var(--gold-2);
  --bs-primary-rgb: 201, 162, 39;
  --bs-link-color: var(--gold-text);
  --bs-link-color-rgb: 138, 106, 16;
  --bs-link-hover-color: #6b520b;
  --bs-link-hover-color-rgb: 107, 82, 11;
  --bs-border-color: var(--border-subtle);
  --bs-border-radius: var(--radius-md);
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
}

/* ---------------- Dasar ---------------- */
html { overflow-x: clip; }   /* clip (bukan hidden) supaya geser/scroll di layar sentuh tetap normal */
body {
  font-family: var(--bs-font-sans-serif);
  background: var(--body-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -.01em;
  overflow-x: clip;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; color: #0d0d0f; letter-spacing: -.02em; }
.min-w-0 { min-width: 0; }
.bg-ink { background: var(--dark-gradient) !important; }
.text-gold { color: var(--gold-text) !important; }
.fs-xs { font-size: .75rem; }
.fs-xxs { font-size: .68rem; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------------- Tombol (tinggi min. 44px di HP agar mudah disentuh) ---------------- */
.btn {
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: .6rem 1rem;
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.btn:active { transform: scale(.985); }
.btn-sm { padding: .35rem .75rem; font-size: .8125rem; border-radius: var(--radius-sm); min-height: 36px; }
.btn-brand, .btn-ncn {
  --bs-btn-color: #1a1405; --bs-btn-hover-color: #1a1405; --bs-btn-active-color: #1a1405;
  --bs-btn-bg: var(--gold-2); --bs-btn-hover-bg: var(--gold); --bs-btn-active-bg: var(--gold-3);
  --bs-btn-disabled-bg: var(--gold-2); --bs-btn-disabled-color: #1a1405;
  background-image: var(--gold-gradient); border: 0; box-shadow: var(--shadow-gold); color: #1a1405;
}
.btn-brand:hover, .btn-ncn:hover { background-image: var(--gold-gradient-hover); color: #1a1405; transform: translateY(-1px); }
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--ink-3); --bs-btn-hover-border-color: var(--ink-3); }
.btn-outline-primary, .btn-outline-success, .btn-outline-gold {
  --bs-btn-color: var(--gold-text); --bs-btn-border-color: var(--gold-border);
  --bs-btn-hover-bg: var(--gold-light); --bs-btn-hover-border-color: var(--gold-2); --bs-btn-hover-color: var(--gold-text);
  --bs-btn-active-bg: #f5ead0; --bs-btn-active-border-color: var(--gold-2); --bs-btn-active-color: var(--gold-text);
  background: #fff;
}
.btn-outline-secondary {
  --bs-btn-color: var(--text-muted); --bs-btn-border-color: var(--border-subtle);
  --bs-btn-hover-bg: #fafaf8; --bs-btn-hover-border-color: #cfcfc8; --bs-btn-hover-color: var(--text-main);
  --bs-btn-active-bg: #f1f1ee; --bs-btn-active-color: var(--text-main);
  background: #fff;
}

/* ---------------- Form (16px di HP supaya iOS tidak auto-zoom) ---------------- */
.form-label { font-weight: 500; font-size: .875rem; color: #33333a; margin-bottom: .35rem; }
.form-control, .form-select {
  border-radius: var(--radius-md); border: 1px solid #d4d4cf;
  padding: .6rem .85rem; font-size: 1rem; min-height: 44px; background-color: #fff;
}
.form-control-sm, .form-select-sm { min-height: 36px; padding: .35rem .65rem; font-size: .875rem; }
.form-control:focus, .form-select:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(212, 175, 55, .22); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(212, 175, 55, .22); border-color: var(--gold-2); }
.input-group-text { background: #fafaf8; border-color: #d4d4cf; }
.form-hint { font-size: .8125rem; color: var(--text-muted); line-height: 1.45; }
.check-msg { font-size: .8125rem; min-height: 1.15rem; margin-top: .25rem; }
.check-msg.ok { color: #047857; font-weight: 500; }
.check-msg.bad { color: #dc2626; font-weight: 500; }
@media (min-width: 768px) { .form-control, .form-select { font-size: .9rem; } }

/* ---------------- Kartu ---------------- */
.card { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-title-sm { font-size: .95rem; font-weight: 700; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.card-title-sm i { color: var(--gold-2); }
.kv { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; padding: .45rem 0; border-bottom: 1px dashed #ecebe6; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--text-muted); }
.kv > span:last-child { text-align: right; font-weight: 600; }
.section-title {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--text-muted);
  margin: 1.25rem 0 .65rem; display: flex; align-items: center; gap: .5rem;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }

/* Kartu statistik */
.stat-card { position: relative; overflow: hidden; height: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: #fff; }
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gold-gradient); }
.stat-card .card-body { padding: .9rem; }
.stat-card .stat-label { font-size: .75rem; color: var(--text-muted); }
.stat-card .stat-value { font-size: 1.15rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.25; color: #0d0d0f; word-break: break-word; }
.stat-card .stat-icon {
  width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--gold); flex-shrink: 0; font-size: 1rem;
}
a.stat-card { text-decoration: none; color: inherit; transition: all .2s ease; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gold-border); }
@media (min-width: 576px) {
  .stat-card .card-body { padding: 1.15rem; }
  .stat-card .stat-value { font-size: 1.45rem; }
  .stat-card .stat-icon { width: 42px; height: 42px; font-size: 1.2rem; }
}

/* ---------------- Tabel ---------------- */
.table-brand { margin-bottom: 0; }
.table-brand thead th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--text-muted);
  background: #fafaf8; border-bottom: 1px solid var(--border-subtle); padding: .7rem .85rem; white-space: nowrap;
}
.table-brand tbody td { padding: .7rem .85rem; vertical-align: middle; border-bottom: 1px solid #f1f0ec; font-size: .875rem; }
.table-brand tbody tr:last-child td { border-bottom: 0; }

/* Tabel menjadi tumpukan kartu di HP: tiap <td data-label="..."> tampil "label ..... isi" */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: .7rem .9rem; border-bottom: 1px solid var(--border-subtle); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack tbody td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .15rem 0 !important; border: 0 !important; text-align: right !important; }
  .table-stack tbody td::before { content: attr(data-label); color: var(--text-muted); font-size: .8rem; text-align: left; flex-shrink: 0; }
  .table-stack tbody td:not([data-label])::before { content: none; }
  .table-stack tbody td.td-utama { justify-content: flex-start; text-align: left !important; font-weight: 700; }
  .table-stack tbody td.td-kosong { justify-content: center; }
}

/* ---------------- Badge, alert, pagination ---------------- */
.badge { font-weight: 600; padding: .35em .65em; border-radius: var(--radius-sm); letter-spacing: .02em; }
.alert { border-radius: var(--radius-lg); border: 0; box-shadow: var(--shadow-sm); font-size: .9rem; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #f4f4f1; color: #33333a; }
.pagination { --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); --bs-pagination-color: var(--gold-text); --bs-pagination-hover-color: var(--ink); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--ink); --bs-nav-pills-link-active-color: var(--gold); --bs-nav-link-color: var(--text-muted); --bs-nav-link-hover-color: var(--ink); }

/* Ikon warna lembut */
.tone-gold   { background: var(--gold-light) !important; color: var(--gold-text) !important; }
.tone-ink    { background: var(--ink) !important; color: var(--gold) !important; }
.tone-green  { background: #ecfdf5 !important; color: #059669 !important; }
.tone-amber  { background: #fffbeb !important; color: #d97706 !important; }
.tone-blue   { background: #eff6ff !important; color: #1d4ed8 !important; }
.tone-rose   { background: #fff1f2 !important; color: #e11d48 !important; }
.tone-slate  { background: #f1f1ee !important; color: #52525b !important; }

/* Badge peringkat */
.rk { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.rk-afiliator { background: #f1f1ee; color: #52525b; }
.rk-basic { background: #eff6ff; color: #1d4ed8; }
.rk-premium { background: var(--ink); color: var(--gold); }
.rk-tinggi { background: var(--gold-gradient); color: #1a1405; }

/* ==========================================================================
   LAYOUT KANTOR: sidebar hitam; di HP menjadi menu geser (offcanvas)
   ========================================================================== */
.sidebar { background: var(--sidebar-gradient); color: #fff; }
.sidebar.offcanvas-lg { --bs-offcanvas-bg: #0c0c0e; --bs-offcanvas-color: #fff; --bs-offcanvas-width: 280px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--gold-gradient); color: #1a1405;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; letter-spacing: .02em; flex-shrink: 0;
}
.brand-name { font-weight: 800; letter-spacing: .06em; color: #fff; }
.brand-name span { color: var(--gold); }
.sidebar-brand-box { padding: 1.15rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar .nav-link {
  color: rgba(255, 255, 255, .72); padding: .65rem .95rem; margin: .1rem .75rem; border-radius: var(--radius-md);
  font-size: .9rem; font-weight: 500; display: flex; align-items: center; gap: .75rem; position: relative;
}
.sidebar .nav-link i { font-size: 1.05rem; opacity: .85; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.sidebar .nav-link.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(90deg, rgba(212, 175, 55, .22) 0%, rgba(212, 175, 55, .06) 100%);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .25);
}
.sidebar .nav-link.active::before {
  content: ""; position: absolute; left: -.75rem; top: 20%; height: 60%; width: 3px; border-radius: 0 4px 4px 0;
  background: var(--gold); box-shadow: 0 0 8px var(--gold);
}
.sidebar .nav-link.active i { color: var(--gold); opacity: 1; }
.sidebar-group { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .42); padding: 1.1rem 1.15rem .35rem; font-weight: 700; }
.sidebar-user { background: rgba(0, 0, 0, .3); border-top: 1px solid rgba(255, 255, 255, .08); padding: .85rem 1rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gold-gradient); color: #1a1405;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; flex-shrink: 0;
}
.admin-main { min-width: 0; padding: 1rem; }
.top-header {
  background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: .75rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.page-title { font-size: 1.15rem; margin: 0; }
@media (min-width: 992px) {
  .sidebar { width: var(--sidebar-w); position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
  .admin-main { padding: 1.5rem; }
  .top-header { padding: .85rem 1.5rem; margin-bottom: 1.5rem; }
  .page-title { font-size: 1.35rem; }
  body.sidebar-tutup .sidebar { display: none; }
}

/* ==========================================================================
   LAYOUT MITRA: app-shell di HP (bar atas + menu bawah), navbar di desktop
   ========================================================================== */
.app-top-bar {
  background: var(--dark-gradient); color: #fff;
  padding: calc(.7rem + env(safe-area-inset-top, 0px)) 1rem .75rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  position: sticky; top: 0; z-index: 1020; box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
  border-bottom: 1px solid rgba(212, 175, 55, .25);
}
.app-icon-btn {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; border: 0;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; font-size: 1.1rem;
}
.app-icon-btn:hover, .app-icon-btn:active { background: rgba(255, 255, 255, .2); color: var(--gold); }
.app-top-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: #fff; text-align: center; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-content { padding: 1rem 1rem calc(var(--bottom-bar-h) + 1.5rem + env(safe-area-inset-bottom, 0px)); }
.app-content.tanpa-atas { padding-top: 0; }

/* Menu bawah dengan tombol tengah menonjol (Daftar) */
.app-bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
  height: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bar-bg); border-top: 1px solid rgba(212, 175, 55, .2);
  display: flex; align-items: center; justify-content: space-around;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .25);
}
.app-bottom-item {
  flex: 1 1 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #8e8e96; text-decoration: none; font-size: .68rem; font-weight: 500;
}
.app-bottom-item i { font-size: 1.3rem; line-height: 1; }
.app-bottom-item.active { color: #fff; font-weight: 700; }
.app-bottom-item.active i { color: var(--gold); }
.app-bottom-fab-wrap { flex: 1 1 0; position: relative; display: flex; flex-direction: column; align-items: center; min-height: 54px; justify-content: flex-end; text-decoration: none; }
.app-bottom-fab {
  position: absolute; top: -26px; width: 54px; height: 54px; border-radius: 50%;
  background: var(--gold-gradient); color: #1a1405;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  border: 4px solid var(--bar-bg); box-shadow: 0 8px 20px rgba(212, 175, 55, .4);
}
.app-bottom-fab-lbl { font-size: .68rem; color: #8e8e96; padding-bottom: 6px; }
.app-bottom-fab-wrap.active .app-bottom-fab-lbl { color: #fff; font-weight: 700; }

.mitra-nav { background: var(--dark-gradient); border-bottom: 1px solid rgba(212, 175, 55, .25); }
.mitra-nav .nav-pill { color: rgba(255, 255, 255, .75); padding: .4rem .9rem; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .92rem; }
.mitra-nav .nav-pill:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.mitra-nav .nav-pill.active { color: #1a1405; background: var(--gold-gradient); font-weight: 600; }

@media (min-width: 992px) {
  .app-content { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
  .app-content.tanpa-atas { padding-top: 1.5rem; }
}

/* Dashboard mitra: kartu hero hitam-emas */
.dash-hero {
  background: var(--dark-gradient); color: #fff; position: relative; overflow: hidden;
  margin: 0 -1rem; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 1.25rem; border-radius: 0 0 24px 24px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .55);
}
.dash-hero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .28) 0%, rgba(212, 175, 55, 0) 70%); }
.dash-hero > * { position: relative; z-index: 1; }
.dash-hero-hello { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.dash-hero-sub { font-size: .8rem; color: rgba(255, 255, 255, .7); }
.dash-hero .form-select {
  background-color: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(212, 175, 55, .4); min-height: 36px; font-size: .85rem; padding-top: .3rem; padding-bottom: .3rem;
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d4af37' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.dash-hero .form-select option { color: #141416; }
.dash-balance { display: block; margin-top: 1rem; color: #fff; text-decoration: none; }
.dash-balance:hover { color: #fff; }
.dash-balance-lbl { font-size: .78rem; color: rgba(255, 255, 255, .7); }
.dash-balance-val {
  font-size: 1.85rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15;
  background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1rem; }
.dash-hero-stat { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; padding: .55rem .6rem; color: #fff; text-decoration: none; min-width: 0; }
.dash-hero-stat:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.dash-hero-stat-val { display: block; font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-hero-stat-lbl { display: block; font-size: .66rem; color: rgba(255, 255, 255, .65); }
@media (min-width: 992px) {
  .dash-hero { margin: 0 0 1.5rem; border-radius: 24px; padding: 1.75rem 2rem; }
  .dash-balance-val { font-size: 2.3rem; }
  .dash-hero-stats { grid-template-columns: repeat(3, minmax(0, 230px)); }
}

/* Aksi cepat */
.dash-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.dash-quick-item { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; color: var(--text-main); background: #fff; border: 1px solid var(--border-subtle); border-radius: 16px; padding: .75rem .25rem; box-shadow: var(--shadow-xs); text-align: center; }
.dash-quick-item:hover { border-color: var(--gold-border); box-shadow: var(--shadow-sm); color: var(--text-main); }
.dash-quick-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.dash-quick-lbl { font-size: .74rem; font-weight: 600; line-height: 1.15; }
@media (min-width: 768px) { .dash-quick { grid-template-columns: repeat(6, 1fr); gap: .75rem; } .dash-quick-lbl { font-size: .8rem; } }

.app-section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 1.25rem 0 .65rem; }
.app-section-title { font-size: .95rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .4rem; }
.app-section-title i { color: var(--gold-2); }

/* Kartu HU */
.hu-card { background: #fff; border-radius: 20px; padding: 1rem 1.1rem; border: 1px solid var(--border-subtle); box-shadow: 0 6px 20px -3px rgba(17, 17, 19, .06); }
.hu-card + .hu-card { margin-top: .75rem; }
.hu-no { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--gold); font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hu-pos { font-size: .68rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: #f1f1ee; color: #52525b; }
.chip-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.chip { background: #fafaf8; border: 1px solid #efeee9; border-radius: 14px; padding: .45rem .7rem; min-width: 0; }
.chip-lbl { display: block; font-size: .66rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.chip-val { display: block; font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 576px) { .chip-row { grid-template-columns: repeat(4, 1fr); } }
.progress-tipis { height: 8px; border-radius: 999px; background: #ecebe6; }
.progress-tipis .progress-bar { background: var(--gold-gradient); border-radius: 999px; }

/* Daftar item */
.list-item { background: #fff; border-radius: 16px; padding: .75rem .9rem; display: flex; align-items: center; gap: .75rem; border: 1px solid var(--border-subtle); box-shadow: 0 4px 14px rgba(17, 17, 19, .04); }
.list-item + .list-item { margin-top: .5rem; }
.list-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--gold); font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Pilihan berupa kartu (radio besar, mudah disentuh) */
.opsi { display: flex; align-items: flex-start; gap: .75rem; border: 1.5px solid var(--border-subtle); border-radius: 14px; padding: .75rem .9rem; cursor: pointer; background: #fff; margin: 0; }
.opsi + .opsi { margin-top: .5rem; }
.opsi .form-check-input { margin-top: .2rem; flex-shrink: 0; }
.opsi:has(input:checked) { border-color: var(--gold-2); background: var(--gold-light); box-shadow: 0 0 0 3px rgba(212, 175, 55, .15); }
.opsi:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.opsi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.opsi-grid .opsi + .opsi { margin-top: 0; }

/* Tombol aksi menempel di bawah layar HP (di atas menu bawah) */
.aksi-tempel { position: sticky; bottom: calc(var(--bottom-bar-h) + .5rem + env(safe-area-inset-bottom, 0px)); z-index: 5; }
@media (min-width: 992px) { .aksi-tempel { position: static; } }

/* ==========================================================================
   POHON BINARY (gaya HAFRA): garis penghubung CSS, 3 baris di HP, 4 di desktop
   ========================================================================== */
.tree ul { display: flex; justify-content: center; padding: 16px 0 0; margin: 0; list-style: none; position: relative; }
.tree > ul { padding-top: 0; }
.tree li { flex: 1 1 0; min-width: 0; text-align: center; position: relative; padding: 16px 2px 0; }
.tree > ul > li { padding-top: 0; }
.tree li::before, .tree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 16px; border-top: 2px solid #d6d3c4; }
.tree li::before { right: 50%; }
.tree li::after { left: 50%; border-left: 2px solid #d6d3c4; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid #d6d3c4; border-radius: 0 8px 0 0; }
.tree li:first-child::after { border-radius: 8px 0 0 0; }
.tree > ul > li::before, .tree > ul > li::after { display: none; }
.tree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 16px; border-left: 2px solid #d6d3c4; }
.tree .lvl3 { display: none; }              /* tingkat ke-4 hanya di layar lebar */
@media (min-width: 992px) { .tree .lvl3 { display: flex; } }

.tn {
  display: inline-flex; flex-direction: column; align-items: center; width: 100%; max-width: 168px;
  padding: 6px 3px; border-radius: var(--radius-md); color: var(--text-main); text-decoration: none; line-height: 1.2;
  background: #fff; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-xs); transition: all .2s ease;
}
a.tn:hover, a.tn:focus-visible { background: var(--gold-light); border-color: var(--gold-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--text-main); }
.tn-root { border: 1.5px solid var(--gold-2); box-shadow: 0 0 0 3px rgba(212, 175, 55, .15); max-width: 200px; }
.tn-icon { display: block; width: 40px; height: 40px; }
.tn-icon svg { width: 100%; height: 100%; display: block; }
.tn-root .tn-icon { width: 52px; height: 52px; }
.tn-user { font-family: ui-monospace, monospace; font-size: .7rem; font-weight: 700; color: var(--ink); margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-name { font-size: .66rem; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.tn-rank { font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin: 2px 0 1px; padding: 0 .4rem; border-radius: 999px; }
.tn-stat { font-size: .6rem; color: var(--text-muted); white-space: nowrap; }
.tn-stat b { color: var(--text-main); font-weight: 600; }
.tn-sisa { display: none; }
.tn-hint { font-size: .66rem; color: var(--text-muted); margin-top: 2px; }
.tn-add { border-style: dashed; border-color: var(--gold-border); }
.tn-add .tn-hint { color: var(--gold-text); font-weight: 700; }
.tn-lock { opacity: .55; cursor: not-allowed; box-shadow: none; }
.tn-lock .tn-icon, .tn-add .tn-icon { width: 34px; height: 34px; }
@media (min-width: 400px) { .tn-stat { font-size: .64rem; } }
@media (min-width: 576px) {
  .tn { padding: 8px 6px; }
  .tn-icon { width: 48px; height: 48px; }
  .tn-root .tn-icon { width: 62px; height: 62px; }
  .tn-user { font-size: .8rem; }
  .tn-name { font-size: .74rem; }
  .tn-rank { font-size: .62rem; }
  .tn-stat { font-size: .7rem; }
  .tn-sisa { display: block; }
  .tn-lock .tn-icon, .tn-add .tn-icon { width: 42px; height: 42px; }
}
@media (min-width: 992px) { .lvl3 .tn-icon { width: 38px; height: 38px; } .lvl3 .tn-user { font-size: .72rem; } .lvl3 .tn-name { font-size: .66rem; } .lvl3 .tn-stat { font-size: .62rem; } }

.legend-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .3rem; }
.tree-up { display: flex; justify-content: center; gap: .5rem; margin-bottom: .85rem; flex-wrap: wrap; }
.tree-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
@media (min-width: 576px) { .tree-nav { display: flex; justify-content: space-between; } }

/* ---------------- Login ---------------- */
.auth-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--dark-gradient); position: relative; overflow: hidden; }
.auth-bg::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .22) 0%, rgba(212, 175, 55, 0) 70%); top: -200px; right: -180px; }
.auth-bg::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .12) 0%, rgba(212, 175, 55, 0) 70%); bottom: -160px; left: -140px; }
.auth-card { width: 100%; max-width: 400px; border: 1px solid rgba(212, 175, 55, .3); border-radius: 22px; box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .6); position: relative; z-index: 1; }
.auth-logo { width: 64px; height: 64px; border-radius: 18px; background: var(--ink); color: var(--gold); border: 2px solid var(--gold-2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; letter-spacing: .04em; margin: 0 auto .75rem; box-shadow: var(--shadow-gold); }

/* Tabel berisi kolom isian: di HP label di atas, isian selebar kartu */
@media (max-width: 767.98px) {
  .table-stack.isian tbody td { flex-direction: column; align-items: stretch; gap: .2rem; text-align: left !important; padding: .3rem 0 !important; }
  .table-stack.isian tbody td.td-utama { font-size: 1rem; padding-bottom: .4rem !important; border-bottom: 1px dashed var(--border-subtle) !important; }
  .table-stack.isian .input-group { flex-wrap: nowrap; }
}
@media (min-width: 768px) { .kol-syarat { min-width: 260px; } }
/* Matriks izin: kolom pertama menempel saat digeser ke samping */
.tabel-izin td:first-child, .tabel-izin th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 180px; }
.tabel-izin thead th:first-child { background: #fafaf8; }
.aksi-tempel { background: var(--body-bg); }
.admin-main .aksi-tempel { bottom: 0; padding: .5rem 0; }

/* ---------------- DataTables (gaya NCN, ramah HP) ---------------- */
div.dt-container { font-size: .875rem; }
div.dt-container .dt-search input { min-height: 38px; width: 100% !important; margin-left: 0 !important; }
div.dt-container .dt-length select { min-height: 36px; }
div.dt-container div.dt-layout-row { margin: .5rem 0; }
div.dt-container .pagination { --bs-pagination-padding-x: .65rem; --bs-pagination-font-size: .85rem; flex-wrap: wrap; }
table.dataTable thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: #fafaf8; white-space: nowrap; }
table.dataTable > tbody > tr > td { vertical-align: middle; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before { border-left-color: var(--gold-2); }
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable > tbody > tr.child ul.dtr-details > li { display: flex; justify-content: space-between; gap: 1rem; }
table.dataTable > tbody > tr.child span.dtr-title { color: var(--text-muted); font-weight: 500; }
div.dt-processing > div:last-child > div { background: var(--gold-2); }
@media (max-width: 767.98px) {
  div.dt-container div.dt-layout-row:not(.dt-layout-table) { flex-direction: column; align-items: stretch; gap: .4rem; }
  div.dt-container div.dt-layout-cell { text-align: center !important; padding: 0 !important; }
  div.dt-container .dt-search { width: 100%; }
  div.dt-container .dt-length { display: none; }
  div.dt-container .pagination { justify-content: center !important; }
}
.tree-nav .btn { white-space: nowrap; font-size: .9rem; padding-left: .5rem; padding-right: .5rem; }

/* ---------------- Produk & paket ---------------- */
.produk-foto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); background: #f1f1ee; }
.produk-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-md); background: #f1f1ee; flex-shrink: 0; }
.produk-thumb-kosong { display: flex; align-items: center; justify-content: center; color: var(--text-soft); font-size: 1.4rem; }
.deskripsi-ringkas { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.isi-baris { display: grid; grid-template-columns: minmax(0, 1fr) 72px 44px; gap: .25rem .5rem; align-items: center; }
.isi-baris > select { grid-column: 1; grid-row: 1; min-width: 0; }
.isi-baris > input { grid-column: 2; grid-row: 1; }
.isi-baris > [data-hapus-baris] { grid-column: 3; grid-row: 1; min-height: 44px; }
.isi-sub { grid-column: 1 / -1; grid-row: 2; font-size: .75rem; color: var(--text-muted); }
.isi-baris + .isi-baris { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--border-subtle); }
@media (min-width: 768px) {
  .isi-baris { grid-template-columns: minmax(0, 1fr) 90px 150px 44px; }
  .isi-sub { grid-column: 3; grid-row: 1; text-align: right; font-size: .8rem; }
  .isi-baris > [data-hapus-baris] { grid-column: 4; }
  .isi-baris + .isi-baris { border-top: 0; padding-top: 0; }
}
