@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

    .monitoring-container {
        max-width: 1900px;
        margin: 0 10px;
        padding: 10px;
    }

    /* Page container - flexbox для растягивания projects-section */
    .page-container {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 80px); /* Высота экрана минус header */
    }

    /* Main Grid - flexbox layout */
    .monitoring-grid {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 30px;
        flex-shrink: 0;
    }

    /* Section Panels */
    .section-panel {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 12px;
        padding: 10px;
        backdrop-filter: blur(10px);
        flex: 1;
        width: auto;
    }

    .section-panel.left {
        /* No extra margin - flex will handle spacing */
    }
    
    .section-panel.right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .section-panel.right .section-header {
        width: 100%;
    }
    
    .section-panel.right .section-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        width: 100%;
    }

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 0 15px 0;
        background: transparent;
        border: none;
    }

    .section-title {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.1em;
        font-weight: 600;
    }

    .section-title img {
        width: 24px;
        height: 24px;
        filter: brightness(0) invert(1);
    }

    .section-badge {
        background: var(--accent-blue);
        color: white;
        padding: 2px 10px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
    }

    .section-badge.disks {
        background: var(--accent-green);
    }

    .section-badge.storages {
        background: var(--accent-purple);
    }
    
    /* Workers Info in Active Jobs Header */
    .workers-info {
        margin-left: 8px;
    }
    
    .workers-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        font-weight: 500;
        padding: 2px 8px;
        border-radius: 10px;
        background: rgba(100, 116, 139, 0.2);
        color: var(--text-muted);
        transition: all 0.2s;
    }
    
    .workers-badge.busy {
        background: rgba(34, 197, 94, 0.15);
        color: #22c55e;
        animation: pulse-green 2s infinite;
    }
    
    .workers-badge.idle {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
    }
    
    .workers-badge.warning {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
    }
    
    .workers-status {
        font-size: 10px;
        opacity: 0.9;
    }
    
    @keyframes pulse-green {
        0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
        50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
    }

    .section-content {
        padding: 0;
        width: 100%;
    }

    /* Device Cards - Compact Layout */
    .device-card {
        background: var(--bg-white-translucent);
        border-radius: 8px;
        padding: 10px 12px;
        margin-bottom: 8px;
        border-left: 3px solid var(--accent-green);
        transition: all 0.2s;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .device-card:hover {
        background: var(--bg-white-medium);
    }
    
    /* All device cards have same width */
    .device-card {
        width: 100%;
    }


    .device-card.disconnected {
        border-left-color: var(--accent-red);
        opacity: 0.7;
    }
    
    .device-card.unmounted {
        border-left-color: var(--accent-yellow);
        opacity: 0.85;
    }

    .device-card.unmounting {
        border-left-color: var(--accent-yellow);
    }

    .device-card.storage {
        border-left-color: var(--accent-purple);
    }

    .device-card-left {
        flex: 1;
        min-width: 0;
    }

    .device-card-right {
        display: flex;
        flex-direction: column;
        gap: 6px;
        align-items: flex-end;
    }

    .device-card-header {
        display: grid;
        grid-template-columns: minmax(220px, 320px) minmax(240px, 1fr) minmax(140px, 200px);
        align-items: center;
        margin-bottom: 6px;
        gap: 12px;
    }

    .device-name-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        min-width: 0;
        overflow: hidden;
    }
    
    .device-name-row > div {
        min-width: 0;
        overflow: hidden;
    }
    
    .device-path {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 220px;
    }

    .device-header-center {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 4px;
        min-width: 0;
    }

    .device-header-right {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        justify-content: flex-end;
        flex-shrink: 0;
    }

    .device-icon {
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .device-icon img {
        width: 20px;
        height: 20px;
        filter: brightness(0) invert(1);
    }

    .device-icon.storage {
        background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-light));
    }

    .device-name {
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .device-name .badge {
        font-size: 10px;
        padding: 2px 6px;
        line-height: 1;
    }

    .device-path {
        font-size: 11px;
        color: var(--text-muted);
        font-family: 'JetBrains Mono', monospace;
    }

    .device-badges {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .badge {
        padding: 3px 8px;
        border-radius: 6px;
        font-size: 10px;
        font-weight: 600;
        white-space: nowrap;
    }

    .badge-connected { background: var(--accent-green-bg); color: var(--accent-green); }
    .badge-disconnected { background: var(--accent-red-bg); color: var(--accent-red); }
    .badge-healthy { background: var(--accent-green-bg); color: var(--accent-green); }
    .badge-warning { background: var(--accent-yellow-bg); color: var(--accent-yellow); }
    .badge-error { background: var(--accent-red-bg); color: var(--accent-red); }
    .badge-working { background: var(--accent-blue-bg); color: var(--accent-blue); }
    .badge-duplicates { background: var(--accent-yellow-bg); color: var(--accent-yellow); }
    .badge-hidden { background: rgba(128, 128, 128, 0.2); color: #888; }
    
    /* Скрытые диски */
    .disk-card.hidden-disk {
        opacity: 0.6;
        border: 2px dashed #888;
        background: repeating-linear-gradient(
            45deg,
            var(--bg-secondary),
            var(--bg-secondary) 10px,
            var(--bg-tertiary) 10px,
            var(--bg-tertiary) 20px
        );
    }
    .disk-card.hidden-disk:hover {
        opacity: 0.9;
    }
    .badge-action { background: var(--accent-blue-bg); color: var(--accent-blue); animation: pulse 1.5s ease-in-out infinite; }

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

    /* Queue Modal */
    .queue-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-overlay);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }
    .queue-modal {
        background: var(--bg-secondary);
        border-radius: 12px;
        border: 1px solid var(--border-color);
        width: 90%;
        max-width: 600px;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
    }
    .queue-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.1rem;
        font-weight: 600;
    }
    .queue-modal-close {
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
    }
    .queue-modal-close:hover { background: var(--bg-tertiary); }
    .queue-modal-body {
        padding: 16px 20px;
        overflow-y: auto;
        max-height: 60vh;
    }
    .queue-count {
        background: var(--accent-blue);
        color: white;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.85rem;
        margin-left: 8px;
    }
    .queue-empty {
        text-align: center;
        padding: 40px;
        color: var(--text-secondary);
        font-size: 1.1rem;
    }
    .folders-list { display: flex; flex-direction: column; gap: 8px; }
    .folder-item {
        background: var(--bg-tertiary);
        border-radius: 8px;
        padding: 12px 16px;
        border-left: 3px solid var(--border-color);
    }
    .folder-item.completed { border-left-color: var(--accent-green); }
    .folder-item.failed { border-left-color: var(--accent-red); }
    .folder-item.pending { border-left-color: var(--text-secondary); }
    .folder-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
    .folder-name { font-weight: 500; color: var(--text-primary); }
    .folder-size { font-size: 0.85rem; color: var(--text-secondary); }
    .folder-path { font-size: 0.8rem; color: var(--text-tertiary); word-break: break-all; }
    .folder-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
    
    /* Disk Info Modal */
    .disk-info-modal { padding: 8px 0; }
    .info-section { margin-bottom: 16px; }
    .info-section h4 { margin: 0 0 12px 0; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); font-size: 1rem; }
    .info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
    .info-item { display: flex; justify-content: space-between; padding: 6px 0; }
    .info-label { color: var(--text-secondary); font-size: 0.9rem; }
    .info-value { color: var(--text-primary); font-weight: 500; font-size: 0.9rem; }
    
    /* Device Metrics Grid */
    .device-metrics {
        display: flex;
        gap: 10px;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .device-metrics-inline {
        display: flex;
        gap: 8px;
        margin-left: 20px;
        flex-wrap: nowrap;
    }

    .metric-item {
        background: transparent;
        padding: 2px 4px;
        display: flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
        color: var(--text-secondary);
        font-size: 11px;
    }
    
    .metric-item .metric-label {
        color: var(--text-muted);
        font-weight: 500;
        text-transform: uppercase;
        font-size: 10px;
        letter-spacing: 0.5px;
    }
    
    .metric-item .metric-value {
        color: var(--text-primary);
        font-weight: 600;
    }

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

    .metric-value {
        font-size: 10px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .metric-value.small {
        font-size: 9px;
    }

    .device-path-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: 4px;
        margin-left: 38px; /* Align with device name (icon width + gap) */
    }

    .device-path-row .device-path {
        flex-shrink: 0;
        min-width: 180px;
        color: var(--text-muted);
        font-size: 12px;
    }

    .disk-fill-progress {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        margin-top: 6px;
    }

    .disk-fill-progress .progress-used,
    .disk-fill-progress .progress-percent {
        font-size: 11px;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .disk-fill-progress .progress-bar {
        flex: 1;
        height: 6px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
    }

    .storage-fill-progress {
        width: 100%;
        margin-top: 6px;
    }

    /* Bottom row with progress and actions */
    .device-bottom-row {
        display: flex;
        align-items: flex-end;
        gap: 12px;
        margin-top: 8px;
    }

    .device-progress-section {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* Progress Bar */
    .progress-container {
        margin: 0;
    }

    .progress-info {
        display: flex;
        justify-content: space-between;
        font-size: 10px;
        color: var(--text-muted);
        margin-bottom: 3px;
    }

    .progress-bar {
        height: 4px;
        background: var(--bg-overlay-light);
        border-radius: 2px;
        overflow: hidden;
    }

    .progress-fill {
        height: 100%;
        border-radius: 2px;
        transition: width 2s ease-out;
        will-change: width;
    }

    .progress-fill.low { background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan)); }
    .progress-fill.medium { background: linear-gradient(90deg, var(--accent-yellow), var(--accent-yellow-light)); }
    .progress-fill.high { background: linear-gradient(90deg, var(--accent-red), var(--accent-red-light)); }

    /* Device Actions */
    .device-actions {
        display: flex;
        gap: 4px;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .action-btn {
        padding: 6px 10px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: var(--bg-tertiary);
        color: var(--text-secondary);
        min-width: 32px;
        min-height: 28px;
    }

    .action-btn:hover {
        background: var(--bg-overlay-light);
        color: var(--text-bright);
        border-color: var(--accent-blue);
    }

    .btn-icon {
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
    }

    .action-btn:hover { transform: scale(1.05); filter: grayscale(0); }
    .action-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(1); }

    .action-btn.info { border-color: var(--accent-blue); color: var(--accent-blue); }
    .action-btn.info:hover { background: var(--accent-blue); color: white; border-color: var(--accent-blue); }
    .action-btn.info .btn-icon { font-style: italic; }
    
    .action-btn.smart:hover { background: var(--accent-purple); color: white; }
    .action-btn.refresh:hover { background: var(--accent-yellow); color: black; }
    
    .action-btn.eject { border-color: var(--accent-orange); color: var(--accent-orange); }
    .action-btn.eject:hover { background: var(--accent-orange); color: white; border-color: var(--accent-orange); }
    
    .action-btn.mount { border-color: var(--accent-green); color: var(--accent-green); }
    .action-btn.mount:hover { background: var(--accent-green); color: white; border-color: var(--accent-green); }
    
    .action-btn.delete { border-color: var(--accent-red); color: var(--accent-red); }
    .action-btn.delete:hover { background: var(--accent-red); color: white; border-color: var(--accent-red); }
    
    .action-btn.check:hover { background: var(--accent-cyan); color: white; }
    
    .action-btn.folders { border-color: var(--text-muted); }
    .action-btn.folders:hover { background: var(--bg-white-medium); color: var(--text-primary); }
    
    .action-btn.stop { border-color: var(--accent-red); color: var(--accent-red); }
    .action-btn.stop:hover { background: var(--accent-red); color: white; border-color: var(--accent-red); }

    /* Context Menu */
    .context-menu {
        position: fixed;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 8px;
        padding: 4px 0;
        min-width: 180px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        z-index: 10000;
        backdrop-filter: blur(10px);
        display: none;
    }

    .context-menu.visible {
        display: block;
    }

    .context-menu-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 14px;
        cursor: pointer;
        transition: background 0.15s;
        font-size: 13px;
        color: var(--text-secondary);
    }

    .context-menu-item:hover {
        background: var(--bg-overlay-light);
        color: var(--text-bright);
    }

    .context-menu-item .ctx-icon {
        font-size: 14px;
        width: 20px;
        text-align: center;
    }

    .context-menu-item.danger {
        color: var(--accent-red);
    }

    .context-menu-item.danger:hover {
        background: rgba(239, 68, 68, 0.15);
    }

    .context-menu-item.disabled {
        opacity: 0.4;
        pointer-events: none;
        cursor: not-allowed;
    }

    .context-menu-item.success {
        color: var(--accent-green);
    }

    .context-menu-item.success:hover {
        background: rgba(34, 197, 94, 0.15);
    }

    .context-menu-item.info {
        color: var(--accent-blue);
    }

    .context-menu-item.info:hover {
        background: rgba(59, 130, 246, 0.15);
    }

    .context-menu-item.warning {
        color: var(--accent-orange);
    }

    .context-menu-item.warning:hover {
        background: rgba(249, 115, 22, 0.15);
    }

    .context-menu-divider {
        height: 1px;
        background: var(--border-color);
        margin: 4px 8px;
    }

    .context-menu-header {
        padding: 6px 14px;
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Operation Status */
    .operation-status {
        display: flex;
        flex-direction: column;
        padding: 8px 12px;
        background: var(--accent-blue-bg-light);
        border-radius: 6px;
        font-size: 12px;
    }

    .operation-status.copying {
        background: var(--accent-green-bg-light);
    }

    .operation-status-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .operation-status .spinner {
        width: 14px;
        height: 14px;
        border: 2px solid var(--accent-blue);
        border-top-color: transparent;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

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

	    /* Jobs Row - Queue and Active Jobs side by side */
	    .jobs-row {
	        display: grid;
	        grid-template-columns: 1fr 1fr;
	        gap: 20px;
	        margin-bottom: 20px;
	        flex-shrink: 0;
	    }

	    /* Standardized card sizing + list window height (Queue + Active Jobs) */
	    .jobs-row {
	        --job-card-height: 150px;   /* standardized card height */
	        --job-list-gap: 10px;       /* gap between cards */
	        --job-list-padding: 12px;   /* padding inside the scroll window */
	    }

    @media (max-width: 1200px) {
        .jobs-row {
            grid-template-columns: 1fr;
        }
    }

    /* Active Jobs Section */
    .active-jobs-section {
        background: var(--bg-card);
        border-radius: 12px;
        border: 1px solid var(--border-color);
        overflow: hidden;
        margin-bottom: 0;
    }

    .jobs-row .active-jobs-section {
        margin-bottom: 0;
    }

    .active-jobs-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 10px;
        background: linear-gradient(135deg, var(--accent-blue-bg-light), transparent);
        border-bottom: 1px solid var(--border-color);
        transition: background 0.3s ease;
    }
    
    .active-jobs-header:hover {
        background: linear-gradient(135deg, var(--accent-blue-bg), transparent);
    }

    .active-jobs-header .section-badge {
        background: var(--accent-blue);
    }
    
	    .collapsible-content {
	        /* Layout: fixed-height "window" with scroll (min 3 cards, max 5 cards) */
	        display: flex;
	        flex-direction: column;
	        gap: var(--job-list-gap);
	        padding: var(--job-list-padding);
	        box-sizing: border-box;

	        min-height: calc(
	            (var(--job-card-height) * 3) +
	            (var(--job-list-gap) * 2) +
	            (var(--job-list-padding) * 2)
	        );
	        max-height: calc(
	            (var(--job-card-height) * 5) +
	            (var(--job-list-gap) * 4) +
	            (var(--job-list-padding) * 2)
	        );

	        overflow-y: auto;
	        overflow-x: hidden;

	        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
	        opacity: 1;
	    }

	    /* Do not shrink cards to "fit" the window; allow scrolling instead. */
	    .collapsible-content > .job-card,
	    .collapsible-content > .queue-placeholder,
	    .collapsible-content > .active-placeholder {
	        flex: 0 0 auto;
	    }
    
	    .collapsible-content.collapsed {
	        max-height: 0;
	        min-height: 0; /* При сворачивании убираем минимальную высоту */
	        padding-top: 0;
	        padding-bottom: 0;
	        overflow: hidden;
	        opacity: 0;
	    }

    /* Отключение анимаций при первой загрузке страницы */
    #activeJobsList.no-animation .job-card,
    #scanQueueList.no-animation .job-card {
        transition: none !important;
        animation: none !important;
    }
    
    #activeJobsList.no-animation .job-card *,
    #scanQueueList.no-animation .job-card * {
        transition: none !important;
        animation: none !important;
    }

	    .job-card {
	        background: var(--bg-card-hover);
	        border-radius: 8px;
	        padding: 12px 92px 12px 15px;
	        margin: 10px 15px;
	        border-left: 4px solid var(--accent-blue);
	        position: relative;
	        overflow: hidden;
	        height: var(--job-card-height);
	        box-sizing: border-box;
	        transition: transform 0.6s ease, opacity 0.6s ease, box-shadow 0.6s ease, background 0.6s ease;
	    }

	    /* Inside the jobs windows, use gap/padding (no per-card margins) */
	    #scanQueueList .job-card,
	    #activeJobsList .job-card {
	        margin: 0;
	    }

	    /* Placeholders participate in the same standardized sizing */
	    #scanQueueList .queue-placeholder,
	    #activeJobsList .active-placeholder {
	        height: var(--job-card-height);
	        box-sizing: border-box;
	    }

	    /* Preflight blink for the top queue card (1s before flight) */
	    @keyframes queue-preflight-blink {
	        0%, 100% { opacity: 1; }
	        50% { opacity: 0.35; }
	    }
	    .job-card.queue-preflight {
	        animation: queue-preflight-blink 0.35s ease-in-out infinite;
	    }

	    /* Smooth "make room" in Active Jobs during preflight */
	    #activeJobsList .active-placeholder {
	        transition: height 1s ease, opacity 1s ease;
	    }

    .job-card.promoted {
        box-shadow: 0 8px 24px rgba(34, 197, 94, 0.18);
    }

    .job-card.queue-promote {
        border-left-color: var(--accent-green);
        background: rgba(34, 197, 94, 0.08);
        box-shadow: 0 12px 28px rgba(34, 197, 94, 0.25);
    }

    .job-card.queue-promote::after {
        content: '';
        position: absolute;
        inset: -2px;
        border-radius: 10px;
        border: 1px solid rgba(34, 197, 94, 0.6);
        animation: promote-glow 1.2s ease-out infinite;
        pointer-events: none;
    }

    .job-card.queue-promote-leave {
        opacity: 0.15 !important;
        transform: scale(0.96) !important;
        transition: opacity 0.4s ease, transform 0.4s ease !important;
    }

    .job-card.queue-ghost {
        opacity: 0.95;
    }

    .job-card.active-hidden {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(-12px);
        position: absolute !important;
        left: -9999px !important;
    }

    .job-card.active-reveal {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        position: relative !important;
        left: auto !important;
        transform: translateY(0);
        animation: active-reveal-animation 0.5s ease-out;
    }

    @keyframes active-reveal-animation {
        from {
            opacity: 0;
            transform: scale(0.95) translateY(-10px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    .job-card-placeholder {
        background: rgba(34, 197, 94, 0.05);
        border: 2px dashed rgba(34, 197, 94, 0.3);
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .job-card.job-completed {
        filter: grayscale(0.9);
        background: rgba(148, 163, 184, 0.18);
        border-left-color: #9ca3af;
    }

    .job-card.job-completed-exit {
        opacity: 0;
        transform: translateY(10px);
    }

    .job-completed-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        font-weight: 800;
        letter-spacing: 3px;
        color: #22c55e;
        background: rgba(15, 23, 42, 0.35);
        text-shadow: 0 6px 18px rgba(34, 197, 94, 0.45);
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
    }

    .job-card.job-completed .job-completed-overlay {
        opacity: 1;
    }

    .job-skipped-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        font-weight: 800;
        letter-spacing: 2px;
        color: #94a3b8;
        background: rgba(15, 23, 42, 0.35);
        text-shadow: 0 6px 18px rgba(148, 163, 184, 0.45);
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
        z-index: 10;
        padding: 16px;
        text-align: center;
        line-height: 1.3;
        word-wrap: break-word;
    }

    .job-card.job-skipped .job-skipped-overlay {
        opacity: 1;
    }

    .job-card.job-skipped-exit {
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .detail-name-row {
        display: flex;
        align-items: center;
        gap: 12px;
        justify-content: space-between;
        width: 100%;
    }

    .detail-name-left {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .detail-name-meta {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-left: auto;
        font-size: 12px;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .queue-fly-clone {
        position: fixed !important;
        z-index: 9999 !important;
        pointer-events: none;
        margin: 0;
        transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.65s ease;
        box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4), 0 0 0 2px rgba(59, 130, 246, 0.3);
        border-radius: 8px;
        will-change: transform, opacity;
    }

    .list-item-enter {
        opacity: 0;
        transform: translateY(-6px);
        animation: list-item-fade-in 0.4s ease-out forwards;
    }

    @keyframes list-item-fade-in {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .queue-item-enter {
        opacity: 0;
        transform: translateY(12px);
        animation: queue-item-fade-in 0.4s ease-out forwards;
    }

    @keyframes queue-item-fade-in {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .queue-item-enter-bottom {
        animation: enter-from-bottom 0.5s ease-out;
    }

    @keyframes enter-from-bottom {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .job-card.promoted::after {
        content: '';
        position: absolute;
        inset: -2px;
        border-radius: 10px;
        border: 1px solid rgba(34, 197, 94, 0.5);
        animation: promote-glow 1.2s ease-out;
        pointer-events: none;
    }

    .job-card.running {
        border-left-color: var(--accent-green);
        animation: pulse-border 2s infinite;
    }
    
    .job-card.no-rules {
        border-left-color: var(--accent-red);
        background: rgba(239, 68, 68, 0.05);
    }
    
    .job-card.failed {
        border-left-color: var(--accent-red);
        background: rgba(239, 68, 68, 0.08);
    }

    @keyframes pulse-border {
        0%, 100% { border-left-color: var(--accent-green); }
        50% { border-left-color: var(--accent-cyan); }
    }

    @keyframes promote-glow {
        0% { opacity: 0; transform: scale(0.98); }
        40% { opacity: 1; }
        100% { opacity: 0; transform: scale(1.02); }
    }
    
    .job-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 6px;
        margin-bottom: 6px;
    }

    .job-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        max-width: 100%;
    }

    .job-name {
        font-weight: 600;
        font-size: 13px;
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .job-name > span:nth-child(2) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .job-status {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 4px;
    }

    .priority-badge {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 4px;
        background: rgba(59, 130, 246, 0.15);
        color: var(--accent-blue);
        font-weight: 600;
        cursor: default;
        white-space: nowrap;
    }

    .priority-badge.high {
        background: rgba(239, 68, 68, 0.2);
        color: var(--accent-red);
    }

    .priority-badge.medium {
        background: rgba(245, 158, 11, 0.2);
        color: var(--accent-yellow);
    }

    .priority-badge.low {
        background: rgba(16, 185, 129, 0.2);
        color: var(--accent-green);
    }

    .priority-badge.editable {
        cursor: pointer;
        border: 1px dashed rgba(59, 130, 246, 0.6);
    }

    .priority-badge.editable:hover {
        background: rgba(59, 130, 246, 0.25);
    }

    .job-status.running {
        background: var(--accent-green-bg);
        color: var(--accent-green);
    }

    .job-status.pending {
        background: var(--accent-yellow-bg);
        color: var(--accent-yellow);
    }

    .job-status.waiting {
        background: var(--accent-purple-bg);
        color: var(--accent-purple);
    }
    
    .job-status.failed {
        background: var(--accent-red-bg);
        color: var(--accent-red);
    }

    .job-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .queue-delete-btn {
        position: absolute;
        top: 40px;
        right: 12px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        padding: 4px;
        border-radius: 4px;
        font-size: 16px;
        opacity: 0.5;
        transition: all 0.2s ease;
        z-index: 10;
    }

    .queue-delete-btn:hover {
        opacity: 1;
        background: rgba(255, 59, 48, 0.1);
        color: var(--accent-red);
        transform: scale(1.1);
    }

    .queue-info-btn:hover {
        opacity: 1;
        background: rgba(10, 132, 255, 0.1);
        color: var(--accent-blue);
        transform: scale(1.1);
    }

    .clear-queue-btn {
        background: transparent;
        border: 1px solid var(--accent-red);
        color: var(--accent-red);
        cursor: pointer;
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 500;
        opacity: 0.8;
        transition: all 0.2s ease;
    }

    .clear-queue-btn:hover {
        opacity: 1;
        background: var(--accent-red);
        color: white;
    }

    /* Stop button for USB disks */
    .action-btn.stop {
        background: var(--accent-red);
        color: white;
        border: none;
    }

    .action-btn.stop:hover {
        background: #c0392b;
    }

    /* Cancel button for jobs */
    .job-cancel-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(239, 68, 68, 0.12);
        border: 1px solid rgba(239, 68, 68, 0.4);
        color: var(--accent-red);
        cursor: pointer;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 600;
        opacity: 0.9;
        transition: all 0.2s ease;
    }

    .job-cancel-btn:hover {
        opacity: 1;
        background: rgba(239, 68, 68, 0.2);
        transform: translateY(-1px);
    }

    .job-cancel-btn .job-stop-icon {
        font-size: 13px;
        line-height: 1;
    }

    /* Inline size next to name */
    .job-size-inline {
        margin-left: auto;
        padding-left: 12px;
        color: var(--text-secondary);
        font-size: 0.85em;
        white-space: nowrap;
    }

    .job-card.waiting {
        border-left-color: var(--accent-purple);
    }

    .job-progress-container {
        margin: 8px 0;
    }

    .job-progress-info {
        display: flex;
        justify-content: space-between;
        font-size: 11px;
        color: var(--text-secondary);
        margin-bottom: 4px;
    }

    .job-progress-bar {
        height: 8px;
        background: var(--bg-overlay-light);
        border-radius: 4px;
        overflow: hidden;
    }

    .job-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
        border-radius: 4px;
        transition: width 2s ease-out;
        will-change: width;
    }

    .active-jobs-section .job-progress-fill {
        transition: none;
    }

    .job-details {
        display: flex;
        gap: 20px;
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 8px;
    }

    .job-detail-item {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .no-active-jobs {
        padding: 30px;
        text-align: center;
        color: var(--text-muted);
    }

    /* Projects Table */
    .projects-section {
        background: var(--bg-card);
        border-radius: 12px;
        border: 1px solid var(--border-color);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 300px;
    }

    .projects-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        padding: 12px 10px;
        background: linear-gradient(135deg, var(--accent-yellow-bg-light), transparent);
        border-bottom: 1px solid var(--border-color);
    }
    
    .projects-header .section-title {
        flex-shrink: 0;
    }
    
    .projects-header .section-badge {
        flex-shrink: 0;
    }

    .projects-table-container {
        flex: 1;
        overflow-y: auto;
        min-height: 200px;
    }

    .projects-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: auto;
    }

    .projects-table th {
        background: var(--bg-overlay-light);
        padding: 8px 10px;
        text-align: left;
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-muted);
        position: sticky;
        top: 0;
    }

    .projects-table td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--border-color);
        white-space: nowrap;
        font-size: 12px;
    }

    .projects-table tr:hover {
        background: var(--accent-blue-bg-light);
    }

    .project-name {
        font-weight: 500;
        color: var(--text-primary);
    }

    .project-path {
        font-size: 10px;
        color: var(--text-muted);
        font-family: 'JetBrains Mono', monospace;
    }

    .mono {
        font-family: 'JetBrains Mono', monospace;
        font-size: 11px;
    }

    .project-uuid {
        font-size: 10px;
        color: var(--text-muted);
        font-family: 'JetBrains Mono', monospace;
        margin-top: 2px;
    }

    .job-detail-item.job-uuid {
        font-size: 10px;
        color: var(--text-muted);
        gap: 6px;
    }

    .project-edit-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .project-edit-text {
        flex: 1;
        min-width: 0;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .project-edit-input {
        width: 100%;
        padding: 8px 10px;
        border-radius: 6px;
        border: 1px solid var(--border-color);
        background: var(--bg-overlay-light);
        color: var(--text-primary);
        font-size: 12px;
        resize: vertical;
    }

    .project-edit-actions {
        display: flex;
        gap: 8px;
        margin-top: 8px;
        justify-content: flex-end;
    }

    .icon-btn {
        background: transparent;
        border: 1px solid var(--border-color);
        color: var(--text-secondary);
        width: 28px;
        height: 28px;
        border-radius: 6px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }

    .icon-btn:hover {
        background: var(--bg-overlay-light);
        color: var(--text-primary);
        transform: translateY(-1px);
    }

    /* Source cell styles */
    .source-cell {
        font-size: 11px;
    }

    .source-disk {
        color: var(--text-primary);
        font-weight: 500;
        margin-bottom: 2px;
    }

    .source-storage {
        color: var(--text-primary);
        font-weight: 500;
    }

    .source-serial {
        font-size: 9px;
        color: var(--text-muted);
        font-family: 'JetBrains Mono', monospace;
    }

    /* Tags cell styles */
    .tags-cell {
        max-width: 400px;
    }

    .projects-filters {
        display: flex;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
        flex: 1;
    }

    .projects-filters button,
    .filter-btn {
        transition: all 0.2s ease;
    }

    .projects-filters button:hover,
    .filter-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
        opacity: 0.9;
    }
    
    .filter-btn.active {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    /* Project Modal Styles */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 10000;
    }

    .modal-overlay.visible {
        display: flex;
    }

    .modal-content {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 12px;
        max-width: 1200px;
        width: 95%;
        max-height: 85vh;
        overflow-y: auto;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

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

    .modal-header h3 {
        margin: 0;
        font-size: 18px;
        color: var(--text-primary);
    }

    .modal-body {
        padding: 24px;
        overflow-x: auto;
    }

    .detail-row {
        display: grid;
        grid-template-columns: 150px 1fr;
        gap: 16px;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .detail-row:last-child {
        border-bottom: none;
    }

    .detail-label {
        font-weight: 600;
        color: var(--text-muted);
        font-size: 13px;
    }

    .detail-value {
        color: var(--text-primary);
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .detail-value.mono {
        font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
        font-size: 12px;
        word-break: normal;
    }

    .copy-btn {
        padding: 4px 8px;
        background: var(--accent-blue-bg-light);
        color: var(--accent-blue);
        border: 1px solid var(--accent-blue);
        border-radius: 4px;
        cursor: pointer;
        font-size: 11px;
        transition: all 0.2s;
        margin-right: 8px;
    }

    .copy-btn:hover {
        background: var(--accent-blue);
        color: white;
    }

    .status-badge {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
    }

    .status-badge.copyed { background: var(--accent-green-bg); color: var(--accent-green); }
    .status-badge.copying { background: var(--accent-blue-bg); color: var(--accent-blue); }
    .status-badge.pending { background: var(--accent-yellow-bg); color: var(--accent-yellow); }
    .status-badge.error { background: var(--accent-red-bg); color: var(--accent-red); }
    .status-badge.cancelled { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

    /* Empty States */
    .empty-state {
        text-align: center;
        padding: 40px 10px;
        color: var(--text-muted);
    }

    .empty-state-icon {
        font-size: 48px;
        margin-bottom: 10px;
        opacity: 0.5;
    }

    .table-empty-state {
        min-height: 220px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: var(--text-muted);
        font-size: 13px;
        padding: 20px;
    }

    /* Notifications */
    @keyframes slideIn {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }

    @keyframes slideOut {
        from { transform: translateX(0); opacity: 1; }
        to { transform: translateX(100%); opacity: 0; }
    }

    .notification-item {
        padding: 0;
        margin-bottom: 8px;
        border-radius: 6px;
        background: var(--bg-overlay);
        font-size: 12px;
        animation: fadeIn 0.3s ease;
        overflow: hidden;
    }

    .notification-header {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 3px 10px;
        background: rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .notification-icon {
        font-size: 12px;
    }

    .notification-title {
        flex: 1;
        font-weight: 600;
        font-size: 11px;
        color: var(--text-primary);
    }

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

    .notification-message {
        padding: 14px 12px;
        color: var(--text-secondary);
        line-height: 1.5;
    }

    /* Responsive */
    @media (max-width: 1200px) {
        .monitoring-grid {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 768px) {
        .monitoring-container {
            padding: 10px;
        }
        .monitoring-header {
            flex-direction: column;
            gap: 10px;
        }
        .device-metrics {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    /* No rules warning hover effect */
    .no-rules-warning:hover {
        background: rgba(220, 38, 38, 0.25) !important;
        border-color: rgba(220, 38, 38, 0.6) !important;
        transform: scale(1.02);
    }
