:root {
    --bg: #0a0a0a; --bg2: #111; --bg3: #1a1a1a;
    --border: #222; --border2: #2a2a2a;
    --text: #eee; --text2: #ccc; --text3: #999;
    --accent: #4af; --green: #4b4; --red: #f44;
    --yellow: #fa0; --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); min-height:100vh; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }

/* Header */
.header { display:flex; align-items:center; justify-content:space-between; padding:0 24px; height:56px; background:var(--bg2); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:100; }
.header .logo { font-size:18px; font-weight:700; letter-spacing:1px; color:var(--accent); display:flex; align-items:center; gap:10px; }
.header .logo span { color:var(--text3); font-weight:400; font-size:13px; }
.nav { display:flex; gap:4px; }
.nav a { padding:8px 14px; border-radius:var(--radius); color:var(--text3); font-size:13px; font-weight:500; transition:all .15s; }
.nav a:hover, .nav a.active { color:var(--text); background:var(--bg3); text-decoration:none; }
.user-menu { display:flex; align-items:center; gap:12px; }
.user-menu .email { font-size:13px; color:var(--text3); }
.user-menu button { background:none; border:1px solid var(--border); color:var(--text3); padding:6px 12px; border-radius:var(--radius); cursor:pointer; font-size:12px; }
.user-menu button:hover { border-color:var(--accent); color:var(--accent); }

/* Layout */
.container { max-width:1200px; margin:0 auto; padding:24px; }
.page { display:none; }
.page.active { display:block; }

/* Cards */
.card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius); padding:20px; margin-bottom:16px; }
.card h3 { font-size:15px; color:var(--text2); margin-bottom:12px; font-weight:600; }
.card-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:16px; }

/* Stats row */
.stats { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:16px; margin-bottom:24px; }
.stat-card { background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
.stat-card .label { font-size:12px; color:var(--text3); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px; }
.stat-card .value { font-size:28px; font-weight:700; color:var(--text); }
.stat-card .sub { font-size:12px; color:var(--text3); margin-top:4px; }

/* GPU cards */
.gpu-server { margin-bottom:20px; }
.gpu-server h3 { font-size:14px; color:var(--text3); margin-bottom:10px; display:flex; align-items:center; gap:8px; }
.gpu-card { display:flex; align-items:center; justify-content:space-between; background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius); padding:14px 18px; margin-bottom:8px; }
.gpu-card .gpu-info { display:flex; align-items:center; gap:16px; }
.gpu-card .gpu-name { font-weight:600; font-size:14px; }
.gpu-card .gpu-vram { font-size:13px; color:var(--text3); }
.gpu-card .gpu-status { padding:4px 10px; border-radius:12px; font-size:12px; font-weight:600; }
.gpu-card .gpu-status.available { background:rgba(68,187,68,.15); color:var(--green); }
.gpu-card .gpu-status.in_use { background:rgba(255,170,0,.15); color:var(--yellow); }

/* Forms */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; color:var(--text3); margin-bottom:6px; font-weight:500; }
input, select, textarea {
    width:100%; padding:10px 14px; background:var(--bg3); border:1px solid var(--border);
    border-radius:var(--radius); color:var(--text); font-size:14px; outline:none; font-family:inherit;
}
input:focus, select:focus, textarea:focus { border-color:var(--accent); }
textarea { resize:vertical; min-height:80px; }

.btn {
    display:inline-flex; align-items:center; gap:8px; padding:10px 20px;
    border-radius:var(--radius); font-size:14px; font-weight:600; cursor:pointer;
    border:none; transition:all .15s;
}
.btn-primary { background:var(--accent); color:#000; }
.btn-primary:hover { background:#5bf; }
.btn-danger { background:var(--red); color:#fff; }
.btn-danger:hover { opacity:.85; }
.btn-outline { background:none; border:1px solid var(--border); color:var(--text2); }
.btn-outline:hover { border-color:var(--accent); color:var(--accent); }
.btn-sm { padding:6px 12px; font-size:12px; }

/* Auth page */
.auth-page { display:flex; align-items:center; justify-content:center; min-height:calc(100vh - 56px); }
.auth-box { width:100%; max-width:420px; }
.auth-box h1 { font-size:24px; margin-bottom:4px; text-align:center; }
.auth-box .sub { color:var(--text3); text-align:center; margin-bottom:24px; font-size:14px; }
.auth-box .toggle { text-align:center; margin-top:16px; font-size:13px; color:var(--text3); }

/* Chat / AI Playground */
.chat-container { display:flex; flex-direction:column; height:calc(100vh - 130px); }
.chat-messages { flex:1; overflow-y:auto; padding:16px 0; }
.chat-msg { display:flex; gap:12px; margin-bottom:16px; max-width:900px; }
.chat-msg.user { flex-direction:row-reverse; }
.chat-msg .avatar { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.chat-msg.user .avatar { background:var(--accent); color:#000; }
.chat-msg.assistant .avatar { background:var(--bg3); color:var(--accent); border:1px solid var(--border); }
.chat-msg .bubble { background:var(--bg2); border:1px solid var(--border); border-radius:12px; padding:12px 16px; font-size:14px; line-height:1.6; max-width:720px; }
.chat-msg.user .bubble { background:var(--accent); color:#000; border-color:var(--accent); }
.chat-msg .bubble pre { background:var(--bg); border:1px solid var(--border); border-radius:6px; padding:12px; margin:8px 0; overflow-x:auto; font-size:13px; }
.chat-msg .bubble code { font-family:'SF Mono',Consolas,monospace; font-size:13px; }
.chat-msg .bubble p { margin-bottom:8px; }
.chat-msg .bubble p:last-child { margin-bottom:0; }
.chat-input { display:flex; gap:10px; padding:16px 0; border-top:1px solid var(--border); }
.chat-input textarea { flex:1; min-height:44px; max-height:120px; padding:12px 16px; }
.chat-input .btn { align-self:flex-end; }
.model-bar { display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border); margin-bottom:8px; }
.model-bar .model-name { font-size:13px; color:var(--accent); font-weight:600; }
.model-bar .model-info { font-size:12px; color:var(--text3); }

/* Tables */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; padding:10px 14px; font-size:12px; color:var(--text3); text-transform:uppercase; letter-spacing:0.5px; border-bottom:1px solid var(--border); font-weight:600; }
td { padding:10px 14px; border-bottom:1px solid var(--border2); }

/* Pricing */
.pricing-table { width:100%; }
.pricing-table th, .pricing-table td { text-align:left; }
.price { font-weight:700; color:var(--accent); }

/* API Docs */
.doc-section { margin-bottom:24px; }
.doc-section h3 { color:var(--accent); margin-bottom:8px; }
.code-block { background:var(--bg3); border:1px solid var(--border); border-radius:var(--radius); padding:16px; font-family:'SF Mono',Consolas,monospace; font-size:13px; overflow-x:auto; line-height:1.5; white-space:pre; margin:8px 0 16px; }
.endpoint { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.method { padding:3px 8px; border-radius:4px; font-size:11px; font-weight:700; }
.method.get { background:rgba(68,187,68,.2); color:var(--green); }
.method.post { background:rgba(68,170,255,.2); color:var(--accent); }
.method.delete { background:rgba(255,68,68,.2); color:var(--red); }

/* Tabs */
.tabs { display:flex; gap:4px; margin-bottom:16px; border-bottom:1px solid var(--border); padding-bottom:0; }
.tabs button { background:none; border:none; color:var(--text3); padding:8px 16px; font-size:13px; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tabs button.active { color:var(--accent); border-bottom-color:var(--accent); }

/* Copy button */
.copy-wrap { position:relative; }
.copy-btn { position:absolute; top:8px; right:8px; background:var(--bg2); border:1px solid var(--border); color:var(--text3); padding:4px 8px; border-radius:4px; cursor:pointer; font-size:11px; }
.copy-btn:hover { color:var(--accent); border-color:var(--accent); }

/* Toast */
.toast { position:fixed; bottom:24px; right:24px; background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius); padding:12px 20px; font-size:13px; z-index:200; transform:translateY(80px); opacity:0; transition:all .3s; }
.toast.show { transform:translateY(0); opacity:1; }
.toast.error { border-color:var(--red); }
.toast.success { border-color:var(--green); }

/* Responsive */
@media (max-width:768px) {
    .header { padding:0 12px; }
    .nav { display:none; }
    .container { padding:16px; }
    .stats { grid-template-columns:1fr 1fr; }
    .card-grid { grid-template-columns:1fr; }
}

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

/* Section headings */
.section-title { font-size:20px; font-weight:700; margin-bottom:16px; display:flex; align-items:center; gap:10px; }
.section-title .badge { font-size:11px; background:var(--accent); color:#000; padding:2px 8px; border-radius:10px; font-weight:600; }

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