/* DB Panel — tema identik panel admin xtreaming.adflex.app */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin-400-normal-Dhut76fR.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin-700-normal-CfpNZvy6.woff2') format('woff2');
}
:root {
  --bg: #0f0f1a;
  --bg-elev: #171725;
  --bg-card: #1c1c2c;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f1f1f6;
  --text-dim: #a7a7bd;
  --text-mute: #6e6e86;
  --accent: #e11d48;
  --accent-soft: rgba(225, 29, 72, 0.14);
  --green: #2ed573;
  --green-soft: rgba(46, 213, 115, 0.13);
  --amber: #ffa502;
  --amber-soft: rgba(255, 165, 2, 0.13);
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }

/* Scrollbar custom (tipis, gelap, menyatu tema) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
.layout { display: flex; min-height: 100vh; }
.layout-body { flex: 1; min-width: 0; }
.sidebar {
  width: 232px; flex-shrink: 0;
  background: transparent;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; overscroll-behavior: contain;
}
/* Pembatas vertikal menyatu layout — tegas di tengah, meredup di ujung atas-bawah */
.sidebar::after {
  content: '';
  position: absolute; top: 0; bottom: 0; right: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 2%, var(--border) 18%, var(--border) 82%, transparent 98%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-name { font-weight: 800; font-size: 14px; }
.brand-sub { font-size: 10px; color: var(--text-mute); }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.navlink svg { flex-shrink: 0; }
.sidebar .btn { justify-content: center; }
.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 9px;
  color: var(--text-dim); text-decoration: none; font-weight: 600; font-size: 13px;
  border: 1px solid transparent;
}
.navlink:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.navlink.active { background: var(--accent-soft); color: #ff8fa3; border-color: rgba(225,29,72,0.35); }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mute); padding: 12px 12px 5px; }
.main { flex: 1; padding: 26px 28px; min-width: 0; }
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.page-sub { color: var(--text-mute); margin: 0 0 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-decoration: none; display: block;
}
a.stat:hover { border-color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-mute); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.toolbar { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .btn, .toolbar .input { height: 38px; align-self: center; }
.input {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 9px 12px; font-family: inherit; font-size: 13px; outline: none;
  flex: 1; min-width: 160px;
}
.input:focus { border-color: var(--accent); }
.mono { font-size: 12px; }
.muted { color: var(--text-mute); }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--text-dim); flex-wrap: wrap; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  text-align: left; padding: 10px 14px; color: var(--text-mute);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.grid td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
table.grid td .cell-clip {
  display: block; max-width: 240px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px;
}
table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: rgba(255,255,255,0.02); }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  border-radius: 9px; padding: 8px 14px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: rgba(255,71,87,0.12); border-color: rgba(255,71,87,0.4); color: #ff6b81; }
a.btn[disabled] { pointer-events: none; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.dd { position: relative; align-self: center; }
.dd-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 0 12px; height: 38px; font-family: inherit; font-size: 13px;
  cursor: pointer; min-width: 150px;
}
.dd-btn:hover { border-color: var(--accent); }
.dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { color: var(--text-dim); font-size: 12px; }
.dd-list {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 95;
  min-width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  max-height: 240px; overflow-y: auto;
}
.dd-item {
  display: block; width: 100%; text-align: left; white-space: nowrap;
  background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 13px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
}
.dd-item:hover { background: rgba(255, 255, 255, 0.06); }
.dd-item.active { background: var(--accent-soft); color: #fff; font-weight: 700; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 30px 26px; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.login-head { text-align: center; margin-bottom: 18px; }
.login-head h1 { font-size: 20px; margin: 12px 0 4px; }
.login-head p { color: var(--text-mute); font-size: 13px; margin: 0; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.field .input { width: 100%; }
.alert-error { background: rgba(255,71,87,0.12); border: 1px solid rgba(255,71,87,0.4); color: #ff8fa3; border-radius: 9px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

/* Toast — fixed kanan atas, autoclose 4 detik */
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  max-width: 360px; padding: 12px 14px;
  border-radius: 11px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.22s ease-out;
}
.toast-ok { background: #0e2e1d; border: 1px solid rgba(46, 213, 115, 0.5); color: #7bf0a8; }
.toast-x {
  margin-left: auto; background: transparent; border: none; color: inherit;
  font-size: 14px; cursor: pointer; opacity: 0.7; padding: 2px 4px; line-height: 1;
}
.toast-x:hover { opacity: 1; }
@keyframes toast-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal dialog custom */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0, 0, 0, 0.65);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
}
.modal-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.modal-body { color: var(--text-dim); font-size: 13px; line-height: 1.6; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .btn { flex: 1; justify-content: center; }
.topbar { display: none; }
.nav-close { display: none; }
.nav-overlay { display: none; }

@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1000;
    width: min(280px, 84vw); height: 100dvh;
    background: var(--bg-elev);
    transform: translateX(-105%);
    transition: transform 0.22s ease-out;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
  }
  .sidebar::after { display: none; }
  .sidebar.open { transform: translateX(0); }
  .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 990;
    background: rgba(0, 0, 0, 0.55);
  }
  .nav-close {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; width: 32px; height: 32px;
    background: transparent; border: 1px solid var(--border); color: var(--text-dim);
    border-radius: 8px; font-size: 14px; cursor: pointer;
  }
  .topbar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
  .nav-toggle {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
    border-radius: 10px; font-size: 18px; cursor: pointer;
  }
  .topbar-title { font-weight: 800; font-size: 15px; }
  .main { padding: 16px 14px; }
  .page-title { font-size: 18px; }
  .page-sub { font-size: 12px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  table.grid { font-size: 12px; }
  table.grid th, table.grid td { padding: 8px 10px; }
  table.grid td .cell-clip { max-width: 130px; }
}
