:root {
    --color-bg: #0f1117;
    --color-surface: #1a1d27;
    --color-surface-hover: #22263a;
    --color-border: #2d3148;
    --color-text: #e2e8f0;
    --color-text-muted: #8892a8;
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-success: #22c55e;
    --color-warning: #eab308;
    --color-danger: #ef4444;
    --color-get: #3b82f6;
    --color-post: #22c55e;
    --color-put: #f97316;
    --color-patch: #a855f7;
    --color-delete: #ef4444;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.5;
}

#app {
    height: 100%;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}
.btn-outline:hover {
    background: var(--color-surface-hover);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

input, select, textarea {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    font-size: 0.875rem;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.method-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
}
.method-get { background: var(--color-get); color: white; }
.method-post { background: var(--color-post); color: white; }
.method-put { background: var(--color-put); color: white; }
.method-patch { background: var(--color-patch); color: white; }
.method-delete { background: var(--color-delete); color: white; }
.method-system { background: var(--color-warning); color: #1a1d27; }

.pre-block {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    max-height: 60vh;
    overflow-y: auto;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-connected { background: var(--color-success); }
.status-reconnecting { background: var(--color-warning); }
.status-disconnected { background: var(--color-danger); }

.diff-added { background: rgba(34, 197, 94, 0.15); }
.diff-removed { background: rgba(239, 68, 68, 0.15); }
.diff-changed { background: rgba(234, 179, 8, 0.15); }

.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-danger);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.plan-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--color-primary);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .inspector-layout {
        flex-direction: column;
    }
    .inspector-left {
        width: 100% !important;
        max-width: 100% !important;
    }
    .inspector-right {
        width: 100% !important;
    }
}
