:root {
    /* Color Palette - Premium Dark Theme */
    --bg-base: #0f1115;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-hover: rgba(255, 255, 255, 0.08);
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --secondary: #ec4899; /* Pink */
    --accent: #8b5cf6; /* Violet */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(16px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-md: 12px;
    --radius-lg: 16px;
    --ws-jobs-panel-height: 260px;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    /* Subtle background gradient */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.05), transparent 25%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Base Components */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    z-index: 10;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 70px;
    padding: 2rem 0.75rem;
}

.sidebar-toggle-btn {
    position: absolute;
    top: 2rem;
    right: -13px;
    width: 26px;
    height: 26px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 11;
    color: var(--text-muted);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    color: var(--text-main);
    transition: opacity 0.3s;
}

.sidebar.collapsed .logo h1 {
    display: none;
}

.logo i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-submenu {
    list-style: none;
    margin: 0.35rem 0 0.15rem 1.15rem;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar.settings-expanded .settings-submenu {
    display: flex;
}

.sidebar.collapsed .settings-submenu {
    display: none !important;
}

.settings-submenu .settings-submenu-link {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    opacity: 0.92;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
}

.sidebar.collapsed .nav-links a {
    padding: 0.85rem;
    justify-content: center;
}

.sidebar.collapsed .nav-links a span {
    display: none;
}

.nav-links a:hover {
    color: var(--text-main);
    background: var(--bg-surface-hover);
}

.nav-links a.active {
    color: white;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
    border-left: 3px solid var(--primary);
}

.sidebar.collapsed .nav-links a.active {
    border-left: none;
    background: rgba(99, 102, 241, 0.2);
}

.nav-links a i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem 3rem;
    position: relative;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

/* Workspace section specific sizing */
#workspace-sec.content-section {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9990;
    padding: 1.25rem;
    margin: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

#workspace-sec.content-section.active {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9990;
}

#workspace-sec .modal {
    width: min(96vw, 1700px) !important;
    max-width: min(96vw, 1700px) !important;
    height: 94vh !important;
    max-height: 94vh !important;
}

body.workspace-open {
    overflow: hidden;
}

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

.job-activity-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.job-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 rgba(99, 102, 241, 0.6);
    animation: jobPulse 1.4s infinite;
}

.job-progress-indeterminate {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.job-progress-bar {
    position: absolute;
    top: 0;
    left: -35%;
    width: 35%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    animation: jobProgressSweep 1.2s linear infinite;
}

@keyframes jobPulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.55); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

@keyframes jobProgressSweep {
    from { left: -35%; }
    to { left: 100%; }
}

header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

header p {
    color: var(--text-muted);
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-weight: 500;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Posts & Cards */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.card-header h3,
.card-header h4 {
    margin: 0;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-draft { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.badge-generating { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-ready { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Generic List/Grid */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.list-item {
    padding: 1.1rem 1.15rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.card-content {
    min-width: 0;
}

.card-subtitle {
    margin: 0.35rem 0 0.55rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.card-meta-row {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.card-actions-compact {
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-self: flex-start;
}

.user-card h4,
.project-card h4 {
    margin: 0;
    font-size: 1.05rem;
}

.project-card .card-subtitle {
    max-width: 70ch;
}

.project-members-list,
.snippet-categories-list {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.project-members-list .badge,
.snippet-categories-list .badge {
    text-transform: none;
    letter-spacing: 0;
}

.snippet-card,
.project-card.list-item {
    align-items: stretch;
}

.item-card {
    padding: 1.25rem;
    position: relative;
}

.item-card h4 {
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

.item-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
}

.item-delete {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.item-delete:hover {
    color: #ef4444;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

/* Forms & Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-main);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"], select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-sans);
    transition: var(--transition);
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

textarea {
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Utils */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

/* Workspace Specifics */
.workspace-grid {
    display: flex;
    height: 100%;
    gap: 2rem;
    overflow: hidden;
}

.ws-sidebar {
    width: 250px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.flow-step.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.flow-step.active .step-num {
    background: var(--primary);
    color: white;
}

.ws-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 1rem;
}

.ws-step-pane {
    display: none;
    animation: fadeIn 0.4s;
}

.ws-step-pane.active {
    display: block;
}

/* Artifact Gallery */
.artifact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.artifact-card {
    position: relative;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 9/16;
}

.artifact-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.artifact-card:hover img {
    transform: scale(1.05);
}

.artifact-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    transition: var(--transition);
}

.artifact-card:hover .artifact-actions {
    opacity: 1;
}

.artifact-card.starred {
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.artifact-card.starred .artifact-actions {
    opacity: 1;
}

.artifact-card.starred i {
    color: var(--primary);
}

.artifact-card.source-selected {
    border: 2px solid var(--secondary);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.35);
}

.artifact-card.hidden-artifact {
    opacity: 0.78;
    border: 1px dashed rgba(255,255,255,0.25);
}

.artifact-flag {
    font-size: 0.62rem;
}

.artifact-flag-hidden {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Video previews */
.artifact-card.is-video video {
    display: block;
    transition: transform 0.4s ease;
}
.artifact-card.is-video:hover video {
    transform: scale(1.03);
}

.jobs-list-fixed {
    max-height: 260px;
    min-height: 120px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.queue-resize-handle {
    height: 8px;
    margin-top: 4px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    cursor: ns-resize;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.12) 4px,
        rgba(255,255,255,0.12) 6px
    );
    transition: background 0.2s;
    user-select: none;
    touch-action: none;
}

.queue-resize-handle:hover,
.queue-resize-handle.dragging {
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        rgba(99,102,241,0.55) 4px,
        rgba(99,102,241,0.55) 6px
    );
}

.scrollable-list {
    max-height: 45vh;
    overflow-y: auto;
}

.gallery-group-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 0;
}

.gallery-group {
    padding: 1rem;
}

.gallery-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gallery-group-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.gallery-group-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.gallery-group-grid {
    margin-top: 0;
}

/* 3-Column Workspace Layout */
.workspace-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.ws-column {
    display: flex;
    flex-direction: column;
}

.ws-column-resize-handle {
    width: 8px;
    cursor: col-resize;
    background: rgba(255, 255, 255, 0.04);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.ws-column-resize-handle:hover,
.ws-column-resize-handle.dragging {
    background: rgba(99, 102, 241, 0.25);
}

.ws-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.ws-section h4 .collapse-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.ws-section.collapsed h4 .collapse-icon {
    transform: rotate(-90deg);
}

.ws-section-content {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
    max-height: 900px;
    opacity: 1;
}

.ws-section.collapsed .ws-section-content {
    max-height: 0;
    opacity: 0;
}

.context-preview-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-height: 420px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
    position: relative;
}

.context-preview-box.expanded {
    max-height: 760px;
}

.context-preview-box.collapsed {
    max-height: 180px;
}

.context-preview-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, var(--bg-base));
    pointer-events: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.context-preview-box.expanded::after {
    display: none;
}

.context-preview-expand-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.context-preview-expand-btn:hover {
    background: var(--primary-hover);
}

.context-preview-box.expanded .context-preview-expand-btn {
    display: none;
}

.context-preview-box strong {
    color: var(--text-main);
    display: block;
    margin-top: 0.5rem;
}

.context-preview-box .philosophy {
    font-style: italic;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

#ws-final-prompt {
    transition: var(--transition);
    border: 2px solid transparent;
}

#ws-final-prompt:focus {
    border-color: var(--primary);
    background: rgba(0,0,0,0.4);
}
/* ===== GLOBAL QUEUE STYLES ===== */

.queue-header {
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 2rem;
    padding: 1rem;
}

.queue-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.queue-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.queue-title i {
    color: var(--primary);
    font-size: 1.2rem;
}

.queue-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.queue-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.queue-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.queue-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.queue-stat-value.running {
    color: #3b82f6;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.queue-stat-value.failed {
    color: #ef4444;
}

.queue-stat-value.queued {
    color: #f59e0b;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Queue Modal */
.queue-modal {
    min-width: 90vw;
    max-width: 1400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.queue-modal .modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
}

.queue-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.queue-filters {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.queue-filters .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.queue-actions {
    display: flex;
    gap: 0.5rem;
}

.queue-list-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.queue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.queue-table thead {
    background: rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.queue-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

.queue-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    vertical-align: top;
}

/* Models table */
.models-table-wrap {
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.models-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.models-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.models-table th,
.models-table td {
    padding: 0.7rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

.models-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.models-name {
    font-weight: 600;
}

.models-subname {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.models-small {
    color: var(--text-muted);
    font-size: 0.77rem;
}

.models-chip {
    display: inline-block;
    min-width: 2.1rem;
    text-align: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.08);
    font-weight: 600;
}

.models-chip.is-active {
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
}

.models-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.models-status.status-healthy {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.models-status.status-rate-limited {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.models-error {
    margin-top: 0.35rem;
    color: #fca5a5;
    font-size: 0.72rem;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-preview-cell {
    width: 120px;
}

.queue-preview-button {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.queue-preview-media,
.queue-preview-empty {
    width: 96px;
    height: 72px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
}

.queue-preview-media img,
.queue-preview-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.queue-preview-media.is-video video {
    object-fit: contain;
    background: #000;
}

.queue-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-align: center;
}

.queue-preview-empty.has-text {
    align-items: flex-start;
    justify-content: flex-start;
}

.queue-context-cell {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 220px;
    max-width: 280px;
}

.queue-context-title {
    font-weight: 600;
    color: var(--text-main);
}

.queue-context-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.queue-context-prompt {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.queue-row-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.artifact-card.artifact-queue-highlight {
    box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px rgba(99, 102, 241, 0.15);
    transform: translateY(-3px);
}

.queue-row {
    transition: background 0.2s;
}

.queue-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.queue-row-running {
    background: rgba(59, 130, 246, 0.05);
}

.queue-row-failed {
    background: rgba(239, 68, 68, 0.05);
}

.queue-row-completed {
    background: rgba(16, 185, 129, 0.05);
}

.queue-row-queued {
    background: rgba(245, 158, 11, 0.05);
}

.job-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.job-type-badge.image {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.job-type-badge.video {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.job-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.job-status-badge {
    background: rgba(160, 174, 192, 0.1);
    color: #94a3b8;
}

.queue-row-running .job-status-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.queue-row-failed .job-status-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.queue-row-completed .job-status-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.queue-row-queued .job-status-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .queue-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .queue-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .queue-modal {
        min-width: 95vw;
    }
    
    .queue-filters {
        flex-direction: column;
    }
    
    .queue-filters .form-group {
        width: 100%;
    }
    
    .queue-table {
        font-size: 0.75rem;
    }
    
    .queue-table th,
    .queue-table td {
        padding: 0.5rem;
    }

    .list-item {
        flex-direction: column;
    }

    .card-actions-compact {
        width: 100%;
        justify-content: flex-start;
    }

    .queue-context-cell {
        min-width: 180px;
    }

    .queue-preview-media,
    .queue-preview-empty {
        width: 72px;
        height: 56px;
    }
}