:root {
  --bg-dark: #0a0f1d;
  --bg-main: #0a0f1d;
  --sidebar-bg: #0d1428;
  --card-bg: rgba(30, 41, 59, 0.45);
  --surface: rgba(30, 41, 59, 0.65);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --gold: #f59e0b;
  --gold-hover: #d97706;
  --text-white: #f8fafc;
  --text-gray: #94a3b8;
  --accent: #a855f7;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --neon-glow: 0 0 15px rgba(99, 102, 241, 0.4);
  --gold-glow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-white);
  height: 100vh;
  overflow: hidden;
}

#super-admin-app {
  display: flex;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, #111827 0%, #030712 100%);
}

/* Sidebar Styling (Obsidian Glass Style) */
.sidebar {
  width: 290px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  padding: 35px 0;
  position: relative;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  padding: 0 28px;
  margin-bottom: 45px;
  gap: 15px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: var(--neon-glow);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  object-fit: contain;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-tag {
  font-size: 11px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-top: 1px;
  color: var(--text-gray);
}

.nav-menu {
  flex: 1;
  padding: 0 18px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 22px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-gray);
  margin-bottom: 10px;
  font-weight: 600;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-white);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: var(--neon-glow);
  transform: translateX(6px);
}

.sidebar-footer {
  padding: 25px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  font-size: 22px;
  background: rgba(255, 255, 255, 0.03);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1.5px solid rgba(245, 158, 11, 0.25);
  box-shadow: var(--gold-glow);
  transition: transform 0.3s;
}

.avatar:hover {
  transform: rotate(15deg) scale(1.05);
}

.sidebar-footer .info {
  display: flex;
  flex-direction: column;
}

.sidebar-footer .name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-white);
}

.sidebar-footer .role {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.header {
  height: 95px;
  background: rgba(13, 20, 40, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 45px;
  border-bottom: 1px solid var(--border-color);
  z-index: 9;
}

.header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#main-view {
  flex: 1;
  padding: 45px;
  overflow-y: auto;
  scroll-behavior: smooth;
  z-index: 1;
}

/* Translucent Cards & Layouts */
.card,
div[style*="background:white"],
div[style*="background: white"],
div[style*="background:var(--surface)"],
div[style*="background: var(--surface)"] {
  background: var(--card-bg) !important;
  color: var(--text-white) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 20px !important;
  box-shadow: var(--shadow-premium) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding: 24px !important;
  margin-bottom: 30px !important;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Stats Dashboard Panel */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.5) 100%);
  padding: 30px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-premium);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: var(--gold-glow);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, #fbbf24 100%);
}

.stat-card:nth-child(2)::after {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.stat-card:nth-child(2):hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.stat-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-gray);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.stat-value {
  font-size: 38px;
  font-weight: 900;
  color: var(--text-white);
  letter-spacing: -1px;
}

/* Sleek Premium Tables */
.data-table {
  width: 100%;
  background: rgba(13, 20, 40, 0.4);
  border-radius: 20px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-premium);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 30px;
}

.data-table th {
  background: rgba(15, 23, 42, 0.7);
  padding: 18px 25px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 18px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
  color: #cbd5e1;
  transition: background 0.2s;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-white);
}

/* Table elements customized for dark mode compatibility */
.data-table a[style*="color: var(--primary)"] {
  color: #818cf8 !important;
  transition: color 0.2s;
}

.data-table a[style*="color: var(--primary)"]:hover {
  color: #a5b4fc !important;
}

/* Exquisite Neon Badges */
.status-badge {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.status-active,
span[style*="color:#10b981"],
span[style*="color: #10b981"] {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

span[style*="color:#ef4444"],
span[style*="color: #ef4444"] {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

.status-badge:not(.status-active) {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Premium Buttons & Interactive States */
.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--neon-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.6);
  filter: brightness(1.1);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn.gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: var(--bg-dark);
  box-shadow: var(--gold-glow);
  font-weight: 800;
}

.primary-btn.gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.55);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.25s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.12);
}

button[style*="background:none"],
button[style*="background: none"] {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px !important;
  width: 36px;
  height: 36px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #cbd5e1 !important;
}

button[style*="background:none"]:hover,
button[style*="background: none"]:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-white) !important;
  transform: scale(1.08);
}

/* Glassmorphic Cyber Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 7, 18, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}

.modal {
  background: linear-gradient(135deg, #131b2e 0%, #0d1222 100%);
  width: 480px;
  padding: 40px;
  border-radius: 28px;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.85);
  animation: zoomIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
  transform: rotate(90deg);
}

.modal h2 {
  margin-bottom: 25px;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  color: var(--text-white);
  text-align: center;
}

.modal-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-gray);
  margin-top: -18px;
  margin-bottom: 25px;
}

.modal-header-icon {
  font-size: 38px;
  text-align: center;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.3));
}

/* Exquisite Form Controls */
.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.form-group input, 
.form-group select,
input[style*="border:1px solid #e2e8f0"],
select[style*="border:1px solid #e2e8f0"] {
  width: 100%;
  padding: 14px 18px;
  background: rgba(5, 8, 16, 0.5) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: 12px !important;
  outline: none;
  font-size: 14px;
  color: var(--text-white) !important;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.25s ease;
}

.form-group input:focus, 
.form-group select:focus,
input[style*="border:1px solid #e2e8f0"]:focus,
select[style*="border:1px solid #e2e8f0"]:focus {
  border-color: rgba(99, 102, 241, 0.6) !important;
  box-shadow: var(--neon-glow);
  background: rgba(5, 8, 16, 0.85) !important;
}

.input-hint {
  font-size: 11px;
  color: var(--text-gray);
  margin-top: 6px;
  opacity: 0.8;
}

/* Custom Bulk key Gen components */
.count-stepper {
  position: relative;
}

.styled-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px;
  padding-right: 45px !important;
}

/* Appointed Role selector info banner */
div[style*="background: #f0fdf4"] {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
  border-radius: 10px !important;
  color: #34d399 !important;
  padding: 12px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
}

/* Custom separator */
hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 25px 0;
}

/* Login authentication Screen (Authentic Cyber Theme) */
#login-overlay {
  background: radial-gradient(circle at 50% 50%, #0d1527 0%, #030712 100%) !important;
  z-index: 10000;
}

#login-overlay .modal {
  width: 440px;
  padding: 45px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.15);
  background: rgba(13, 20, 38, 0.9);
  backdrop-filter: blur(20px);
}

/* Toast Alerts Styling */
div[style*="position:fixed; bottom:30px; left:50%"] {
  background: linear-gradient(135deg, #0d1222 0%, #1e1b4b 100%) !important;
  border: 1.5px solid rgba(99, 102, 241, 0.3) !important;
  color: #c7d2fe !important;
  padding: 14px 28px !important;
  border-radius: 16px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), var(--neon-glow) !important;
  font-family: inherit;
  font-size: 14px !important;
  letter-spacing: 0.5px;
}

/* Utility Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   PREMIUM SELECT & OPTION DROPDOWN STYLING
   ========================================================================== */

/* Prevents browser native white background + inherited white text color clash (white-on-white bug) */
select option {
  background-color: #0d1425 !important; /* solid premium dark blue background */
  color: #f1f5f9 !important; /* light slate white text */
  padding: 10px 15px !important;
}

/* Exquisite style for role change select dropdowns inside tables */
.role-select {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 6px 28px 6px 12px !important;
  border-radius: 8px !important;
  background-color: #1e293b !important; /* elegant slate blue */
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  outline: none !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 11px !important;
}

.role-select:hover {
  background-color: #334155 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.role-select:focus {
  border-color: var(--primary) !important;
  box-shadow: var(--neon-glow) !important;
}

