/* ==========================================================================
   BITCHAIN PRO X — ADMIN PANEL STYLES
   Matches existing dark purple/neon design language
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --admin-bg: #060010;
  --admin-surface: #0d0020;
  --admin-card: rgba(20, 0, 40, 0.85);
  --admin-border: rgba(157, 78, 221, 0.2);
  --admin-border-hover: rgba(199, 125, 255, 0.5);
  --primary: #9d4edd;
  --primary-light: #c77dff;
  --primary-glow: rgba(157, 78, 221, 0.3);
  --accent-blue: #3a86ff;
  --accent-green: #06d6a0;
  --accent-red: #e63946;
  --accent-yellow: #ffd166;
  --text-primary: #f0e6ff;
  --text-secondary: rgba(224, 170, 255, 0.7);
  --text-muted: rgba(180, 140, 220, 0.5);
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 64px;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--admin-bg);
  color: var(--text-primary);
  overflow: hidden;
}

/* ── ADMIN LAYOUT ─────────────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh; height: 100dvh;
  background: linear-gradient(180deg, #0a0018 0%, #060010 100%);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), min-width var(--transition);
  z-index: 100;
  overflow: hidden;
  position: relative;
}

.admin-sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--admin-border);
  min-height: var(--topbar-height);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, #7b2cbf, #9d4edd);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(157,78,221,0.5);
}

.sidebar-logo-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar-logo-text span { color: var(--primary-light); }

.admin-sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 12px 4px;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.admin-sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(157, 78, 221, 0.12);
  border-color: rgba(157, 78, 221, 0.2);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(157,78,221,0.25), rgba(199,125,255,0.1));
  border-color: rgba(157, 78, 221, 0.4);
  box-shadow: 0 0 20px rgba(157,78,221,0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--primary-light);
}

.nav-icon {
  font-size: 1.1rem;
  min-width: 24px;
  text-align: center;
}

.nav-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: opacity var(--transition);
  flex: 1;
}

.nav-item.active .nav-label { color: var(--primary-light); }
.admin-sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

.nav-badge {
  background: var(--accent-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
  transition: opacity var(--transition);
}

.admin-sidebar.collapsed .nav-badge { opacity: 0; }

.nav-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition), opacity var(--transition);
}

.admin-sidebar.collapsed .nav-arrow { opacity: 0; }
.nav-item.submenu-open .nav-arrow { transform: rotate(90deg); }

.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.nav-submenu.open { max-height: 200px; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 48px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-sub-item:hover { background: rgba(157,78,221,0.1); color: var(--text-secondary); }
.nav-sub-item.active { color: var(--primary-light); }
.admin-sidebar.collapsed .nav-sub-item { opacity: 0; pointer-events: none; }

/* Sidebar bottom */
.sidebar-bottom {
  border-top: 1px solid var(--admin-border);
  padding: 12px 8px;
}

.sidebar-admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-admin-profile:hover { background: rgba(157,78,221,0.1); }

.admin-avatar-sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b2cbf, #9d4edd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid var(--admin-border);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.admin-profile-info {
  flex: 1;
  min-width: 0;
  transition: opacity var(--transition);
}

.admin-sidebar.collapsed .admin-profile-info { opacity: 0; }

.admin-profile-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-profile-role {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary-light);
  letter-spacing: 0.5px;
}

/* Collapse toggle */
.sidebar-collapse-btn {
  position: absolute;
  top: 22px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-muted);
  z-index: 10;
  transition: all var(--transition);
}

.sidebar-collapse-btn:hover { color: var(--primary-light); border-color: var(--admin-border-hover); }

/* ── MAIN AREA ────────────────────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Top bar */
.admin-topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(6, 0, 16, 0.9);
  border-bottom: 1px solid var(--admin-border);
  backdrop-filter: blur(20px);
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}

.topbar-hamburger:hover { background: rgba(157,78,221,0.15); color: var(--primary-light); }

.topbar-breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-breadcrumb span:last-child {
  color: var(--primary-light);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  background: rgba(157,78,221,0.1);
  border: 1px solid var(--admin-border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-btn:hover { background: rgba(157,78,221,0.2); border-color: var(--admin-border-hover); color: var(--primary-light); }

.topbar-logout {
  background: rgba(230,57,70,0.1);
  border-color: rgba(230,57,70,0.3);
  color: #e63946;
}

.topbar-logout:hover { background: rgba(230,57,70,0.2); color: #ff6b75; }

/* Content area */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.admin-content::-webkit-scrollbar { width: 6px; }
.admin-content::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ── SECTION MANAGEMENT ───────────────────────────────────────────────────── */
.admin-section { display: none; }
.admin-section.active { display: block; }

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-glow);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ── STAT CARDS ───────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(20px);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  border-color: var(--admin-border-hover);
  box-shadow: 0 0 30px var(--primary-glow);
  transform: translateY(-2px);
}

.stat-card:hover::before { opacity: 1; }

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-icon.purple { background: rgba(157,78,221,0.2); }
.stat-icon.blue { background: rgba(58,134,255,0.2); }
.stat-icon.green { background: rgba(6,214,160,0.2); }
.stat-icon.red { background: rgba(230,57,70,0.2); }
.stat-icon.yellow { background: rgba(255,209,102,0.2); }

.stat-trend {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.stat-trend.up { background: rgba(6,214,160,0.15); color: #06d6a0; }
.stat-trend.down { background: rgba(230,57,70,0.15); color: #e63946; }
.stat-trend.neutral { background: rgba(157,78,221,0.15); color: var(--primary-light); }

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── GLASS CARDS ──────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  padding: 24px;
  margin-bottom: 20px;
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.glass-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── TABLES ───────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.table-wrap::-webkit-scrollbar { height: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 600px;
}

.admin-table th {
  background: rgba(157,78,221,0.08);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(157,78,221,0.06);
  color: var(--text-secondary);
  vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(157,78,221,0.05); }
.admin-table tr:last-child td { border-bottom: none; }

/* ── BADGES / STATUS ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-pending { background: rgba(255,209,102,0.15); color: #ffd166; border: 1px solid rgba(255,209,102,0.3); }
.badge-approved { background: rgba(6,214,160,0.15); color: #06d6a0; border: 1px solid rgba(6,214,160,0.3); }
.badge-rejected { background: rgba(230,57,70,0.15); color: #e63946; border: 1px solid rgba(230,57,70,0.3); }
.badge-active { background: rgba(6,214,160,0.15); color: #06d6a0; border: 1px solid rgba(6,214,160,0.3); }
.badge-inactive { background: rgba(180,140,220,0.1); color: var(--text-muted); border: 1px solid var(--admin-border); }
.badge-admin { background: rgba(157,78,221,0.2); color: var(--primary-light); border: 1px solid rgba(157,78,221,0.4); }
.badge-open { background: rgba(58,134,255,0.15); color: #3a86ff; border: 1px solid rgba(58,134,255,0.3); }
.badge-resolved { background: rgba(6,214,160,0.15); color: #06d6a0; border: 1px solid rgba(6,214,160,0.3); }
.badge-completed { background: rgba(6,214,160,0.15); color: #06d6a0; border: 1px solid rgba(6,214,160,0.3); }

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #7b2cbf, #9d4edd);
  color: #fff;
  box-shadow: 0 4px 15px rgba(157,78,221,0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #9d4edd, #c77dff);
  box-shadow: 0 6px 20px rgba(157,78,221,0.5);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #04a87e, #06d6a0);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6,214,160,0.3);
}

.btn-success:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(6,214,160,0.4); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #c1121f, #e63946);
  color: #fff;
  box-shadow: 0 4px 15px rgba(230,57,70,0.3);
}

.btn-danger:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(230,57,70,0.4); transform: translateY(-1px); }

.btn-ghost {
  background: rgba(157,78,221,0.1);
  border: 1px solid var(--admin-border);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) { background: rgba(157,78,221,0.2); border-color: var(--admin-border-hover); color: var(--primary-light); }

.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* ── SEARCH & FILTERS ─────────────────────────────────────────────────────── */
.table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.search-input {
  width: 100%;
  background: rgba(157,78,221,0.08);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 38px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: all var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(157,78,221,0.15); }

.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
}

.filter-tab:hover { background: rgba(157,78,221,0.1); color: var(--text-secondary); }
.filter-tab.active { background: rgba(157,78,221,0.2); border-color: var(--primary); color: var(--primary-light); }

/* ── FORMS ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(157,78,221,0.08);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(157,78,221,0.15); }

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239d4edd' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

/* ── MODALS ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-backdrop.active { opacity: 1; pointer-events: all; }

.modal-box {
  background: linear-gradient(135deg, #120028 0%, #0a0018 100%);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
  box-shadow: 0 20px 80px rgba(0,0,0,0.5), 0 0 60px rgba(157,78,221,0.1);
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.modal-backdrop.active .modal-box { transform: scale(1) translateY(0); }

.modal-box.wide { max-width: 860px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover { color: var(--primary-light); background: rgba(157,78,221,0.1); }

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-border);
  flex-wrap: wrap;
}

/* Info rows */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.info-item {
  background: rgba(157,78,221,0.06);
  border: 1px solid rgba(157,78,221,0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.info-item-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-item-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

/* ── PAGINATION ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover { background: rgba(157,78,221,0.1); color: var(--text-secondary); }
.page-btn.active { background: rgba(157,78,221,0.2); border-color: var(--primary); color: var(--primary-light); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── EMPTY STATES ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 2.5rem; margin-bottom: 16px; opacity: 0.6; }
.empty-state-text { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state-sub { font-size: 0.78rem; color: var(--text-muted); }

/* ── SKELETON LOADERS ─────────────────────────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.skeleton {
  background: rgba(157,78,221,0.15);
  border-radius: 4px;
  animation: skeleton-pulse 1.5s ease infinite;
}

/* ── CHAT ─────────────────────────────────────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  height: calc(100vh - var(--topbar-height) - 48px - 80px);
  min-height: 400px;
}

.chat-list {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.chat-list-item {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(157,78,221,0.06);
  cursor: pointer;
  transition: all var(--transition);
}

.chat-list-item:hover { background: rgba(157,78,221,0.08); }
.chat-list-item.active { background: rgba(157,78,221,0.15); border-left: 3px solid var(--primary-light); }

.chat-list-user { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.chat-list-preview { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread { background: var(--primary); color: #fff; font-size: 0.65rem; font-weight: 700; border-radius: 10px; padding: 1px 6px; }

.chat-window {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-window-header {
  padding: 16px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.chat-msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.83rem;
  line-height: 1.5;
}

.chat-msg.user {
  background: rgba(157,78,221,0.1);
  border: 1px solid rgba(157,78,221,0.2);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg.admin {
  background: linear-gradient(135deg, rgba(157,78,221,0.3), rgba(199,125,255,0.15));
  border: 1px solid rgba(199,125,255,0.3);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg-time { font-size: 0.65rem; color: var(--text-muted); margin-top: 4px; }

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  background: rgba(157,78,221,0.08);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: border-color var(--transition);
  max-height: 100px;
}

.chat-input:focus { border-color: var(--primary); }

/* ── CHARTS ───────────────────────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ── PACKAGE GRID ─────────────────────────────────────────────────────────── */
.pkg-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.pkg-admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.pkg-admin-card:hover { border-color: var(--admin-border-hover); box-shadow: 0 0 24px var(--primary-glow); transform: translateY(-2px); }
.pkg-admin-icon { font-size: 2rem; margin-bottom: 10px; }
.pkg-admin-name { font-size: 0.85rem; font-weight: 800; color: var(--text-primary); letter-spacing: 0.5px; margin-bottom: 4px; }
.pkg-admin-price { font-size: 1.2rem; font-weight: 900; color: var(--primary-light); margin-bottom: 8px; }
.pkg-admin-stat { font-size: 0.72rem; color: var(--text-muted); }
.pkg-admin-stat span { color: var(--text-secondary); font-weight: 600; }

/* ── USER AVATAR ──────────────────────────────────────────────────────────── */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-xs {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b2cbf, #9d4edd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  min-width: 30px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.user-name-sm { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.user-email-sm { font-size: 0.72rem; color: var(--text-muted); }

/* ── AUDIT LOG ────────────────────────────────────────────────────────────── */
.audit-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(157,78,221,0.06);
}

.audit-item:last-child { border-bottom: none; }

.audit-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  box-shadow: 0 0 8px var(--primary);
}

.audit-action { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.audit-meta { font-size: 0.72rem; color: var(--text-muted); }

/* ── MOBILE DRAWER ────────────────────────────────────────────────────────── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99;
  backdrop-filter: blur(4px);
}

/* ── TOAST ────────────────────────────────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.87rem;
  font-weight: 700;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

.admin-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.admin-toast.success { background: linear-gradient(135deg, #04a87e, #06d6a0); color: #fff; }
.admin-toast.error { background: linear-gradient(135deg, #c1121f, #e63946); color: #fff; }
.admin-toast.warning { background: linear-gradient(135deg, #d48806, #ffd166); color: #1a0533; }
.admin-toast.info { background: linear-gradient(135deg, #1a6bcc, #3a86ff); color: #fff; }

/* ── CONFIRM DIALOG ───────────────────────────────────────────────────────── */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.confirm-backdrop.active { opacity: 1; pointer-events: all; }

.confirm-box {
  background: linear-gradient(135deg, #120028, #0a0018);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  transform: scale(0.95);
  transition: transform var(--transition);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.confirm-backdrop.active .confirm-box { transform: scale(1); }

.confirm-icon { font-size: 2.5rem; margin-bottom: 14px; }
.confirm-title { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.confirm-message { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 22px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* ── ACCESS DENIED ────────────────────────────────────────────────────────── */
#adminAccessDenied {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--admin-bg);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 24px;
}

#adminAccessDenied.show { display: flex; }
#adminAccessDenied .denied-icon { font-size: 4rem; margin-bottom: 20px; }
#adminAccessDenied h2 { font-size: 1.8rem; font-weight: 900; color: var(--accent-red); margin-bottom: 10px; }
#adminAccessDenied p { color: var(--text-muted); margin-bottom: 24px; }

/* ── LOADING OVERLAY ──────────────────────────────────────────────────────── */
#adminLoadingOverlay {
  position: fixed;
  inset: 0;
  background: var(--admin-bg);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(157,78,221,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCROLLBAR ────────────────────────────────────────────────────────────── */
.admin-content::-webkit-scrollbar { width: 6px; }
.admin-content::-webkit-scrollbar-track { background: transparent; }
.admin-content::-webkit-scrollbar-thumb { background: rgba(157,78,221,0.3); border-radius: 4px; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh; height: 100dvh;
    z-index: 100;
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    transition: left var(--transition);
  }

  .admin-sidebar.mobile-open { left: 0; }
  .mobile-overlay.show { display: block; }
  .topbar-hamburger { display: flex; }
  .sidebar-collapse-btn { display: none; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 16px; padding-bottom: 100px; }
  .chat-layout { display: flex; flex-direction: column; height: auto; min-height: auto; }
  .chat-list { height: 250px; flex-shrink: 0; }
  .chat-window { height: 550px; flex-shrink: 0; }

  .section-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .modal-box { padding: 18px; }
  .glass-card { padding: 16px; }
}


