:root {
    --bg: #0F172A;
    --surface: #1E293B;
    --surface-hover: #334155;
    --input-bg: #0B1120;

    --primary: #10B981;
    --secondary: #34D399;
    --accent: #6EE7B7;

    --text: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --border-focus: #10B981;

    --danger: #EF4444;
    --warning: #F59E0B;

    --get: #3B82F6;
    --post: #10B981;
    --put: #F59E0B;
    --patch: #8B5CF6;
    --del: #EF4444;

    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius: 12px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Utilities */
.glass {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-2 {
    margin-bottom: 0.75rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.flex-fill {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.full-width {
    width: 100%;
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    z-index: 10;
}

.brand {
    height: 64px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
}

.sidebar-actions {
    padding: 1.5rem 1.5rem 0.5rem;
}

.sidebar-section {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
}

.route-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.route-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.route-item.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.method-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    width: 50px;
    text-align: center;
    color: #fff;
}

.method-badge.GET {
    background: var(--get);
}

.method-badge.POST {
    background: var(--post);
}

.method-badge.PUT {
    background: var(--put);
}

.method-badge.PATCH {
    background: var(--patch);
}

.method-badge.DELETE {
    background: var(--del);
}

.route-path {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
}

.route-item.active .route-path {
    color: var(--text);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    padding: 0.6rem 1.2rem;
}

.btn.primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn.primary:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.btn.secondary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn.secondary:hover {
    background: rgba(16, 185, 129, 0.2);
}

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

.btn.outline:hover {
    border-color: var(--text-muted);
    background: var(--surface-hover);
}

.btn.sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.danger-text:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Main Workspace */
.workspace {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.empty-state.active {
    opacity: 1;
    pointer-events: auto;
}

.empty-icon {
    color: var(--primary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.5;
}

.editor-state {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
}

.editor-state.active {
    opacity: 1;
    pointer-events: auto;
}

.editor-header {
    height: 80px;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border);
}

.path-builder {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border 0.2s;
    width: 60%;
    max-width: 600px;
}

.path-builder:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.inp-select {
    background: var(--surface);
    color: var(--text);
    border: none;
    border-right: 1px solid var(--border);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    appearance: none;
}

.path-inp {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
}

.editor-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.config-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.config-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.inp {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.inp:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

/* Headers List */
.headers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-row .inp {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.btn-remove-header {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.btn-remove-header:hover {
    color: var(--danger);
}

/* Body Editor */
.editor-card.flex-fill {
    display: flex;
    flex-direction: column;
}

.code-area {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #a6e22e;
    background: #000;
    resize: none;
    flex-grow: 1;
    line-height: 1.5;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.code-area:focus {
    border-color: var(--primary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}