:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface2: #1a1a2e;
    --border: #2a2a3e;
    --text: #e0e0e8;
    --text2: #8888a0;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* { 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;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero h1 { font-size: 3rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--text2); font-size: 1.2rem; margin-bottom: 2rem; }
.endpoints { display: flex; gap: 1rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }
.endpoint {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.method {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}
.endpoint code { font-size: 0.9rem; }
.actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; }
.quickstart { text-align: left; max-width: 700px; margin: 0 auto; }
.quickstart h3 { margin-bottom: 0.5rem; color: var(--text2); }
.quickstart pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.8; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface2); }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}
.login-card h1 { text-align: center; margin-bottom: 0.5rem; }
.login-card h2 { text-align: center; color: var(--text2); margin-bottom: 1.5rem; font-weight: 400; }

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

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-brand { font-size: 1.2rem; font-weight: 700; }
.nav-user { display: flex; align-items: center; gap: 1rem; }
.nav-user span { color: var(--text2); }

/* Dashboard */
.dashboard { padding: 2rem; max-width: 1400px; margin: 0 auto; }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab {
    padding: 0.7rem 1.2rem;
    background: transparent;
    color: var(--text2);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text2); font-size: 0.85rem; margin-top: 0.3rem; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.data-table th {
    background: var(--surface2);
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table td {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}
.data-table tr:hover td { background: var(--surface2); }
.data-table code { font-size: 0.8rem; background: var(--surface2); padding: 2px 6px; border-radius: 4px; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-ok { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-err { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-admin { background: rgba(99,102,241,0.15); color: var(--primary); }
.badge-user { background: rgba(136,136,160,0.15); color: var(--text2); }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.close { background: none; border: none; color: var(--text2); font-size: 1.5rem; cursor: pointer; }

/* Messages */
.error { background: rgba(239,68,68,0.1); border: 1px solid var(--danger); color: var(--danger); padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.success { background: rgba(34,197,94,0.1); border: 1px solid var(--success); color: var(--success); padding: 0.6rem 1rem; border-radius: 6px; }

h3 { margin-bottom: 1rem; color: var(--text2); }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .dashboard { padding: 1rem; }
    .tabs { overflow-x: auto; }
    .data-table { font-size: 0.8rem; }
}
