/* Design System & Base Variables */
:root {
    --bg-app: hsl(224, 71%, 4%);
    --bg-sidebar: hsl(224, 71%, 6%);
    --bg-card: hsla(224, 71%, 8%, 0.65);
    --border-card: hsla(224, 40%, 20%, 0.4);
    --border-card-hover: hsla(263, 90%, 65%, 0.4);
    
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(215, 20%, 65%);
    --text-muted: hsl(215, 15%, 45%);
    
    --accent-start: hsl(263, 90%, 60%);
    --accent-end: hsl(217, 91%, 60%);
    
    --color-success: hsl(142, 70%, 45%);
    --color-success-bg: hsla(142, 70%, 45%, 0.15);
    --color-danger: hsl(0, 84%, 60%);
    --color-danger-bg: hsla(0, 84%, 60%, 0.15);
    --color-warning: hsl(38, 92%, 50%);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-glow: 0 0 20px hsla(263, 90%, 60%, 0.15);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Reset & Basic Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background-color: hsla(0, 0%, 0%, 0.4);
    color: #e06c75;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    display: inline-block;
}

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

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: hsla(263, 90%, 60%, 0.15);
    border: 1px solid hsla(263, 90%, 65%, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.icon-grad {
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: hsla(224, 40%, 20%, 0.2);
    border-color: hsla(224, 40%, 20%, 0.3);
}

.menu-item.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, hsla(263, 90%, 60%, 0.1), hsla(217, 91%, 60%, 0.1));
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-glow);
}

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

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--color-success);
    box-shadow: 0 0 10px var(--color-success);
}

.status-dot.offline {
    background-color: var(--color-danger);
    box-shadow: 0 0 10px var(--color-danger);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
    height: 100vh;
}

.main-header {
    margin-bottom: 35px;
}

.main-header h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.main-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* Tab Panels */
.tab-panel {
    display: none;
    flex-grow: 1;
    animation: fadeIn 0.4s ease;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
}

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

/* Premium Glass Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:hover {
    border-color: hsla(224, 40%, 30%, 0.6);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-card);
}

.icon-grad-circle {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, hsla(263, 90%, 60%, 0.15), hsla(217, 91%, 60%, 0.15));
    border: 1px solid hsla(263, 90%, 65%, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grid Layouts */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: start;
}

.grid-layout > .glass-card {
    grid-column: span 4;
}

.grid-layout > .full-span-card {
    grid-column: span 8;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    background-color: hsla(0, 0%, 0%, 0.35);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition-fast);
    outline: none;
    width: 100%;
}

.form-control:focus {
    border-color: var(--border-card-hover);
    box-shadow: 0 0 10px hsla(263, 90%, 60%, 0.2);
}

select.form-control option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    font-family: var(--font-body);
    outline: none;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    filter: grayscale(0.2);
}

.css-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid hsla(210, 40%, 98%, 0.25);
    border-top-color: var(--accent-end);
    border-radius: 50%;
    display: inline-block;
    animation: cssSpin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes cssSpin {
    to { transform: rotate(360deg); }
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: hsla(224, 40%, 20%, 0.3);
    border-color: var(--border-card);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: hsla(224, 40%, 20%, 0.5);
}

.btn-danger {
    background-color: var(--color-danger-bg);
    border-color: hsla(0, 84%, 60%, 0.3);
    color: var(--color-danger);
}

.btn-danger:hover {
    background-color: hsla(0, 84%, 60%, 0.25);
}

.btn-block {
    width: 100%;
}

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

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Progress bar inside pull card */
.download-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: hsla(263, 90%, 60%, 0.05);
    border: 1px solid hsla(263, 90%, 65%, 0.15);
    border-radius: 10px;
    padding: 14px;
    animation: fadeIn var(--transition-fast);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-bar-bg {
    height: 6px;
    background-color: hsla(0, 0%, 100%, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    border-radius: 3px;
    width: 0%;
}

.animated-fill {
    animation: progressGlow 1.5s infinite linear;
    background-size: 200% 100%;
}

@keyframes progressGlow {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* File Upload Drag & Drop Area */
.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 2px dashed var(--border-card);
    border-radius: 12px;
    padding: 24px;
    background-color: hsla(224, 71%, 8%, 0.35);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.file-upload-wrapper:hover {
    border-color: var(--accent-start);
    background-color: hsla(263, 90%, 60%, 0.05);
    box-shadow: var(--shadow-glow);
}

.icon-upload {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: transform var(--transition-fast);
}

.file-upload-wrapper:hover .icon-upload {
    transform: translateY(-4px);
}

.file-upload-wrapper span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Model Grid & Cards */
.model-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    min-height: 100px;
}

.model-card {
    background-color: hsla(0, 0%, 0%, 0.25);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
}

.model-card:hover {
    border-color: var(--border-card-hover);
    box-shadow: 0 4px 20px hsla(263, 90%, 60%, 0.05);
}

.model-info-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.model-details h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.model-badge {
    background-color: hsla(263, 90%, 60%, 0.15);
    color: var(--text-primary);
    border: 1px solid hsla(263, 90%, 65%, 0.25);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.model-info-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.model-info-stats span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-info-stats i {
    width: 14px;
    color: var(--text-muted);
}

.loading-spinner {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.loading-spinner i {
    font-size: 1.2rem;
    color: var(--accent-start);
}

/* API Keys Manager Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.keys-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.keys-table th {
    padding: 14px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-card);
}

.keys-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-card);
    font-size: 0.9rem;
}

.keys-table tbody tr:last-child td {
    border-bottom: none;
}

.key-code-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.key-badge {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.key-badge.inactive {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: hsla(0, 0%, 100%, 0.1);
    transition: .4s;
    border-radius: 20px;
    border: 1px solid var(--border-card);
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-toggle {
    background-color: var(--color-success);
    border-color: var(--color-success);
}

input:checked + .slider-toggle:before {
    transform: translateX(18px);
}

/* Playground Layout */
.playground-layout {
    display: flex;
    gap: 24px;
    flex-grow: 1;
    height: calc(100vh - 180px);
}

.playground-sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
}

.playground-sidebar h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: hsla(0, 0%, 100%, 0.1);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-start);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-start);
}

.endpoint-info {
    background-color: hsla(0, 0%, 0%, 0.3);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.endpoint-info label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.endpoint-info label.margin-top {
    margin-top: 8px;
}

.endpoint-info code {
    word-break: break-all;
}

/* Playground Chat Panel */
.playground-chat {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-card);
    background-color: hsla(224, 71%, 5%, 0.3);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header-info h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Chat Bubbles */
.chat-bubble {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: bubbleFade 0.3s ease;
}

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

.chat-bubble.system {
    align-self: flex-start;
}

.chat-bubble.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: hsla(224, 40%, 20%, 0.4);
    border: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.chat-bubble.user .avatar {
    background-color: hsla(263, 90%, 60%, 0.15);
    border-color: hsla(263, 90%, 65%, 0.3);
    color: var(--text-primary);
}

.chat-bubble.system .avatar {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white;
}

.chat-bubble .message-content {
    background-color: hsla(224, 40%, 15%, 0.5);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-bubble.user .message-content {
    background-color: hsla(263, 90%, 60%, 0.08);
    border-color: hsla(263, 90%, 65%, 0.2);
}

.chat-bubble.loading .message-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

/* Chat Formatted Prose & Code Blocks */
.chat-bubble .message-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.chat-text-para {
    margin: 0;
    line-height: 1.55;
}

.chat-inline-code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background-color: hsla(0, 0%, 0%, 0.45);
    border: 1px solid hsla(224, 40%, 30%, 0.45);
    color: #9cdcfe;
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 0.88em;
}

.chat-code-block {
    background-color: hsl(224, 65%, 5%);
    border: 1px solid hsla(224, 40%, 26%, 0.65);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.chat-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 12px;
    background-color: hsla(224, 50%, 12%, 0.85);
    border-bottom: 1px solid hsla(224, 40%, 22%, 0.55);
}

.chat-code-lang {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.76rem;
    text-transform: lowercase;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.btn-copy-code {
    padding: 3px 10px;
    font-size: 0.76rem;
    border-radius: 6px;
    gap: 6px;
}

.btn-copy-code.copied {
    color: var(--color-success);
    border-color: hsla(142, 70%, 45%, 0.45);
    background-color: var(--color-success-bg);
}

.chat-code-pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #e6edf3;
}

.chat-code-body {
    display: block;
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
    white-space: pre;
}

/* Chat Input Bar */
.chat-input-container {
    padding: 18px 24px;
    border-top: 1px solid var(--border-card);
    display: flex;
    gap: 15px;
    background-color: hsla(224, 71%, 5%, 0.3);
}

.chat-input-textarea {
    flex-grow: 1;
    background-color: hsla(0, 0%, 0%, 0.35);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    outline: none;
    resize: none;
    height: 44px;
    line-height: 20px;
    transition: var(--transition-fast);
}

.chat-input-textarea:focus {
    border-color: var(--border-card-hover);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(10, 15, 30, 0.85);
    border: 1px solid var(--border-card-hover);
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.5), var(--shadow-glow);
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: slideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

@keyframes slideIn {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Auth Gate & Login Card */
.auth-gate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top right, hsla(263, 90%, 60%, 0.14), transparent 45%),
                radial-gradient(circle at bottom left, hsla(217, 91%, 60%, 0.12), transparent 45%),
                var(--bg-app);
    z-index: 200;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-brand h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 0;
    color: var(--text-secondary);
}

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

.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: hsla(217, 91%, 60%, 0.1);
    border: 1px solid hsla(217, 91%, 60%, 0.25);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

.auth-error {
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border: 1px solid hsla(0, 84%, 60%, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

/* Sidebar Admin Session Footer */
.admin-session-box {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* One-time API key reveal */
.new-key-reveal {
    margin-top: 8px;
    padding: 14px;
    border-radius: 10px;
    background: hsla(142, 70%, 45%, 0.08);
    border: 1px solid hsla(142, 70%, 45%, 0.35);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.new-key-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-success);
}

.new-key-reveal code {
    word-break: break-all;
    color: var(--text-primary);
}

/* Native Modal Dialog */
.app-dialog {
    margin: auto;
    border: none;
    background: transparent;
    color: var(--text-primary);
    max-width: 440px;
    width: calc(100% - 32px);
}

.app-dialog::backdrop {
    background: rgba(5, 8, 20, 0.75);
    backdrop-filter: blur(6px);
}

.dialog-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

/* Persistent Model Pull Queue */
.pull-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.pull-job-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    background-color: hsla(224, 40%, 12%, 0.65);
    border: 1px solid var(--border-card);
    animation: fadeIn var(--transition-fast);
}

.pull-job-item.pull-failed {
    background-color: hsla(0, 84%, 60%, 0.08);
    border-color: hsla(0, 84%, 60%, 0.35);
}

.pull-job-item.pull-completed {
    background-color: hsla(142, 70%, 45%, 0.08);
    border-color: hsla(142, 70%, 45%, 0.35);
}

.pull-job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pull-job-error {
    font-size: 0.82rem;
    color: var(--color-danger);
    word-break: break-word;
    line-height: 1.4;
}

.pull-job-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Compute, GPU & VRAM Monitor */
.compute-card-header {
    justify-content: space-between;
}

.compute-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.compute-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 960px) {
    .compute-grid {
        grid-template-columns: 1fr;
    }
}

.compute-panel {
    background-color: hsla(0, 0%, 0%, 0.25);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compute-section-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

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

.gpu-device-card,
.running-model-row {
    background-color: hsla(224, 40%, 12%, 0.65);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gpu-device-top,
.running-model-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gpu-metrics-meta,
.running-model-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.mode-badge {
    font-size: 0.74rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.mode-badge.mode-gpu {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border-color: hsla(142, 70%, 45%, 0.35);
}

.mode-badge.mode-hybrid {
    background-color: hsla(38, 92%, 50%, 0.15);
    color: var(--color-warning);
    border-color: hsla(38, 92%, 50%, 0.35);
}

.mode-badge.mode-cpu {
    background-color: hsla(217, 91%, 60%, 0.15);
    color: var(--accent-end);
    border-color: hsla(217, 91%, 60%, 0.35);
}
