:root {
  --bg-dark: #07090e;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(56, 189, 248, 0.18);
  --border-hover: rgba(56, 189, 248, 0.45);
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --cyan: #38bdf8;
  --green: #22c55e;
  --purple: #a855f7;
  --yellow: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --glass-blur: blur(16px);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #07090e; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.brand-badge {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #07090e;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--cyan);
}

.nav-user-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-badge-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.btn-green {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.btn-green:hover {
  background: linear-gradient(135deg, #15803d, #166534);
}

.btn-outline {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--cyan);
  color: white;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 70px 20px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-highlight {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 30px;
}

/* Feature Badges */
.feature-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.fb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Pricing Grid */
.pricing-section {
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 36px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.pricing-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.pricing-card.popular {
  border-color: #38bdf8;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #07090e;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}

.pkg-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.pkg-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 40px;
  margin-bottom: 20px;
}

.pkg-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 20px;
}

.pkg-price {
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.pkg-unit {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.pkg-features {
  list-style: none;
  margin-bottom: 28px;
  flex-grow: 1;
}

.pkg-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.check-icon {
  color: var(--green);
  font-weight: 800;
}

/* Member Dashboard */
.dashboard-section {
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.dash-header {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dash-stat-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-stat-val {
  font-size: 1.8rem;
  font-weight: 800;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  position: relative;
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: white;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: #07090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--cyan);
}

/* VietQR Modal Box */
.qr-box-wrap {
  text-align: center;
  background: #07090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.qr-image {
  max-width: 240px;
  width: 100%;
  border-radius: 8px;
  margin-bottom: 14px;
}

.bank-info-grid {
  text-align: left;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 12px 16px;
  border-radius: 8px;
}

.bank-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  animation: slideUp 0.3s ease;
}

/* Key Management Table & Cards */
.keys-table-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.85));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
}

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

.keys-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.keys-table thead th {
  background: #0b1120;
  color: var(--text-dim);
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.keys-table tbody tr {
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  transition: background 0.15s;
}

.keys-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.4);
}

.keys-table td {
  padding: 14px;
  vertical-align: middle;
}

.key-code-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #07090e;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.84rem;
  color: #a5f3fc;
}

.key-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.key-status-active {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.key-status-exhausted {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.key-credit-bar {
  width: 100%;
  max-width: 140px;
  height: 6px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}

.key-credit-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  transition: width 0.3s ease;
}

.empty-keys-box {
  text-align: center;
  padding: 40px 20px;
  background: #07090e;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

