* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

:root {
  --primary-black: #0a0a0a;
  --secondary-black: #111111;
  --card-black: #151515;
  --accent-green: #00ff88;
  --accent-green-dark: #00cc6a;
  --accent-orange: #ff9900;
  --text-primary: #f0f0f0;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;
  --border-color: #222222;
  --sidebar-width: 250px;
}

body {
  background-color: var(--primary-black);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--secondary-black);
  border-right: 1px solid var(--border-color);
  padding: 2rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.sidebar-logo-icon {
  font-size: 1.8rem;
  color: var(--accent-green);
}

.sidebar-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(
    90deg,
    var(--accent-green),
    var(--accent-green-dark)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    var(--accent-green),
    var(--accent-green-dark)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-info h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.user-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-plan {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 0.3rem;
}

.sidebar-nav {
  padding: 0 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
  font-weight: 600;
}

.nav-item i {
  font-size: 1.2rem;
  width: 24px;
}

.nav-badge {
  background: var(--accent-green);
  color: var(--primary-black);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-weight: 700;
  margin-left: auto;
}

.sidebar-footer {
  padding: 1.5rem 1.5rem 0;
  margin-top: 7rem;
  border-top: 1px solid var(--border-color);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.logout-btn:hover {
  background: rgba(255, 50, 50, 0.1);
  color: #ff5555;
  border-color: rgba(255, 50, 50, 0.3);
}

/* ===============================
   MOBILE HEADER
================================ */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: #0b0b11;
  border-bottom: 1px solid #1f1f2e;
  padding: 0 16px;
  z-index: 1001;
  align-items: center;
  justify-content: space-between;
}

.mobile-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-logo-icon {
  font-size: 22px;
  color: var(--accent-green);
}

.mobile-logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(
    90deg,
    var(--accent-green),
    var(--accent-green-dark)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ===============================
   SIDEBAR OVERLAY
================================ */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===============================
   MOBILE SIDEBAR BEHAVIOR
================================ */

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .dashboard-header {
    display: none;
  }

  .tab-content {
    padding-top: 4.5rem; /* space for mobile header */
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1002;
    will-change: transform;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .dashboard-header {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding-top: 70px; /* space for mobile header */
  }
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: 100vh;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.header-title p {
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.header-btn {
  background: var(--card-black);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  font-weight: 500;
}

.header-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.header-btn.primary, .primary {
  background: linear-gradient(
    90deg,
    var(--accent-green-dark),
    var(--accent-green)
  );
  color: var(--primary-black);
  border: none;
  font-weight: 600;
}

.header-btn.primary:hover, .primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--card-black);
  border-radius: 15px;
  padding: 1.8rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--accent-green);
  transform: translateY(-5px);
}

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

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(0, 255, 136, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-green);
}

.stat-change {
  font-size: 0.9rem;
  color: var(--accent-green);
  font-weight: 600;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  font-family: "JetBrains Mono", monospace;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Generators Section */
.generators-section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.generators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.generator-card {
  background: var(--card-black);
  border-radius: 15px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.generator-card:hover {
  border-color: var(--accent-green);
  transform: translateY(-5px);
}

.generator-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 1.5rem;
}

.generator-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  background: rgba(0, 255, 136, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent-green);
}

.generator-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.generator-status {
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}

.status-active {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
}

.status-locked {
  background: rgba(255, 50, 50, 0.1);
  color: #ff5555;
}

.generator-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.generator-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.generator-stat {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-green);
  margin-bottom: 0.3rem;
}

.stat-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.generator-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.generator-btn.active {
  background: linear-gradient(
    90deg,
    var(--accent-green-dark),
    var(--accent-green)
  );
  color: var(--primary-black);
}

.generator-btn.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.generator-btn.locked {
  background: #333333;
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Recent Activity */
.activity-section {
  background: var(--card-black);
  border-radius: 15px;
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: rgba(0, 255, 136, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent-green);
}

.activity-content h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.activity-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.activity-time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 992px) {
  .sidebar {
    width: 70px;
    padding: 2rem 0;
  }

  .sidebar-logo-text,
  .user-info,
  .nav-item span,
  .logout-btn span {
    display: none;
  }

  .sidebar-logo {
    justify-content: center;
    padding: 0 0 2rem;
  }

  .sidebar-user {
    justify-content: center;
    padding: 0 0 1.5rem;
  }

  .nav-item {
    justify-content: center;
    padding: 0.9rem 0;
  }

  .nav-badge {
    display: none;
  }

  .main-content {
    margin-left: 70px;
  }

  .sidebar-footer {
    padding: 1.5rem 0.5rem 0;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1.5rem;
  }

  .dashboard-header {
    display: none;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .generators-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .main-content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    flex-direction: column;
  }
}

/* Services Cards */
.generator-services-view {
  margin-top: 20px;
}

.services-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.back-btn {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 14px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.service-card {
  background: #141414;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s;
}

.service-card:hover {
  border: 1px solid var(--accent-green);
  transform: translateY(-5px);
}

.service-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 8px;
}

.service-name {
  font-weight: 600;
}

.service-stock {
  font-size: 13px;
  color: #aaa;
}

.service-btn {
  margin-top: auto;
  padding: 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(
    90deg,
    var(--accent-green-dark),
    var(--accent-green)
  );
  color: var(--primary-black);
  transition: all 0.3s;
}

.service-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.service-btn.disabled {
  background: #333;
  cursor: not-allowed;
}

/* History Tab */
.history-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: #0f0f14;
  border-radius: 10px;
  overflow: hidden;
}

.history-table thead {
  background: #161622;
}

.history-table th,
.history-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
}

.history-table th {
  color: var(--accent-green);
  font-weight: 600;
}

.history-table td {
  color: #fff;
  border-top: 1px solid #1f1f2e;
}

.history-table a {
  color: var(--accent-green-dark);
  text-decoration: none;
  font-weight: 500;
}

.history-table a:hover {
  text-decoration: underline;
}

.loading-row {
  text-align: center;
  padding: 30px;
}

.history-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.history-pagination button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
}

.history-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Upgrade Tab */
/* Pricing Section */
.pricing-section {
  padding: 4rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.pricing-card {
  background: var(--card-black);
  border-radius: 15px;
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.pricing-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.pricing-card.popular {
  border-color: var(--accent-green);
}

.pricing-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent-green);
  color: var(--primary-black);
  padding: 0.5rem 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom-left-radius: 10px;
}

.pricing-name {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-green);
}

.pricing-price span {
  font-size: 1rem;
  color: var(--text-secondary);
}

.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-features li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.pricing-features li i {
  margin-right: 10px;
  font-size: 1rem;
}

.pricing-features li i.fa-check {
  color: var(--accent-green);
}

.pricing-features li i.fa-times {
  color: var(--text-muted);
}

.pricing-btn {
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  border: none;
  font-size: 1rem;
  background: linear-gradient(
    90deg,
    var(--accent-green-dark),
    var(--accent-green)
  );
}

.pricing-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===============================
   SUPPORT TAB
================================ */

.support-card {
  max-width: 100%;
  margin: 40px auto 0;
  padding: 32px;
  background: linear-gradient(180deg, #12121a, #0b0b11);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.support-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #5865f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
}

.support-title {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.support-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.support-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: #5865f2;
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.support-discord-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(88, 101, 242, 0.4);
}

/* ===============================
   DASHBOARD LOADER
================================ */

.page-loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #0f1220, #07080f);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  color: #fff;
}

.loader-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-green-dark);
  animation: spin 1s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-container.hidden {
  opacity: 0;
}

.dashboard-container {
  opacity: 1;
  transition: opacity 0.3s ease;
}