:root {
  --bg-dark: #070b14;
  --bg-sidebar: #0b1120;
  --bg-card: #111827;
  --bg-card-glow: #131d31;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --indigo: #6366f1;
  --indigo-glow: rgba(99, 102, 241, 0.15);
  --danger: #ef4444;
  --font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* UTILITY CLASSES */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-emerald { color: var(--emerald); }
.text-indigo { color: var(--indigo); }
.text-danger { color: var(--danger); }
.font-mono { font-family: var(--font-mono); }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }
.text-center { text-align: center; }

/* MODAL OVERLAY & AUTH CARD */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.brand-badge {
  display: inline-block;
  background: var(--indigo-glow);
  color: var(--indigo);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-bottom: 1rem;
}

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.auth-form {
  margin-top: 1.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: var(--emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-full { width: 100%; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
}
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); }

.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}
.btn-emerald:hover { opacity: 0.95; transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--text-muted); color: #fff; }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-link {
  background: none;
  border: none;
  color: var(--indigo);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* LAYOUT & SIDEBAR */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 2rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.925rem;
  transition: all 0.2s ease;
}

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

.nav-item.active {
  background: var(--indigo-glow);
  color: var(--indigo);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.user-status-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

.user-details {
  overflow: hidden;
}

.user-email {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-dot.green { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

/* MAIN CONTENT VIEW */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1200px;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.top-header h1 {
  font-size: 2rem;
  font-weight: 800;
}

/* CARDS & GRIDS */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
}

.card-glow {
  background: var(--bg-card-glow);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-primary { background: var(--indigo-glow); color: var(--indigo); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-success { background: var(--emerald-glow); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-outline { border: 1px solid var(--border-color); color: var(--text-muted); }

/* LICENSE BOX */
.license-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.license-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.license-key-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.key-code {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.info-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 700;
}

/* PROGRESS BARS & STATS */
.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.stat-max { font-size: 1.25rem; color: var(--text-muted); }

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.progress-bar-bg.lg { height: 12px; }

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-bar-fill.emerald { background: var(--emerald); box-shadow: 0 0 10px var(--emerald); }
.progress-bar-fill.indigo { background: var(--indigo); box-shadow: 0 0 10px var(--indigo); }

.usage-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}
.u-label { display: block; font-size: 0.75rem; color: var(--text-muted); }
.u-val { font-size: 1.1rem; font-weight: 700; }

/* DATA TABLE */
.card-table { padding: 0; overflow: hidden; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}
.data-table tr:last-child td { border-bottom: none; }

/* DOWNLOAD CARDS */
.download-card {
  text-align: center;
  padding: 2.25rem 1.75rem;
}
.download-card.highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-card) 100%);
}
.os-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.version-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin: 1rem 0 1.5rem 0;
  color: var(--text-muted);
}

.sha-box {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sha-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  word-break: break-all;
  margin-top: 0.25rem;
  opacity: 0.7;
}

.setup-steps {
  padding-left: 1.25rem;
  line-height: 1.8;
  color: var(--text-muted);
}

/* TOP UP CARDS */
.topup-card {
  position: relative;
  text-align: center;
  padding: 2.25rem 1.5rem;
}
.topup-card.highlight {
  border-color: rgba(99, 102, 241, 0.5);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-card) 100%);
}
.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--indigo);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.topup-header h3 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}
.topup-minutes {
  margin: 1.25rem 0;
}
.min-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}
.bonus-tag {
  display: inline-block;
  background: var(--emerald-glow);
  color: var(--emerald);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-top: 0.4rem;
}
.topup-rate {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar { width: 80px; padding: 1rem; }
  .sidebar-brand span:last-child, .nav-item span:last-child, .user-details { display: none; }
  .main-content { margin-left: 80px; padding: 1.5rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
