:root {
    --bg: #000000;
    --bg-alt: #060608;
    --panel: #0c0c10;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6e7a8a;
    --accent: #5ec8ff;
    --accent-hover: #7ad4ff;
    --accent-dim: rgba(94, 200, 255, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --border-active: rgba(94, 200, 255, 0.32);
    --success: #22c55e;
    --error: #ef4444;
    --radius: 8px;
    --radius-lg: 12px;
    --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.auth-header p { color: var(--text-secondary); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.15s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.form-error {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: var(--error);
    font-size: 13px;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--panel); border-color: rgba(255, 255, 255, 0.15); }

.btn-loader { width: 18px; height: 18px; }
.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* Dashboard Layout */
.dashboard { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon svg { width: 20px; height: 20px; }

.sidebar-logo-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

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

.sidebar-footer .nav-item {
    padding: 10px 12px;
    font-size: 13px;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 48px 64px;
}

.page-header {
    margin-bottom: 40px;
    text-align: center;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Cards */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* API Key Display */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.api-key-value {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: var(--text-secondary);
    word-break: break-all;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text);
}

/* Actors */
.actors-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.actor-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 400px;
    text-align: center;
    transition: border-color 0.2s;
}
.actor-card:hover { border-color: var(--border-active); }

.actor-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 16px;
}

.actor-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.actor-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-use {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-use:hover { background: var(--accent-hover); }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 18px; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    font-size: 20px;
    line-height: 1;
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.modal-body { padding: 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

/* Docs Panel */
.docs-section { margin-bottom: 24px; }
.docs-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.docs-row { display: flex; gap: 16px; margin-bottom: 10px; }
.docs-label { width: 70px; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.docs-value { font-size: 14px; color: var(--text); font-family: monospace; }

.method-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
}

.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

/* Sample Call UI */
.sample-call-section { margin-top: 24px; }
.sample-call-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    margin-bottom: 16px;
}
.sample-call-input:focus { outline: none; border-color: var(--accent); }

.copy-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s;
}
.copy-call-btn:hover { background: var(--accent-hover); }
.copy-call-btn.copied { background: var(--success); }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.section { display: none; }
.section.active { display: block; }

/* Activity Table */
.activity-table { width: 100%; border-collapse: collapse; }
.activity-table th {
    text-align: left;
    padding: 12px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.activity-table td {
    padding: 14px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.activity-table tr:last-child td { border-bottom: none; }

/* Responsive */
@media (max-width: 1024px) {
    .main-content { padding: 32px 40px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .actors-grid { flex-direction: column; align-items: center; }
    .actor-card { width: 100%; max-width: 400px; }
}
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-logo-text, .nav-item span, .sidebar-footer .nav-item span { display: none; }
    .main-content { margin-left: 60px; padding: 24px; }
}