/* ============================================================
   OKTA payment — BASE (variabel, reset, komponen umum, layout dashboard)
   Semua CSS proyek ada di folder assets/css/:
     base.css          → file ini (dimuat di semua halaman)
     sidebar.css       → sidebar + top bar mobile (semua halaman /dashboard)
     landing.css       → index.php
     auth.css          → login.php + register.php
     overview.css      → dashboard/index.php
     create.css        → dashboard/create.php
     transactions.css  → dashboard/transactions.php
     withdraw.css      → dashboard/withdraw.php
     disbursement.css  → dashboard/disbursement.php
   Font dimuat lewat <link> di includes/header.php.
   ============================================================ */

:root {
  /* Dark Green Palette */
  --primary: 152 72% 51%;          /* #25df91 */
  --primary-fg: 160 60% 4%;        /* near black for text on green */
  --primary-soft: 152 40% 12%;
  --bg: 160 40% 5%;                /* #07110d */
  --fg: 150 20% 92%;               /* #e8f0ed */
  --card: 155 30% 8%;              /* #0d1b16 */
  --card-2: 155 25% 10%;           /* #101f19 */
  --muted: 150 12% 62%;            /* #9aaba4 */
  --muted-fg: 150 12% 62%;
  --muted-bg: 155 20% 12%;
  --border: 0 0% 100% / 0.08;
  --accent: 152 72% 51%;
  --danger: 350 90% 65%;
  --success: 152 72% 51%;
  --warning: 42 88% 66%;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow: 0 1px 3px hsl(160 40% 2% / 0.4), 0 8px 24px hsl(160 40% 2% / 0.35);
  --shadow-lg: 0 8px 28px hsl(160 40% 2% / 0.5);
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --font-heading: "Cabinet Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --sidebar-w: 245px;
  --mobile-bar-h: 56px;
  --green: #25df91;
  --green-light: #72eab4;
  --green-dark: #0eae6b;

  /* ---- Token tema (dipakai semua file CSS; nilai terang ada di bawah) ---- */
  --c-strong: #ffffff;       /* judul */
  --c-text: #e8f0ed;         /* teks utama */
  --c-text-2: #b9c9c3;       /* teks sekunder */
  --c-muted: #9aaba4;
  --c-muted-2: #71827b;
  --c-bg: #07110d;
  --c-card: #0d1b16;
  --c-card-2: #101f19;
  --c-danger: #ff7d8d;
  --c-warn: #f4c95d;
  --c-green-text: #25df91;   /* hijau untuk teks/ikon */
  --rgb-fg: 255, 255, 255;   /* garis, hover, isian tipis */
  --rgb-ink: 0, 0, 0;        /* latar isian gelap */
  --rgb-bg: 7, 17, 13;
  --rgb-card: 13, 27, 22;
  color-scheme: dark;
}

/* ============================================================
   MODE TERANG — aktif bila <html data-theme="light">
   ============================================================ */
html[data-theme="light"] {
  --primary-soft: 152 40% 90%;
  --bg: 150 27% 96%;
  --fg: 158 45% 9%;
  --card: 0 0% 100%;
  --card-2: 150 25% 96%;
  --muted: 155 12% 36%;
  --muted-fg: 155 12% 36%;
  --muted-bg: 150 20% 93%;
  --border: 160 30% 10% / 0.1;
  --danger: 350 75% 45%;
  --warning: 38 90% 35%;
  --shadow: 0 1px 3px hsl(160 30% 20% / 0.08), 0 8px 24px hsl(160 30% 20% / 0.08);
  --shadow-lg: 0 8px 28px hsl(160 30% 20% / 0.14);

  --c-strong: #0a1a13;
  --c-text: #12261d;
  --c-text-2: #2c4137;
  --c-muted: #4a5f56;
  --c-muted-2: #61756c;
  --c-bg: #f2f7f4;
  --c-card: #ffffff;
  --c-card-2: #eaf2ee;
  --c-danger: #c81e3a;
  --c-warn: #8a5b00;
  --c-green-text: #0a7d4c;
  --rgb-fg: 5, 30, 20;
  --rgb-ink: 60, 110, 90;
  --rgb-bg: 242, 247, 244;
  --rgb-card: 255, 255, 255;
  color-scheme: light;
}
html[data-theme="light"] .badge-pending { background: rgba(190,130,0,0.12); border-color: rgba(190,130,0,0.35); }
html[data-theme="light"] .badge-success { background: rgba(10,125,76,0.1); border-color: rgba(10,125,76,0.3); }
html[data-theme="light"] .badge-failed,
html[data-theme="light"] .alert-error { background: rgba(200,30,58,0.08); border-color: rgba(200,30,58,0.3); }
html[data-theme="light"] .alert-success { background: rgba(10,125,76,0.08); border-color: rgba(10,125,76,0.3); }
html[data-theme="light"] .pg-maint-banner { background: rgba(190,130,0,0.1); border-color: rgba(190,130,0,0.35); }
html[data-theme="light"] .pg-maint-banner span { color: var(--c-warn); }
html[data-theme="light"] .kyc-banner { background: rgba(190,130,0,0.1); border-color: rgba(190,130,0,0.35); }
html[data-theme="light"] .kyc-banner.kyc-rejected { background: rgba(200,30,58,0.07); border-color: rgba(200,30,58,0.3); }
html[data-theme="light"] .kyc-banner.kyc-pending { background: rgba(10,125,76,0.07); border-color: rgba(10,125,76,0.3); }
html[data-theme="light"] .btn-outline:hover:not(:disabled) { border-color: rgba(10,125,76,0.5); }

/* ---- Tombol ganti tema (pojok kanan atas) ---- */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: auto;
  z-index: 10050;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--rgb-fg), 0.18);
  background: hsl(var(--card));
  color: hsl(var(--fg));
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.06); border-color: rgba(37, 223, 145, 0.6); }
.theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ico-sun { display: none; }
html[data-theme="light"] .theme-toggle .ico-sun { display: block; }
html[data-theme="light"] .theme-toggle .ico-moon { display: none; }
@media (max-width: 850px) { .theme-toggle { top: 12px; right: 12px; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: hsl(var(--bg));
  color: hsl(var(--fg));
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .font-heading {
  font-family: var(--font-heading);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---- Util ---- */
.container { max-width: 80rem; margin: 0 auto; padding: 0 1.25rem; }
.text-muted { color: hsl(var(--muted)); }
.text-primary { color: var(--c-green-text); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--muted));
  margin-bottom: 0.4rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.35rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px hsl(160 40% 2% / 0.3);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #04100b;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 223, 145, 0.35);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(var(--rgb-fg), 0.12);
  color: hsl(var(--fg));
  box-shadow: none;
}
.btn-outline:hover:not(:disabled) {
  background: rgba(var(--rgb-fg), 0.06);
  border-color: rgba(37, 223, 145, 0.4);
  color: var(--c-green-text);
}
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---- Form ---- */
.input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid rgba(var(--rgb-fg), 0.1);
  background: hsl(var(--card));
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 1rem;
  color: hsl(var(--fg));
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: rgba(37, 223, 145, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 223, 145, 0.15);
}
.input::placeholder { color: hsl(var(--muted)); }
select.input { cursor: pointer; }

/* ---- Card ---- */
.card {
  background: hsl(var(--card));
  border: 1px solid rgba(var(--rgb-fg), 0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border: 1px solid;
  text-transform: uppercase;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.badge-success { background: rgba(37,223,145,0.12); color: var(--c-green-text); border-color: rgba(37,223,145,0.25); }
.badge-pending { background: rgba(244,201,93,0.12); color: var(--c-warn); border-color: rgba(244,201,93,0.3); }
.badge-failed  { background: rgba(255,125,141,0.1);  color: var(--c-danger);  border-color: rgba(255,125,141,0.25); }

/* ---- Alert ---- */
.alert {
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.alert-error {
  border: 1px solid rgba(255,125,141,0.3);
  background: rgba(255,125,141,0.08);
  color: var(--c-danger);
}
.alert-success {
  border: 1px solid rgba(37,223,145,0.3);
  background: rgba(37,223,145,0.08);
  color: var(--c-green-text);
}

/* ---- Table ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted));
  border-bottom: 1px solid rgba(var(--rgb-fg), 0.08);
  background: rgba(var(--rgb-fg), 0.03);
}
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(var(--rgb-fg), 0.06);
  white-space: nowrap;
}
tr:hover td { background: rgba(var(--rgb-fg), 0.03); }
.text-right { text-align: right; }

/* ---- Copy row ---- */
.copy-row {
  display: flex;
  border: 1.5px solid rgba(var(--rgb-fg), 0.1);
  background: rgba(var(--rgb-fg), 0.03);
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.copy-row .val {
  flex: 1;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  word-break: break-all;
}
.copy-row button {
  padding: 0.5rem 0.85rem;
  border: none;
  border-left: 1px solid rgba(var(--rgb-fg), 0.1);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
  color: hsl(var(--fg));
}
.copy-row button:hover { background: rgba(37,223,145,0.1); }

/* ============================================================
   DASHBOARD LAYOUT (dipakai semua halaman /dashboard)
   ============================================================ */
.dash-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: hsl(var(--bg));
}

.dash-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2rem 1.75rem;
}

.page-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.2rem;
  color: var(--c-strong);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Code block */
pre.code {
  background: #0a1410;
  color: #e2e8f0;
  border: none;
  padding: 1.15rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  overflow-x: auto;
  line-height: 1.65;
  white-space: pre-wrap;
  margin: 0;
  border-radius: var(--radius-sm);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--rgb-fg), 0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--rgb-fg), 0.2); }

/* ============================================================
   MOBILE (≤ 850px) — sidebar berubah jadi drawer + top bar 56px
   ============================================================ */
@media (max-width: 850px) {
  .dash-shell { display: block; }

  /* Selector 2 kelas → menang atas padding halaman tanpa perlu !important */
  .dash-shell .dash-main {
    padding: calc(var(--mobile-bar-h) + 1.25rem) 1rem 2rem;
  }

  .table-wrap { margin: 0 -0.5rem; padding: 0 0.5rem; }

  /* Wajib ≥16px, kalau lebih kecil iOS Safari zoom otomatis saat input difokuskan
     (sengaja pakai !important supaya menang atas ukuran font di CSS tiap halaman) */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }

  /* Cegah scroll halaman saat drawer terbuka */
  body.sidebar-open { overflow: hidden; }
}

@media (max-width: 480px) {
  .dash-shell .dash-main {
    padding: calc(var(--mobile-bar-h) + 1rem) 0.85rem 1.75rem;
  }
  .page-title { font-size: 1.45rem; }
}


/* ---- Banner maintenance ---- */
.pg-maint-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 201, 93, 0.35);
  background: rgba(244, 201, 93, 0.08);
  color: var(--c-warn);
  font-size: 0.85rem;
  line-height: 1.5;
}
.pg-maint-banner svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pg-maint-banner strong { display: block; color: var(--c-warn); margin-bottom: 2px; }
.pg-maint-banner span { color: var(--c-warn); }
.is-maintenance { opacity: 0.55; pointer-events: none; }

/* ---- Form callback merchant: input + tombol Simpan sejajar, tombol penuh di HP ---- */
.cb-form { display: flex; gap: 0.75rem; align-items: stretch; }
.cb-form .input { flex: 1 1 auto; min-width: 0; margin: 0; }
.cb-form .cb-save { flex: 0 0 auto; min-width: 110px; padding: 0.7rem 1.4rem; font-size: 0.9rem; }
@media (max-width: 600px) {
  .cb-form { flex-direction: column; gap: 0.6rem; }
  .cb-form .cb-save { width: 100%; min-width: 0; }
}
