/* ============================================
   GenisisAnti — Admin Dashboard Styles
   Dark mode premium com glassmorphism
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(20, 20, 30, 0.8);
  --bg-card-hover: rgba(30, 30, 45, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --text-primary: #e8e8ed;
  --text-secondary: #8b8b9e;
  --text-muted: #55556a;

  --accent: #6c5ce7;
  --accent-hover: #7d6ff0;
  --accent-glow: rgba(108, 92, 231, 0.3);

  --green: #00d68f;
  --green-bg: rgba(0, 214, 143, 0.1);
  --red: #ff5c72;
  --red-bg: rgba(255, 92, 114, 0.1);
  --orange: #ffa94d;
  --orange-bg: rgba(255, 169, 77, 0.1);
  --blue: #4dabf7;
  --blue-bg: rgba(77, 171, 247, 0.1);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  --sidebar-width: 240px;

  --font: 'Inter', -apple-system, system-ui, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ---- Screens ---- */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ---- LOGIN ---- */
.login-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(108, 92, 231, 0.08), transparent 60%);
}

.login-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  border-radius: 50%;
  top: -150px;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.6s ease-out;
}

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

.login-logo { text-align: center; margin-bottom: 36px; }

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  margin-bottom: 16px;
}

.logo-icon svg { width: 28px; height: 28px; color: #fff; }

.login-logo h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, #c0bfff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* ---- Form Inputs ---- */
.input-group { margin-bottom: 20px; }

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  transition: border var(--transition), box-shadow var(--transition);
  outline: none;
}

.input-wrapper input:focus,
.input-group input:focus,
.input-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input:not(.input-wrapper input),
.select-input,
.datetime-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
}

.disabled-input {
  opacity: 0.5;
  cursor: not-allowed;
}

.select-input {
  appearance: none;
  cursor: pointer;
}

.select-input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #b3adff);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.5);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.5);
}

.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(255, 92, 114, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 92, 114, 0.2);
}

.btn-full { width: 100%; justify-content: center; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-sm svg { width: 14px; height: 14px; }

.error-text {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
}

.logo-sm svg { width: 18px; height: 18px; color: #fff; }

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 4px;
}

.nav-item svg { width: 18px; height: 18px; }

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

.nav-item.active {
  background: var(--accent-glow);
  color: #fff;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout svg { width: 18px; height: 18px; }

.btn-logout:hover {
  background: var(--red-bg);
  color: var(--red);
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 0 32px 32px;
  overflow-y: auto;
  height: 100vh;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 5;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.content-header h2 { font-size: 22px; font-weight: 700; }

.header-right { display: flex; gap: 10px; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 { font-size: 16px; font-weight: 600; }

/* ---- Search ---- */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrapper svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-wrapper input {
  padding: 8px 12px 8px 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  width: 260px;
  outline: none;
  transition: border var(--transition);
}

.search-wrapper input:focus {
  border-color: var(--accent);
}

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 18px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background var(--transition);
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

td { color: var(--text-secondary); }

.code-cell {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  user-select: all;
}

.code-cell:hover { color: var(--accent-hover); }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-active { background: var(--green-bg); color: var(--green); }
.badge-expired { background: var(--red-bg); color: var(--red); }
.badge-blocked { background: var(--red-bg); color: var(--red); }
.badge-trial { background: var(--orange-bg); color: var(--orange); }
.badge-lifetime { background: var(--blue-bg); color: var(--blue); }

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---- Actions ---- */
.actions-cell { display: flex; gap: 6px; }

/* ---- Sections ---- */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 { font-size: 18px; font-weight: 700; }

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}

/* ---- Type Selector ---- */
.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.type-option input { display: none; }

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 14px;
  background: var(--bg-glass);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.type-card svg { width: 24px; height: 24px; color: var(--text-muted); }
.type-card strong { font-size: 14px; }
.type-card span { font-size: 11px; color: var(--text-muted); }

.type-option.selected .type-card {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.type-option.selected .type-card svg { color: var(--accent); }

.type-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  animation: slideInRight 0.3s ease;
  max-width: 360px;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-title, .nav-item span, .sidebar-footer span { display: none; }
  .sidebar-header { justify-content: center; }
  .main-content { margin-left: 60px; padding: 0 16px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .search-wrapper input { width: 160px; }
}
