/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #f5b84b;
  --primary-dark: #d99c2e;
  --primary-light: rgba(245,184,75,0.14);
  --purple: #f5b84b;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --red-light: rgba(239,68,68,0.14);
  --red-border: rgba(239,68,68,0.3);
  --text-main: #f1f5f9;
  --text-muted: #9ca3af;
  --bg: #07111d;
  --surface: #0c1622;
  --border: rgba(245,184,75,0.22);
  --radius: 12px;
  --shadow: 0 4px 24px rgba(245,184,75,0.10);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  /* Gold extras */
  --gold: #f5b84b;
  --gold-soft: rgba(245,184,75,0.14);
  --gold-border: rgba(245,184,75,0.45);
  --gold-glow: 0 0 24px rgba(245,184,75,0.18);
  --dark-card: rgba(12,22,34,0.9);
  --border-dark: rgba(255,255,255,0.07);
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background: var(--bg);
  min-height: 100vh;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 20% 40%, rgba(245,184,75,0.10) 0%, transparent 60%), linear-gradient(135deg, #07111d 0%, #0b1929 60%, #070e1a 100%);
  min-height: 100vh;
}

.login-card {
  background: rgba(12,22,34,0.95);
  border-radius: 20px;
  border: 1px solid var(--gold-border);
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), var(--gold-glow);
  animation: fadeUp 0.45s cubic-bezier(.23,1,.32,1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 28px;
}

/* Brand logo wrapper with glow */
.brand-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.brand-logo svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 14px rgba(245, 184, 75, 0.45));
  transition: filter 0.3s, transform 0.3s;
}
.brand-logo:hover svg {
  filter: drop-shadow(0 6px 20px rgba(245, 184, 75, 0.65));
  transform: translateY(-2px) scale(1.04);
}
.brand-glow {
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  background: radial-gradient(ellipse at center, rgba(245,184,75,0.22) 0%, transparent 70%);
  animation: pulseGlow 2.8s ease-in-out infinite;
  z-index: 0;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.12); }
}

/* Brand name with gradient */
.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f5b84b 0%, #fcd97a 50%, #d99c2e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  text-transform: lowercase;
}

/* Tagline */
.brand-tagline {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
  opacity: 0.85;
}

/* Thin divider between brand and form heading */
.brand-divider {
  width: 40px;
  height: 2px;
  margin: 0 auto 16px;
  border-radius: 99px;
  background: linear-gradient(90deg, #f5b84b, #fcd97a);
  opacity: 0.5;
}

.login-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}
.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Form */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 13px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.input-wrapper input {
  width: 100%;
  padding: 11px 42px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(12,22,34,0.8);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input-wrapper input:focus {
  border-color: var(--gold);
  background: rgba(15,28,44,0.95);
  box-shadow: 0 0 0 3px rgba(245,184,75,0.12);
}
.input-wrapper input.error-input {
  border-color: var(--red);
  background: var(--red-light);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.2s;
}
.toggle-password:hover { color: var(--primary); }

/* Error message */
.error-msg {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
  animation: shake 0.35s ease;
}
.error-msg.visible {
  display: flex;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* Login button */
.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #f5b84b, #d99c2e);
  color: #07111d;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 3px 14px rgba(245,184,75,0.35);
  margin-top: 4px;
}
.btn-login:hover:not(:disabled) {
  opacity: 0.93;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,184,75,0.42);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-loader {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.hidden { display: none !important; }
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   SHARED COMPONENTS
   ============================================= */

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #f5b84b, #d99c2e);
  color: #07111d;
  border: none;
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(245,184,75,0.30);
  transition: opacity 0.18s, transform 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: rgba(12,22,34,0.6);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Table */
.table-wrap {
  background: rgba(12,22,34,0.9);
  border: 1px solid rgba(245,184,75,0.18);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead tr {
  background: rgba(7,17,29,0.8);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  color: var(--text-main);
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: rgba(245,184,75,0.05); }

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 600;
}
.badge--active   { background: rgba(16,185,129,0.14); color: #34d399; }
.badge--inactive { background: rgba(255,255,255,0.07); color: #9ca3af; }

/* Action buttons in table */
.action-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
  color: var(--text-muted);
}
.action-btn:hover        { border-color: var(--primary); color: var(--primary); }
.action-btn.action-del   { }
.action-btn.action-del:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* Compact 2×2 action grid in produk table */
.tbl-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  min-width: 170px;
}
.tbl-actions .action-btn { text-align: center; justify-content: center; }

/* Table empty state */
.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.table-empty span { font-size: 2rem; display: block; margin-bottom: 8px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 18, 0.75);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}
.modal-overlay.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: #0c1622;
  border: 1px solid var(--gold-border);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  margin: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), var(--gold-glow);
  animation: slideUp 0.22s cubic-bezier(.23,1,.32,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover { color: var(--red); background: var(--red-light); }

#produkForm { padding: 16px 20px; }

/* form-row = two columns */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* override input-wrapper for modal — simpler inputs */
#produkForm .form-group { margin-bottom: 14px; }
#produkForm label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 5px;
}
#produkForm input,
#produkForm select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(7,17,29,0.9);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}
#produkForm input:focus,
#produkForm select:focus {
  border-color: var(--gold);
  background: rgba(12,22,34,0.95);
  box-shadow: 0 0 0 3px rgba(245,184,75,0.12);
}

.modal-error {
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* ---- Kelola Akun Modal ---- */
.modal-box--wide { max-width: 580px; }

.modal-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Scrollable account list */
.akun-list-wrap {
  max-height: 240px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
}
.akun-list { display: flex; flex-direction: column; }

.akun-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.akun-item:last-child { border-bottom: none; }
.akun-item:hover { background: rgba(245,184,75,0.06); }

.akun-cred {
  flex: 1;
  min-width: 0;
}
.akun-email {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.akun-pass {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.akun-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.akun-status--tersedia { background: rgba(16,185,129,0.14); color: #34d399; }
.akun-status--terjual  { background: rgba(255,255,255,0.06); color: #9ca3af; }

.akun-actions { display: flex; gap: 5px; flex-shrink: 0; }
.akun-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.akun-btn:hover           { border-color: var(--primary); color: var(--primary); }
.akun-btn.akun-btn--del:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.akun-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.akun-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.akun-empty span { font-size: 1.8rem; display: block; margin-bottom: 6px; }

/* Add section */
.akun-add-section { padding: 16px 20px; }

.akun-add-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}
.akun-add-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}
.akun-add-hint code {
  background: rgba(245,184,75,0.1);
  border: 1px solid rgba(245,184,75,0.25);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  color: var(--gold);
}

.akun-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 0.83rem;
  font-family: monospace;
  color: var(--text-main);
  background: rgba(7,17,29,0.9);
  outline: none;
  resize: vertical;
  transition: border-color 0.18s, box-shadow 0.18s;
  line-height: 1.6;
}
.akun-textarea:focus {
  border-color: var(--gold);
  background: rgba(12,22,34,0.95);
  box-shadow: 0 0 0 3px rgba(245,184,75,0.12);
}

.akun-add-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}
.akun-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---- Jual Akun Popup ---- */
.modal-box--jual { max-width: 400px; }

.jual-body {
  padding: 20px 20px 24px;
  text-align: center;
}
.jual-success-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.jual-info-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.jual-cred-block {
  background: rgba(7,17,29,0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
  text-align: left;
}
.jual-cred-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.jual-cred-row:last-child { border-bottom: none; }

.jual-cred-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 68px;
  flex-shrink: 0;
}
.jual-cred-value-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.jual-cred-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: monospace;
  word-break: break-all;
  flex: 1;
}
.jual-copy-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.jual-copy-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(245,184,75,0.1); }
.jual-copy-btn.copied { border-color: var(--green); color: var(--green); background: rgba(16,185,129,0.1); }

.jual-close-btn { width: 100%; justify-content: center; }

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #1e293b;
  color: #fff;
  border-radius: 99px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.3s cubic-bezier(.23,1,.32,1);
  white-space: nowrap;
}
.toast.hidden { display: none; }
.toast svg { color: #34d399; flex-shrink: 0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


:root {
  --sidebar-w: 232px;
}

.dashboard-body {
  background: var(--bg);
  background-image: radial-gradient(ellipse at 80% 10%, rgba(245,184,75,0.07) 0%, transparent 50%),
                    radial-gradient(ellipse at 10% 80%, rgba(245,184,75,0.05) 0%, transparent 45%);
  min-height: 100vh;
  display: flex;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #080f18;
  border-right: 1px solid var(--gold-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.28s cubic-bezier(.23,1,.32,1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--gold-border);
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.sidebar-brand-name {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  background: linear-gradient(135deg, #f5b84b, #fcd97a, #d99c2e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.sidebar-brand-sub {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}
.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-bottom {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gold-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
  background: rgba(245,184,75,0.1);
  color: var(--gold);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(245,184,75,0.2), rgba(245,184,75,0.08));
  color: var(--gold);
  font-weight: 700;
  border-left: 3px solid var(--gold);
  padding-left: 9px;
}
.nav-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--gold-border);
  gap: 10px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}
.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-logout {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sidebar-logout:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

/* ---- Main Wrapper ---- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
.topbar {
  height: 56px;
  background: rgba(8,15,24,0.95);
  border-bottom: 1px solid var(--gold-border);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.sidebar-toggle:hover { background: rgba(245,184,75,0.1); color: var(--gold); }
.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---- Avatar ---- */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5b84b, #d99c2e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar--sm { width: 30px; height: 30px; font-size: 0.78rem; }

/* ---- Page Content ---- */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
}
.page { animation: fadeUp 0.35s ease both; }
.page.hidden { display: none !important; }

/* ---- Greeting Block ---- */
.greeting-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
}
.greeting-crown {
  font-size: 2rem;
  line-height: 1;
  margin-top: 3px;
}
.greeting-text { flex: 1; }
.greeting-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 6px;
}
.greeting-quote {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  animation: quoteFade 0.5s ease both;
}
@keyframes quoteFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card-v2 {
  background: rgba(12,22,34,0.9);
  border: 1px solid rgba(245,184,75,0.18);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.stat-card-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,184,75,0.12), var(--gold-glow);
}
.stat-card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon--purple { background: rgba(245,184,75,0.15); color: var(--gold); }
.icon--blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.icon--green  { background: rgba(16,185,129,0.15); color: #34d399; }
.icon--teal   { background: rgba(13,148,136,0.15); color: #2dd4bf; }

.stat-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-card-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Bot status dot */
.bot-status { font-size: 1rem; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.active  { background: var(--green); box-shadow: 0 0 0 2px rgba(16,185,129,0.25); }
.status-dot.offline { background: #94a3b8; }

/* ---- Info Strip ---- */
.info-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,184,75,0.1);
  border: 1px solid rgba(245,184,75,0.3);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 500;
}

/* ---- Placeholder Pages ---- */
.page--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}
.placeholder-block {
  text-align: center;
  color: var(--text-muted);
}
.placeholder-icon { font-size: 3rem; margin-bottom: 12px; }
.placeholder-block h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.placeholder-block p { font-size: 0.88rem; }

/* ---- Sidebar collapsed (mobile) ---- */
.sidebar.collapsed { transform: translateX(-100%); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.5), 0 0 40px rgba(245,184,75,0.08); }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: 20px 16px 32px; }
  .greeting-title { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .login-card { padding: 28px 20px 24px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}


/* Navbar */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stacked text block: name + tagline */
.nav-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.nav-brand-name {
  font-size: 0.97rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #f5b84b 0%, #fcd97a 50%, #d99c2e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.nav-brand-tagline {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.75;
  text-transform: uppercase;
  line-height: 1;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.btn-logout {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

/* Main */
.dashboard-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 24px;
  animation: fadeUp 0.4s ease both;
}

.welcome-section {
  margin-bottom: 28px;
}
.welcome-section h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.welcome-section p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon--blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon--green  { background: #ecfdf5; color: var(--green); }
.stat-icon--purple { background: #f5f3ff; color: var(--purple); }
.stat-icon--orange { background: #fffbeb; color: var(--orange); }
.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}
.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
}
.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--red); }

/* Info card */
.info-card {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.88rem;
  color: var(--primary-dark);
}
.info-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.info-card p { margin-top: 3px; color: #4338ca; }

/* Responsive */
@media (max-width: 480px) {
  .login-card { padding: 28px 20px 24px; }
  .navbar { padding: 0 16px; }
  .dashboard-main { padding: 20px 14px; }
}

/* =============================================
   REVENUE — stat-card-change indicator
   ============================================= */
.stat-card-change {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 2px;
  display: inline-block;
}

/* Gold revenue card text fix */
#revCardTotal .stat-card-label { color: #92400e; }
#revCardTotal .stat-card-value { color: #92400e; }

/* Revenue chart card */
#revenueChartCard {
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* =============================================
   CSS VARIABLE ALIASES (Pengaturan page)
   ============================================= */
:root {
  --text-primary: var(--text-main);
  --bg-main:      var(--bg);
}

/* =============================================
   SIDEBAR — User Submenu
   ============================================= */
.nav-submenu {
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-submenu.open {
  max-height: 200px;
}
.nav-submenu-item {
  padding: 7px 16px 7px 44px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  margin: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav-submenu-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.nav-submenu-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-item--parent .nav-arrow {
  margin-left: auto;
  transition: transform 0.25s;
  opacity: 0.5;
  flex-shrink: 0;
}
.nav-item--parent.open .nav-arrow {
  transform: rotate(180deg);
}

/* =============================================
   USER TABLE PAGE
   ============================================= */
.user-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.user-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.user-filter-bar input,
.user-filter-bar select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg);
  outline: none;
  transition: border-color 0.18s;
}
.user-filter-bar input { flex: 1; min-width: 180px; }
.user-filter-bar input:focus,
.user-filter-bar select:focus { border-color: var(--primary); background: #fff; }

.badge--active  { background: #ecfdf5; color: #059669; }
.badge--banned  { background: #fef2f2; color: #dc2626; }
.badge--inactive{ background: #f8fafc; color: #94a3b8; }

/* =============================================
   ORDER TRACKING CARD
   ============================================= */
.order-tracker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 24px;
}
.order-tracker-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  background: linear-gradient(to right, var(--primary-light), transparent);
}
.order-tracker-header svg { color: var(--primary); flex-shrink: 0; }
.order-tracker-body { padding: 16px 18px; }
.order-tracker-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg);
  outline: none;
  transition: border-color 0.18s;
  min-width: 0;
}
.order-tracker-input:focus { border-color: var(--primary); background: #fff; }

/* Order Result */
.order-result {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  animation: fadeIn .25s ease;
}
.order-result--notfound {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #dc2626;
  font-size: 13px;
}
.order-result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.order-result-id code {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 9px;
  border-radius: 6px;
}
.order-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
  padding: 12px 16px;
}
.order-result-section { padding: 6px 0; }
.order-result-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.order-result-value { font-size: 13px; color: var(--text-main); }
.order-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  border-top: 1px solid var(--border);
}
.order-account-row:first-child { border-top: none; }
.order-account-no {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.badge--pending { background: rgba(245,184,75,0.14); color: var(--gold); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* =============================================
   DARK GOLD PREMIUM — FINISHING TOUCHES
   ============================================= */

/* Total Pendapatan card — gold glow premium */
#revCardTotal {
  background: linear-gradient(135deg, rgba(245,184,75,0.18) 0%, rgba(217,156,46,0.10) 100%) !important;
  border: 1px solid rgba(245,184,75,0.40) !important;
  box-shadow: 0 0 28px rgba(245,184,75,0.12) !important;
}
#revCardTotal:hover {
  box-shadow: 0 0 40px rgba(245,184,75,0.22), 0 8px 24px rgba(0,0,0,0.4) !important;
  transform: translateY(-2px);
}

/* Dashboard greeting title gold accent */
.greeting-title span,
.greeting-highlight { color: var(--gold); }

/* Form textarea dark */
#produkForm textarea,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(7,17,29,0.9);
  outline: none;
  resize: vertical;
  transition: border-color 0.18s, box-shadow 0.18s;
}
#produkForm textarea:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  background: rgba(12,22,34,0.95);
  box-shadow: 0 0 0 3px rgba(245,184,75,0.12);
}

/* Nav submenu dark */
.nav-submenu {
  background: rgba(8,15,24,0.95);
}
.nav-submenu-item {
  color: var(--text-muted);
}
.nav-submenu-item:hover {
  color: var(--gold);
  background: rgba(245,184,75,0.08);
}
.nav-submenu-item.active {
  color: var(--gold);
  font-weight: 600;
}

/* Order account number badge gold */
.order-account-no {
  background: rgba(245,184,75,0.15);
  color: var(--gold);
}

/* Order result card dark */
.order-result {
  background: rgba(12,22,34,0.95);
  border: 1px solid rgba(245,184,75,0.25);
  border-radius: 12px;
}
.order-result-top {
  background: linear-gradient(135deg, rgba(245,184,75,0.10), rgba(217,156,46,0.05));
  border-bottom: 1px solid rgba(245,184,75,0.18);
}
.order-result-id code {
  color: var(--gold);
}

/* Scrollbar — dark gold */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(7,17,29,0.6); }
::-webkit-scrollbar-thumb {
  background: rgba(245,184,75,0.30);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(245,184,75,0.50); }

/* Page section headers dark */
.page-header { border-bottom: none; }
.page-title  { color: var(--text-main); }

/* Card panel used in settings */
.card-panel {
  background: rgba(12,22,34,0.9);
  border: 1px solid rgba(245,184,75,0.18);
  border-radius: var(--radius);
}

/* User table badge tweaks for dark */
.badge--active  { background: rgba(16,185,129,0.14); color: #34d399; }
.badge--banned  { background: rgba(239,68,68,0.14);  color: #f87171; }

/* Topbar badge glow */
.topbar-badge .avatar {
  box-shadow: 0 0 0 2px rgba(245,184,75,0.35);
}

/* Edit balance overlay dark */
#editBalanceOverlay .modal-box {
  background: #0c1622;
  border: 1px solid var(--gold-border);
}

/* Revenue chart canvas wrapper dark bg */
#revenueChart {
  background: transparent;
}

/* Premium line separator */
.gold-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,184,75,0.4), transparent);
  margin: 16px 0;
}

/* Sidebar nav section label */
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,184,75,0.5);
  padding: 10px 12px 4px;
}

/* Input on dark background — general override */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select {
  color-scheme: dark;
}

/* =============================================
   FINTECH MODE — Animations & Transitions
   ============================================= */

/* Smooth value transitions */
.stat-card-value,
#revDaily,
#revMonthly,
#revTotal {
  transition: color 0.35s ease, text-shadow 0.35s ease, transform 0.25s ease;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Pulse on value change */
@keyframes valuePulse {
  0%   { transform: scale(1);    }
  40%  { transform: scale(1.06); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1);    }
}
.value-pulse {
  animation: valuePulse 0.65s cubic-bezier(.23,1,.32,1) both;
  text-shadow: 0 0 14px rgba(245,184,75,0.45);
}

/* Green glow — harian/bulanan positif */
.green-glow {
  text-shadow: 0 0 12px rgba(34,197,94,0.45);
}

/* Gold glow — total pendapatan */
.gold-glow {
  text-shadow: 0 0 14px rgba(245,184,75,0.55);
}

/* Live refresh badge */
@keyframes revDot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.rev-live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  margin-left: 6px;
  vertical-align: middle;
  animation: revDot 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
}

/* Chart wrapper dark */
.chart-wrapper {
  background: rgba(8,15,24,0.6);
  border: 1px solid rgba(245,184,75,0.12);
  border-radius: 14px;
  padding: 20px;
  position: relative;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}
.chart-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Revenue card change badge */
.stat-card-change {
  display: none;
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}

/* Error fallback text */
#chartFallback {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 40px 0;
}

/* =============================================
   RECENT ORDERS + TOP PRODUCTS WIDGETS
   ============================================= */

.section-card {
  background: rgba(12,22,34,0.88);
  border: 1px solid rgba(245,184,75,0.20);
  border-radius: 14px;
  padding: 16px;
  min-height: 200px;
  transition: border-color 0.3s;
}
.section-card:hover {
  border-color: rgba(245,184,75,0.35);
}

.section-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.section-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}
.section-card-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.83rem;
  padding: 28px 0;
  opacity: 0.7;
}

/* ── Order Item ── */
.order-item {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 10px 6px;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
  cursor: default;
}
.order-item:last-child { border-bottom: none; }
.order-item:hover {
  background: rgba(245,184,75,0.05);
  transform: translateX(4px);
}

/* Fade-in animation for new orders */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.order-new {
  animation: fadeInUp 0.5s cubic-bezier(.23,1,.32,1) both;
}

/* ── Top Product Item ── */
.top-product-item {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
  cursor: default;
}
.top-product-item:last-child { border-bottom: none; }
.top-product-item:hover {
  background: rgba(245,184,75,0.05);
  transform: translateX(3px);
}

/* Progress bar */
.top-product-bar-wrap {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}
.top-product-bar {
  height: 100%;
  background: linear-gradient(90deg, #f5b84b, #fcd97a);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(.23,1,.32,1);
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  #recentOrdersCard,
  #topProductsCard {
    grid-column: 1 / -1;
  }
}

/* =============================================
   ANALYTICS PANEL - SaaS Level
   ============================================= */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.analytics-card {
  background: rgba(12,22,34,0.9);
  border: 1px solid rgba(245,184,75,0.18);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.25s;
  cursor: default;
  overflow: hidden;
}
.analytics-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245,184,75,0.4);
  box-shadow: 0 6px 20px rgba(245,184,75,0.10);
}
.analytics-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(245,184,75,0.3));
}
.analytics-body { flex: 1; min-width: 0; }
.analytics-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  white-space: nowrap;
}
.analytics-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  transition: color 0.3s ease;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analytics-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analytics-badge {
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(245,184,75,0.12);
  border: 1px solid rgba(245,184,75,0.3);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
@media (max-width: 1200px) { .analytics-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .analytics-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .analytics-grid { grid-template-columns: 1fr; } }


/* =============================================
   USER INSIGHT PANEL
   ============================================= */

.insight-mini-card {
  background: rgba(12,22,34,0.9);
  border: 1px solid rgba(245,184,75,0.18);
  border-radius: 12px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.insight-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245,184,75,0.38);
  box-shadow: 0 4px 16px rgba(245,184,75,0.08);
}
.insight-mini-icon { font-size: 1.4rem; flex-shrink: 0; }
.insight-mini-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.insight-mini-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}
.insight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  transition: background 0.18s ease, transform 0.18s ease;
}
.insight-row:last-child { border-bottom: none; }
.insight-row:hover {
  background: rgba(245,184,75,0.05);
  transform: translateX(3px);
}
.insight-rank { font-size: 1.1rem; flex-shrink: 0; width: 26px; text-align: center; }
.insight-user { flex: 1; min-width: 0; }
.insight-uname {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.insight-usub { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.insight-amount {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .insight-mini-card { padding: 10px; }
  .insight-mini-val  { font-size: 1.1rem; }
}


/* =============================================
   MOBILE MODE — Responsive & App-Like
   ============================================= */

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* ── Mobile Overlay ── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mobile-overlay.active { display: block; }

/* ── FAB Button ── */
.fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 999;
  background: linear-gradient(135deg, #f5b84b, #d99c2e);
  color: #07111d;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245,184,75,0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(245,184,75,0.6);
}
.fab:active { transform: scale(0.95); }

/* ── Sidebar Toggle Button — always visible ── */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(245,184,75,0.2);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  transition: background 0.2s, color 0.2s;
}
.sidebar-toggle:hover {
  background: rgba(245,184,75,0.08);
  color: var(--gold);
}

@media (max-width: 768px) {

  /* ── Show FAB ── */
  .fab { display: flex; }

  /* ── Sidebar: slide dari kiri ── */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.23,1,.32,1);
    box-shadow: none;
    width: 260px !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }

  /* ── Main wrapper full width ── */
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* ── Topbar ── */
  .topbar {
    padding: 0 12px;
    height: 56px;
  }
  .topbar-time { display: none; }

  /* ── Page content padding ── */
  .page-content {
    padding: 12px;
  }

  /* ── Stat card grid → 1 col ── */
  .stats-row,
  .stat-cards-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }

  /* ── Analytics grid → 2 col ── */
  .analytics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }

  /* ── Insight mini card grid → 1 col ── */
  .insight-mini-cards-row,
  div[style*="repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Section card two-col grids → 1 col ── */
  #recentOrdersCard,
  #topProductsCard {
    min-width: 0;
  }

  /* ── Tables: horizontal scroll ── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }
  .data-table {
    min-width: 560px;
  }

  /* ── Buttons: touch-friendly ── */
  .btn-primary,
  .btn-secondary,
  button {
    min-height: 42px;
  }

  /* ── Nav items: larger tap area ── */
  .nav-item {
    padding: 13px 16px !important;
  }

  /* ── Modals: full-width on mobile ── */
  .modal-content {
    width: 96vw !important;
    max-width: 96vw !important;
    margin: 12px;
    max-height: 92vh;
    overflow-y: auto;
  }

  /* ── Chart shorter on mobile ── */
  #revenueChartCard > div:last-child {
    height: 200px !important;
  }

  /* ── Greeting ── */
  .greeting-title { font-size: 1.2rem !important; }
  .greeting-block { padding: 16px !important; }

  /* ── Section card full width ── */
  .section-card { min-height: 0; }

  /* ── Analytics card smaller text ── */
  .analytics-value { font-size: 0.9rem !important; }
  .analytics-icon  { font-size: 1.2rem !important; }

  /* ── Page header wrap ── */
  .page-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .page-header .btn-primary { width: 100%; justify-content: center; }

  /* ── Bottom padding for FAB ── */
  .page-content { padding-bottom: 88px; }
}

@media (max-width: 480px) {
  .stats-row,
  .stat-cards-grid {
    grid-template-columns: 1fr !important;
  }
  .analytics-grid {
    grid-template-columns: 1fr !important;
  }
  .topbar-title { font-size: 0.85rem; }
}


/* =============================================
   AI BUSINESS ASSISTANT PANEL
   ============================================= */

.ai-summary-card {
  background: linear-gradient(135deg, rgba(12,22,34,0.95), rgba(18,30,46,0.9));
  border: 1px solid rgba(245,184,75,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  box-shadow: 0 0 20px rgba(245,184,75,0.06);
}
.ai-summary-icon { font-size: 1.5rem; flex-shrink: 0; }

.ai-sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ── AI Item ── */
.ai-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 6px;
  border-radius: 8px;
  margin-bottom: 6px;
  border-left: 3px solid transparent;
  transition: background 0.2s ease;
}
.ai-item:hover { background: rgba(255,255,255,0.03); }
.ai-item-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.ai-item-body { flex: 1; min-width: 0; }
.ai-item-title { font-size: 0.8rem; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.ai-item-msg   { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* Success → hijau */
.ai-item-success { border-left-color: #22c55e; background: rgba(34,197,94,0.05); }
.ai-item-success .ai-item-title { color: #22c55e; }

/* Warning → merah */
.ai-item-warning { border-left-color: #ef4444; background: rgba(239,68,68,0.05); }
.ai-item-warning .ai-item-title { color: #ef4444; }

/* Info / reco → gold */
.ai-item-info, .ai-item-reco {
  border-left-color: var(--gold);
  background: rgba(245,184,75,0.05);
}
.ai-item-info .ai-item-title,
.ai-item-reco .ai-item-title { color: var(--gold); }

/* Buttons */
.ai-btn-refresh, .ai-btn-broadcast {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(245,184,75,0.3);
  transition: background 0.2s, transform 0.15s;
  min-height: 34px;
}
.ai-btn-refresh {
  background: rgba(245,184,75,0.08);
  color: var(--gold);
}
.ai-btn-broadcast {
  background: rgba(245,184,75,0.15);
  color: var(--gold);
}
.ai-btn-refresh:hover, .ai-btn-broadcast:hover {
  background: rgba(245,184,75,0.22);
  transform: translateY(-1px);
}
.ai-btn-refresh:active, .ai-btn-broadcast:active { transform: scale(0.97); }

/* Broadcast textarea */
.ai-broadcast-textarea {
  width: 100%;
  background: rgba(8,15,24,0.8);
  border: 1px solid rgba(245,184,75,0.2);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.ai-broadcast-textarea:focus {
  border-color: rgba(245,184,75,0.45);
}

@media (max-width: 900px) {
  .ai-sections-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .ai-sections-grid { grid-template-columns: 1fr; gap: 10px; }
  .ai-summary-card  { padding: 12px; }
}

/* AI Health Badge */
.ai-health-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  padding: 6px 12px;
  background: rgba(245,184,75,0.08);
  border: 1px solid rgba(245,184,75,0.2);
  border-radius: 10px;
  min-width: 80px;
}
.ai-health-badge span:first-child {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* AI Promo Button */
.ai-btn-promo {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(245,184,75,0.5);
  background: linear-gradient(135deg, rgba(245,184,75,0.2), rgba(217,156,46,0.2));
  color: var(--gold);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  min-height: 34px;
}
.ai-btn-promo:hover {
  background: linear-gradient(135deg, rgba(245,184,75,0.35), rgba(217,156,46,0.3));
  box-shadow: 0 0 12px rgba(245,184,75,0.25);
  transform: translateY(-1px);
}
.ai-btn-promo:active { transform: scale(0.97); }
