* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    color: #e2e8f0;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

.login-box {
    max-width: 500px;
    width: 100%;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
}

.logo {
    font-size: 38px;
    font-weight: 800;
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.logo span {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 32px;
}

.api-key-box {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
}

.api-key-label {
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.api-key-value {
    color: #a5b4fc;
    font-size: 16px;
    font-weight: 700;
    font-family: monospace;
    word-break: break-all;
    background: rgba(0,0,0,0.3);
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(99,102,241,0.3);
}

.copy-btn {
    background: rgba(99,102,241,0.2);
    border: none;
    color: #a5b4fc;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: rgba(99,102,241,0.4);
    transform: scale(1.05);
}

.hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 12px;
}

/* Dashboard */
.navbar {
    background: rgba(20,20,40,0.95);
    backdrop-filter: blur(20px);
    padding: 16px 40px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-brand span {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.api-key-display {
    font-size: 12px;
    color: #94a3b8;
    font-family: monospace;
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px 24px;
}

.stat-label {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-top: 4px;
}

.stat-value.green { color: #22c55e; }
.stat-value.purple { color: #8b5cf6; }
.stat-value.blue { color: #3b82f6; }
.stat-value.yellow { color: #f59e0b; }

/* Panels */
.panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
}

/* Forms */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
}

.form-group {
    flex: 1;
    min-width: 180px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #6366f1;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.4);
}

.btn-success {
    background: #22c55e;
    color: white;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34,197,94,0.4);
}

.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239,68,68,0.4);
}

.btn-warning {
    background: #f59e0b;
    color: white;
}
.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245,158,11,0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #94a3b8;
}
.btn-outline:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.btn-api {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    padding: 8px 16px;
    font-size: 12px;
}
.btn-api:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.4);
}

.btn-block {
    width: 100%;
    padding: 12px;
}

/* Console */
.console {
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    height: 300px;
    overflow-y: auto;
    color: #94a3b8;
    margin-top: 20px;
}

.console::-webkit-scrollbar { width: 6px; }
.console::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.console::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 3px; }

.log-line {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.log-line:last-child { border-bottom: none; }
.log-line.success { color: #22c55e; }
.log-line.error { color: #ef4444; }
.log-line.info { color: #3b82f6; }
.log-line.warning { color: #f59e0b; }
.log-line.token { color: #a5b4fc; }

/* Sessions */
.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #22c55e;
    transition: all 0.3s;
}

.session-item:hover {
    background: rgba(255,255,255,0.05);
}

.session-item.inactive {
    border-left-color: #ef4444;
    opacity: 0.5;
}

.session-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.session-info span {
    font-size: 13px;
}

.session-info .label {
    color: #94a3b8;
}

.session-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.running {
    background: rgba(34,197,94,0.2);
    color: #22c55e;
}

.status-badge.stopped {
    background: rgba(239,68,68,0.2);
    color: #ef4444;
}

.token-counter {
    font-size: 18px;
    font-weight: 700;
    color: #a5b4fc;
}

.session-count {
    font-size: 12px;
    color: #64748b;
}

.empty-state {
    color: #64748b;
    text-align: center;
    padding: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #1a1a2e;
    max-width: 700px;
    width: 100%;
    border-radius: 16px;
    padding: 40px;
    border: 1px solid rgba(255,255,255,0.06);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.api-section {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.api-section h3 {
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.code-block {
    background: #0a0a0a;
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    color: #22c55e;
    word-break: break-all;
}

.response-example {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .nav-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .form-row {
        flex-direction: column;
    }
    .form-group {
        min-width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .session-info {
        flex-direction: column;
        gap: 4px;
    }
    .session-item {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .login-box {
        padding: 32px 20px;
    }
}