/* ==========================================================================
   MAITU STUDIO - ULTRA MODERN ADMIN CONSOLE (REDESIGNED 2026)
   Aesthetic: Obsidian Luxury Dark Mode, Crisp Glassmorphism, SaaS Standard
   ========================================================================== */

:root {
  --admin-bg: #07090e;
  --admin-surface: #0c101a;
  --admin-surface-card: #101524;
  --admin-surface-hover: #161c30;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-focus: rgba(59, 130, 246, 0.5);
  --admin-accent: #3b82f6;
  --admin-accent-glow: rgba(59, 130, 246, 0.3);
  --admin-text-main: #ffffff;
  --admin-text-muted: #94a3b8;
  --admin-text-dim: #64748b;
  --admin-success: #10b981;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
}

body.admin-page-body {
  background-color: var(--admin-bg) !important;
  color: var(--admin-text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Ambient Glows */
.admin-page-body .bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.admin-page-body .bg-mesh {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% -20%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
}

.admin-page-body .bg-grid {
  position: absolute;
  inset: 0;
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 80%);
}

/* Layout Wrapper */
.admin-dashboard-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   SIDEBAR (SLEEK & CLEAN MINIMALIST DESIGN)
   ========================================================================== */
.admin-sidebar {
  width: 250px;
  background: #090c15;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 20;
}

.admin-sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.admin-sidebar-logo-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.admin-sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px;
}

.admin-sidebar-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #090c15;
}

.admin-sidebar-title-box {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.admin-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.admin-brand-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.admin-nav-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 12px 6px 12px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.admin-nav-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

.admin-nav-item:hover i {
  opacity: 1;
  color: #ffffff;
}

.admin-nav-item.active {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.admin-nav-item.active i {
  opacity: 1;
  color: #3b82f6;
}

.admin-nav-count {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.admin-nav-exit {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  color: #64748b;
}

.admin-nav-exit:hover {
  color: #94a3b8;
}

/* Sidebar User Footer */
.admin-sidebar-footer {
  padding: 12px 10px 14px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(7, 9, 15, 0.6);
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 7px 10px;
}

.admin-user-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.admin-user-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-user-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid #090c15;
}

.admin-user-details {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.admin-user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.64rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 2px;
}

.admin-user-logout-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.admin-user-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Animated Loading State for User Card */
.admin-user-card.is-loading {
  position: relative;
  overflow: hidden;
}

.admin-user-card.is-loading .admin-user-avatar-wrap img {
  display: none;
}

.admin-user-card.is-loading .admin-user-online-dot {
  display: none;
}

.admin-user-card-loader-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: adminSpin 0.8s linear infinite;
}

.admin-user-card.is-loading .admin-user-card-loader-spinner {
  display: block;
}

@keyframes adminSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.admin-user-card-skeleton-wrap {
  display: none;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.admin-user-card.is-loading .admin-user-card-skeleton-wrap {
  display: flex;
}

.admin-user-card-skeleton-bar {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: adminSkeletonShimmer 1.5s infinite;
}

.admin-user-card.is-loading .admin-user-details,
.admin-user-card.is-loading .admin-user-logout-btn {
  display: none;
}

@keyframes adminSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   MAIN VIEWPORT & TOPBAR
   ========================================================================== */
.admin-main-viewport {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.admin-page-title {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.admin-page-desc {
  font-size: 0.88rem;
  color: var(--admin-text-muted);
  margin: 0;
}

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

/* ==========================================================================
   KPI CARDS
   ========================================================================== */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

@media (max-width: 1200px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .admin-kpi-grid { grid-template-columns: 1fr; }
}

.admin-kpi-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.admin-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.admin-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(59, 130, 246, 0.15);
}

.admin-kpi-card:hover::before {
  opacity: 1;
}

.admin-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-kpi-val {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 10px;
  line-height: 1;
}

.admin-kpi-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-kpi-trend.positive { color: #34d399; }
.admin-kpi-trend.neutral { color: #94a3b8; }

/* ==========================================================================
   CHARTS & PERFORMANCE GRID
   ========================================================================== */
.admin-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1.15fr;
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1080px) {
  .admin-charts-grid { grid-template-columns: 1fr; }
}

.admin-chart-box {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
}

.admin-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-chart-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 3px 0;
  letter-spacing: -0.01em;
}

.admin-chart-sub {
  font-size: 0.8rem;
  color: var(--admin-text-dim);
  margin: 0;
}

.admin-chip-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-chip-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulseDot 2s infinite;
}

.admin-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 250px;
  flex: 1;
}

.doughnut-center-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.doughnut-center-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.doughnut-center-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 3px;
}

.doughnut-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.doughnut-breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.doughnut-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doughnut-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.doughnut-bar-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.doughnut-bar-fill {
  height: 100%;
  border-radius: 999px;
}

/* ==========================================================================
   PANEL CARDS & TABLES
   ========================================================================== */
.admin-panel-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

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

.admin-data-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.admin-data-table th {
  padding: 14px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  background: rgba(8, 11, 20, 0.7);
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

/* Premium Monospace Transaction Pill */
.tbl-trans-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tbl-trans-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.tbl-trans-mono {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: -0.01em;
}

.tbl-copy-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.tbl-copy-btn:hover {
  color: #38bdf8;
}

/* Customer Card */
.tbl-customer-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tbl-customer-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  border: 1.5px solid rgba(88, 101, 242, 0.35);
  flex-shrink: 0;
}

.tbl-customer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.tbl-customer-name {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
}

.tbl-customer-keymaster {
  font-size: 0.72rem;
  color: #64748b;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tbl-customer-keymaster span {
  color: #818cf8;
}

/* Script Badges */
.tbl-pkg-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tbl-pkg-tag.tag-cyan {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #38bdf8;
}

.tbl-pkg-tag.tag-purple {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.tbl-pkg-tag.tag-amber {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.tbl-pkg-tag.tag-default {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* Amounts */
.tbl-amount-paid {
  font-weight: 700;
  color: #34d399;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.tbl-amount-free {
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.14);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.02em;
}

/* Form Controls & Inputs */
.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.admin-search-wrap i {
  position: absolute;
  left: 14px;
  color: #64748b;
}

.admin-table-search-input,
.admin-text-input,
.admin-dev-select-styled {
  width: 100%;
  background: rgba(8, 11, 20, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px;
  padding: 10px 14px 10px 40px;
  color: #ffffff !important;
  font-size: 0.86rem;
  outline: none;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.admin-text-input {
  padding: 11px 14px;
}

.admin-dev-select-styled {
  padding: 10px 14px;
  cursor: pointer;
}

.admin-table-search-input:focus,
.admin-text-input:focus,
.admin-dev-select-styled:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.3) !important;
  background: rgba(11, 15, 28, 0.95) !important;
}

/* Tab Panes */
.admin-tab-pane {
  display: none;
  animation: adminTabFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-tab-pane.active {
  display: block;
}

@keyframes adminTabFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Media Cards */
.admin-media-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
}

.admin-media-item-card:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Diagnostics Grid */
.admin-diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* Shimmer & Skeleton Loaders */
.admin-skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: adminShimmer 1.5s infinite ease-in-out;
  border-radius: 6px;
  display: inline-block;
}

@keyframes adminShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.admin-chart-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 11, 20, 0.75);
  backdrop-filter: blur(4px);
  z-index: 5;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  border-radius: 12px;
}

.admin-chart-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.admin-diag-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 18px;
  transition: all 0.2s ease;
}

.admin-diag-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(59, 130, 246, 0.3);
}

.admin-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.admin-diag-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.admin-diag-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #94a3b8;
}

/* Button UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  box-sizing: border-box;
}

.btn-primary {
  background: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.btn-outline-glow {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.btn-outline-glow:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* Spin animation for refresh buttons */
@keyframes spinIcon {
  100% { transform: rotate(360deg); }
}
.spin {
  animation: spinIcon 1s linear infinite;
}

/* ==========================================================================
/* ==========================================================================
   ACCESS DENIED / 403 NO PERMISSIONS MINIMAL PRELOADER
   ========================================================================== */
.access-denied-preloader {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: #06070d;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.access-denied-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 380px;
  width: 100%;
  position: relative;
  z-index: 10;
  animation: deniedFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes deniedFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.access-denied-logo-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.access-denied-warning-box {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.95));
  animation: preloaderLogoPulse 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.access-denied-glow {
  position: absolute;
  inset: -14px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.5) 0%, rgba(239, 68, 68, 0.15) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(14px);
  animation: preloaderGlowPulse 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.access-denied-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.access-denied-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 22px;
  min-height: 20px;
  line-height: 1.5;
}

.access-denied-bar-bg {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 24px;
}

.access-denied-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
  animation: preloaderBarAnim 1.5s ease-in-out infinite;
}

.access-denied-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn-denied-clean {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-denied-clean:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.access-denied-switch-link {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
  padding: 4px 8px;
}

.access-denied-switch-link:hover {
  color: #94a3b8;
  text-decoration: underline;
}

/* ==========================================================================
   LANGUAGE SWITCHER DROPDOWN (GLOBAL)
   ========================================================================== */
.lang-dropdown-wrap,
.lang-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-pill-btn,
.lang-dropdown-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  height: 34px;
  padding: 0 12px 0 10px;
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  flex-shrink: 0;
  outline: none;
}

.lang-pill-btn:hover,
.lang-dropdown-btn:hover,
.lang-dropdown-wrap.is-open .lang-pill-btn,
.lang-dropdown.is-open .lang-dropdown-btn {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.25);
  color: #ffffff;
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 175px;
  background: rgba(10, 12, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 6px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(37, 99, 235, 0.15);
  z-index: 1000;
  animation: popoverFadeIn 0.15s ease;
}

.lang-dropdown-wrap.is-open .lang-dropdown-menu,
.lang-dropdown.is-open .lang-dropdown-menu {
  display: block;
}

.lang-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--admin-text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: inherit;
  font-size: 0.82rem;
}

.lang-dropdown-item:hover {
  background: rgba(37, 99, 235, 0.14);
  color: #ffffff;
}

.lang-dropdown-item.active {
  background: rgba(37, 99, 235, 0.22);
  color: #60a5fa;
  font-weight: 700;
}


