/* BGR Dashboard — Design System v3 */
/* Inspired by agent-interface premium dark theme */

.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Design Tokens ─── */
:root {
    --bg-primary: #07070d;
    --bg-secondary: #0e0e16;
    --bg-surface: #111119;
    --bg-card: rgba(16, 16, 24, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-elevated: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.08));
    --success: #22c55e;
    --success-soft: #16a34a;
    --success-bg: rgba(34, 197, 94, 0.12);
    --success-border: rgba(34, 197, 94, 0.2);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.2);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.3);
    --info: #38bdf8;
    --info-bg: rgba(56, 189, 248, 0.12);
    --info-border: rgba(56, 189, 248, 0.2);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;
    --shadow-glow: 0 0 80px rgba(99, 102, 241, 0.08);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-elevated: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
    --shadow-accent: 0 4px 20px rgba(99, 102, 241, 0.25);
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ambient background — layered radials for depth */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 500px at 10% 5%, rgba(99, 102, 241, 0.07) 0%, transparent 100%),
        radial-gradient(ellipse 600px 400px at 90% 85%, rgba(139, 92, 246, 0.05) 0%, transparent 100%),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(99, 102, 241, 0.02) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle noise texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ─── Animations ─── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
        opacity: 0.7;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes drawerSlideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.4s ease;
}

/* ─── Header ─── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    width: 46px;
    height: 46px;
    background: var(--accent-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
}

/* Shimmer on logo icon */
.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
            transparent 30%,
            rgba(255, 255, 255, 0.15) 50%,
            transparent 70%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.version-badge {
    padding: 0.375rem 0.875rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 9999px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    transition: all var(--transition-fast);
}

.version-badge:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

/* ─── Stats Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 1.375rem 1.5rem;
    backdrop-filter: blur(20px);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

/* Gradient orb decorations */
.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
    filter: blur(30px);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.running {
    border-left: 3px solid var(--success);
}

.stat-card.running::before {
    background: var(--success);
    opacity: 0.08;
}

.stat-card.running:hover::before {
    opacity: 0.12;
}

.stat-card.stopped {
    border-left: 3px solid var(--danger);
}

.stat-card.stopped::before {
    background: var(--danger);
    opacity: 0.08;
}

.stat-card.stopped:hover::before {
    opacity: 0.12;
}

.stat-label {
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-card:not(.running):not(.stopped):not(.memory):not(.restarts) .stat-value {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.running .stat-value {
    color: var(--success);
}

.stat-card.stopped .stat-value {
    color: var(--danger);
}

.stat-card.memory {
    border-left: 3px solid var(--info);
}

.stat-card.memory::before {
    background: var(--info);
    opacity: 0.08;
}

.stat-card.memory:hover::before {
    opacity: 0.12;
}

.stat-card.memory .stat-value {
    color: var(--info);
}

/* ─── Guard Stat Card ─── */
.stat-card.guarded {
    border-left: 3px solid #14b8a6;
}

.stat-card.guarded::before {
    background: #14b8a6;
    opacity: 0.08;
}

.stat-card.guarded:hover::before {
    opacity: 0.12;
}

.stat-card.guarded .stat-value {
    color: #14b8a6;
}

/* ─── Restarts Stat Card ─── */
.stat-card.restarts {
    border-left: 3px solid var(--warning);
}

.stat-card.restarts::before {
    background: var(--warning);
    opacity: 0.08;
}

.stat-card.restarts:hover::before {
    opacity: 0.12;
}

.stat-card.restarts .stat-value {
    color: var(--warning);
}

/* ─── Guard Toggle (inline shield icon in process name) ─── */
.guard-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    opacity: 0.35;
}

.guard-toggle svg {
    width: 14px;
    height: 14px;
}

.guard-toggle:hover {
    opacity: 1;
    color: var(--text-muted);
    background: var(--bg-hover);
    transform: scale(1.15);
}

.guard-toggle.guarded {
    opacity: 1;
    color: #14b8a6;
    filter: drop-shadow(0 0 6px rgba(20, 184, 166, 0.5));
}

.guard-toggle.guarded svg {
    fill: rgba(20, 184, 166, 0.15);
}

.guard-toggle.guarded:hover {
    color: #99f6e4;
    filter: drop-shadow(0 0 10px rgba(20, 184, 166, 0.7));
    background: rgba(20, 184, 166, 0.1);
}

/* Guard badge for mobile cards */
.guard-badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Guard action button styling */
.action-btn.guard {
    color: var(--text-muted);
}

.action-btn.guard:hover {
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
    border-color: rgba(20, 184, 166, 0.3);
}

.action-btn.guard.active {
    color: #14b8a6;
    background: rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.2);
}

.action-btn.guard.active:hover {
    background: rgba(20, 184, 166, 0.15);
    color: #99f6e4;
}

/* Context menu guard item */
.context-item.guard:hover {
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
}

.context-item.guard:hover svg {
    color: #14b8a6;
}

.context-item.guard-active {
    color: #14b8a6;
}

.context-item.guard-active svg {
    color: #14b8a6;
    fill: rgba(20, 184, 166, 0.15);
}

.context-item.guard-active:hover {
    background: rgba(20, 184, 166, 0.1);
    color: #99f6e4;
}

.context-item.guard-active:hover svg {
    color: #99f6e4;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.toolbar-logo {
    font-size: 1.1rem;
}

.toolbar h2 {
    font-size: 1.125rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    white-space: nowrap;
    margin-right: 0.25rem;
}

/* ─── Search ─── */
.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
    transition: color var(--transition-fast);
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.875rem 0.5rem 2.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 0 20px rgba(99, 102, 241, 0.05);
    background: rgba(255, 255, 255, 0.05);
}

.search-input:focus~.search-icon {
    color: var(--accent-primary);
}

.search-input::-moz-placeholder {
    color: var(--text-muted);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-shortcut {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    background: var(--bg-secondary);
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.search-input:focus~.search-shortcut {
    opacity: 0;
}

.search-count {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 1px 6px;
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    pointer-events: none;
    letter-spacing: 0.3px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-glass);
}

.btn-icon.active {
    background: rgba(var(--color-primary), 0.1);
    color: rgb(var(--color-primary));
    border: 1px solid rgba(var(--color-primary), 0.2);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-ghost {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-ghost:active {
    transform: scale(0.98);
}

/* Guard All button */
.btn-guard-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
}

.btn-guard-all svg {
    width: 16px;
    height: 16px;
    transition: all 0.25s ease;
}

.btn-guard-all:hover svg {
    stroke: #14b8a6;
    filter: drop-shadow(0 0 4px rgba(20, 184, 166, 0.4));
}

.btn-guard-all.all-guarded {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
    color: #14b8a6;
}

.btn-guard-all.all-guarded svg {
    stroke: #14b8a6;
    fill: rgba(20, 184, 166, 0.15);
    filter: drop-shadow(0 0 6px rgba(20, 184, 166, 0.5));
}

.btn-guard-all.all-guarded:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-guard-all.all-guarded:hover svg {
    stroke: #ef4444;
    fill: rgba(239, 68, 68, 0.15);
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.4));
}

.btn-guard-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* ─── Process Table ─── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-2xl);
    overflow-x: auto;
    overflow-y: hidden;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

/* ─── Group Header ─── */
.group-header {
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

.group-header td {
    padding: 0.625rem 1.25rem 0.375rem 1.25rem !important;
    background: rgba(255, 255, 255, 0.015) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    border-top: 1px solid var(--border-glass) !important;
}

.group-header:first-child td {
    border-top: none !important;
}

.group-header:hover td {
    background: var(--bg-hover) !important;
}

.group-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
}

.group-chevron {
    width: 12px;
    height: 12px;
    stroke: var(--text-dim);
    fill: none;
    stroke-width: 2.5;
    transition: transform var(--transition-fast);
    transform: rotate(90deg);
    flex-shrink: 0;
}

.group-header.collapsed .group-chevron {
    transform: rotate(0deg);
}

.group-name {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
    font-weight: 500;
}

.group-counts {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    font-size: 0.625rem;
    font-weight: 500;
}

.group-count-running {
    color: var(--text-dim);
}

.group-count-running.has-running {
    color: var(--success-soft);
}

.group-count-sep {
    color: var(--border-hover);
}

.group-count-total {
    color: var(--text-dim);
}

th {
    text-align: left;
    padding: 0.875rem 1.25rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-glass);
    font-weight: 600;
}

td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr[data-process-name] {
    cursor: pointer;
}

tr[data-process-name]:hover td {
    background: var(--bg-hover);
}

tr[data-process-name].selected td {
    background: rgba(99, 102, 241, 0.06);
    border-bottom-color: rgba(99, 102, 241, 0.08);
}

/* Row entrance animation */
tr.animate-in {
    animation: fadeSlideIn 0.35s ease forwards;
}

tr.animate-in:nth-child(1) {
    animation-delay: 0s;
}

tr.animate-in:nth-child(2) {
    animation-delay: 0.04s;
}

tr.animate-in:nth-child(3) {
    animation-delay: 0.08s;
}

tr.animate-in:nth-child(4) {
    animation-delay: 0.12s;
}

tr.animate-in:nth-child(5) {
    animation-delay: 0.16s;
}

tr.animate-in:nth-child(6) {
    animation-delay: 0.2s;
}

tr.animate-in:nth-child(7) {
    animation-delay: 0.24s;
}

tr.animate-in:nth-child(8) {
    animation-delay: 0.28s;
}

tr.animate-in:nth-child(9) {
    animation-delay: 0.32s;
}

tr.animate-in:nth-child(10) {
    animation-delay: 0.36s;
}

.process-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    overflow: hidden;
}

.process-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



/* ─── Status Badge ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
}

.status-badge.running {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.status-badge.stopped {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: relative;
}

.status-badge.running .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-badge.stopped .status-dot {
    background: var(--danger);
    opacity: 0.6;
}

/* ─── Memory Badge ─── */
.memory-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.08);
    /* info-bg-subtle */
    color: var(--info);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    border: 1px solid rgba(56, 189, 248, 0.15);
    width: -moz-fit-content;
    width: fit-content;
    white-space: nowrap;
}

.pid {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.port-num {
    color: var(--info);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    background: var(--info-bg);
    border-radius: 6px;
    border: 1px solid var(--info-border);
}

a.port-link {
    text-decoration: none;
    transition: all var(--transition-fast);
}

a.port-link:hover {
    text-decoration: underline;
    background: rgba(56, 189, 248, 0.15);
    /* Slightly brighter info-bg on hover */
    color: #7dd3fc;
    /* Brighter info color */
}

.command {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.runtime {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* ─── Action Buttons (SVG-based) ─── */
.actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    background: transparent;
    color: var(--text-muted);
    padding: 0;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-glass);
    transform: scale(1.08);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.action-btn.success:hover {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.action-btn.info:hover {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info-border);
}

.action-btn.warning:hover {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.action-btn.deploy:hover {
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
    border-color: rgba(20, 184, 166, 0.3);
}

/* ─── Context Menu ─── */
.context-menu {
    position: fixed;
    z-index: 10000;
    min-width: 180px;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
    animation: contextIn 0.15s ease-out;
}

.context-menu.closing {
    animation: contextOut 0.12s ease-in forwards;
}

@keyframes contextIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes contextOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
}

.context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
    font-family: inherit;
}

.context-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}

.context-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.context-item:hover svg {
    opacity: 1;
}

.context-item.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.context-item.danger:hover svg {
    color: var(--danger);
}

.context-item.success:hover {
    background: var(--success-bg);
    color: var(--success);
}

.context-item.success:hover svg {
    color: var(--success);
}

.context-item.deploy:hover {
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
}

.context-item.deploy:hover svg {
    color: #14b8a6;
}

.context-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

/* Hint that rows are right-clickable */
#processes-table tr[data-process-name] {
    cursor: default;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    font-weight: 500;
}

.empty-state p {
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    animation: modalIn 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(99, 102, 241, 0.08);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::-moz-placeholder {
    color: var(--text-muted);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ─── Detail Drawer ─── */
.detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 520px;
    min-width: 360px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-glass);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3), -2px 0 20px rgba(0, 0, 0, 0.2);
}

.detail-drawer.resizing {
    transition: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

.drawer-resize-handle {
    position: absolute;
    left: -3px;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    transition: background 0.15s;
}

.drawer-resize-handle:hover,
.drawer-resize-handle:active {
    background: var(--accent-primary);
    opacity: 0.5;
}

.detail-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.15);
}

.drawer-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}



.drawer-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.drawer-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ─── Accordion ─── */
.drawer-accordion {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.accordion-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-bottom: 1px solid var(--border-glass);
}

.accordion-section.open {
    flex: 1;
}

.accordion-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(0, 0, 0, 0.12);
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.accordion-trigger:hover {
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-secondary);
}

.accordion-section.open>.accordion-trigger {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
}

.accordion-chevron {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.accordion-section.open>.accordion-trigger .accordion-chevron {
    transform: rotate(90deg);
}

.accordion-body {
    display: none;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.accordion-section.open>.accordion-body {
    display: flex;
}


/* ─── Accordion Sub-tabs ─── */
.accordion-subtabs {
    display: flex;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.06);
    padding: 0 0.5rem;
    gap: 0;
}

.accordion-subtab {
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.accordion-subtab:hover {
    color: var(--text-secondary);
}

.accordion-subtab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.accordion-sub-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ─── Stderr Badge ─── */
.stderr-badge {
    font-size: 0.55rem;
    font-weight: 700;
    background: var(--error);
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.3;
    min-width: 16px;
    text-align: center;
    font-family: var(--font-mono);
}

/* ─── Meta (inside accordion) ─── */
.drawer-meta {
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 600;
}

.meta-value {
    font-size: 0.78rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* ─── Guard Toggle (inside drawer meta) ─── */
.meta-guard {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
}

.meta-guard .meta-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.meta-guard .meta-label svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-dim);
    transition: all 0.25s ease;
}

.meta-guard.guarded {
    background: rgba(20, 184, 166, 0.06);
    border-color: rgba(20, 184, 166, 0.2);
}

.meta-guard.guarded .meta-label svg {
    stroke: #14b8a6;
    filter: drop-shadow(0 0 4px rgba(20, 184, 166, 0.4));
}

.guard-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

.guard-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.guard-toggle-track {
    position: relative;
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.guard-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.25s ease;
}

.guard-toggle-input:checked~.guard-toggle-track {
    background: rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.4);
}

.guard-toggle-input:checked~.guard-toggle-track .guard-toggle-thumb {
    left: 16px;
    background: #14b8a6;
    box-shadow: 0 0 6px rgba(20, 184, 166, 0.5);
}

.guard-toggle-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
    transition: color 0.25s ease;
    min-width: 60px;
}

.meta-guard.guarded .guard-toggle-label {
    color: #14b8a6;
}

/* Guard restart counter */
.meta-restarts {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.6rem;
}

.meta-restarts .meta-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.restart-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.restart-count-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

.drawer-logs {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    padding: 1rem 1.5rem;
    min-height: 0;
    background: rgba(0, 0, 0, 0.2);
    contain: strict;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 899;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ─── Toast Notifications ─── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.125rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    animation: toastIn 0.3s ease forwards;
    min-width: 260px;
    max-width: 400px;
    backdrop-filter: blur(16px);
}

.toast.removing {
    animation: toastOut 0.25s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.success .toast-icon {
    background: var(--success-bg);
    color: var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.error .toast-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.toast.info {
    border-left: 3px solid var(--info);
}

.toast.info .toast-icon {
    background: var(--info-bg);
    color: var(--info);
}

/* ─── Log File Info ─── */
.log-file-info {
    padding: 0.375rem 1.5rem;
    font-size: 0.6875rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 28px;
}

.log-file-info:empty {
    display: none;
}

/* ─── Env Variables Panel ─── */
.drawer-env {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    min-height: 0;
    background: rgba(0, 0, 0, 0.2);
}

.env-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
}

.env-row:last-child {
    border-bottom: none;
}

.env-key {
    color: var(--accent-primary);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 120px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.env-value {
    color: var(--text-secondary);
    word-break: break-all;
}

.env-empty {
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

/* ─── Config Editor Panel ─── */
.drawer-config {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.config-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    gap: 0.75rem;
}

.config-path {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.config-editor {
    flex: 1;
    width: 100%;
    resize: none;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    min-height: 0;
    -moz-tab-size: 4;
      -o-tab-size: 4;
         tab-size: 4;
}

.config-editor:focus {
    background: rgba(0, 0, 0, 0.3);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    white-space: nowrap;
}

/* ─── Virtual Scroll Spacers ─── */
.log-virtual-top,
.log-virtual-bottom {
    display: block;
    width: 100%;
    pointer-events: none;
}

/* ─── Log Lines ─── */
.log-line {
    padding: 0.1rem 0.5rem 0.1rem 0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 0;
    content-visibility: auto;
    contain-intrinsic-size: auto 1.7em;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.06);
}

.log-line-num {
    color: var(--text-dim);
    min-width: 3ch;
    text-align: right;
    padding-right: 0.75rem;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
    flex-shrink: 0;
    opacity: 0.5;
    font-size: 0.65rem;
}

.log-line:hover .log-line-num {
    opacity: 0.8;
}

.log-line-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Expanded line: word-wrap enabled */
.log-line.expanded .log-line-content {
    white-space: pre-wrap;
    word-break: break-all;
    overflow: visible;
    text-overflow: unset;
}

.log-line.expanded {
    background: rgba(99, 102, 241, 0.06);
    border-left: 2px solid var(--accent-primary);
    margin-left: -2px;
}

/* Copy feedback animation */
.log-line.copied::after {
    content: 'Copied!';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: var(--success);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    animation: fadeIn 0.2s ease;
    pointer-events: none;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ─── Log Viewer Toolbar ─── */
.drawer-log-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.log-search {
    flex: 1;
    background: var(--bg-deeper);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    outline: none;
    transition: border-color 0.2s;
}

.log-search:focus {
    border-color: var(--accent);
}

.log-search::-moz-placeholder {
    color: var(--text-muted);
}

.log-search::placeholder {
    color: var(--text-muted);
}

.log-autoscroll {
    background: var(--bg-deeper);
    border: 1px solid var(--border-glass);
    border-radius: 9999px;
    color: var(--text-muted);
    height: 28px;
    padding: 0 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.log-autoscroll svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.log-autoscroll.active {
    color: var(--success);
    border-color: var(--success-border);
    background: var(--success-bg);
}

.log-autoscroll:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.log-autoscroll.active:hover {
    background: var(--success-bg);
    color: var(--success);
}

/* Line count indicator */
.log-line-count {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    flex-shrink: 0;
    white-space: nowrap;
}



/* ─── Legacy logs panel (kept for backwards compat) ─── */
.logs-panel {
    margin-top: 2rem;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.logs-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    max-height: 400px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .detail-drawer {
        width: 100%;
        max-width: 420px;
    }

    .command {
        max-width: 160px;
    }
}

/* ─── Mobile Cards (hidden by default, shown on ≤768px) ─── */
.mobile-cards {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .toolbar {
        flex-direction: column;
    }

    .toolbar-left {
        flex-direction: column;
        width: 100%;
    }

    .search-wrapper {
        max-width: 100%;
    }

    /* Hide table, show cards */
    .table-container {
        display: none;
    }

    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .detail-drawer {
        width: 100%;
        max-width: 100%;
    }

    /* ─── Process Card ─── */
    .process-card {
        background: var(--bg-card);
        border: 1px solid var(--border-glass);
        border-radius: var(--radius-lg);
        padding: 1rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .process-card:hover {
        border-color: var(--accent-primary);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
        transform: translateY(-1px);
    }

    .card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.75rem;
    }

    .card-header .process-name {
        font-size: 0.95rem;
        font-weight: 600;
    }

    .card-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem 1rem;
        margin-bottom: 0.6rem;
    }

    .card-detail {
        display: flex;
        justify-content: space-between;
        font-size: 0.78rem;
        color: var(--text-secondary);
    }

    .card-label {
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.65rem;
        letter-spacing: 0.05em;
        font-weight: 500;
    }

    .card-command {
        font-family: var(--font-mono);
        font-size: 0.72rem;
        color: var(--text-muted);
        background: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius-sm);
        padding: 0.35rem 0.5rem;
        margin-bottom: 0.75rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .card-actions .action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.6rem;
        font-size: 0.75rem;
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-glass);
    }
}

.metrics-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

.metrics-cell span {
    min-width: 48px;
}


/* Guard Sentinel Pill (standalone guard status) */
.guard-sentinel-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    letter-spacing: 0.02em;
    transition: all var(--transition-fast);
    cursor: default;
}

.guard-sentinel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: all var(--transition-fast);
}

.guard-sentinel-pill.active {
    border-color: rgba(20, 184, 166, 0.25);
    color: #14b8a6;
}

.guard-sentinel-pill.active .guard-sentinel-dot {
    background: #14b8a6;
    box-shadow: 0 0 6px rgba(20, 184, 166, 0.6);
    animation: statusPulse 2s infinite;
}

.guard-sentinel-pill.stopped {
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--text-dim);
}

.guard-sentinel-pill.stopped .guard-sentinel-dot {
    background: var(--danger);
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
}

/* ─── Keyboard Navigation Focus ─── */
tr.keyboard-focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
    background: rgba(168, 85, 247, 0.08) !important;
    border-radius: var(--radius-sm);
}

tr.keyboard-focus td:first-child .process-name span {
    color: var(--accent-primary);
}

/* ─── Keyboard Shortcuts Overlay ─── */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.shortcuts-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.shortcuts-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    min-width: 440px;
    max-width: 520px;
    animation: scaleIn 0.2s ease;
}

.shortcuts-overlay.active .shortcuts-panel {
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
}

.shortcuts-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.shortcuts-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.shortcuts-close:hover {
    color: var(--text-primary);
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.shortcut-section h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 600;
    margin: 0 0 0.6rem 0;
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.shortcut-row span {
    flex: 1;
}

.shortcut-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    line-height: 1;
    flex-shrink: 0;
}
/*# sourceMappingURL=style.css.map */
/*# sourceMappingURL=globals-ed87fd9e.css.map */