/* ─── Cipron Design System ───────────────────────────────────────────────── */
:root {
  --bg:        #050508;
  --bg-2:      #0d0d12;
  --bg-3:      #13131a;
  --bg-4:      #1a1a24;
  --bg-hover:  #1f1f2e;
  --border:    #1e1e2e;
  --border-2:  #2a2a3d;
  --border-3:  #353550;
  --text:      #f0f0ff;
  --text-2:    #9090b0;
  --text-3:    #55556a;
  --accent:    #8b5cf6;
  --accent-2:  #7c3aed;
  --accent-3:  #6d28d9;
  --accent-lo: rgba(139,92,246,.12);
  --accent-glow: rgba(139,92,246,.25);
  --green:     #10b981;
  --green-lo:  rgba(16,185,129,.12);
  --yellow:    #f59e0b;
  --yellow-lo: rgba(245,158,11,.12);
  --red:       #ef4444;
  --red-lo:    rgba(239,68,68,.12);
  --blue:      #3b82f6;
  --blue-lo:   rgba(59,130,246,.12);
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 48px rgba(0,0,0,.7);
  --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -.04em; line-height: 1.15; }
h2 { font-size: 1.6rem;  font-weight: 700; letter-spacing: -.03em; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
h4 { font-size: .9rem;   font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
p  { color: var(--text-2); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: var(--font-mono);
  font-size: .875em;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-4); color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-3); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-outline:hover { background: var(--bg-4); border-color: var(--accent); color: var(--accent); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-4); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; border-radius: 8px; }

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--text-2); letter-spacing: .03em; }

.form-input, .form-select, .form-textarea {
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 10px 14px;
  color: var(--text); font-size: .875rem; font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lo);
}
.form-input::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-hint { font-size: .78rem; color: var(--text-3); }
.form-error { font-size: .78rem; color: var(--red); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.card-hover { transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-hover:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* ── Badges / Tags ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
}
.badge-green  { background: var(--green-lo);  color: var(--green); }
.badge-red    { background: var(--red-lo);    color: var(--red); }
.badge-yellow { background: var(--yellow-lo); color: var(--yellow); }
.badge-blue   { background: var(--blue-lo);   color: var(--blue); }
.badge-purple { background: var(--accent-lo); color: var(--accent); }
.badge-gray   { background: var(--bg-4);      color: var(--text-2); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--bg-3); padding: 12px 16px;
  text-align: left; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-3); }
tbody td { padding: 14px 16px; color: var(--text-2); vertical-align: middle; }
tbody td:first-child { color: var(--text); }

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat-card .stat-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; color: var(--text); }
.stat-card .stat-sub   { font-size: .8rem; color: var(--text-3); }
.stat-card .stat-icon  {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-lo);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 1.1rem; margin-bottom: 4px;
}

/* ── Sidebar layout ──────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); min-height: 100vh; flex-shrink: 0;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.03em; color: var(--text);
}
.sidebar-logo img { width: 28px; height: 28px; }
.sidebar-logo span { color: var(--accent); }

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3); padding: 0 8px 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: .875rem; font-weight: 500; color: var(--text-2);
  transition: all .12s; text-decoration: none; margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-4); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-lo); color: var(--accent); font-weight: 600; }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
}

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

.main-content {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}

.topbar {
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-weight: 600; font-size: 1rem; }

.page-body { padding: 28px; flex: 1; }

/* ── Alert / Toast ───────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .875rem; display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-lo); border-color: rgba(16,185,129,.25); color: var(--green); }
.alert-error   { background: var(--red-lo);   border-color: rgba(239,68,68,.25);  color: var(--red); }
.alert-warning { background: var(--yellow-lo); border-color: rgba(245,158,11,.25); color: var(--yellow); }
.alert-info    { background: var(--blue-lo);  border-color: rgba(59,130,246,.25); color: var(--blue); }

.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 9999;
}
.toast {
  min-width: 300px; max-width: 400px;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 14px 18px;
  font-size: .875rem; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(120%); } }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-lg); padding: 28px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn .15s ease;
}
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-close {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 1.2rem; padding: 4px; border-radius: 6px;
  transition: color .1s, background .1s;
}
.modal-close:hover { color: var(--text); background: var(--bg-4); }

/* ── Grid helpers ────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }

/* ── Code block ──────────────────────────────────────────────────────────── */
.code-block {
  background: var(--bg); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 14px 18px;
  font-family: var(--font-mono); font-size: .83rem;
  color: var(--text-2); overflow-x: auto; white-space: pre;
}
.license-key-display {
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600;
  letter-spacing: 3px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 14px 20px; text-align: center;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--text-3);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: .5; }
.empty-state h3 { color: var(--text-2); margin-bottom: 8px; }

/* ── Progress / loading ──────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
}

/* ── Landing page specific ───────────────────────────────────────────────── */
.landing-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 62px;
  background: rgba(5,5,8,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.hero {
  min-height: 88vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 80px 24px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(139,92,246,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-lo); border: 1px solid rgba(139,92,246,.3);
  border-radius: 999px; padding: 5px 14px;
  font-size: .78rem; font-weight: 600; color: var(--accent);
  margin-bottom: 28px;
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 5rem); max-width: 820px; margin: 0 auto 24px; }
.hero p  { font-size: 1.15rem; max-width: 560px; margin: 0 auto 40px; color: var(--text-2); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px; margin-top: 48px;
}
.feature-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature-card .fc-icon {
  width: 44px; height: 44px; border-radius: 11px; background: var(--accent-lo);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}

.pricing-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; flex-direction: column; gap: 4px;
  transition: all .2s;
}
.pricing-card.featured {
  border-color: var(--accent); background: var(--bg-2);
  box-shadow: 0 0 40px var(--accent-glow);
}
.pricing-card .price-amount {
  font-size: 3rem; font-weight: 800; letter-spacing: -.05em; color: var(--text);
  line-height: 1;
}
.pricing-card .price-period { font-size: .875rem; color: var(--text-3); }
.pricing-features { list-style: none; margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.pricing-features li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .875rem; }
.pricing-features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }
