/* ============================================
   BOT ADMIN — Modern Dark Panel v2
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Core palette */
  --bg-body: #0f1117;
  --bg-surface: #181a20;
  --bg-card: #1e2028;
  --bg-elevated: #252730;
  --bg-input: #14151b;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.04);
  --border-focus: rgba(99,102,241,0.5);

  /* Text */
  --text-primary: #e4e5e9;
  --text-secondary: #8b8d97;
  --text-muted: #5c5e69;
  --text-heading: #f0f1f3;

  /* Brand / accent */
  --primary: #6366f1;
  --primary-rgb: 99,102,241;
  --primary-soft: rgba(99,102,241,0.12);
  --primary-hover: #5558e3;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

  /* Semantic */
  --success: #10b981;
  --success-rgb: 16,185,129;
  --danger: #ef4444;
  --danger-rgb: 239,68,68;
  --warning: #f59e0b;
  --warning-rgb: 245,158,11;
  --info: #06b6d4;
  --info-rgb: 6,182,212;

  /* Layout */
  --sidebar-w: 250px;
  --header-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --radius-pill: 50px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 24px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 20px rgba(99,102,241,0.15);

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ========== RESET ========== */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; -webkit-font-smoothing:antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration:none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed; left: 0; top: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 1.25rem; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .brand-logo {
  width: 32px; height: 32px;
  background: var(--gradient);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.sidebar-brand .brand-name {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.3px;
}
.sidebar-brand .brand-badge {
  font-size: 0.6rem; font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-section {
  padding: 1rem 0.75rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding-left: 1.25rem;
}

.sidebar-nav {
  flex: 1; padding: 0.25rem 0.75rem;
  display: flex; flex-direction: column; gap: 2px;
  list-style: none;
  overflow-y: auto;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.nav-item i {
  font-size: 1.1rem; width: 1.25rem; text-align: center;
  opacity: 0.7;
  transition: all var(--transition);
}
.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}
.nav-item:hover i { opacity: 1; }
.nav-item.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.4);
}
.nav-item.active i { opacity: 1; color: #fff; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}
.nav-item.nav-logout { color: var(--danger); }
.nav-item.nav-logout:hover { background: rgba(var(--danger-rgb), 0.08); }

.mobile-toggle {
  display: none;
  background: none; border: none; color: var(--text-primary);
  font-size: 1.25rem; cursor: pointer; padding: 4px;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ========== MAIN ========== */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.top-bar {
  height: var(--header-h);
  background: rgba(15,17,23,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}
.top-bar .page-title {
  font-size: 1rem; font-weight: 600;
  color: var(--text-heading);
}
.top-bar .top-actions {
  display: flex; align-items: center; gap: 0.75rem;
}
.admin-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary);
}
.admin-chip .chip-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 700;
}

.page-content {
  flex: 1;
  padding: 1.5rem;
}

/* ========== CARD ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  overflow: hidden;
}
.card:hover {
  border-color: rgba(255,255,255,0.08);
}
.card-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head .card-title {
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-heading);
  display: flex; align-items: center; gap: 8px;
}
.card-head .card-title i { color: var(--primary); font-size: 1rem; }
.card-head .card-meta {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 500;
}
.card-body { padding: 1.25rem; }

/* ========== STAT CARDS ========== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
}
.stat-card.sc-primary::before { background: var(--primary); }
.stat-card.sc-success::before { background: var(--success); }
.stat-card.sc-warning::before { background: var(--warning); }
.stat-card.sc-info::before { background: var(--info); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(255,255,255,0.08);
}
.stat-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.stat-icon.si-primary { background: var(--primary-soft); color: var(--primary); }
.stat-icon.si-success { background: rgba(var(--success-rgb),0.12); color: var(--success); }
.stat-icon.si-warning { background: rgba(var(--warning-rgb),0.12); color: var(--warning); }
.stat-icon.si-info { background: rgba(var(--info-rgb),0.12); color: var(--info); }

.stat-badge {
  font-size: 0.65rem; font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(var(--success-rgb),0.1);
  color: var(--success);
}
.stat-value {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: 2px;
  letter-spacing: -0.5px;
}
.stat-label {
  font-size: 0.7rem; color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ========== TABLE ========== */
.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl thead th {
  padding: 0.7rem 1.25rem;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl tbody tr {
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-light);
}
.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.02); }
.tbl tbody td {
  padding: 0.7rem 1.25rem;
  color: var(--text-primary);
  vertical-align: middle;
  font-size: 0.8125rem;
}
.tbl .cell-user {
  display: flex; flex-direction: column; gap: 1px;
}
.tbl .cell-user .name { font-weight: 600; color: var(--text-heading); }
.tbl .cell-user .handle { font-size: 0.7rem; color: var(--text-muted); }
.tbl .cell-time {
  font-size: 0.7rem; color: var(--text-muted); white-space: nowrap;
}

/* ========== BADGE ========== */
.badge {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  text-transform: capitalize;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: rgba(var(--success-rgb),0.12); color: var(--success); }
.badge-danger { background: rgba(var(--danger-rgb),0.12); color: var(--danger); }
.badge-warning { background: rgba(var(--warning-rgb),0.12); color: var(--warning); }
.badge-info { background: rgba(var(--info-rgb),0.12); color: var(--info); }
.badge-muted { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

.amount-up { color: var(--success); font-weight: 600; font-size: 0.8125rem; }
.amount-down { color: var(--danger); font-weight: 600; font-size: 0.8125rem; }

/* ========== FORMS ========== */
.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  transition: all var(--transition);
  width: 100%;
  line-height: 1.5;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--bg-surface);
}
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }

.form-label {
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px; display: block;
}
.form-group { margin-bottom: 1rem; }

/* ========== BUTTONS ========== */
.btn {
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8125rem; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.35);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb),0.4);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 6px rgba(var(--success-rgb),0.3);
}
.btn-success:hover { background: #0ea572; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 6px rgba(var(--danger-rgb),0.3);
}
.btn-danger:hover { background: #dc3636; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

/* ========== PAGINATION ========== */
.pager {
  display: flex; gap: 6px;
  align-items: center; justify-content: center;
  padding: 1.25rem 0;
}
.pager a, .pager span {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.pager a:hover {
  color: var(--primary);
  border-color: rgba(var(--primary-rgb),0.3);
  background: var(--primary-soft);
}
.pager .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.35);
}

/* ========== ALERTS ========== */
.alert {
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 500;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
}
.alert-success {
  background: rgba(var(--success-rgb),0.08);
  color: var(--success);
  border-color: rgba(var(--success-rgb),0.15);
}
.alert-danger {
  background: rgba(var(--danger-rgb),0.08);
  color: var(--danger);
  border-color: rgba(var(--danger-rgb),0.15);
}
.alert-info {
  background: rgba(var(--info-rgb),0.08);
  color: var(--info);
  border-color: rgba(var(--info-rgb),0.15);
}

/* ========== LOGIN ========== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--bg-body);
}
.login-art {
  flex: 1;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-art::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
}
.login-art-content {
  position: relative; z-index: 1;
  text-align: center; color: #fff;
  padding: 2rem;
}
.login-art-content .art-icon {
  font-size: 3rem; margin-bottom: 1rem;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.2));
}
.login-art-content h2 {
  font-size: 1.75rem; font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}
.login-art-content p {
  font-size: 0.9rem; opacity: 0.85;
  max-width: 280px; margin: 0 auto;
  line-height: 1.6;
}

.login-form-side {
  width: 440px;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.login-box {
  width: 100%; max-width: 360px;
}
.login-box .login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 2rem;
}
.login-box .login-brand .lb-icon {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.login-box .login-brand span {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-heading);
}
.login-box h1 {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.login-box .login-sub {
  font-size: 0.8125rem; color: var(--text-muted);
  margin-bottom: 1.75rem;
}
.login-box .form-group { margin-bottom: 1.25rem; }

/* ========== CHART ========== */
.chart-wrap {
  position: relative;
  height: 280px;
  padding: 1.25rem;
}

/* ========== SHOP GRID ========== */
.shop-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  align-items: start;
  height: calc(100vh - var(--header-h) - 3rem);
}
.shop-layout > .card {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.shop-layout > .card .card-body {
  overflow-y: auto;
  flex: 1;
}
.shop-table-wrap {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* ========== CODE ========== */
code {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  background: rgba(var(--primary-rgb),0.08);
  padding: 2px 6px; border-radius: 4px;
  font-size: 0.75rem; color: var(--primary);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-in {
  animation: fadeUp 0.35s ease-out both;
}
.anim-in:nth-child(1) { animation-delay: 0s; }
.anim-in:nth-child(2) { animation-delay: 0.06s; }
.anim-in:nth-child(3) { animation-delay: 0.12s; }
.anim-in:nth-child(4) { animation-delay: 0.18s; }
.anim-in:nth-child(5) { animation-delay: 0.24s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-overlay { display: block; }
  .mobile-toggle { display: block; }
  .main-wrap { margin-left: 0; }
  .page-content { padding: 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .shop-layout { grid-template-columns: 1fr; height: auto; }
  .shop-layout > .card { height: auto; }
  .shop-table-wrap { max-height: 60vh; }
  .login-art { display: none; }
  .login-form-side { width: 100%; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
