/* ═══════════════════════════════════════════════
   TASK MANAGER — System Monitor
   ═══════════════════════════════════════════════ */

.taskmanager-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 !important;
}

/* ─── Tabs ─── */
.tm-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--glass-border);
}

.tm-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tm-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tm-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(124, 92, 252, 0.06);
}

/* ─── Tab Content ─── */
.tm-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.tm-panel {
    display: none;
}

.tm-panel.active {
    display: block;
}

/* ─── Process List ─── */
.tm-process-header,
.tm-process-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
    align-items: center;
}

.tm-process-header {
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-size: 10px;
    position: sticky;
    top: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.tm-process-row {
    color: var(--text-secondary);
    border-radius: 6px;
    transition: background 0.15s ease;
    font-family: var(--font-mono);
}

.tm-process-row:hover {
    background: rgba(124, 92, 252, 0.08);
}

.tm-process-name {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tm-process-icon {
    font-size: 14px;
}

.tm-process-status {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2ecc71;
    margin-right: 4px;
}

.tm-process-status.idle {
    background: #f39c12;
}

/* ─── Performance Section ─── */
.tm-perf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tm-perf-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 14px;
}

.tm-perf-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tm-perf-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.tm-perf-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ─── Usage Bar ─── */
.tm-usage-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.tm-usage-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
    background: linear-gradient(90deg, var(--accent), #9b7dff);
}

.tm-usage-fill.warning {
    background: linear-gradient(90deg, #f39c12, #e74c3c);
}

/* ─── Status Bar ─── */
.tm-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* ─── Running/Suspended ─── */
.tm-process-row.tm-suspended {
    opacity: 0.5;
}

.tm-process-row.tm-running:hover {
    background: rgba(124, 92, 252, 0.12);
}

/* ─── Context Menu ─── */
.tm-context-menu {
    position: fixed;
    z-index: 99999;
    min-width: 160px;
    background: rgba(18, 18, 30, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.tm-ctx-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
}

.tm-ctx-item:hover {
    background: rgba(124, 92, 252, 0.15);
    color: var(--text-primary);
}

.tm-ctx-end:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* ─── System Dialog ─── */
.tm-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tmFadeIn 0.15s ease;
}

@keyframes tmFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.tm-dialog {
    background: rgba(18, 18, 30, 0.96);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px 32px;
    text-align: center;
    max-width: 340px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    animation: tmSlideUp 0.2s ease;
}

@keyframes tmSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tm-dialog-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.tm-dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tm-dialog-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.tm-dialog-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tm-dialog-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tm-dialog-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tm-dialog-confirm {
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.tm-dialog-confirm:hover {
    background: rgba(231, 76, 60, 0.3);
}