/* ==============================================
   AUTO ORDER DIGITAL STORE
   Modern SaaS Dashboard UI — Dark/Light Theme
   Palette: near-black base + electric blue accent only
   ============================================== */

:root {
  --bg: #08090d;
  --bg-soft: #0d0f14;
  --surface: rgba(18, 20, 27, 0.75);
  --surface-solid: #13151c;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #2f6fed;
  --accent-2: #38bdf8;
  --accent-soft: rgba(47, 111, 237, 0.14);
  --accent-glow: rgba(47, 111, 237, 0.45);
  --gradient: linear-gradient(135deg, #1d4ed8 0%, #2f6fed 60%, #38bdf8 100%);
  --text: #f2f0fb;
  --text-dim: #948fb0;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --radius: 28px;
  --radius-lg: 32px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --shadow-card: 0 10px 34px rgba(10, 6, 25, 0.35);
  color-scheme: dark;
}

/* ---------- Light mode override ---------- */
[data-theme="light"] {
  --bg: #f3f2fa;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-solid: #ffffff;
  --border: rgba(23, 15, 60, 0.08);
  --accent: #1d4ed8;
  --accent-2: #0284c7;
  --accent-soft: rgba(29, 78, 216, 0.10);
  --accent-glow: rgba(29, 78, 216, 0.25);
  --gradient: linear-gradient(135deg, #1d4ed8 0%, #2f6fed 60%, #38bdf8 100%);
  --text: #1a1730;
  --text-dim: #6c6684;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.10);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.10);
  --shadow-card: 0 10px 30px rgba(90, 70, 150, 0.10);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -10%, rgba(47, 111, 237, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.10) 0%, transparent 40%),
    var(--bg) fixed;
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.2px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.sidebar .brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Avatar bulat: foto profil kalau ada, kalau tidak tampil inisial username
   atau ikon default. Dipakai di sidebar brand & mobile app-bar brand. */
.brand-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-appbar-brand .brand-avatar { width: 42px; height: 42px; font-size: 15px; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  background: var(--bg-soft);
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

.sidebar nav a:hover { background: var(--accent-soft); color: var(--text); border-color: var(--accent-glow); }
.sidebar nav a.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 18px var(--accent-glow);
}

.sidebar .logout-link { margin-top: 24px; color: var(--danger); }

.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  cursor: pointer;
}
.theme-toggle .opt {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-dim);
  transition: all 0.15s ease;
}
.theme-toggle .opt.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.main {
  flex: 1;
  padding: 28px 32px;
  max-width: 100%;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.topbar > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.topbar h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.2px; margin: 0; }
.topbar .subtitle { flex: 1 0 100%; color: var(--text-dim); font-size: 13px; margin-top: 0; }

/* ---------- Glass cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card { padding: 18px 20px; position: relative; overflow: hidden; }
.stat-card .label { color: var(--text-dim); font-size: 13px; margin-bottom: 6px; font-weight: 500; position: relative; z-index: 1; }
.stat-card .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); position: relative; z-index: 1; }
.stat-card .card-icon {
  position: absolute;
  top: 50%; right: -6px;
  transform: translateY(-50%);
  width: 72px; height: 72px;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
  color: var(--accent);
}
.stat-card .card-icon svg { width: 100%; height: 100%; stroke-width: 1.5; }

@media (max-width: 700px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-card .value { font-size: 19px; }
  .stat-card .label { font-size: 11px; }
  .stat-card .card-icon { width: 52px; height: 52px; }
}

/* Kartu yang harus selalu memanjang satu baris penuh (bukan setengah), meskipun
   ada di dalam grid 2-kolom pada layar kecil — mis. Status Bot, Total Transaksi. */
.stat-card-wide { grid-column: 1 / -1; }

/* ---------- Balance bar (saldo akun / pencairan / jam WIB) ---------- */
.balance-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}
.balance-item { padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.balance-item .card-icon-static {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.balance-item.pencairan .card-icon-static { background: var(--success-soft); color: var(--success); }
.balance-item .label { color: var(--text-dim); font-size: 12.5px; font-weight: 500; margin-bottom: 3px; }
.balance-item .value { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); }
.balance-item.clock-item { justify-content: center; text-align: center; flex-direction: column; gap: 4px; min-width: 150px; }
.balance-item.clock-item .value { font-size: 22px; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .balance-bar { grid-template-columns: 1fr 1fr; gap: 10px; }
  .balance-item { padding: 12px 14px; gap: 10px; }
  .balance-item .card-icon-static { width: 36px; height: 36px; }
  .balance-item .label { font-size: 11px; }
  .balance-item .value { font-size: 16px; }
  .balance-item.clock-item {
    grid-column: 1 / -1;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-width: 0;
  }
  .balance-item.clock-item .label { font-size: 12px; }
  .balance-item.clock-item .value { font-size: 21px; }
}

/* ---------- Revenue / buyers chart ---------- */
.chart-card { margin-bottom: 24px; }
.chart-legend { display: flex; gap: 18px; align-items: center; }
.chart-legend .dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.chart-legend .dot::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--dot-color, var(--accent));
}
.chart-legend .dot.buyers::before { --dot-color: var(--success); }
.chart-wrap { position: relative; height: 260px; margin-top: 8px; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.chart-tooltip {
  display: none;
  position: absolute;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  pointer-events: none;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  z-index: 2;
}
.chart-tooltip .tt-date { font-weight: 600; margin-bottom: 4px; color: var(--text-dim); font-size: 11px; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.chart-tooltip .tt-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
@media (max-width: 700px) {
  .chart-wrap { height: 220px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { box-shadow: 0 0 0 1px var(--accent-glow), 0 0 18px var(--accent-glow); transform: translateY(-1px); }
.btn-primary { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: 0 6px 16px var(--accent-glow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,0.3); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Forms ---------- */
input, select, textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; display: block; }
.form-group { margin-bottom: 14px; }

/* ---------- Table ---------- */
#table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -24px;
  padding: 0 24px;
}
#table-wrap table { min-width: 560px; }
@media (max-width: 700px) {
  #table-wrap { margin: 0 -16px; padding: 0 16px; }
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--accent-soft); }

.badge { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-inactive { background: var(--danger-soft); color: var(--danger); }

/* ---------- Saldo control widget (modal: tambah/kurang saldo) ---------- */
.saldo-widget {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  padding: 18px;
  margin-bottom: 18px;
}
.saldo-widget .saldo-target {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.saldo-widget .saldo-current {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}
.saldo-widget .saldo-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 14px;
  margin-bottom: 12px;
}
.saldo-widget .saldo-input-row span { color: var(--text-dim); font-size: 14px; font-weight: 600; }
.saldo-widget .saldo-input-row input {
  border: none;
  background: transparent;
  padding: 10px 6px;
  font-size: 16px;
  font-weight: 600;
}
.saldo-widget .saldo-input-row input:focus { box-shadow: none; }
.saldo-widget .saldo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.saldo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.saldo-btn.add { background: var(--gradient); color: #fff; box-shadow: 0 6px 16px var(--accent-glow); }
.saldo-btn.add:hover { filter: brightness(1.08); transform: translateY(-1px); }
.saldo-btn.sub { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,0.3); }
.saldo-btn.sub:hover { background: rgba(248,113,113,0.2); transform: translateY(-1px); }
.saldo-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.saldo-widget .saldo-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 10px; line-height: 1.5; }

/* ---------- Backup download progress ring ---------- */
.backup-progress-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.backup-progress-ring { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.backup-progress-ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.backup-progress-ring circle {
  fill: none;
  stroke-width: 5;
}
.backup-progress-ring .track { stroke: var(--border); }
.backup-progress-ring .fill {
  stroke: var(--accent-2);
  stroke-linecap: round;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  transition: stroke-dashoffset 0.2s ease;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}
.backup-progress-ring span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.backup-progress-label { font-size: 13px; color: var(--text-dim); }

/* ---------- Toast ---------- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 240px;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.25s ease;
  color: var(--text);
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,6,20,0.6);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 420px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.modal-box h2 { margin-top: 0; font-family: var(--font-display); font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Loading ---------- */
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--accent-soft);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-dim); gap: 10px; }

/* ---------- Search / Pagination ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.search-box { max-width: 280px; }
.search-wrap { position: relative; max-width: 280px; flex: 1; }
.search-wrap .search-box { max-width: none; width: 100%; padding-left: 40px; }
.search-wrap-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pagination button {
  width: 32px; height: 32px; border-radius: var(--radius-xs); border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text-dim); cursor: pointer; font-size: 13px;
}
.pagination button.active { background: var(--gradient); color: #fff; border-color: transparent; }

/* ---------- Console (Setting Telegram) ---------- */
.console-box {
  background: #050608;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  color: #8ec5ff;
  height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}
[data-theme="light"] .console-box { background: #0b0d12; color: #a9d6ff; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.off { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* ---------- Login page ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 380px; max-width: 100%; padding: 32px 28px; }
.login-card .brand {
  text-align: center; font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 4px;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-card .tagline { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; display: none; }

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 50%;
    top: 84px;
    width: min(94vw, 380px);
    max-height: calc(100vh - 110px);
    height: auto;
    overflow-y: auto;
    z-index: 999;
    border-radius: var(--radius-lg);
    box-shadow: 0 26px 60px rgba(0,0,0,0.5);
    transform: translate(-50%, -10px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .sidebar.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
  .sidebar { border: 1px solid var(--border); }
  .sidebar .brand { display: none; } /* judul brand udah ada di mobile app-bar */
  .main { padding: 20px; }
  .two-col { grid-template-columns: 1fr !important; }
}

/* ---------- Halaman Profil ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.profile-avatar-upload {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}
.profile-avatar-upload .avatar-big {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  overflow: hidden;
  border: 3px solid var(--surface-solid);
  box-shadow: 0 8px 22px var(--accent-glow);
}
.profile-avatar-upload .avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-upload .avatar-edit-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--surface-solid);
  cursor: pointer;
  box-shadow: 0 4px 10px var(--accent-glow);
}
.profile-avatar-upload .avatar-edit-btn:hover { filter: brightness(1.1); }
.profile-head-info { min-width: 200px; }
.profile-head-info .p-username { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.profile-head-info .p-email { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.profile-avatar-remove {
  font-size: 12px;
  color: var(--danger);
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-xs);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.contact-row .contact-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-row .contact-body { flex: 1; min-width: 0; }
.contact-row .contact-body input {
  border: none; background: transparent; padding: 0; color: var(--text); font-size: 14px; font-weight: 500;
  width: 100%;
}
.contact-row .contact-body input:focus { box-shadow: none; }
.contact-row .contact-label { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* ---------- Kartu Anggota (Kelola Admin, ganti tabel di layar kecil) ---------- */
.admin-list { display: flex; flex-direction: column; gap: 14px; }
.admin-card {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: var(--radius-xs);
  padding: 0;
  overflow: hidden;
}
.admin-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}
.admin-card-id { display: flex; align-items: flex-start; gap: 12px; }
.admin-card-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.admin-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-card-name { font-weight: 700; font-size: 15px; color: var(--text); }
.admin-card-email { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.admin-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.admin-card-actions .btn { padding: 6px 8px; }
.admin-card-gap { height: 16px; }
.admin-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; padding: 0 16px; }
.admin-card-stat { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.admin-card-stat .label { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.admin-card-stat .value { font-size: 15px; font-weight: 700; }
.admin-card-contact { display: flex; gap: 10px; padding: 0 16px 16px; }
.admin-card-contact a.btn, .admin-card-contact span.btn { flex: 1; justify-content: center; text-decoration: none; }
.admin-card-contact .btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ---------- Mobile app-bar (judul brand di paling atas, gaya "header pill" ala referensi) ---------- */
.mobile-appbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  position: sticky;
  top: 10px;
  z-index: 500;
  box-shadow: var(--shadow-card);
}
.mobile-appbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.mobile-appbar-brand span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw;
}
.mobile-appbar .hamburger { display: inline-flex; }
.mobile-appbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 860px) { .mobile-appbar { display: flex; } }

/* ---------- Lonceng notifikasi (pojok kanan atas topbar tiap halaman) ---------- */
/* Wrapper buat gabungin tombol aksi topbar yang udah ada (mis. "+ Tambah
   Produk") bareng lonceng notif di kanan atas, biar gak berantakan spacing-nya. */
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.notif-bell-btn:hover { background: var(--accent-soft); border-color: var(--accent-glow); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface-solid);
}
/* position:fixed + z-index setinggi mungkin -> selalu paling depan, gak akan
   ketutup card/elemen manapun di halaman manapun. Posisi persis (top/left)
   dihitung di JS (positionNotifDropdown) tiap kali dibuka. */
.notif-dropdown {
  display: none;
  position: fixed;
  width: 320px; max-width: calc(100vw - 20px);
  max-height: 380px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  z-index: 99999;
  overflow: hidden;
  flex-direction: column;
}
.notif-dropdown.open { display: flex; }
.notif-dropdown-head {
  padding: 12px 14px;
  font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-body { overflow-y: auto; max-height: 330px; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--text-dim); font-size: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-item-msg { font-size: 12.5px; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; }
.notif-item-time { font-size: 11px; color: var(--text-dim); opacity: 0.75; margin-top: 4px; }

/* ---------- Daftar notif terkirim di Kelola Admin (owner) ---------- */
.notif-admin-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.notif-admin-item:last-child { border-bottom: none; }
.notif-admin-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- Header "Menu" + tombol X di dalam panel (cuma tampil mobile) ---------- */
.sidebar-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.menu-close-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(248,113,113,0.35);
  background: var(--danger-soft);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
@media (max-width: 860px) { .sidebar-mobile-head { display: flex; } }
.hamburger {
  display: none;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: var(--radius-xs);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.hamburger:hover { background: var(--accent-soft); border-color: var(--accent-glow); }
.hamburger svg { width: 20px; height: 20px; }
.topbar .hamburger { display: none !important; } /* diganti tombol hamburger di mobile app-bar */

/* ---------- Backdrop pas sidebar mobile kebuka ---------- */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6, 4, 14, 0.55);
  backdrop-filter: blur(2px);
  z-index: 998;
}
.sidebar-backdrop.open { display: block; }

/* ---------- Icon SVG reusable ---------- */
.svg-icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.svg-icon.sm { width: 14px; height: 14px; }
.svg-icon.lg { width: 24px; height: 24px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent-glow); background: var(--accent-soft); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- Produk & Stok (merged page) ---------- */
.code-badge {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.modal-box-lg { width: 620px; }

.tier-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.tier-row .tier-remove {
  width: 34px; height: 34px; border-radius: var(--radius-xs); border: 1px solid rgba(248,113,113,0.3);
  background: var(--danger-soft); color: var(--danger); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.tier-empty-hint { color: var(--text-dim); font-size: 12px; margin-bottom: 8px; }

/* Header kartu produk di dalam modal Kelola Stok — pengganti <select> polos */
.stock-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(47,111,237,0.16), rgba(56,189,248,0.05));
  border: 1px solid var(--accent-glow);
}
.stock-modal-header .icon {
  width: 46px; height: 46px; border-radius: var(--radius-xs); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--gradient); color: #fff;
}
.stock-modal-header .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.stock-modal-header .meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.mini-stats .mini-card {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; text-align: center;
}
.mini-stats .mini-card .num { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--accent); }
.mini-stats .mini-card .lbl { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---------- Kelola Admin ---------- */
.role-tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-glow); }
