:root {
  --font-size: 16px;
  --background: #0d0d0f;
  --foreground: #ffffff;
  --card: #16161a;
  --card-foreground: #ffffff;
  --popover: #0d0d0f;
  --popover-foreground: #ffffff;
  --primary: #00ff88; /* Vibrant Mint / Emerald */
  --primary-foreground: #000000;
  --secondary: #1f1f23;
  --secondary-foreground: #ffffff;
  --muted: #1f1f23;
  --muted-foreground: #a1a1aa;
  --accent: #112a20;
  --accent-foreground: #00ff88;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #27272a;
  --input: transparent;
  --input-background: #000000;
  --switch-background: #00ff88;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: #00ff88;
  --radius: 8px; /* Softer, modern corners */
  --sidebar: #0d0d0f;
  --sidebar-foreground: #ffffff;
  --glow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

/* ===== Header Layout (Premium) ===== */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13, 13, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0;
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 3rem;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

/* ===== Brand (Cyberpunk) ===== */
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-icon {
  background: var(--primary);
  color: black;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-title {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--foreground);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.brand-subtitle {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--primary);
  letter-spacing: 2px;
  margin-top: 2px;
}

/* ===== Nav (Interactive) ===== */
.portal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 99px;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.nav-link.active {
  color: black;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.nav-badge {
  background: #ff4444;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(255, 68, 68, 0.4);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4444;
  box-shadow: 0 0 8px #ff4444;
}

/* ===== Secure Badge & User ===== */
.secure-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 0.75rem;
  color: #888;
  background: rgba(255, 255, 255, 0.03);
  font-family: 'Fira Code', monospace;
  text-transform: uppercase;
}

.secure-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.user-widget {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.user-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted-foreground);
  letter-spacing: 0.5px;
}

.balance-glow {
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
}

.user-name {
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
}

.logout-form { display:inline; }

.logout-btn {
  background: none;
  border: none;
  padding: 0;
  color: #999;
  text-decoration: none;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-family: 'Fira Code', monospace;
  transition: color .2s;
  cursor: pointer;
}

.logout-btn:hover { color: var(--primary); }

/* ===== Mobile Menu Elements ===== */
.menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.55rem;
  color: var(--foreground);
  cursor: pointer;
}

.mobile-nav-wrap {
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.mobile-nav {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 1rem 0;
}

.desktop-nav { display: flex; }

[x-cloak] { display: none !important; }

/* ===== Buttons & Components ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
}

.btn-outline {
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: black;
  box-shadow: var(--glow);
}

.btn-primary {
  background: var(--primary);
  color: black;
  border: 1px solid var(--primary);
  box-shadow: var(--glow);
}

.btn-primary:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: 0 0 20px var(--primary);
}

main { flex: 1; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  background-color: #000;
  margin-top: auto;
  padding: 3rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
  text-transform: uppercase;
}

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); }

/* ===== Forms ===== */
.form-container {
  max-width: 440px;
  margin: 4rem auto;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
  color: white;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 992px) {
  .desktop-nav { display: none !important; }
  .menu-btn { display: inline-flex; }
  .secure-badge { display: none; }
  
  .header-container { gap: 1rem; }
  .header-left, .header-right { gap: 1rem; }
  
  .portal-header {
      padding: 0.5rem 0;
  }
}

@media (max-width: 600px) {
  .user-widget { display: none; }
  .header-container { padding-left: 1rem; padding-right: 1rem; }
  .brand-title { font-size: 1.1rem; }
}
