/* ========================================
   WHISPER HUB - Modern Dark Theme
   ======================================== */

:root {
    /* Color Palette - Midnight Blue Theme */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2332;
    --bg-card: #151d2b;
    --bg-hover: #1e2a3d;
    
    /* Accent Colors */
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Border & Shadow */
    --border-color: #1e293b;
    --border-light: rgba(255, 255, 255, 0.05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 80px;
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.bg-shape-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -100px;
    animation: float1 20s ease-in-out infinite;
}

.bg-shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: -100px;
    left: -100px;
    animation: float2 25s ease-in-out infinite;
}

.bg-shape-3 {
    width: 300px;
    height: 300px;
    background: #10b981;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 30s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-50px, 50px) rotate(180deg); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(50px, -50px) rotate(-180deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.login-card {
    background: rgba(21, 29, 43, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header .logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.login-header .logo svg {
    width: 40px;
    height: 40px;
    color: white;
}

.login-header .logo .pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.error-message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

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

.btn-warning {
    background: var(--accent-warning);
    color: #1a1a1a;
}

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

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-login {
    margin-top: 8px;
    padding: 16px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

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

/* ========================================
   APP LAYOUT
   ======================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-mini {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-mini svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

.nav-link.active svg {
    color: var(--accent-primary);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

.logout-link {
    color: var(--accent-danger) !important;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    background: var(--bg-primary);
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.card-body {
    padding: 24px;
}

.link-more {
    font-size: 13px;
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.link-more:hover {
    color: var(--accent-secondary);
}

/* ========================================
   DASHBOARD
   ======================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.pods-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.stat-icon.active-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.stat-icon.queue-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

.stat-icon.setting-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Queue Breakdown */
.queue-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.queue-stat {
    display: flex;
    align-items: center;
    gap: 16px;
}

.queue-stat-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.api-bar .bar-fill {
    background: var(--accent-primary);
}

.gui-bar .bar-fill {
    background: var(--accent-secondary);
}

.queue-stat-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 100px;
}

.queue-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.queue-value {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Pods Mini List */
.pods-mini-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pod-mini-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.pod-mini-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pod-mini-status.status-running {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.pod-mini-status.status-stopped {
    background: var(--text-muted);
}

.pod-mini-info {
    display: flex;
    flex-direction: column;
}

.pod-mini-id {
    font-family: var(--font-mono);
    font-size: 13px;
}

.pod-mini-tasks {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   TABLES
   ======================================== */

.tasks-table-container {
    overflow-x: auto;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
}

.tasks-table th,
.tasks-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tasks-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
}

.tasks-table td {
    font-size: 14px;
}

.tasks-table tbody tr:hover {
    background: var(--bg-hover);
}

.task-id {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.task-file {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-actions {
    display: flex;
    gap: 8px;
}

/* Status & Source Badges */
.status-badge,
.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.status-processing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.status-done {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

.source-badge.api {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.source-badge.gui {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
}

/* ========================================
   TRANSCRIBE PAGE
   ======================================== */

.transcribe-container {
    display: grid;
    gap: 24px;
}

.upload-card {
    max-width: 800px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.upload-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.upload-text span {
    color: var(--accent-primary);
    cursor: pointer;
}

.upload-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

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

.file-info svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.file-name {
    font-weight: 500;
}

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

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

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

.btn-remove svg {
    width: 20px;
    height: 20px;
}

.form-section {
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.checkbox-group {
    flex-direction: row !important;
    align-items: center !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition-fast);
    position: relative;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    margin-top: 8px;
}

/* Result Card */
.result-card {
    max-width: 800px;
}

.result-actions {
    display: flex;
    gap: 12px;
}

.task-progress {
    padding: 20px 0;
}

.progress-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.error {
    background: var(--accent-danger);
}

.progress-message {
    font-size: 14px;
    color: var(--text-secondary);
}

.transcription-result {
    margin-top: 20px;
}

.transcription-result pre,
.result-text {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.result-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.meta-value {
    font-family: var(--font-mono);
    font-size: 14px;
}

/* ========================================
   TASKS PAGE
   ======================================== */

.tasks-filters {
    display: flex;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
}

.filter-group select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Task Details */
.task-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
}

.detail-value.monospace {
    font-family: var(--font-mono);
    font-size: 13px;
}

.error-text {
    color: var(--accent-danger);
}

.result-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.result-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.result-section .result-actions {
    margin-top: 12px;
}

/* ========================================
   PODS PAGE
   ======================================== */

.pods-header-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.pods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.pod-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-fast);
}

.pod-card:hover {
    border-color: var(--accent-primary);
}

.pod-card.running {
    border-color: rgba(16, 185, 129, 0.3);
}

.pod-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pod-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.pod-status-indicator.active {
    background: var(--accent-success);
    box-shadow: 0 0 12px var(--accent-success);
    animation: pod-pulse 2s ease-in-out infinite;
}

@keyframes pod-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--accent-success); }
    50% { opacity: 0.8; box-shadow: 0 0 20px var(--accent-success); }
}

.pod-id {
    font-family: var(--font-mono);
    font-size: 14px;
    flex: 1;
}

.pod-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.pod-badge.gui {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
}

.pod-badge.main {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

/* Статусы менеджера подов */
.pod-badge.active {
    background: var(--accent-success);
    color: white;
}

.pod-badge.idle {
    background: var(--text-muted);
    color: var(--text-primary);
}

.pod-badge.checking_shutdown {
    background: var(--accent-warning);
    color: white;
}

.pod-badge.marked_for_shutdown {
    background: #f97316;
    color: white;
}

.pod-badge.shutting_down {
    background: var(--accent-danger);
    color: white;
}

.pod-badge.exited {
    background: var(--text-muted);
    color: var(--text-secondary);
}

.pod-badge.starting {
    background: var(--accent-secondary);
    color: white;
}

.pod-badge.not_ready {
    background: #64748b;
    color: white;
}

.status-active {
    color: var(--accent-success);
}

.status-idle {
    color: var(--text-muted);
}

.status-checking_shutdown {
    color: var(--accent-warning);
}

.status-marked_for_shutdown {
    color: #f97316;
}

.status-shutting_down {
    color: var(--accent-danger);
}

.status-exited {
    color: var(--text-muted);
}

.status-starting {
    color: var(--accent-secondary);
}

.status-not_ready {
    color: #64748b;
}

.pod-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.pod-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pod-info-item .label {
    font-size: 12px;
    color: var(--text-muted);
}

.pod-info-item .value {
    font-size: 14px;
}

.pod-info-item .status-running {
    color: var(--accent-success);
}

.pod-info-item .status-stopped {
    color: var(--text-muted);
}

.pod-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.pod-url {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.pod-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-fast);
}

.pod-link:hover {
    color: var(--accent-secondary);
}

.pod-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   SETTINGS PAGE
   ======================================== */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.settings-card {
    grid-column: 1 / -1;
    max-width: 600px;
}

.settings-card form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.save-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-success);
    font-size: 14px;
    margin-top: 16px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-md);
}

.save-status svg {
    width: 20px;
    height: 20px;
}

.info-card,
.api-info-card {
    height: fit-content;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.info-value {
    font-size: 14px;
}

.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.endpoint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.endpoint .method {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.endpoint .method.get {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.endpoint .method.post {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
}

.endpoint code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}

.endpoint p {
    width: 100%;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Create Pod Modal */
.create-pod-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.create-pod-info p {
    margin-bottom: 12px;
}

.create-pod-info ul {
    list-style: none;
    margin-bottom: 12px;
}

.create-pod-info li {
    font-size: 14px;
    padding: 4px 0;
}

.warning-text {
    font-size: 13px;
    color: var(--accent-warning);
}

.create-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

/* ========================================
   UTILITIES
   ======================================== */

.loading {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
}

.error {
    text-align: center;
    color: var(--accent-danger);
    padding: 32px;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    grid-column: 1 / -1;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loading-spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
    margin: 0;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    
    .result-meta {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .pods-grid {
        grid-template-columns: 1fr;
    }
    
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   API KEYS PAGE
   ======================================== */

.api-keys-actions {
    margin-bottom: 24px;
}

.api-keys-info {
    margin-bottom: 24px;
}

.info-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.info-box h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.info-box p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-box code {
    display: inline-block;
    background: var(--bg-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    margin: 4px 0;
}

.api-keys-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-hover);
}

.data-table td {
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tr.inactive {
    opacity: 0.5;
}

.data-table td code {
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
}

.data-table td.loading,
.data-table td.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.status-badge.inactive {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    color: #f59e0b;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.key-display code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 14px;
    word-break: break-all;
    color: var(--accent-primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ========================================
   USERS PAGE
   ======================================== */

.users-actions {
    margin-bottom: 24px;
}

.users-table-container {
    overflow-x: auto;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.admin {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.role-badge.user {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.create-status,
.edit-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

.data-table td.error {
    text-align: center;
    padding: 40px;
    color: var(--accent-danger);
}

/* ========================================
   MULTI-FILE UPLOAD
   ======================================== */

.files-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

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

.files-header button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.files-count {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: auto;
}

.files-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition-fast);
}

.file-item:hover {
    background: var(--bg-tertiary);
}

.file-item-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
}

.file-upload-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.15) 0%,
        rgba(139, 92, 246, 0.2) 50%,
        rgba(59, 130, 246, 0.25) 100%
    );
    transition: width 0.3s ease;
    z-index: 0;
}

.file-item.uploading .file-upload-progress {
    position: relative;
    overflow: hidden;
}

.file-item.uploading .file-upload-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.file-item.uploaded .file-upload-progress {
    background: linear-gradient(90deg, 
        rgba(34, 197, 94, 0.15) 0%,
        rgba(34, 197, 94, 0.25) 100%
    );
}

.file-item.upload-error .file-upload-progress {
    background: linear-gradient(90deg, 
        rgba(239, 68, 68, 0.15) 0%,
        rgba(239, 68, 68, 0.25) 100%
    );
}

.file-upload-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    min-width: 140px;
    justify-content: flex-end;
}

.upload-percent {
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 40px;
    text-align: right;
}

.file-item.uploaded .upload-percent {
    color: var(--accent-success);
}

.file-item.upload-error .upload-percent {
    color: var(--accent-danger);
}

.upload-speed {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 80px;
}

.file-item.uploading {
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.file-item.uploaded {
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.file-item.upload-error {
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.file-item .file-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.file-item-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

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

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn-remove-file:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

.btn-remove-file svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   TASKS LIST (MULTI-FILE)
   ======================================== */

.tasks-card {
    max-width: 1000px;
}

.tasks-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.tasks-summary {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.summary-item {
    color: var(--text-muted);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.task-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition-fast);
}

.task-item:hover {
    background: var(--bg-tertiary);
}

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

.task-file-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.task-file-info .file-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.task-filename {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

.task-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.task-size,
.task-id {
    color: var(--text-muted);
}

.task-progress-bar {
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.task-error {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    color: var(--accent-danger);
    font-size: 13px;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.task-result {
    margin-top: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.task-result pre {
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    color: var(--text-secondary);
    font-family: inherit;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
}

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

