/**
 * ArenaX Standalone Admin Portal Stylesheet
 * Enterprise glassmorphism layout, vibrant cyber neon accents, responsive sidebar and data grids.
 */

.admin-body {
  margin: 0;
  padding: 0;
  background-color: #0b0f19;
  color: #f1f5f9;
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ================= Sidebar ================= */
.admin-sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-logo-badge {
  font-size: 1.8rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}
.admin-brand-info h2 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.admin-brand-info h2 span {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 14px 8px 6px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nav-item.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.admin-sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================= Main Area ================= */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-user-tag {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  color: #c7d2fe;
}

/* Views Container */
.admin-views-container {
  padding: 28px 32px;
  flex: 1;
}

.admin-view {
  display: none;
}
.admin-view.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

/* Overview Stat Tiles */
.overview-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1080px) {
  .overview-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .overview-stat-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}
.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.stat-card .stat-icon.cyan { background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.35); }
.stat-card .stat-icon.violet { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.35); }
.stat-card .stat-icon.rose { background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.35); }
.stat-card .stat-icon.amber { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.35); }

.stat-content {
  display: flex;
  flex-direction: column;
}
.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}
.stat-val {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 2-Column Overview Grid */
.overview-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 980px) {
  .overview-grid-2 {
    grid-template-columns: 1fr;
  }
}

.admin-card {
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-header-row h4 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.header-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metrics-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.mini-metric {
  background: rgba(10, 15, 29, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.mini-metric .num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
}
.mini-metric .lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Category Bars */
.category-bars-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.cat-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
}
.cat-bar-lbl {
  width: 90px;
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
}
.cat-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.cat-bar-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* Quick Nav Pills */
.quick-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* Lexicon Top Actions */
.lexicon-top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lexicon-search-bar-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input-box {
  flex: 1;
  min-width: 280px;
}
.quick-add-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* File Drop Zone */
.file-drop-area {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.file-drop-area:hover, .file-drop-area.dragover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
}
.drop-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}
.drop-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: #c7d2fe;
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .admin-views-container {
    padding: 16px;
  }
}

/* Modals in Admin Portal */
.modal-backdrop.open,
.modal-backdrop[style*="display: flex"],
.modal-backdrop[style*="display:flex"] {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#adminAuthModal {
  z-index: 99999 !important;
}

#adminAuthModal .modal-content {
  transform: scale(1) !important;
}
