        :root {
            /* Core brand colors */
            --primary-color: #6366f1;
            --primary-dark: #4f46e5;
            --secondary-color: #64748b;

            /* Vibrant status colors - Termius-style */
            --success-color: #4ecdc4;        /* Teal-green */
            --danger-color: #ff6b6b;         /* Coral red */
            --warning-color: #ffe66d;        /* Bright yellow */
            --info-color: #5b9cf4;           /* Sky blue */

            /* Background colors */
            --dark-color: #0f172a;
            --dark-bg: #0f172a;
            --light-color: #f8fafc;
            --border-color: #2e3440;

            /* Component backgrounds */
            --card-bg: #1e293b;
            --sidebar-bg: #1a1d29;           /* Deep blue-grey to match terminal */
            --sidebar-hover: #2e3440;

            /* Terminal colors - Vibrant theme */
            --terminal-bg: #1a1d29;          /* Deep blue-grey background */
            --terminal-border: #2e3440;      /* Subtle border */
            --terminal-accent: #00d9ff;      /* Bright cyan accent */
        }
        
        * {
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            margin: 0;
            padding: 0;
            overflow: hidden;
            font-weight: 400;
            line-height: 1.6;
            background: linear-gradient(135deg, #2b2a66 0%, #0f172a 100%);
            color: #e2e8f0;
        }
        
        /* === TELA DE LOGIN === */
        .login-screen {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 9999;
            background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 45%),
                         radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.12), transparent 50%),
                         linear-gradient(135deg, #5f5cf1 0%, #6d72ff 45%, #4c3dfa 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 1;
            visibility: visible;
            transition: all 0.5s ease;
        }
        
        /* Loading inicial */
        .loading-screen {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 10000;
            background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            color: white;
            opacity: 1;
            visibility: visible;
            transition: all 0.5s ease;
        }
        
        .loading-screen.hide {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        
        .login-screen.hide {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        
        .login-card {
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(24px);
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-radius: 28px;
            padding: 3rem 3.25rem;
            width: 92%;
            max-width: 420px;
            box-shadow: 0 30px 45px -20px rgba(31, 36, 102, 0.45);
            transform: translateY(0);
            transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .login-card:hover {
            transform: translateY(-5px);
        }
        
        .login-header {
            text-align: center;
            margin-bottom: 2rem;
        }
        
        .login-header h1 {
            color: #0f172a !important;
            font-weight: 700;
            font-size: 1.85rem;
            margin-bottom: 0.5rem;
            letter-spacing: -0.01em;
            text-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
            opacity: 1;
            mix-blend-mode: normal;
        }

        .login-header h1 i {
            color: #4338ca !important;
        }
        
        .login-header p {
            color: #64748b;
            font-size: 0.95rem;
            margin: 0;
        }

        .login-card .form-label {
            font-weight: 600;
            color: #334155;
        }

        .login-card .form-control {
            background: #1f2937;
            border: none;
            border-radius: 14px;
            padding: 0.85rem 1.1rem;
            color: #f8fafc;
            font-size: 0.95rem;
            transition: border 0.2s ease, transform 0.2s ease;
            box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
        }

        .login-card .form-control:focus {
            outline: none;
            box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.4), 0 0 0 6px rgba(99, 102, 241, 0.15);
            transform: translateY(-1px);
            background: #1c2533;
        }

        .login-card .form-control::placeholder {
            color: transparent;
        }

        .login-card .form-text {
            color: #94a3b8;
        }

        .form-floating label {
            color: var(--secondary-color);
        }

        .login-card .form-floating label {
            color: rgba(226, 232, 240, 0.75);
            padding-left: calc(1.1rem + 0.25rem);
        }

        .login-card .form-floating>.form-control:focus~label,
        .login-card .form-floating>.form-control:not(:placeholder-shown)~label {
            color: rgba(226, 232, 240, 0.9);
        }
        
        .form-control {
            border: 2px solid var(--border-color);
            border-radius: 12px;
            padding: 0.75rem 1rem;
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }
        
        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
        }
        
        #loginBtn {
            background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
            border: none;
            border-radius: 14px;
            padding: 0.9rem 2rem;
            font-weight: 600;
            font-size: 0.96rem;
            transition: transform 0.2s ease, box-shadow 0.3s ease;
            width: 100%;
            box-shadow: 0 16px 30px -15px rgba(76, 29, 149, 0.55);
        }

        #loginBtn i {
            margin-right: 0.35rem;
        }

        #loginBtn:hover {
            transform: translateY(-1px);
            box-shadow: 0 20px 35px -18px rgba(76, 29, 149, 0.6);
        }

        #loginBtn:active {
            transform: translateY(0);
        }

        .login-card small {
            color: #94a3b8;
        }
        
        /* === DASHBOARD PRINCIPAL === */
        .dashboard-container {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            opacity: 0;
            visibility: hidden;
            transition: all 0.5s ease;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
        }
        
        .dashboard-container.show {
            opacity: 1;
            visibility: visible;
        }
        
        /* === SIDEBAR === */
        .sidebar {
            width: 350px;
            background: var(--sidebar-bg);
            color: white;
            display: none; /* Ocultar sidebar */
            flex-direction: column;
            transition: all 0.3s ease;
            border-right: 1px solid var(--terminal-border);
        }
        
        .sidebar-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--terminal-border);
            background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
        }
        
        .sidebar-header h4 {
            margin: 0;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        
        .sidebar-content {
            flex: 1;
            padding: 1rem;
            overflow-y: auto;
        }
        
        .devices-section h6 {
            color: #94a3b8;
            font-size: 0.75rem;
            text-transform: uppercase;
            font-weight: 600;
            margin-bottom: 1rem;
            letter-spacing: 0.5px;
        }
        
        .device-card {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
        }
        
        .device-card:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
            border-color: var(--primary-color);
        }
        
        .device-name {
            font-weight: 600;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .device-info {
            font-size: 0.85rem;
            color: #94a3b8;
            margin-bottom: 0.75rem;
        }
        
        .device-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.8rem;
        }
        
        .status-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }
        
        .status-online { background: var(--success-color); }
        .status-offline { background: var(--danger-color); }
        .status-connecting { 
            background: var(--warning-color); 
            animation: pulse 1s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* Botão de reconexão */
        #reconnectBtn {
            animation: reconnectPulse 2s infinite;
            box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
        }

        #reconnectBtn:hover {
            animation: none;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(255, 193, 7, 0.6);
        }

        @keyframes reconnectPulse {
            0%, 100% { 
                transform: scale(1);
                box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
            }
            50% { 
                transform: scale(1.05);
                box-shadow: 0 0 20px rgba(255, 193, 7, 0.8);
            }
        }
        
        /* === ÁREA PRINCIPAL === */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow-y: auto;
        }
        
        .top-bar {
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #334155;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        /* Estilo do menu de navegação */
        .top-bar .navbar {
            padding: 0;
        }
        
        .top-bar .nav-link {
            color: #e2e8f0;
            font-weight: 500;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            transition: all 0.3s ease;
            text-decoration: none;
            border: 2px solid transparent;
        }
        
        .top-bar .nav-link:hover {
            color: var(--primary-color);
            background-color: rgba(99, 102, 241, 0.1);
            border-color: rgba(99, 102, 241, 0.2);
        }
        
        .top-bar .nav-link.active {
            color: var(--primary-color);
            background-color: rgba(99, 102, 241, 0.15);
            border-color: var(--primary-color);
            font-weight: 600;
        }
        
        .top-bar .text-muted {
            color: #94a3b8 !important;
        }

        /* Estilo dos botões consistente com devices.html */
        .btn-primary {
            background: var(--primary-color);
            border-color: var(--primary-color);
            border-radius: 8px;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .btn-primary:hover {
            background: #5855eb;
            border-color: #5855eb;
            transform: translateY(-1px);
        }

        .btn-outline-danger:hover {
            transform: translateY(-1px);
        }
        
        .welcome-area {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(30, 41, 59, 0.8);
            backdrop-filter: blur(10px);
            margin: 2rem;
            border-radius: 20px;
            flex-direction: column;
            text-align: center;
            padding: 3rem;
            transition: all 0.3s ease;
            border: 1px solid #334155;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
        
        .welcome-area.hide {
            display: none;
        }
        
        .terminal-container {
            flex: 1;
            margin: 1rem;
            background: var(--terminal-bg);
            border-radius: 16px;
            display: none;
            flex-direction: column;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
                        0 0 0 1px rgba(0, 217, 255, 0.1);  /* Subtle cyan glow */
            border: 1px solid var(--terminal-border);
            position: relative;
            min-height: 0;
            overflow: hidden;
        }

        /* Add a subtle top accent to terminal */
        .terminal-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg,
                transparent,
                var(--terminal-accent),
                transparent);
            opacity: 0.5;
            border-radius: 16px 16px 0 0;
        }
        
        .terminal-container.show {
            display: flex;
        }

        .terminal-container.fullscreen {
            position: fixed;
            inset: 0;
            margin: 0;
            z-index: 9999;
            border-radius: 0;
            box-shadow: none;
        }

        .terminal-container.fullscreen .terminal-header,
        .terminal-container.fullscreen::before {
            border-radius: 0;
        }

        body.terminal-fullscreen {
            overflow: hidden;
        }

        .terminal-header {
            background: rgba(46, 52, 64, 0.6);  /* Semi-transparent dark */
            backdrop-filter: blur(10px);
            padding: 0.75rem 1.5rem;
            border-radius: 16px 16px 0 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            border-bottom: 1px solid var(--terminal-border);
            position: relative;
            z-index: 1;
        }

        .terminal-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .terminal-actions .btn {
            margin: 0;
        }

        .terminal-actions .btn.me-2 {
            margin-right: 0 !important;
        }
        
        .terminal-controls {
            display: flex;
            gap: 0.5rem;
        }
        
        .control-btn {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
        }
        
        .control-close { background: #ff5f57; }
        .control-minimize { background: #ffbd2e; }
        .control-maximize { background: #28ca42; }
        
        .terminal-title {
            color: white;
            font-weight: 500;
            font-size: 0.9rem;
        }

        .terminal-tabs {
            display: flex;
            align-items: flex-end;
            padding: 0 1rem;
            gap: 2px;
            flex-wrap: nowrap;
            overflow-x: hidden;
            background: rgba(15, 23, 42, 0.95);
            border-bottom: 2px solid var(--terminal-border);
            min-height: 44px;
        }

        .terminal-tabs:hover {
            overflow-x: auto;
        }

        .terminal-tabs::-webkit-scrollbar {
            height: 4px;
        }

        .terminal-tabs::-webkit-scrollbar-track {
            background: transparent;
        }

        .terminal-tabs::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.3);
            border-radius: 2px;
        }

        .terminal-tabs::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.5);
        }

        .terminal-tab-list {
            display: flex;
            gap: 2px;
            flex: 1;
            min-width: 0;
            align-items: flex-end;
        }

        .terminal-tab {
            background: rgba(30, 41, 59, 0.6);
            border: 1px solid var(--terminal-border);
            border-bottom: none;
            color: rgba(226, 232, 240, 0.7);
            padding: 0.6rem 1.2rem;
            border-radius: 8px 8px 0 0;
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s ease;
            max-width: 240px;
            position: relative;
            margin-bottom: -1px;
        }

        .terminal-tab:hover {
            background: rgba(30, 41, 59, 0.85);
            color: rgba(226, 232, 240, 0.95);
        }

        .terminal-tab.active {
            background: var(--terminal-bg);
            border-color: var(--terminal-border);
            border-bottom: 2px solid var(--terminal-bg);
            color: #f8fafc;
            z-index: 1;
            margin-bottom: -2px;
        }

        .terminal-tab.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--terminal-bg);
        }

        .terminal-tab-error {
            background: rgba(220, 38, 38, 0.2);
            border-color: rgba(248, 113, 113, 0.5);
        }

        .terminal-tab-error.active {
            background: rgba(220, 38, 38, 0.3);
            border-color: rgba(248, 113, 113, 0.7);
        }

        .terminal-tab-label {
            overflow: hidden;
            text-overflow: ellipsis;
            font-weight: 500;
            letter-spacing: 0.01em;
            font-size: 0.9rem;
        }

        .terminal-tab.active .terminal-tab-label {
            font-weight: 600;
        }

        .terminal-tab-close {
            border: none;
            background: transparent;
            color: rgba(226, 232, 240, 0.6);
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            width: 18px;
            height: 18px;
            border-radius: 3px;
            transition: background 0.2s ease, color 0.2s ease;
            font-size: 14px;
        }

        .terminal-tab-close:hover {
            color: #ffffff;
            background: rgba(248, 113, 113, 0.25);
        }

        .terminal-tab-add {
            background: transparent;
            border: none;
            color: rgba(226, 232, 240, 0.7);
            width: 32px;
            height: 32px;
            border-radius: 4px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            transition: all 0.2s ease;
            margin-bottom: 4px;
            font-size: 16px;
        }

        .terminal-tab-add:hover {
            background: rgba(99, 102, 241, 0.2);
            color: #ffffff;
        }
        
        .terminal-content {
            flex: 1;
            position: relative;
            padding: 0 1rem 1rem;
            min-height: 0;
        }

        .terminal-panels {
            width: 100%;
            height: 100%;
            position: relative;
        }

        .terminal-panel {
            position: absolute;
            inset: 0;
            border-radius: 12px;
            overflow: hidden;
            background: #1e1e1e;
            display: none;
        }

        .terminal-panel.active {
            display: block;
        }
        
        .terminal-instance {
            width: 100%;
            height: 100%;
            padding: 0.5rem;
            overflow: hidden;
            box-sizing: border-box;
        }
        
        .terminal-instance .xterm {
            padding: 0;
            overflow: hidden;
        }
        
        .terminal-instance .xterm-viewport {
            overflow-y: auto !important;
            overflow-x: hidden !important;
            scrollbar-width: thin;
            scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
        }

        .terminal-instance .xterm-viewport::-webkit-scrollbar {
            width: 8px;
        }

        .terminal-instance .xterm-viewport::-webkit-scrollbar-track {
            background: transparent;
        }

        .terminal-instance .xterm-viewport::-webkit-scrollbar-thumb {
            background-color: rgba(99, 102, 241, 0.35);
            border-radius: 4px;
        }

        .terminal-instance .xterm-viewport::-webkit-scrollbar-thumb:hover {
            background-color: rgba(99, 102, 241, 0.6);
        }

        .terminal-container.fullscreen .terminal-instance .xterm-viewport {
            scrollbar-width: none;
        }

        .terminal-container.fullscreen .terminal-instance .xterm-viewport::-webkit-scrollbar {
            width: 0;
            background: transparent;
        }

        .terminal-instance .xterm-screen {
            overflow-wrap: break-word;
            word-break: break-all;
        }

        #newTabDeviceModal .modal-content {
            background: rgba(15, 23, 42, 0.96);
            border: 1px solid rgba(99, 102, 241, 0.35);
            box-shadow: 0 25px 50px -20px rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(18px);
            color: #e2e8f0;
        }

        #newTabDeviceModal .modal-header {
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
        }

        #newTabDeviceModal .modal-title {
            color: #e0e7ff;
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        #newTabDeviceModal .btn-close {
            filter: invert(1);
            opacity: 0.75;
        }

        #newTabDeviceModal .btn-close:hover {
            opacity: 1;
        }

        #newTabDeviceSearch {
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(99, 102, 241, 0.4);
            color: #e2e8f0;
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
        }

        #newTabDeviceSearch:focus {
            background: rgba(30, 41, 59, 0.95);
            border-color: rgba(99, 102, 241, 0.75);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
            color: #f8fafc;
        }

        #newTabDeviceSearch::placeholder {
            color: rgba(148, 163, 184, 0.7);
        }

        .device-list-modal {
            max-height: 60vh;
            overflow-y: auto;
        }

        .device-list-modal .list-group-item {
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(99, 102, 241, 0.15);
            color: #e2e8f0;
            margin-bottom: 0.5rem;
            border-radius: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            transition: transform 0.18s ease, background 0.18s ease, border 0.18s ease;
        }

        .device-list-modal .list-group-item:hover {
            background: rgba(79, 70, 229, 0.2);
            border-color: rgba(99, 102, 241, 0.35);
            transform: translateY(-1px);
        }

        .device-list-modal .list-group-item:last-child {
            margin-bottom: 0;
        }

        .device-list-modal .list-group-item.disabled {
            opacity: 0.55;
            background: rgba(30, 41, 59, 0.65);
        }

        .device-list-modal .list-group-item .fw-semibold {
            color: #e0e7ff;
        }

        .device-list-modal .list-group-item small {
            color: rgba(148, 163, 184, 0.85) !important;
        }

        .device-list-modal .btn-primary {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(129, 140, 248, 0.95));
            border: 1px solid rgba(129, 140, 248, 0.8);
            color: #f8fafc;
            font-weight: 600;
            padding: 0.35rem 0.9rem;
            border-radius: 10px;
            box-shadow: 0 12px 20px -12px rgba(79, 70, 229, 0.6);
        }

        .device-list-modal .btn-primary:hover,
        .device-list-modal .btn-primary:focus {
            background: linear-gradient(135deg, rgba(129, 140, 248, 0.95), rgba(165, 180, 252, 0.9));
            border-color: rgba(165, 180, 252, 0.85);
            color: #ffffff;
            box-shadow: 0 14px 28px -16px rgba(99, 102, 241, 0.75);
        }

        #fileTransferModal .modal-content {
            background: rgba(15, 23, 42, 0.96);
            border: 1px solid rgba(99, 102, 241, 0.35);
            box-shadow: 0 25px 50px -20px rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(18px);
            color: #e2e8f0;
        }

        #fileTransferModal .modal-header {
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.35), rgba(30, 41, 59, 0.9));
            color: #e0e7ff;
        }

        #fileTransferModal .modal-footer {
            border-top: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(15, 23, 42, 0.85);
        }

        #fileTransferModal .btn-close {
            filter: invert(1);
            opacity: 0.75;
        }

        #fileTransferModal .btn-close:hover {
            opacity: 1;
        }

        #fileTransferModal .file-transfer-card {
            background: rgba(30, 41, 59, 0.9);
            border: 1px solid rgba(99, 102, 241, 0.2);
            color: #e2e8f0;
            box-shadow: 0 12px 32px -20px rgba(15, 23, 42, 0.8);
        }

        #fileTransferModal .card-header {
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(30, 41, 59, 0.65);
            color: #c7d2fe;
        }

        #fileTransferModal .form-label {
            color: #cbd5f5;
        }

        #fileTransferModal .form-control,
        #fileTransferModal .form-control:disabled {
            background: rgba(15, 23, 42, 0.8);
            border: 1px solid rgba(99, 102, 241, 0.25);
            color: #f8fafc;
        }

        #fileTransferModal .form-control::placeholder {
            color: rgba(148, 163, 184, 0.75);
        }

        #fileTransferModal .form-control:focus {
            background: rgba(15, 23, 42, 0.9);
            border-color: rgba(129, 140, 248, 0.6);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
            color: #f8fafc;
        }

        #fileTransferModal .btn-primary {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(129, 140, 248, 0.95));
            border: 1px solid rgba(129, 140, 248, 0.8);
            color: #f8fafc;
            font-weight: 600;
            box-shadow: 0 12px 20px -12px rgba(79, 70, 229, 0.6);
        }

        #fileTransferModal .btn-primary:hover,
        #fileTransferModal .btn-primary:focus {
            background: linear-gradient(135deg, rgba(129, 140, 248, 0.95), rgba(165, 180, 252, 0.9));
            border-color: rgba(165, 180, 252, 0.85);
            color: #ffffff;
            box-shadow: 0 14px 28px -16px rgba(99, 102, 241, 0.75);
        }

        #fileTransferModal .btn-outline-light {
            border-color: rgba(148, 163, 184, 0.3);
            color: #e2e8f0;
        }

        #fileTransferModal .btn-outline-light:hover,
        #fileTransferModal .btn-outline-light:focus {
            border-color: rgba(129, 140, 248, 0.6);
            color: #c7d2fe;
            background: rgba(99, 102, 241, 0.15);
        }

        #fileTransferModal .table {
            color: #e2e8f0;
        }

        #fileTransferModal thead tr {
            background: rgba(30, 41, 59, 0.85);
            color: #cbd5f5;
        }

        #fileTransferModal tbody tr {
            background: rgba(15, 23, 42, 0.85);
            border-color: rgba(99, 102, 241, 0.15);
        }

        #fileTransferModal tbody tr:hover {
            background: rgba(79, 70, 229, 0.2);
        }

        #fileTransferModal .alert-info {
            background: rgba(79, 70, 229, 0.1);
            border: 1px solid rgba(129, 140, 248, 0.35);
            color: #c7d2fe;
        }

        #snippetsModal .modal-content {
            background: rgba(15, 23, 42, 0.96);
            border: 1px solid rgba(99, 102, 241, 0.35);
            color: #e2e8f0;
            box-shadow: 0 25px 50px -20px rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(18px);
        }

        #snippetsModal .modal-header {
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            background: linear-gradient(135deg, rgba(79, 70, 229, 0.35), rgba(30, 41, 59, 0.9));
            color: #e0e7ff;
        }

        #snippetsModal .modal-body {
            background: rgba(15, 23, 42, 0.9);
        }

        #snippetsModal .btn-close {
            filter: invert(1);
            opacity: 0.75;
        }

        #snippetsModal .btn-close:hover {
            opacity: 1;
        }

        #snippetsModal .input-group-text {
            background: rgba(30, 41, 59, 0.9);
            border: 1px solid rgba(99, 102, 241, 0.35);
            color: rgba(226, 232, 240, 0.85);
        }

        #snippetsModal .form-control,
        #snippetsModal .form-select,
        #snippetsModal textarea {
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid rgba(99, 102, 241, 0.25);
            color: #f8fafc;
        }

        #snippetsModal .form-control:focus,
        #snippetsModal .form-select:focus,
        #snippetsModal textarea:focus {
            border-color: rgba(129, 140, 248, 0.75);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
            background: rgba(15, 23, 42, 0.9);
        }

        #snippetsModal .form-control::placeholder,
        #snippetsModal textarea::placeholder {
            color: rgba(148, 163, 184, 0.7);
        }

        #snippetsModal .form-text {
            color: rgba(148, 163, 184, 0.75) !important;
        }

        #snippetsModal .btn-primary {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(129, 140, 248, 0.95));
            border: 1px solid rgba(129, 140, 248, 0.8);
            color: #f8fafc;
            font-weight: 600;
            box-shadow: 0 12px 20px -12px rgba(79, 70, 229, 0.6);
        }

        #snippetsModal .btn-primary:hover,
        #snippetsModal .btn-primary:focus {
            background: linear-gradient(135deg, rgba(129, 140, 248, 0.95), rgba(165, 180, 252, 0.9));
            border-color: rgba(165, 180, 252, 0.85);
            color: #ffffff;
            box-shadow: 0 14px 28px -16px rgba(99, 102, 241, 0.75);
        }

        #snippetsModal .btn-outline-secondary {
            border-color: rgba(148, 163, 184, 0.35);
            color: rgba(226, 232, 240, 0.85);
        }

        #snippetsModal .btn-outline-secondary:hover,
        #snippetsModal .btn-outline-secondary:focus {
            border-color: rgba(129, 140, 248, 0.6);
            color: #c7d2fe;
            background: rgba(99, 102, 241, 0.15);
        }

        #snippetsModal .alert-info {
            background: rgba(79, 70, 229, 0.1);
            border: 1px solid rgba(129, 140, 248, 0.35);
            color: #c7d2fe;
        }

        #snippetsModal .form-select,
        #snippetsModal .form-control,
        #snippetsModal textarea {
            font-size: 0.9rem;
        }

        #snippetsModal .form-select.form-select-sm,
        #snippetsModal .form-control.form-control-sm,
        #snippetsModal textarea.form-control-sm {
            font-size: 0.85rem;
        }

        #snippetsModal .card {
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid rgba(99, 102, 241, 0.25);
            color: #e2e8f0;
        }

        #snippetsModal .card-header {
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            background: rgba(30, 41, 59, 0.85);
            color: #c7d2fe;
        }

        .snippet-list .list-group-item {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid rgba(99, 102, 241, 0.15);
            color: #e2e8f0;
            border-radius: 10px;
            margin-bottom: 0.5rem;
        }

        .snippet-list .list-group-item:last-child {
            margin-bottom: 0;
        }

        .snippet-meta {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
        }

        .snippet-meta small {
            color: rgba(148, 163, 184, 0.85) !important;
        }

        .snippet-tags .badge {
            margin-right: 0.25rem;
        }

        .snippet-actions {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            align-items: flex-end;
        }

        .snippet-actions .btn {
            min-width: 110px;
        }

        .snippet-step-form {
            background: rgba(15, 23, 42, 0.8);
            border: 1px solid rgba(99, 102, 241, 0.2);
            border-radius: 10px;
            padding: 1rem;
            margin-bottom: 0.75rem;
        }

        .snippet-step-form:last-child {
            margin-bottom: 0;
        }

        .snippet-step-form .form-label {
            font-size: 0.8rem;
            color: rgba(226, 232, 240, 0.9);
        }

        .snippet-step-form textarea {
            resize: vertical;
        }

        .snippet-runner-command {
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid rgba(99, 102, 241, 0.35);
            border-radius: 10px;
            color: #e2e8f0;
            padding: 0.75rem 1rem;
            overflow-x: auto;
            font-family: 'Fira Code', 'Courier New', monospace;
            font-size: 0.9rem;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .snippet-runner-expected {
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(99, 102, 241, 0.3);
            border-radius: 10px;
            color: #e2e8f0;
            padding: 0.75rem 1rem;
            font-size: 0.85rem;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .snippet-runner-validation textarea {
            min-height: 80px;
        }

        .snippet-runner-validation .validation-message {
            font-size: 0.8rem;
        }
        
        /* === RESPONSIVIDADE === */
        @media (max-width: 992px) {
            .sidebar {
                position: fixed;
                z-index: 1000;
                left: -350px;
                top: 0;
                bottom: 0;
            }
            
            .sidebar.show {
                left: 0;
            }
            
            .sidebar-overlay {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 999;
                display: none;
            }
            
            .sidebar-overlay.show {
                display: block;
            }

            body {
                overflow: auto;
            }

            .dashboard-container {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
            }

            .main-content {
                padding-bottom: 1rem;
            }

            .welcome-area {
                margin: 1rem;
                padding: 2rem 1.5rem;
            }

            .terminal-container {
                margin: 0.75rem;
                border-radius: 14px;
            }
        }

        @media (max-width: 768px) {
            .top-bar {
                padding: 0.75rem 1rem;
            }

            .welcome-area {
                padding: 1.5rem;
            }

            .terminal-tabs {
                padding: 0.5rem 0.5rem 0.35rem;
            }

            .terminal-tab {
                padding: 0.35rem 0.75rem;
                font-size: 0.85rem;
            }

            .terminal-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
                padding: 0.85rem 1rem;
            }

            .terminal-actions {
                width: 100%;
                justify-content: flex-start;
            }

            .terminal-actions .btn {
                flex: 1;
                min-width: 0;
                justify-content: center;
            }

            .terminal-content {
                padding: 0 0.75rem 0.75rem;
            }

            .terminal-instance {
                padding: 0.25rem;
            }
        }
        
        /* === LOADING === */
        .loading {
            opacity: 0.7;
            pointer-events: none;
        }
        
        .spinner-border-sm {
            width: 1rem;
            height: 1rem;
        }
        
        /* === ALERTS === */
        .alert {
            border: none;
            border-radius: 12px;
            padding: 1rem 1.5rem;
        }
        
        .alert-success {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success-color);
            border-left: 4px solid var(--success-color);
        }
        
        .alert-danger {
            background: rgba(239, 68, 68, 0.1);
            color: var(--danger-color);
            border-left: 4px solid var(--danger-color);
        }

        /* === SYSTEM HEALTH === */
        .system-health-section {
            width: 100%;
            text-align: left;
        }

        .sys-health-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }

        .sys-health-header h6 {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin: 0;
        }

        .sys-health-last-update {
            font-size: 0.6rem;
            color: #64748b;
            margin-left: auto;
            margin-right: 0.5rem;
        }

        .system-metric-card {
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(148, 163, 184, 0.12);
            border-radius: 10px;
            padding: 0.55rem 0.7rem;
            display: flex;
            align-items: center;
            gap: 0.55rem;
            position: relative;
            overflow: hidden;
            transition: all 0.25s ease;
            height: 100%;
        }

        .system-metric-card:hover {
            border-color: rgba(99, 102, 241, 0.3);
            box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.25);
        }

        .metric-icon {
            font-size: 0.95rem;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 7px;
            flex-shrink: 0;
        }

        .metric-info {
            flex: 1;
            min-width: 0;
        }

        .metric-label {
            font-size: 0.58rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #94a3b8;
            font-weight: 600;
            line-height: 1;
        }

        .metric-value {
            font-size: 1rem;
            font-weight: 700;
            color: #f1f5f9;
            line-height: 1.2;
        }

        .metric-detail {
            font-size: 0.6rem;
            color: #64748b;
            line-height: 1.1;
        }

        .metric-bar {
            height: 3px;
            background: rgba(148, 163, 184, 0.1);
            border-radius: 2px;
            margin-top: 0.25rem;
            overflow: hidden;
        }

        .metric-bar-fill {
            height: 100%;
            border-radius: 2px;
            background: linear-gradient(90deg, #10b981, #10b981);
            transition: width 0.8s ease, background 0.5s ease;
        }

        .metric-bar-fill.warning {
            background: linear-gradient(90deg, #f59e0b, #f97316);
        }

        .metric-bar-fill.danger {
            background: linear-gradient(90deg, #ef4444, #dc2626);
        }

        /* Sparkline inline */
        .metric-sparkline {
            width: 48px;
            height: 20px;
            flex-shrink: 0;
            opacity: 0.7;
        }

        /* Status cards (Redis, Sessions, Network) */
        .system-status-card {
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(148, 163, 184, 0.12);
            border-radius: 10px;
            padding: 0.55rem 0.7rem;
            display: flex;
            align-items: center;
            gap: 0.55rem;
            height: 100%;
            transition: all 0.25s ease;
        }

        .system-status-card:hover {
            border-color: rgba(99, 102, 241, 0.3);
            box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.25);
        }

        .status-icon {
            font-size: 0.95rem;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 7px;
            flex-shrink: 0;
        }

        .status-info {
            flex: 1;
            min-width: 0;
        }

        .status-label {
            font-size: 0.58rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #94a3b8;
            font-weight: 600;
            line-height: 1;
        }

        .status-value {
            font-size: 0.85rem;
            font-weight: 700;
            color: #f1f5f9;
            line-height: 1.2;
        }

        .status-detail {
            font-size: 0.6rem;
            color: #64748b;
            line-height: 1.1;
        }

        .status-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 4px;
            vertical-align: middle;
        }

        .status-dot.online {
            background: #10b981;
            box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
        }

        .status-dot.offline {
            background: #ef4444;
            box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
        }

        /* Collectors */
        .system-collectors-card {
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(148, 163, 184, 0.12);
            border-radius: 10px;
            padding: 0.55rem 0.7rem;
            height: 100%;
        }

        .collector-header {
            font-size: 0.68rem;
            font-weight: 600;
            color: #cbd5e1;
            margin-bottom: 0.4rem;
            display: flex;
            align-items: center;
        }

        .collector-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.3rem;
        }

        .collector-item {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.25rem 0.45rem;
            border-radius: 6px;
            background: rgba(30, 41, 59, 0.5);
            font-size: 0.65rem;
            color: #94a3b8;
            transition: background 0.2s ease;
            min-width: 0; /* permite que o item do grid encolha abaixo do conteudo (evita estouro horizontal) */
        }

        .collector-item:hover {
            background: rgba(30, 41, 59, 0.8);
        }

        .collector-status {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .collector-status.running {
            background: #10b981;
            box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
            animation: pulse 2s infinite;
        }

        .collector-status.stopped {
            background: #64748b;
        }

        .collector-status.disabled {
            background: #334155;
        }

        .collector-name {
            flex: 1;
            min-width: 0; /* necessario pro ellipsis funcionar dentro do flex */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .collector-badge {
            font-size: 0.5rem;
            padding: 0.05rem 0.3rem;
            border-radius: 3px;
            font-weight: 600;
            text-transform: uppercase;
            flex-shrink: 0;
        }

        .collector-badge.running {
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }

        .collector-badge.stopped {
            background: rgba(148, 163, 184, 0.1);
            color: #64748b;
        }

        .collector-badge.disabled {
            background: rgba(51, 65, 85, 0.3);
            color: #475569;
        }

        /* Service migrado pro ManagerPro-Collector */
        .collector-status.in-collector {
            background: #6366f1;
            box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
            animation: pulse 2s infinite;
        }
        .collector-badge.in-collector {
            background: rgba(99, 102, 241, 0.15);
            color: #a5b4fc;
        }

        /* Processo ManagerPro-Collector fora do ar — alarmante */
        .collector-status.collector-down {
            background: #ef4444;
            box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
            animation: pulse 1.2s infinite;
        }
        .collector-badge.collector-down {
            background: rgba(239, 68, 68, 0.18);
            color: #fca5a5;
            border: 1px solid rgba(239, 68, 68, 0.35);
        }

        /* Version bar (horizontal) */
        .system-version-bar {
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid rgba(148, 163, 184, 0.12);
            border-radius: 10px;
            padding: 0.45rem 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .version-bar-item {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }

        .version-bar-label {
            font-size: 0.6rem;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            font-weight: 600;
        }

        .version-bar-value {
            font-size: 0.68rem;
            color: #e2e8f0;
            font-weight: 500;
        }

        .version-bar-sep {
            width: 1px;
            height: 14px;
            background: rgba(148, 163, 184, 0.15);
        }

        @media (max-width: 1199px) {
            /* Tablets (iPad ~10" retrato/paisagem): 2 colunas dao espaco
               suficiente pros nomes, evitando truncamento agressivo */
            .collector-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 576px) {
            .collector-grid {
                grid-template-columns: 1fr;
            }
            .system-metric-card,
            .system-status-card {
                padding: 0.45rem 0.55rem;
            }
            .version-bar-sep {
                display: none;
            }
            .system-version-bar {
                gap: 0.3rem 0.6rem;
            }
        }

/* ============================================================
   CAMADA PREMIUM — home (hero de boas-vindas + cards de sistema)
   ============================================================ */
.welcome-area {
    background:
        radial-gradient(900px 260px at 18% -12%, rgba(99, 102, 241, 0.13), transparent 60%),
        radial-gradient(900px 260px at 82% -12%, rgba(139, 92, 246, 0.11), transparent 60%),
        linear-gradient(160deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.84)) !important;
    border: 1px solid var(--border-color, #334155) !important;
    box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.65) !important;
    position: relative;
    overflow: hidden;
}
.welcome-area::before {
    content: '';
    position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), rgba(139, 92, 246, 0.55), transparent);
}
.welcome-area #welcomeArea, .welcome-area > * { position: relative; z-index: 1; }

/* Cards de sistema com fundo gradiente + fio de acento no topo */
.system-metric-card,
.system-status-card {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.5)) !important;
    position: relative;
    overflow: hidden;
}
.system-metric-card::after,
.system-status-card::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
    pointer-events: none;
}
.system-metric-card:hover,
.system-status-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.35) !important;
}
