/* NEXUS DATA - Design System (Impeccable-compliant) */
:root {
  --bg-primary: #0a0f1c;
  --bg-secondary: #0f1524;
  --bg-card: #141c2e;
  --bg-card-hover: #1a2540;
  --bg-input: #0d1220;
  --text-primary: #f0f2f5;
  --text-secondary: #9ca3b4;
  --text-muted: #5c6578;
  --accent: #e5a00d;
  --accent-hover: #d4940c;
  --accent-subtle: rgba(229, 160, 13, 0.08);
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --border: #1e2a3e;
  --border-light: #283a52;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.app-container { display: flex; min-height: 100vh; overflow-x: hidden; max-width: 100vw; }
.sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 24px 20px;
  min-height: 100vh;
  width: calc(100vw - 240px);
  max-width: calc(100vw - 240px);
  overflow-x: hidden;
  box-sizing: border-box;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #0a0f1c;
}
.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.nav-section { margin-bottom: 20px; }
.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 450;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}
.nav-item-icon { font-size: 16px; width: 22px; text-align: center; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Module Cards */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px 8px;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 90px;
  justify-content: center;
}
.module-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}
.module-card::before { display: none; }
.module-icon {
  font-size: 18px;
  margin-bottom: 3px;
}
.module-card:hover .module-icon { transform: none; }
.module-name {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.module-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.credits-counter {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}
.credits-bar {
  width: 70%;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 1px;
  margin-top: 6px;
  overflow: hidden;
}
.credits-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.2s;
}
.module-info-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.module-card:hover .module-info-btn { opacity: 1; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  font-weight: 500;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-card-change { font-size: 12px; margin-top: 4px; }
.stat-card-change.positive { color: var(--success); }
.stat-card-change.negative { color: var(--danger); }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-table tr:hover td { background: var(--bg-card-hover); }

/* Buttons */
.btn {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--accent);
  color: #0a0f1c;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.85; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Inputs */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 3px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-input::placeholder { color: var(--text-muted); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 580px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.2px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }

/* Badges */
.badge {
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-success { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.badge-warning { background: rgba(234, 179, 8, 0.12); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.badge-info { background: var(--accent-subtle); color: var(--accent); }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

/* Search */
.search-box {
  position: relative;
  margin-bottom: 20px;
}
.search-box input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.15s;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
}

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 4px; max-height: 24px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  min-width: 280px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.2s ease-out;
  font-size: 13px;
}
.toast-success { border-top: 2px solid var(--success); }
.toast-error { border-top: 2px solid var(--danger); }
.toast-info { border-top: 2px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Query result */
.query-result {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
  max-height: 500px;
  overflow-y: auto;
}

/* Responsive */

/* Tablet breakpoint */
@media (max-width: 1024px) {
  .main-content { padding: 20px 16px; }
  .modules-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
  .module-card { min-height: 85px; }
  .module-icon { font-size: 20px; }
  .module-name { font-size: 9px; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content {
  
   margin-left: 0; padding: 16px; }
  .modules-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .module-card { padding: 10px 6px 8px; min-height: 75px; }
  .module-icon { font-size: 26px; }
  .module-name { font-size: 10px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* Auth */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}
.auth-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 13px;
}

/* Plans */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: border-color 0.15s;
}
.plan-card:hover { border-color: var(--border-light); }
.plan-card.featured { border-color: var(--accent); }
.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.plan-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.plan-period { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.plan-features { list-style: none; text-align: left; margin-bottom: 20px; }
.plan-features li {
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.plan-features li::before { content: '✓ '; color: var(--success); font-weight: bold; }

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.category-tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.category-tab:hover, .category-tab.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

/* Mobile responsiveness - melhorado */
@media (max-width: 480px) {
  .modules-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .module-card { padding: 8px 5px 6px; min-height: 75px; }
  .module-icon { font-size: 18px; }
  .module-name { font-size: 8px; -webkit-line-clamp: 2; }
  .header { padding: 12px 16px; }
  .header h1 { font-size: 16px; }
  .modal-content { width: 95%; margin: 10px; padding: 16px; max-height: 90vh; }
  .result-row { flex-direction: column; }
  .result-label { width: 100%; margin-bottom: 2px; }
  .result-value { width: 100%; }
  .search-bar { width: 100%; }
  .search-bar input { width: 100%; }
  .filter-tabs { flex-wrap: wrap; gap: 4px; }
  .filter-tab { font-size: 9px; padding: 4px 8px; }
}

@media (max-width: 768px) {
  .modal-content { width: 92%; margin: 20px auto; }
  .nav-items { gap: 4px; }
  .nav-item { font-size: 12px; padding: 8px 10px; }
  .nav-item-icon { display: none; }
}

/* Sidebar mobile toggle */
@media (max-width: 768px) {
  .sidebar.mobile-open { display: flex; position: fixed; z-index: 1000; width: 240px; height: 100vh; top: 0; left: 0; }
}

/* ===== MOBILE RESPONSIVENESS COMPLETE ===== */
/* Mobile Header Bar */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  align-items: center;
  padding: 0 16px;
  gap: 6px;
}
.mobile-header .logo-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.mobile-header .logo-text {
  font-size: 14px;
}
.mobile-menu-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.mobile-menu-btn:hover { background: var(--bg-card-hover); }
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 998;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.mobile-open {
    display: flex;
    flex-direction: column;
    transform: translateX(0);
  }
  .main-content {
  
  
    margin-left: 0;
    padding: 72px 14px 24px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .page-title { font-size: 18px; }
  .page-subtitle { font-size: 12px; }
  /* Cards grid mobile */
  .modules-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .module-card {
    padding: 14px 8px 10px;
    min-height: 80px;
  }
  .module-icon { font-size: 24px; margin-bottom: 6px; }
  .module-name { font-size: 9.5px; }
  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .stat-card { padding: 14px; }
  .stat-card-value { font-size: 18px; }
  .stat-card-label { font-size: 10px; }
  /* Modal */
  .modal-content {
    width: 95% !important;
    max-width: 95vw !important;
    margin: 8px auto !important;
    padding: 16px !important;
    max-height: 92vh !important;
    border-radius: 12px !important;
  }
  .modal-header h2 { font-size: 16px; }
  /* Results */
  .result-row { flex-direction: column; gap: 2px; }
  .result-label { width: 100%; font-size: 9px; }
  .result-value { width: 100%; font-size: 12px; }
  /* Search */
  .search-bar { width: 100%; }
  .search-bar input { font-size: 14px; padding: 12px; }
  /* Tables */
  .my-apis-table { font-size: 9px; }
  .my-apis-table th { padding: 8px 6px; font-size: 9px; }
  .my-apis-table td { padding: 8px 6px; font-size: 9px; }
  /* API Store */
  .api-grid { grid-template-columns: 1fr !important; gap: 6px; }
  .api-tabs { overflow-x: auto; gap: 0; }
  .api-tab { padding: 10px 14px; font-size: 12px; white-space: nowrap; }
  .filter-bar { gap: 4px; }
  .filter-btn { padding: 5px 10px; font-size: 10px; }
  /* Payment Modal */
  .payment-modal-content {
    width: 94% !important;
    padding: 20px !important;
    max-height: 90vh;
    overflow-y: auto;
  }
  .crypto-options { grid-template-columns: repeat(2, 1fr); }
  /* Plans */
  .plans-grid { grid-template-columns: 1fr; }
  /* Category tabs */
  .category-tabs { gap: 4px; }
  .category-tab { padding: 6px 10px; font-size: 10px; }
}

@media (max-width: 480px) {
  .main-content {
  
   padding: 64px 10px 20px; }
  .modules-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .module-card { padding: 12px 6px 8px; min-height: 85px; }
  .module-icon { font-size: 18px; }
  .module-name { font-size: 9px; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 16px; }
  .api-card { padding: 16px; }
  .api-card-name { font-size: 13px; }
  .api-card-price { font-size: 14px; }
  .api-card-desc { font-size: 9px; }
  .field-tag { font-size: 9px; padding: 2px 6px; }
}

/* Paginação */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 0;
}
.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.pagination button:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}
.pagination button.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination .page-info {
  color: var(--text-muted);
  font-size: 11px;
}

/* Category filters - scroll horizontal */
.categories-filter, .filter-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
.categories-filter::-webkit-scrollbar,
.filter-categories::-webkit-scrollbar {
  height: 3px;
}
.categories-filter::-webkit-scrollbar-thumb,
.filter-categories::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
.categories-filter button,
.filter-categories button {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.categories-filter button:hover,
.filter-categories button:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.categories-filter button.active,
.filter-categories button.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}
