@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #0c0e13;
  --panel: #151922;
  --soft: #1c2230;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #8f98ab;
  --gold: #ffc107;
  --ok: #3ecf8e;
  --ok-bg: rgba(62, 207, 142, 0.14);
  --danger: #ff6b7a;
  --danger-bg: rgba(255, 107, 122, 0.14);
  --warn-bg: rgba(255, 193, 7, 0.14);
  --sidebar: 248px;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}

/* FULL WIDTH LAYOUT */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: #10141c;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.brand img {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
}
.nav-section {
  margin-top: 10px;
  padding: 10px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}
.nav-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}
.nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-btn.active {
  background: rgba(255, 193, 7, 0.12);
  color: var(--gold);
}
.nav-group { display: flex; flex-direction: column; gap: 0; }
.nav-parent { position: relative; }
.nav-parent .nav-label { flex: 1; }
.nav-parent .nav-chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  opacity: 0.75;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.nav-group.is-open > .nav-parent .nav-chevron {
  transform: rotate(180deg);
}
/* Tree persis gaya screenshot: border-kiri + cabang horizontal + › */
.nav-children {
  display: none;
  flex-direction: column;
  margin: 0 0 6px 21px; /* sejajar pusat ikon parent (pad 12 + icon 18/2) */
  padding: 2px 0 0 14px;
  border-left: 1px solid rgba(170, 180, 195, 0.35);
}
.nav-group.is-open > .nav-children {
  display: flex;
}
.nav-child {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 6px 8px 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(190, 198, 210, 0.78);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
}
.nav-child::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: rgba(170, 180, 195, 0.35);
  transform: translateY(-50%);
}
/* Tutup sisa garis vertikal di bawah item terakhir → bentuk L */
.nav-child:last-child::after {
  content: "";
  position: absolute;
  left: -16px;
  top: calc(50% + 0.5px);
  bottom: 0;
  width: 4px;
  background: #10141c;
}
.nav-caret {
  flex-shrink: 0;
  width: 10px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.7;
  color: inherit;
}
.nav-child:hover {
  color: #fff;
  background: transparent;
}
.nav-child.active {
  color: var(--gold);
  background: transparent;
  font-weight: 600;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.main {
  width: 100%;
  min-width: 0;
  padding: 28px 32px 40px;
}
.page-content {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.page-content.is-ready {
  opacity: 1;
  transform: none;
}
.empty-state.soft {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.topbar h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.topbar .lead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--gold); color: #111; }
.btn-soft { background: var(--soft); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(255,107,122,0.25); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.filters input,
.filters select,
.map-select,
.login-card input,
#popular-input {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
.filters input { flex: 1; min-width: 220px; }
.filters select { min-width: 180px; }
.map-select { width: 100%; min-width: 200px; }
.markup-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.markup-input {
  width: 88px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
}
.markup-input:focus {
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.12);
}
.markup-cell span { color: var(--muted); font-size: 13px; font-weight: 700; }
.filters input:focus,
.filters select:focus,
.map-select:focus,
.login-card input:focus,
#popular-input:focus {
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.12);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead { background: #0f131a; }
th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.badge-on { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: rgba(143,152,171,0.14); color: var(--muted); }
.badge-warn { background: var(--warn-bg); color: var(--gold); }

.toggle {
  width: 46px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #3a4252;
  position: relative;
  cursor: pointer;
}
.toggle.on { background: var(--gold); }
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.toggle.on::after { transform: translateX(20px); }
.toggle:disabled { opacity: 0.5; cursor: wait; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.hint-box {
  background: var(--soft);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.deposit-account {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.deposit-account-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.deposit-account-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.2;
  word-break: break-all;
}
.deposit-account-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.tripay-channel-name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tripay-channel-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}
.tripay-channel-icon.placeholder {
  display: inline-block;
  background: var(--soft);
  border: 1px solid var(--line);
}
.tripay-group-row td {
  background: rgba(255,255,255,0.03);
  padding-top: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
tr.is-muted td { opacity: 0.55; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

.banner-table {
  width: 100%;
  border-collapse: collapse;
}
.banner-table th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.banner-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.banner-col-no {
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.banner-thumb {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 21 / 7;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--soft);
  display: block;
}
.banner-thumb--promo {
  aspect-ratio: 3 / 1;
  max-width: 480px;
}
.banner-thumb.fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.banner-detail-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  font-size: 13px;
}
.banner-detail-grid > span {
  color: var(--muted);
  font-weight: 600;
}
.banner-detail-grid input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  color: inherit;
  font: inherit;
}
.banner-detail-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  color: inherit;
  font: inherit;
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}
.banner-detail-grid textarea:focus,
.banner-detail-grid input:focus {
  outline: none;
  border-color: rgba(255, 193, 7, 0.55);
}
.banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 118px;
}
.banner-move {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.btn-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #111;
}
.btn-banner svg {
  width: 14px;
  height: 14px;
}
.btn-banner-edit { background: #2ec4b6; }
.btn-banner-del { background: #e85d5d; color: #fff; }
.btn-banner-up { background: #3dcf6a; }
.btn-banner-down { background: #f0c14b; }

@media (max-width: 900px) {
  .banner-table thead { display: none; }
  .banner-row {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
  }
  .banner-row td {
    display: block;
    border: 0;
    padding: 8px 0;
  }
  .banner-col-no { text-align: left; }
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}
.alert-error { background: var(--danger-bg); color: #ffb4bc; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
#flash {
  position: fixed;
  left: 50%;
  right: auto;
  top: 24px;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 1000;
  min-width: 240px;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
#flash[hidden] {
  display: none !important;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 30% 20%, rgba(255,193,7,0.08), transparent 42%), var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
}
.login-badge {
  display: inline-flex;
  margin: 16px 0 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-card h1 { margin: 0 0 8px; font-size: 26px; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-card label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.login-card input { width: 100%; padding: 12px 14px; }

.btn-sm { padding: 7px 12px; font-size: 12px; }
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.brand-card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.brand-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  overflow: hidden;
  flex-shrink: 0;
  background: #0f131a;
}
.brand-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.brand-card-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255,255,255,0.85);
  background: linear-gradient(135deg, #2a3344, #1a2030);
}
.brand-upload {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0,0,0,0.65);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.brand-card-body { padding: 14px; display: grid; gap: 10px; }
.brand-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.brand-card-head strong { display: block; font-size: 15px; }
.brand-card-head small { color: var(--muted); font-size: 12px; }
.brand-desc {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: #3a4458 var(--panel);
}
.brand-desc::-webkit-scrollbar {
  width: 8px;
}
.brand-desc::-webkit-scrollbar-track {
  background: var(--panel);
  border-radius: 8px;
}
.brand-desc::-webkit-scrollbar-thumb {
  background: #3a4458;
  border-radius: 8px;
  border: 2px solid var(--panel);
}
.brand-desc::-webkit-scrollbar-thumb:hover {
  background: #4d5870;
}
.brand-desc:focus {
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.12);
}
.brand-card-actions { display: flex; justify-content: flex-end; }

/* Settings form (Pusat Bantuan, dll.) */
.settings-form {
  width: 100%;
  max-width: none;
  padding: 0;
  overflow: hidden;
}
.settings-section {
  padding: 22px 24px 24px;
}
.settings-section + .settings-section {
  border-top: 1px solid var(--line);
}
.settings-section-head {
  margin-bottom: 18px;
}
.settings-section-head h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.settings-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.settings-fields {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-fields .field--full {
  grid-column: 1 / -1;
}
.field {
  display: grid;
  gap: 8px;
  margin: 0;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.field-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input::placeholder {
  color: rgba(143, 152, 171, 0.7);
}
.field-input:focus {
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.12);
}
.field-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.field-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}
.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

.settings-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .settings-fields {
    grid-template-columns: 1fr;
  }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-section, .sidebar-foot { display: none; }
  .brand {
    border: 0;
    margin: 0;
    padding: 0 8px 0 0;
    width: 120px;
  }
  .brand img { max-width: 110px; }
  .main { padding: 16px; }
  .stats { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 22px; }
}
