:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a2e;
  --border: #2a2a3e;
  --text: #e0e0e0;
  --text2: #888;
  --primary: #6c5ce7;
  --primary2: #a29bfe;
  --green: #00b894;
  --red: #e17055;
  --yellow: #fdcb6e;
  --blue: #0984e3;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Nav */
nav { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 16px 0; position: sticky; top: 0; z-index: 100; }
nav .container { display: flex; justify-content: space-between; align-items: center; }
nav .logo { font-size: 1.5rem; font-weight: 700; color: var(--primary2); }
nav .links { display: flex; gap: 20px; align-items: center; }
nav .links a { color: var(--text2); }
nav .links a:hover { color: var(--text); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); border: none; cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary2); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); }

/* Cards */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: 8px; }
.stat-card { text-align: center; }
.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--primary2); }
.stat-card .label { color: var(--text2); font-size: 0.85rem; }

/* Forms */
input, select, textarea { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); font-size: 0.9rem; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--primary); }
label { font-size: 0.85rem; color: var(--text2); margin-bottom: 4px; display: block; }
.form-group { margin-bottom: 16px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text2); font-weight: 500; font-size: 0.85rem; }
td { font-size: 0.9rem; }
tr:hover { background: var(--bg3); }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background: rgba(0,184,148,0.15); color: var(--green); }
.badge-red { background: rgba(225,112,85,0.15); color: var(--red); }
.badge-blue { background: rgba(9,132,227,0.15); color: var(--blue); }
.badge-yellow { background: rgba(253,203,110,0.15); color: var(--yellow); }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 32px; min-width: 400px; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal h2 { margin-bottom: 20px; }
.modal-close { cursor: pointer; float: right; font-size: 1.5rem; color: var(--text2); background: none; border: none; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 12px 20px; cursor: pointer; color: var(--text2); border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary2); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Dashboard sidebar */
.dashboard-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 65px); }
.sidebar { background: var(--bg2); border-right: 1px solid var(--border); padding: 24px 0; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 12px 24px; color: var(--text2); transition: all 0.2s; }
.sidebar a:hover, .sidebar a.active { color: var(--text); background: var(--bg3); text-decoration: none; }
.sidebar a.active { border-right: 3px solid var(--primary); }
.main-content { padding: 32px; overflow-x: auto; }

/* Hero */
.hero { text-align: center; padding: 80px 0; }
.hero h1 { font-size: 3rem; margin-bottom: 16px; background: linear-gradient(135deg, var(--primary2), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.2rem; color: var(--text2); max-width: 600px; margin: 0 auto 32px; }

/* Pricing */
.pricing-card { text-align: center; padding: 32px; position: relative; }
.pricing-card.featured { border-color: var(--primary); }
.pricing-card .price { font-size: 2.5rem; font-weight: 700; color: var(--primary2); }
.pricing-card .price span { font-size: 1rem; color: var(--text2); }
.pricing-card ul { list-style: none; margin: 20px 0; }
.pricing-card li { padding: 8px 0; color: var(--text2); }

/* Auth page */
.auth-container { max-width: 400px; margin: 80px auto; }
.auth-container .card { padding: 40px; }
.auth-container h1 { text-align: center; margin-bottom: 8px; }
.auth-container .subtitle { text-align: center; color: var(--text2); margin-bottom: 24px; }

/* Code block */
pre, code { font-family: 'SF Mono', Monaco, monospace; }
pre { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; font-size: 0.85rem; }
code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }

/* Copy button */
.copy-btn { padding: 8px 16px; background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); cursor: pointer; }
.copy-btn:hover { border-color: var(--primary); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }

/* Toggle */
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; inset: 0; background: var(--bg3); border-radius: 24px; transition: 0.3s; border: 1px solid var(--border); }
.toggle .slider:before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: var(--text2); border-radius: 50%; transition: 0.3s; }
.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider:before { transform: translateX(20px); background: #fff; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.pagination button { padding: 6px 12px; background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); cursor: pointer; }
.pagination button:hover { border-color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); }

/* Search */
.search-box { position: relative; max-width: 300px; }
.search-box input { padding-left: 36px; }
.search-box::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 0.85rem; }

/* Section */
.section { padding: 60px 0; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 40px; }

/* Features */
.feature-card { padding: 24px; text-align: center; }
.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* Footer */
footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--text2); font-size: 0.85rem; }

/* Utilities */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text2); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-sm { font-size: 0.85rem; }
.hidden { display: none; }
.w-full { width: 100%; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Responsive */
@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero h1 { font-size: 2rem; }
  .modal { min-width: auto; margin: 20px; }
}
