@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@600;700;800;900&display=swap');

/* ═══════════════════════════════════════
   DESIGN TOKENS — LICENSE APP
═══════════════════════════════════════ */
:root {
  --bg: #08080e;
  --surface-1: #0f0f1a;
  --surface-2: #171728;
  --surface-3: #1f1f35;
  --surface-4: #2a2a45;
  --border: rgba(124,58,237,0.15);
  --border-soft: rgba(255,255,255,0.06);
  --border-bright: rgba(255,255,255,0.12);
  --text-1: #f0f0f8;
  --text-2: #9a9ab8;
  --text-3: #5c5c78;
  --primary: #7c3aed;
  --primary-light: #a855f7;
  --primary-dark: #6d28d9;
  --primary-glow: rgba(124,58,237,0.25);
  --green: #10b981;
  --green-glow: rgba(16,185,129,0.2);
  --red: #ef4444;
  --yellow: #f59e0b;
  --orange: #f97316;
  --blue: #3b82f6;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --sidebar-w: 250px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-light); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--text-1); }
img { max-width: 100%; display: block; }

/* ═══════════  LAYOUT  ═══════════ */
.app-layout { display: flex; min-height: 100vh; }
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin 0.25s ease;
}
@media (max-width: 900px) { .main-content { margin-left: 0; } }

.page-container { padding: 32px; flex: 1; }
.page-header {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.page-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; }

/* ═══════════  SIDEBAR  ═══════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
}

.sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-1);
}
.sidebar-brand-sub { font-size: 0.68rem; color: var(--text-3); font-weight: 500; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  padding: 20px 24px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  margin: 2px 10px;
  transition: all 0.15s;
}
.sidebar-link:hover { color: var(--text-1); background: var(--surface-2); }
.sidebar-link.active { color: var(--primary-light); background: rgba(124,58,237,0.08); }
.sidebar-link .icon { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.sidebar-user-plan { font-size: 0.68rem; color: var(--primary-light); font-weight: 500; }

/* ═══════════  TOPBAR  ═══════════ */
.topbar {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 0.9rem; font-weight: 600; color: var(--text-2); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--text-2);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
}
@media (max-width: 900px) { .hamburger-btn { display: inline-flex; } }

/* ═══════════  CARDS  ═══════════ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.card-title { font-size: 1rem; font-weight: 700; }
.card-body { padding: 24px; }

.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at top right, var(--primary-glow), transparent 70%);
  pointer-events: none;
}
.stat-card:hover { border-color: var(--border); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: rgba(124,58,237,0.1);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: var(--primary-light);
  flex-shrink: 0;
}
.stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.78rem; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

/* ═══════════  GRIDS  ═══════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (min-width: 901px) and (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
.gap-6 { gap: 24px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

/* ═══════════  BUTTONS  ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border-soft);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border); color: var(--text-1); }
.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ═══════════  BADGES  ═══════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-green  { background: rgba(16,185,129,0.12); color: var(--green); }
.badge-red    { background: rgba(239,68,68,0.12);  color: var(--red); }
.badge-yellow { background: rgba(245,158,11,0.12); color: var(--yellow); }
.badge-orange { background: rgba(249,115,22,0.12); color: var(--orange); }
.badge-blue   { background: rgba(59,130,246,0.12); color: var(--blue); }
.badge-purple { background: rgba(168,85,247,0.12); color: var(--primary-light); }
.badge-gray   { background: var(--surface-3);      color: var(--text-3); }

/* ═══════════  FORMS  ═══════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.15s;
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--text-3); }
.form-hint { font-size: 0.78rem; color: var(--text-3); }
.form-error { font-size: 0.78rem; color: var(--red); }

/* ═══════════  TABLE  ═══════════ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--surface-2); }
th {
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-soft);
}
td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

.license-key-cell {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--primary-light);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.license-key-cell:hover { max-width: none; background: var(--surface-3); }

/* ═══════════  ALERTS  ═══════════ */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: var(--green); }
.alert-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: var(--red); }
.alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: var(--yellow); }
.alert-info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); color: var(--blue); }

/* ═══════════  AUTH PAGE  ═══════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.auth-glow {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.2;
  pointer-events: none;
}
.auth-glow-1 { background: radial-gradient(circle, var(--primary), transparent 70%); top: -150px; left: -100px; }
.auth-glow-2 { background: radial-gradient(circle, #4f46e5, transparent 70%); bottom: -100px; right: -100px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  z-index: 1;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}
.auth-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 0 24px var(--primary-glow);
}
.auth-logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-1);
}
.auth-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; text-align: center; }
.auth-subtitle { font-size: 0.88rem; color: var(--text-3); text-align: center; margin-bottom: 28px; }

/* ═══════════  COPY BUTTON  ═══════════ */
.copy-btn {
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { background: var(--surface-4); color: var(--text-1); }
.copy-btn.copied { background: rgba(16,185,129,0.15); color: var(--green); border-color: rgba(16,185,129,0.3); }

/* ═══════════  EMPTY STATE  ═══════════ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; color: var(--text-3); opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.empty-state p { font-size: 0.88rem; margin-bottom: 20px; }

/* ═══════════  PAGINATION  ═══════════ */
.pagination-wrap { display: flex; justify-content: center; gap: 4px; margin-top: 24px; }
.pagination-wrap .page-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}
.pagination-wrap .page-link:hover { background: var(--surface-3); color: var(--text-1); }
.pagination-wrap .active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ═══════════  UTILITIES  ═══════════ */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* ═══════════  ANIMATION  ═══════════ */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
