﻿:root {
  --bg: #08070c;
  --bg-elev: #100e17;
  --bg-elev-2: #171320;
  --border: #251f30;
  --text: #ede9f5;
  --text-dim: #a89fc0;
  --text-faint: #6b6280;
  --accent: #a855f7;
  --accent-hover: #bf6cff;
  --accent-2: #d946ef;
  --accent-dim: rgba(168, 85, 247, 0.16);
  --accent-glow: 0 0 24px rgba(168, 85, 247, 0.35);
  --green: #2ecc71;
  --green-dim: rgba(46, 204, 113, 0.15);
  --red: #ff5c5c;
  --red-dim: rgba(255, 92, 92, 0.15);
  --yellow: #f5b942;
  --yellow-dim: rgba(245, 185, 66, 0.15);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent-dim); }

/* ---------- Layout ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px 10px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: var(--text);
  background: linear-gradient(135deg, #fff, var(--accent-2) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: var(--accent-glow);
  flex-shrink: 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover { background: var(--bg-elev-2); color: var(--text); }
.nav a.active { background: var(--accent-dim); color: #d9b8ff; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: block;
  padding: 9px 12px;
  color: var(--text-faint);
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.sidebar-footer a:hover { color: var(--text-dim); background: var(--bg-elev-2); }

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 34px 60px 34px;
}

.trial-banner-bar {
  background: var(--accent-dim);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #d9b8ff;
  margin-bottom: 20px;
}
.trial-banner-bar a { color: #fff; font-weight: 650; text-decoration: underline; }
.trial-banner-bar.expired {
  background: var(--yellow-dim);
  border-color: rgba(245, 185, 66, 0.4);
  color: var(--yellow);
}
.trial-banner-bar.expired a { color: #fff; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 20px;
  margin: 0 0 4px 0;
  font-weight: 650;
}

.page-header p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Cards / stats ---------- */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-card .label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
}

.stat-card .value.accent { color: #d9b8ff; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.red { color: var(--red); }
.stat-card .value.yellow { color: var(--yellow); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-danger {
  background: var(--red-dim);
  border-color: rgba(255, 92, 92, 0.35);
  color: var(--red);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

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

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  padding: 11px 14px;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-elev-2); }

.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12.5px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-gray { background: var(--bg-elev-2); color: var(--text-faint); border: 1px solid var(--border); }

.row-actions { display: flex; gap: 6px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 22px;
}

.modal h2 { margin: 0 0 16px 0; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Toast ---------- */

#toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  min-width: 220px;
  animation: slide-in 0.18s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }

@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Toolbar / filters ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input { width: auto; min-width: 140px; }

/* ---------- SDK box (tabbed) ---------- */

.sdk-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.03));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius);
  padding: 20px 22px 22px 22px;
  margin-bottom: 26px;
}

.sdk-box-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.sdk-box-header h2 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sdk-box-header p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  max-width: 60ch;
}

.sdk-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  margin-bottom: 14px;
}

.sdk-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.sdk-tab:hover { color: var(--text); }
.sdk-tab.active { color: #d9b8ff; border-bottom-color: var(--accent); }

.sdk-tab-content.hidden { display: none; }

.sdk-tab-filename {
  color: var(--text-faint);
  font-size: 11.5px;
  margin-bottom: 8px;
}

.sdk-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.code-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre;
  margin: 0;
}

.code-box .kw { color: #d9b8ff; }
.code-box .str { color: var(--green); }
.code-box .com { color: var(--text-faint); }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-faint);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px 4px;
  width: auto;
  font-size: 12px;
}
.copy-btn:hover { color: var(--accent); }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 360px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow), var(--accent-glow);
}

.login-error {
  background: var(--red-dim);
  color: var(--red);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .main { padding: 20px; }
}
