/* ==========================================================================
   QianDao V2 - Modern Developer Workbench Design System
   Visual Style: Inspired by Vercel / Supabase / Cloudflare / Postman Workbench
   ========================================================================== */

:root {
    /* Color System - Deep Obsidian & Zinc Dark Base */
    --bg-deepest: #05070c;
    --bg: #080b12;
    --bg-surface: #0f1422;
    --bg-card: #151c2e;
    --bg-card-hover: #1c263e;
    --bg-glass: rgba(15, 20, 34, 0.85);

    /* Translucent Lines & Borders */
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --line-focus: rgba(99, 102, 241, 0.5);
    --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.25);

    /* Primary Accent (Indigo Glow) */
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-active: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.35);

    /* Method & Status Palette */
    --success: #10b981;
    --success-hover: #34d399;
    --success-soft: rgba(16, 185, 129, 0.15);

    --danger: #f43f5e;
    --danger-hover: #fb7185;
    --danger-soft: rgba(244, 63, 94, 0.15);

    --warning: #f59e0b;
    --warning-hover: #fbbf24;
    --warning-soft: rgba(245, 158, 11, 0.15);

    --purple: #a855f7;
    --purple-soft: rgba(168, 85, 247, 0.15);

    --info: #06b6d4;
    --info-soft: rgba(6, 182, 212, 0.15);

    /* Typography */
    --text: #f8fafc;
    --text-soft: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #080b12;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;

    /* Elevation Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 36px -4px rgba(0, 0, 0, 0.7);
    --shadow-glass: 0 20px 30px -5px rgba(0, 0, 0, 0.65), 0 8px 10px -6px rgba(0, 0, 0, 0.5);

    /* Layout Dimensions */
    --sidebar-w: 240px;
}

/* ===== Base Reset & Background ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--text);
    font-family: "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

code, pre, .mono, .stat-value, .brand-mark, .history-badge {
    font-family: "JetBrains Mono", Consolas, monospace;
}

h1, h2, h3, h4, p {
    margin: 0;
}

a {
    color: var(--primary-hover);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* ===== Pulse Dot Indicator Animation ===== */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ===== Layout Structure ===== */
.shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #ffffff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 0 16px var(--primary-glow);
    flex-shrink: 0;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.sidebar-btn-active {
    background: var(--primary-soft) !important;
    color: var(--primary-hover) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-soft);
}

.version-badge {
    font-size: 11px;
    margin-top: 4px;
    color: var(--text-muted);
}

.footer-link {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content Workspace */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 24px 32px 48px;
    width: calc(100% - var(--sidebar-w));
    min-width: 0;
    box-sizing: border-box;
}

/* Console Topbar Header */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-root {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--line-strong);
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.system-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--success-soft);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
    font-size: 12px;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
}

/* Toast Glass Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 9999;
    min-width: 320px;
    max-width: 460px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-glass);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.hidden {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
    pointer-events: none;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: var(--success-soft);
    color: var(--success);
}

.toast-error .toast-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: toastProgress 3.2s linear forwards;
}

.toast-success .toast-progress { background: var(--success); }
.toast-error .toast-progress { background: var(--danger); }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Views Wrapper */
.app-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.2s ease-out;
}

.app-view.hidden {
    display: none !important;
}

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

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 16px var(--primary-glow);
}
.btn-primary:active {
    background: var(--primary-active);
    transform: translateY(1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--line-strong);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger-hover);
    border-color: rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border-color: var(--line);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: var(--line-strong);
}

.button-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* HTTP Method Rainbow Pills */
.method-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    line-height: 1.2;
}

.method-get {
    background: var(--info-soft);
    color: #38bdf8;
    border-color: rgba(6, 182, 212, 0.3);
}
.method-post {
    background: var(--success-soft);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}
.method-put {
    background: var(--warning-soft);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}
.method-delete {
    background: var(--danger-soft);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.3);
}
.method-patch {
    background: var(--purple-soft);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
}

/* ===== Form Controls & Vercel Pill Switches ===== */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--line-focus);
    box-shadow: var(--focus-ring);
}

textarea {
    min-height: 90px;
    resize: vertical;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

/* Vercel/iOS Pill Toggle Switches */
.toggle-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 0;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-soft);
    user-select: none;
}

.toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 22px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--line-strong);
    position: relative;
    cursor: pointer;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.toggle input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.toggle input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

/* ===== Cards & Panels ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.feature-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.section-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-hover);
    margin-bottom: 4px;
}

.section-head h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.section-head p {
    font-size: 13px;
    color: var(--text-soft);
    margin-top: 2px;
}

/* ===== KPI Stat Cards Grid ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 13px;
    color: var(--text-soft);
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Dual Column Dashboard Layout (65% / 35%) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 380px);
    gap: 24px;
    align-items: start;
}

.dashboard-col-left,
.dashboard-col-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* CLI Event Stream / Terminal Timeline */
.terminal-panel {
    background: var(--bg-surface);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease;
}

.history-item:hover {
    background: var(--bg-card-hover);
}

.history-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-badge {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
}

.history-badge.status-2xx {
    background: var(--success-soft);
    color: var(--success);
}

.history-badge.status-err {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Health Gauges & Activity */
.health-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.health-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.health-bar-label {
    width: 110px;
    font-size: 13px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.health-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
    display: flex;
}

.health-bar-fill-success {
    background: var(--success);
    height: 100%;
}

.health-bar-fill-failed {
    background: var(--danger);
    height: 100%;
}

.health-bar-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.feed-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-time {
    color: var(--text-muted);
    font-size: 12px;
}

.telemetry-widget-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.telemetry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.telemetry-label {
    color: var(--text-soft);
}

.telemetry-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.telemetry-badge.badge-active {
    color: #34d399;
}

.telemetry-badge.badge-secure {
    color: #818cf8;
}

/* ===== Workbench Task Center ===== */
.task-list-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workbench-toolbar-card {
    padding: 16px 20px;
}

.workbench-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.search-box input {
    padding-left: 40px;
    height: 40px;
    box-sizing: border-box;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    height: 40px;
    box-sizing: border-box;
}

.filter-chip {
    padding: 6px 14px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-chip:hover {
    color: var(--text);
}

.filter-chip-active {
    background: var(--bg-card);
    color: var(--text) !important;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.task-list-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.task-card {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.15s ease;
}

.task-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.task-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.task-url {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
    margin-top: 2px;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-soft);
}

.task-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Task Studio Dual-Pane Layout ===== */
.studio-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.studio-left-pane,
.studio-right-pane {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-group {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.editor-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.editor-group-head h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.editor-group-head p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sticky-actions {
    position: sticky;
    bottom: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line-strong);
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.preview-card {
    background: var(--bg-deepest);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-head strong {
    font-size: 13px;
    color: var(--text);
}

.preview-head .meta {
    font-size: 12px;
    color: var(--text-muted);
}

.preview {
    background: transparent;
    color: #a5b4fc;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* ===== Settings Views ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
}

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Glassmorphism Login Page ===== */
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.login-ambient-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.login-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-hover);
    display: grid;
    place-items: center;
    margin-bottom: 8px;
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.login-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

.error-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--danger-soft);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--danger-hover);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

/* Responsive Breakdown */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .studio-layout {
        grid-template-columns: 1fr;
    }
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    .mobile-menu-btn {
        display: inline-flex;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: span 1;
    }
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .workbench-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: 100%;
    }
}
