:root {
  --bg-dark: #090e17;
  --bg-card: #121927;
  --bg-input: #0a101d;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.2s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  background: linear-gradient(135deg, #10b981, #3b82f6);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand span {
  font-size: 20px;
  display: block;
}

.sub-brand {
  font-size: 12px;
  color: var(--text-muted);
}

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

.profile-info {
  text-align: right;
}

.profile-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
}

.credit-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-tab:hover { color: var(--text-main); }
.nav-tab.active { background: var(--primary); color: white; }

.special-tab.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

/* Tab Panes Switching */
.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: block !important;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.central-card {
  max-width: 480px;
  margin: 50px auto;
}

.card-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.card-header h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.subtitle { color: var(--text-muted); font-size: 14px; }
.text-center { text-align: center; }

.icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px auto;
}

.admin-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input, .search-input, .filter-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .search-input:focus, .filter-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.helper-text {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Checkbox */
.custom-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px !important;
  color: var(--text-main) !important;
}

.custom-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); }

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-label { display: block; font-size: 12px; color: var(--text-muted); }
.metric-val { font-size: 22px; font-weight: 800; }
.metric-val-sm { font-size: 13px; font-weight: 700; word-break: break-all; }

/* Tables */
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-role { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-admin { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-active { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-trial { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-expired { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-suspended { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-subreseller { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }
.badge-nosub { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.flex-wrap { flex-wrap: wrap; gap: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 12px; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }

/* Info List */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-list i {
  margin-top: 4px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.close-modal-btn:hover { color: var(--text-main); }

.modal-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.plan-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.plan-card:hover, .plan-card.active {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.plan-title { display: block; font-weight: 700; font-size: 15px; }
.plan-cost { font-size: 13px; color: var(--text-muted); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.quick-credentials {
  margin-top: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.quick-credentials ul {
  list-style: none;
  margin-top: 6px;
}

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out;
}

.toast-success { background: #059669; color: white; }
.toast-error { background: #dc2626; color: white; }
.hidden { display: none !important; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 850px) {
  .metrics-grid, .grid-2-col, .form-row { grid-template-columns: 1fr; }
}
