@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08080d;
  --bg-card: #0e0e16;
  --bg-input: #12121c;
  --bg-hover: #161622;
  --border: #1a1a2c;
  --purple: #9b59d0;
  --pink: #e84393;
  --green: #4cdf8b;
  --orange: #ffa726;
  --red: #ff4757;
  --blue: #5c7cfa;
  --text: #d4d4e0;
  --dim: #6a6a80;
  --dimmer: #3a3a50;
  --grad: linear-gradient(135deg, #9b59d0, #e84393);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══ Sidebar ═══ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.sidebar-logo .icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: white;
}

.sidebar-logo span {
  font-size: 20px; font-weight: 800; letter-spacing: 1px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--dim); transition: all 0.2s;
  margin-bottom: 4px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--purple); color: white; }
.nav-item .badge {
  margin-left: auto; background: var(--pink); color: white;
  font-size: 11px; padding: 1px 8px; border-radius: 10px; font-weight: 600;
}

.sidebar-footer {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--dimmer);
}

/* ═══ Main ═══ */
.main {
  margin-left: 240px; padding: 28px 32px;
  min-height: 100vh;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }

/* ═══ Stats ═══ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
}
.stat-card .label {
  font-size: 12px; color: var(--dim); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 1px;
}
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .value.purple { color: var(--purple); }
.stat-card .value.green { color: var(--green); }
.stat-card .value.orange { color: var(--orange); }
.stat-card .value.pink { color: var(--pink); }

/* ═══ Table ═══ */
.table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.table-header h3 { font-size: 15px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 14px 16px; font-size: 13px;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

.key-text { color: var(--purple); font-weight: 600; }
.hwid-text {
  color: var(--dim); font-size: 11px;
  max-width: 120px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ═══ Badges ═══ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600; font-family: 'Outfit', sans-serif;
}
.badge-active { background: rgba(76,223,139,0.12); color: var(--green); }
.badge-expired { background: rgba(255,71,87,0.12); color: var(--red); }
.badge-frozen { background: rgba(92,124,250,0.12); color: var(--blue); }
.badge-unused { background: rgba(106,106,128,0.12); color: var(--dim); }

/* ═══ Buttons ═══ */
.btn {
  border: none; border-radius: 10px; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 600;
  font-size: 13px; padding: 10px 20px;
  transition: all 0.2s;
}
.btn-primary { background: var(--grad); color: white; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ghost {
  background: transparent; color: var(--dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }
.btn-sm { padding: 6px 12px; font-size: 11px; border-radius: 6px; }
.btn-danger { background: rgba(255,71,87,0.12); color: var(--red); border: none; }
.btn-danger:hover { background: rgba(255,71,87,0.25); }
.btn-freeze { background: rgba(92,124,250,0.12); color: var(--blue); border: none; }
.btn-freeze:hover { background: rgba(92,124,250,0.25); }

.actions { display: flex; gap: 6px; }

/* ═══ Modal ═══ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; width: 420px;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } }

.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal label {
  display: block; font-size: 12px; color: var(--dim);
  margin-bottom: 6px; margin-top: 14px;
}
.modal input, .modal select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; color: var(--text);
  font-size: 13px; font-family: 'Outfit', sans-serif;
  outline: none; transition: border 0.2s;
}
.modal input:focus, .modal select:focus { border-color: var(--purple); }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }

/* ═══ Logs ═══ */
.log-entry {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.log-entry:last-child { border-bottom: none; }
.log-time {
  color: var(--dimmer); font-size: 11px;
  font-family: 'JetBrains Mono', monospace; min-width: 140px;
}
.log-action { font-weight: 500; }
.log-key {
  color: var(--purple);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}

/* ═══ Search ═══ */
.search-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px; color: var(--text);
  font-size: 13px; font-family: 'Outfit', sans-serif;
  outline: none; width: 220px;
}
.search-input:focus { border-color: var(--purple); }
.search-input::placeholder { color: var(--dimmer); }

/* ═══ Utility ═══ */
.hidden { display: none !important; }

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dimmer); border-radius: 3px; }