        /* Variables - Tema Adaptativo según hora */
        :root {
            /* Dimensiones */
            --sidebar-width: 280px;
            --header-height: 60px;

            /* Colores principales - Monocromático */
            --primary: #d4d4d4;
            --primary-hover: #e5e5e5;
            --primary-light: #f5f5f5;
            --secondary: #a3a3a3;

            /* Transiciones */
            --transition: 0.15s ease;
        }

        /* Tema por defecto (auto-detectado por JS) */
        :root {
            /* Colores de fondo - Escala de grises */
            --bg-dark: #1a1a1a;
            --bg-darker: #0f0f0f;
            --bg-panel: #262626;
            --bg-hover: #333333;
            --bg-input: #1f1f1f;
            --bg-chat: #141414;

            /* Colores de texto */
            --text-primary: #f5f5f5;
            --text-secondary: #a3a3a3;
            --text-muted: #737373;

            /* Estados */
            --success: #a3a3a3;
            --warning: #d4d4d4;
            --error: #737373;

            /* Bordes */
            --border: #404040;
            --border-light: #525252;

            /* Radios */
            --radius-sm: 6px;
            --radius-md: 8px;
            --radius-lg: 12px;
        }

        /* Tema: Mañana (6:00-12:00) - Grises más claros */
        [data-theme="morning"] {
            --bg-dark: #2a2a2a;
            --bg-darker: #1f1f1f;
            --bg-panel: #363636;
            --bg-hover: #404040;
            --bg-input: #2d2d2d;

            --text-primary: #fafafa;
            --text-secondary: #d4d4d4;
            --text-muted: #a3a3a3;

            --border: #525252;
            --border-light: #737373;

            --primary: #e5e5e5;
            --primary-hover: #ffffff;
        }

        /* Tema: Tarde (12:00-18:00) - Grises medio */
        [data-theme="afternoon"] {
            --bg-dark: #1f1f1f;
            --bg-darker: #171717;
            --bg-panel: #2a2a2a;
            --bg-hover: #333333;
            --bg-input: #262626;

            --text-primary: #f0f0f0;
            --text-secondary: #c4c4c4;
            --text-muted: #949494;

            --border: #404040;
            --border-light: #525252;

            --primary: #d4d4d4;
            --primary-hover: #e5e5e5;
        }

        /* Tema: Noche (18:00-22:00) - Grises oscuros */
        [data-theme="evening"] {
            --bg-dark: #171717;
            --bg-darker: #0f0f0f;
            --bg-panel: #1f1f1f;
            --bg-hover: #262626;
            --bg-input: #1a1a1a;

            --text-primary: #e5e5e5;
            --text-secondary: #b0b0b0;
            --text-muted: #808080;

            --border: #363636;
            --border-light: #404040;

            --primary: #c4c4c4;
            --primary-hover: #d4d4d4;
        }

        /* Tema: Madrugada (22:00-6:00) - Grises muy oscuros */
        [data-theme="night"] {
            --bg-dark: #0a0a0a;
            --bg-darker: #050505;
            --bg-panel: #141414;
            --bg-hover: #1a1a1a;
            --bg-input: #0f0f0f;

            --text-primary: #d4d4d4;
            --text-secondary: #a0a0a0;
            --text-muted: #707070;

            --border: #262626;
            --border-light: #333333;

            --primary: #a3a3a3;
            --primary-hover: #c4c4c4;
        }

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

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-dark);
            color: var(--text-primary);
            min-height: 100vh;
            overflow-x: hidden;
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
        }

        /* Header - Flat Design */
        .top-header {
            height: var(--header-height);
            background: var(--bg-panel);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            gap: 16px;
        }

        .header-logo {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .header-logo .logo-link {
            text-decoration: none;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .header-logo .logo-icon {
            width: 36px;
            height: 36px;
            background: var(--primary);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }

        .header-logo .logo-link:hover .logo-icon {
            background: var(--primary-hover);
        }

        .header-logo .logo-text {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.5px;
        }


        .header-nav {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .header-status {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .session-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 4px 8px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: var(--bg-dark);
            max-width: 220px;
        }

        .session-avatar {
            width: 26px;
            height: 26px;
            border-radius: 999px;
            object-fit: cover;
            border: 1px solid #3a3a3a;
            background: #2a2a2a;
            flex-shrink: 0;
        }

        .session-user-name {
            font-size: 0.78rem;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .logout-btn {
            border-color: #5a2a2a !important;
            color: #f2b8b8 !important;
            background: #2a1616 !important;
        }

        .logout-btn:hover {
            background: #3a1d1d !important;
            color: #ffd2d2 !important;
        }

        .session-settings-panel {
            position: fixed;
            top: calc(var(--header-height) + 8px);
            right: 20px;
            width: 320px;
            max-width: calc(100vw - 24px);
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 12px;
            z-index: 1200;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
            display: none;
        }

        .session-settings-panel.visible {
            display: block;
        }

        .session-settings-title {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .session-form-row {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 10px;
        }

        .session-form-row label {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .session-form-row input[type="text"],
        .session-form-row input[type="url"] {
            background: #101010;
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text-primary);
            padding: 7px 8px;
            font-size: 0.82rem;
        }

        .privacy-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 6px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            font-size: 0.78rem;
            color: var(--text-secondary);
        }

        .privacy-item:last-child {
            border-bottom: none;
        }

        .memory-inject-panel {
            margin: 8px 0 4px;
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #121212;
            color: var(--text-secondary);
            font-size: 0.78rem;
        }

        .memory-inject-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .memory-inject-list {
            margin-top: 6px;
            max-height: 92px;
            overflow: auto;
            white-space: pre-wrap;
            color: #c9c9c9;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.72rem;
            border-top: 1px dashed rgba(255, 255, 255, 0.12);
            padding-top: 6px;
            display: none;
        }

        .memory-inject-list.visible {
            display: block;
        }

        .nav-item {
            padding: 10px 20px;
            border-radius: var(--border-radius-lg);
            cursor: pointer;
            transition: var(--transition-normal);
            font-weight: 500;
            font-size: 0.875rem;
            color: var(--text-secondary);
            background: rgba(64, 64, 64, 0.3);
            border: 1px solid rgba(148, 163, 184, 0.1);
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .nav-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--gradient-primary);
            opacity: 0;
            transition: var(--transition-normal);
            z-index: 0;
        }

        .nav-item span {
            position: relative;
            z-index: 1;
        }

        .nav-item:hover {
            color: white;
            border-color: rgba(163, 163, 163, 0.3);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(163, 163, 163, 0.2);
        }

        .nav-item:hover::before {
            opacity: 0.1;
        }

        .nav-item.active {
            background: rgba(163, 163, 163, 0.2);
            color: white;
            border-color: rgba(163, 163, 163, 0.5);
            box-shadow: 0 0 20px rgba(163, 163, 163, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
        }

        .nav-item.active::before {
            opacity: 0.15;
        }

        /* Estilos para los botones de navegación en el sidebar derecho */
        .nav-link-btn {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
            color: #cbd5e1;
            background: rgba(64, 64, 64, 0.3);
            border: 1px solid rgba(148, 163, 184, 0.2);
            min-width: 100%;
            text-align: left;
        }

        .nav-link-btn:hover {
            background: rgba(74, 85, 104, 0.5);
            color: white;
            border-color: #a3a3a3;
            box-shadow: var(--neuro-shadow-light);
        }

        /* Estilos para el sidebar derecho rediseñado */
        .quick-cmd-btn {
            transition: all 0.2s ease;
        }

        .quick-cmd-btn:hover {
            background: rgba(163, 163, 163, 0.2) !important;
            border-color: var(--primary) !important;
            transform: translateX(4px);
        }

        .quick-action-btn {
            transition: all 0.2s ease;
        }

        .quick-action-btn:hover {
            background: var(--bg-hover) !important;
            border-color: var(--primary) !important;
            transform: translateY(-2px);
        }

        .shortcut-item {
            transition: all 0.2s ease;
        }

        .shortcut-item:hover {
            color: var(--text-primary);
        }

        .mini-service-item {
            transition: all 0.2s ease;
        }

        .mini-service-item:hover {
            background: rgba(16, 185, 129, 0.2) !important;
        }

        .service-led-card {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .service-led-card.active {
            background: rgba(139, 231, 174, 0.08);
            border-color: rgba(139, 231, 174, 0.28);
        }

        .service-led-card.inactive {
            background: rgba(255, 255, 255, 0.03);
            border-color: rgba(255, 255, 255, 0.06);
            opacity: 0.85;
        }

        .service-led {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #f3f3f3;
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24), 0 0 6px rgba(255, 255, 255, 0.35);
            flex-shrink: 0;
        }

        .service-led.on {
            background: #8be7ae;
            box-shadow: 0 0 0 1px rgba(139, 231, 174, 0.35), 0 0 6px rgba(139, 231, 174, 0.5);
        }

        .service-led.off {
            background: #cfcfcf;
            box-shadow: 0 0 0 1px rgba(207, 207, 207, 0.26), 0 0 4px rgba(207, 207, 207, 0.3);
        }

        .service-led.working {
            animation: provider-led-blink 0.75s ease-in-out infinite;
        }

        /* Estilos para el modo Visor de Artefactos */
        body.viewer-active .chat-header,
        body.viewer-active .message-input-container,
        body.viewer-active #chat-messages > .message {
            display: none !important;
        }

        body.viewer-active .chat-area {
            border: none;
        }

        body.viewer-active #chat-messages {
            padding: 0;
            height: 100%;
            overflow: hidden;
        }

        .favorite-item {
            display: flex;
            align-items: center;
            padding: 8px;
            border-radius: 8px;
            color: #cbd5e1;
            transition: all 0.3s ease;
        }

        .favorite-item:hover {
            background: rgba(74, 85, 104, 0.3);
            cursor: pointer;
        }

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

        .icon-btn {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            cursor: pointer;
            transition: none;
            color: var(--text-secondary);
        }

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

        /* Contenido principal */
        .main-content {
            display: flex;
            height: calc(100vh - var(--header-height)); /* Sin footer ahora */
        }



        /* Sidebar izquierdo - Flat */
        .sidebar-left {
            width: var(--sidebar-width);
            background: var(--bg-panel);
            border-right: 1px solid var(--border);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            position: fixed;
            left: 0;
            top: var(--header-height);
            bottom: 0;
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 900;
        }

        .sidebar-left::-webkit-scrollbar {
            display: none;
        }

        .sidebar-left.hidden {
            transform: translateX(-100%);
        }

        body.sidebar-left-hidden {
            padding-left: 0;
        }

        .sidebar-section {
            background: transparent;
            border-radius: 0;
            padding: 12px 0;
            border: none;
            border-bottom: 1px solid var(--border);
        }

        .sidebar-section:last-child {
            border-bottom: none;
        }

        .section-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            margin-bottom: 16px;
            padding: 8px 0;
        }

        .section-title {
            font-size: 0.7rem;
            font-weight: 500;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
            padding: 0 10px;
        }

        .service-logo {
            width: 100px;
            height: 100px;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--neuro-shadow-light);
            background: white;
            padding: 12px;
            flex-shrink: 0;
            object-fit: contain;
            transition: var(--transition-normal);
        }

        .service-logo:hover {
            transform: scale(1.03);
            box-shadow: var(--neuro-hover);
        }

        .service-logo-container {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100px;
            height: 100px;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--neuro-shadow-light);
            background: rgba(64, 64, 64, 0.5);
            flex-shrink: 0;
            padding: 10px;
            transition: var(--transition-normal);
            overflow: hidden;
        }

        .service-logo-container:hover {
            transform: translateY(-2px);
            box-shadow: var(--neuro-hover);
        }

        .service-logo-container img {
            width: 80px;
            height: 80px;
            object-fit: contain;
            transition: var(--transition-normal);
        }

        .service-logo-container:hover img {
            transform: scale(1.05);
        }

        .service-status-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 8px;
            border-radius: var(--border-radius-sm);
            transition: var(--transition-normal);
            cursor: pointer;
        }

        .service-status-item:hover {
            background: rgba(64, 64, 64, 0.4);
            transform: translateX(4px);
        }

        .service-status-item:last-child {
            border-bottom: none;
        }

        .service-icon {
            width: 22px;
            height: 22px;
            color: var(--text-muted);
            flex-shrink: 0;
            transition: var(--transition-normal);
        }

        .service-status-item:hover .service-icon {
            color: var(--primary-light);
            transform: scale(1.1);
        }

        .service-name {
            font-size: 0.9rem;
            color: var(--text-secondary);
            flex: 1;
            font-weight: 500;
            transition: var(--transition-normal);
        }

        .service-status-item:hover .service-name {
            color: var(--text-primary);
        }

        /* Servicios - Ultra Flat */
        .services-grid {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .services-grid.compact {
            gap: 0;
        }

        .service-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 10px;
            background: transparent;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: none;
            border: none;
        }

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

        .service-icon-wrapper {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            flex-shrink: 0;
        }

        .service-icon-wrapper.small {
            width: 24px;
            height: 24px;
        }

        .service-icon {
            width: 14px;
            height: 14px;
            color: var(--text-secondary);
        }

        .service-icon-wrapper.small .service-icon {
            width: 12px;
            height: 12px;
        }

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

        .service-name {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .service-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .service-status {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--success);
            flex-shrink: 0;
        }

        .service-status.active {
            background: var(--success);
        }

        .service-status.warning {
            background: var(--warning);
        }

        .service-status.error {
            background: var(--error);
        }

        /* Panel de Integraciones */
        .integrations-panel {
            position: fixed;
            top: calc(var(--header-height) + 20px);
            right: 20px;
            width: 320px;
            max-height: calc(100vh - var(--header-height) - 60px);
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 16px;
            overflow-y: scroll;
            scrollbar-width: none;
            -ms-overflow-style: none;
            z-index: 1002;
            display: none;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        }

        .integrations-panel::-webkit-scrollbar {
            display: none;
        }

        .integrations-panel.visible {
            display: block;
        }

        .integrations-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border);
        }

        .integrations-header h3 {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .integrations-close {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
        }

        .integration-category {
            margin-bottom: 16px;
        }

        .integration-category-title {
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 8px;
        }

        .integration-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            background: var(--bg-dark);
            border-radius: var(--radius-sm);
            margin-bottom: 6px;
            cursor: pointer;
        }

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

        .integration-icon {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-panel);
            border: 1px solid var(--border);
        }

        .integration-icon i {
            width: 18px;
            height: 18px;
            color: var(--text-secondary);
        }

        .integration-info {
            flex: 1;
        }

        .integration-name {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .integration-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .integration-status {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--border);
        }

        .integration-status.connected {
            background: var(--success);
        }

        /* Layout principal - Fijo y estable */
        .main-content {
            display: flex;
            position: fixed;
            top: var(--header-height);
            left: 0;
            right: 0;
            bottom: 0;
            overflow: hidden;
        }

        /* Área de chat */
        .chat-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            margin-left: var(--sidebar-width);
            margin-right: var(--sidebar-width);
            background: var(--bg-chat);
            overflow: hidden;
            min-width: 0;
        }

        /* Estados para cuando los sidebars están ocultos */
        .sidebar-left.hidden {
            transform: translateX(-100%);
        }

        .sidebar-right.hidden {
            transform: translateX(100%);
        }

        .sidebar-left.hidden ~ .chat-area {
            margin-left: 0;
        }

        .sidebar-right.hidden ~ .chat-area {
            margin-right: 0;
        }

        /* Cuando ambos sidebars están ocultos */
        body.sidebar-left-hidden.sidebar-right-hidden .chat-area {
            margin-left: 0;
            margin-right: 0;
        }

        /* Estilos para sistema de pestañas */
        .tabs-container {
            width: 100%;
            background: rgba(40, 40, 40, 0.7);
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            padding: 0 24px;
        }

        .tab-nav {
            display: flex;
            gap: 2px;
            overflow-x: auto;
            padding-bottom: 4px;
            /* Ocultar barras de scroll */
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE/Edge */
        }

        .tab-nav::-webkit-scrollbar {
            display: none; /* Ocultar scroll para Chrome/Safari */
        }

        .tab-btn {
            padding: 12px 20px;
            border-radius: 12px 12px 0 0;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
            color: #cbd5e1;
            background: rgba(64, 64, 64, 0.3);
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-bottom: none;
            min-width: 140px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--neuro-inset);
            white-space: nowrap;
        }

        .tab-btn:hover {
            background: rgba(74, 85, 104, 0.5);
            color: white;
        }

        .tab-btn.active {
            background: rgba(163, 163, 163, 0.15);
            color: white;
            border-color: var(--primary);
        }

        .tab-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .tab-pane {
            display: none;
            flex: 1;
            overflow: hidden;
        }

        .tab-pane.active {
            display: block;
            animation: fadeIn 0.3s ease-in-out;
        }

        .content-container {
            padding: 8px 12px 12px 12px; /* Espaciado optimizado */
            height: 100%;
            overflow-y: auto;
            max-height: calc(100vh - var(--header-height) - 40px); /* Ajustado para mejor uso del espacio */
        }

        /* Reducir espacios en formularios */
        .form-container {
            max-width: 600px;
            margin-top: 10px; /* Menos espacio superior */
        }

        .form-group {
            margin-bottom: 12px; /* Menos espacio entre campos */
        }

        .form-actions {
            margin-top: 16px; /* Menos espacio superior */
            margin-bottom: 0; /* Eliminar margen inferior */
        }

        /* Listas - Ultra Flat */
        .chats-list, .projects-list {
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-top: 12px;
        }

        .chat-item, .project-item {
            background: transparent;
            border-radius: var(--radius-sm);
            padding: 10px 12px;
            border: none;
            transition: none;
            cursor: pointer;
            border-bottom: 1px solid var(--border);
        }

        .chat-item:hover, .project-item:hover {
            background: var(--bg-hover);
        }

        .chat-item-header, .project-item-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
        }

        .chat-title, .project-title {
            font-weight: 600;
            color: #e2e8f0;
            flex: 1;
        }

        .chat-date, .project-date {
            font-size: 0.8rem;
            color: #94a3b8;
        }

        .chat-preview, .project-description {
            color: #cbd5e1;
            font-size: 0.9rem;
            line-height: 1.4;
        }

        .project-meta {
            display: flex;
            justify-content: space-between;
            margin-top: 12px;
            font-size: 0.8rem;
            color: #94a3b8;
        }

        .project-status-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: #10b981;
        }

        .project-status-indicator.inactive {
            background-color: #ef4444;
        }

        /* Estilos para la vista de detalle del proyecto */
        .project-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 12px;
        }

        .project-header h2 {
            margin: 0;
            display: flex;
            align-items: center;
        }

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

        .project-info {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .project-overview h3,
        .project-stats h3,
        .project-chats-section h3 {
            margin: 0 0 12px 0;
            color: #e2e8f0;
            font-size: 1.1rem;
        }

        .project-details {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
            margin: 12px 0;
        }

        .detail-row {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
        }

        .detail-row label {
            font-weight: 500;
            color: #94a3b8;
        }

        .detail-row span {
            color: #e2e8f0;
            font-weight: 400;
        }

        .project-stats {
            background: rgba(64, 64, 64, 0.2);
            padding: 16px;
            border-radius: 12px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 16px;
        }

        .stat-card {
            text-align: center;
            padding: 12px;
            background: rgba(40, 40, 40, 0.5);
            border-radius: 8px;
        }

        .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: #a3a3a3;
            margin-bottom: 4px;
        }

        .stat-label {
            font-size: 0.8rem;
            color: #94a3b8;
        }

        .form-container {
            max-width: 600px;
            margin-top: 20px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #e2e8f0;
        }

        /* Formularios - Ultra Flat */
        .form-input {
            width: 100%;
            padding: 10px 14px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 0.95rem;
            transition: none;
            font-family: inherit;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--border-light);
        }

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

        .form-group label {
            display: block;
            margin-bottom: 6px;
            font-weight: 500;
            font-size: 0.875rem;
            color: var(--text-secondary);
        }

        /* Estilos para la página de precios */
        .pricing-section {
            margin-top: 20px;
        }

        .pricing-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 24px;
            margin: 24px 0;
        }

        .pricing-card {
            background: rgba(64, 64, 64, 0.3);
            border-radius: 16px;
            padding: 24px;
            border: 1px solid rgba(148, 163, 184, 0.2);
            transition: all 0.3s ease;
            box-shadow: var(--neuro-inset);
        }

        .pricing-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--neuro-shadow-light);
            border-color: rgba(163, 163, 163, 0.4);
        }

        .pricing-header {
            text-align: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
        }

        .pricing-price {
            margin: 12px 0;
        }

        .price-amount {
            font-size: 2rem;
            font-weight: 700;
            color: white;
            display: block;
        }

        .price-subtext {
            font-size: 0.9rem;
            color: #94a3b8;
        }

        .pricing-features {
            margin: 20px 0;
        }

        .feature-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 0;
            color: #cbd5e1;
        }

        .pricing-actions {
            margin-top: 20px;
        }

        .pricing-disclaimer {
            margin-top: 30px;
        }

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

        .agents-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin: 12px 0;
        }

        .agent-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: rgba(64, 64, 64, 0.2);
            border-radius: 12px;
        }

        .agent-selector {
            display: flex;
            gap: 12px;
            flex: 1;
        }

        .agent-role, .agent-name {
            flex: 1;
        }

        .btn-icon {
            background: rgba(64, 64, 64, 0.5);
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 8px;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: var(--neuro-inset);
        }

        .btn-icon:hover {
            background: rgba(74, 85, 104, 0.5);
            border-color: #a3a3a3;
            box-shadow: var(--neuro-shadow-light);
        }

        /* Botones - Ultra Flat */
        .btn-primary {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            padding: 8px 16px;
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            transition: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .btn-primary:hover {
            opacity: 0.9;
        }

        .btn-secondary {
            background: transparent;
            color: var(--text-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 8px 16px;
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            transition: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .btn-secondary:hover {
            color: var(--text-primary);
        }

        .add-agent-btn {
            margin-top: 12px;
            background: rgba(64, 64, 64, 0.5);
            color: #f1f5f9;
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 12px;
            padding: 12px 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: var(--neuro-inset);
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
        }

        .add-agent-btn:hover {
            background: rgba(74, 85, 104, 0.5);
            border-color: #a3a3a3;
            box-shadow: var(--neuro-shadow-light);
        }

        /* Para dispositivos móviles */
        @media (max-width: 576px) {
            .chat-area {
                margin-left: 12px;
                margin-right: 12px;
            }

            .tab-btn {
                min-width: 120px;
                padding: 10px 12px;
                font-size: 0.85rem;
            }

            .content-container {
                padding: 16px;
                max-height: calc(100vh - var(--header-height) - 60px);
            }

            .form-container {
                max-width: 100%;
            }
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 0;
            display: flex;
            flex-direction: column;
            background: var(--bg-chat);
            -webkit-overflow-scrolling: touch;
        }

        .chat-messages::-webkit-scrollbar {
            display: none;
        }

        /* Mensajes - Minimalista */
        .message {
            display: flex;
            gap: 12px;
            padding: 12px 16px;
            max-width: 100%;
            width: 100%;
        }

        .message:hover {
            background: rgba(255, 255, 255, 0.03);
        }

        .message:last-child {
            border-bottom: none;
        }

        .message-avatar {
            width: 28px;
            height: 28px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: 1px solid var(--border);
            flex-shrink: 0;
            color: var(--text-secondary);
        }

        .message.user .message-avatar {
            border-color: var(--primary);
            color: var(--primary);
        }

        .message-content {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
            background: transparent !important;
            position: relative;
            padding-right: 34px;
        }

        .message-role {
            font-size: 0.7rem;
            font-weight: 500;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .message-copy-btn {
            position: absolute;
            top: 0;
            right: 0;
            width: 24px;
            height: 24px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.03);
            color: var(--text-muted);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.15s ease;
        }

        .message:hover .message-copy-btn {
            opacity: 1;
        }

        .message-copy-btn:hover {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.08);
        }

        .message-model-chip {
            display: inline-flex;
            align-items: center;
            padding: 2px 8px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(255, 255, 255, 0.04);
            color: var(--text-muted);
            font-size: 0.68rem;
            text-transform: none;
            letter-spacing: 0;
            line-height: 1.2;
        }

        .message-verification-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            font-size: 0.68rem;
            text-transform: none;
            letter-spacing: 0;
            line-height: 1.2;
        }

        .message-verification-chip.ok {
            color: #8be7ae;
            background: rgba(34, 197, 94, 0.12);
            border-color: rgba(34, 197, 94, 0.4);
        }

        .message-verification-chip.warn {
            color: #f7cd7b;
            background: rgba(245, 158, 11, 0.12);
            border-color: rgba(245, 158, 11, 0.45);
        }

        .message-verification-chip.fail {
            color: #ff9b9b;
            background: rgba(239, 68, 68, 0.12);
            border-color: rgba(239, 68, 68, 0.42);
        }

        .message.user .message-role {
            color: var(--primary);
        }

        .message-text {
            color: var(--text-primary);
            line-height: 1.6;
            font-size: 0.95rem;
            word-wrap: break-word;
            white-space: normal;
        }

        .message-text p {
            margin: 0 0 10px 0;
        }

        .message-text p:last-child {
            margin-bottom: 0;
        }

        .message-text h1,
        .message-text h2,
        .message-text h3 {
            margin: 10px 0 8px;
            line-height: 1.3;
            color: var(--text-primary);
        }

        .message-text h1 { font-size: 1.05rem; }
        .message-text h2 { font-size: 1rem; }
        .message-text h3 { font-size: 0.95rem; }

        .message-text ul,
        .message-text ol {
            margin: 8px 0 10px 18px;
            padding: 0;
        }

        .message-text li {
            margin: 4px 0;
        }

        .message-text pre {
            margin: 10px 0;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 6px;
            overflow-x: auto;
            position: relative;
        }

        .code-copy-btn {
            position: absolute;
            top: 6px;
            right: 6px;
            width: 24px;
            height: 24px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 6px;
            background: rgba(0, 0, 0, 0.25);
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.15s ease;
        }

        .message-text pre:hover .code-copy-btn {
            opacity: 1;
        }

        .code-copy-btn:hover {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.12);
        }

        .message-text pre code {
            background: transparent;
            padding: 0;
            border-radius: 0;
            color: var(--text-primary);
            font-size: 0.84rem;
            line-height: 1.45;
            white-space: pre;
        }

        .message-text blockquote {
            margin: 10px 0;
            padding: 8px 12px;
            border-left: 2px solid rgba(255, 255, 255, 0.2);
            background: rgba(255, 255, 255, 0.03);
            border-radius: 4px;
            color: var(--text-secondary);
        }

        .message-text a {
            color: var(--primary-light);
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .processing-shell {
            display: inline-flex;
            flex-direction: column;
            gap: 6px;
            color: var(--text-secondary);
        }

        .processing-label {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.72rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-muted);
            margin-left: 6px;
        }

        .processing-bubble {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 32px;
            padding: 6px 12px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            background: transparent;
        }

        .processing-dots {
            display: flex;
            align-items: center;
            gap: 6px;
            height: 10px;
        }

        .processing-dot {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: #b8b8b8;
            opacity: 0.35;
            animation: capibara-processing-dot 1.2s ease-in-out infinite;
        }

        .processing-dot:nth-child(2) { animation-delay: 0.2s; }
        .processing-dot:nth-child(3) { animation-delay: 0.4s; }

        @keyframes capibara-processing-dot {
            0%, 100% { opacity: 0.3; transform: scale(0.95); }
            50% { opacity: 1; transform: scale(1.2); }
        }

        .message-text strong {
            color: var(--text-primary);
            font-weight: 600;
        }

        .message-text code {
            background: rgba(255, 255, 255, 0.05);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85em;
            color: var(--text-secondary);
        }

        /* Pensamiento del modelo */
        .message-thinking {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-sm);
            padding: 10px;
            margin-bottom: 10px;
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .message-thinking-header {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 6px;
            cursor: pointer;
            user-select: none;
        }

        .message-thinking-header span {
            font-weight: 500;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-transform: uppercase;
        }

        .message-thinking-content {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            line-height: 1.4;
            white-space: pre-wrap;
            color: var(--text-muted);
        }

        .message-thinking.collapsed .message-thinking-content {
            display: none;
        }

        /* Eliminar scrollbars visibles globalmente */
        * {
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        
        *::-webkit-scrollbar {
            display: none;
        }
        
        /* Header del Chat - Minimalista */
        .chat-header {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding: 8px 16px;
            background: transparent;
            border-bottom: 1px solid var(--border);
        }

        .chat-logo {
            display: none;
        }

        .tokens-monitor {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .token-metric {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }

        .token-metric.total {
            padding-left: 12px;
            border-left: 1px solid var(--border);
        }

        .token-label {
            font-size: 0.65rem;
            text-transform: uppercase;
            color: var(--text-muted);
            letter-spacing: 0.05em;
        }

        .token-value {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-secondary);
            font-family: 'JetBrains Mono', monospace;
        }

        .credits-display {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            background: rgba(163, 163, 163, 0.1);
            border-radius: var(--radius-sm);
            margin-left: 8px;
            color: var(--primary);
            font-size: 0.85rem;
            font-weight: 600;
        }

        /* Lista de Equipos CrewAI */
        .crew-teams-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
            max-height: 200px;
            overflow-y: auto;
        }

        .crew-team-item {
            background: var(--bg-dark);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 10px;
            cursor: pointer;
            transition: var(--transition);
        }

        .crew-team-item:hover {
            background: var(--bg-hover);
            border-color: var(--border-light);
        }

        .crew-team-item.active {
            border-color: var(--success);
            background: rgba(34, 197, 94, 0.05);
        }

        .crew-team-item.paused {
            border-color: var(--warning);
            opacity: 0.8;
        }

        .crew-team-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 6px;
        }

        .crew-team-name {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 140px;
        }

        .crew-team-status {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            animation: pulse-status 2s infinite;
        }

        .crew-team-status.paused {
            background: var(--warning);
            animation: none;
        }

        .crew-team-status.stopped {
            background: var(--error);
            animation: none;
        }

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

        .crew-team-roles {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 8px;
        }

        .crew-team-actions {
            display: flex;
            gap: 6px;
        }

        .crew-action-btn {
            flex: 1;
            padding: 4px 8px;
            font-size: 0.7rem;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: var(--transition);
            text-transform: uppercase;
            font-weight: 600;
        }

        .crew-action-btn.pause {
            background: var(--warning);
            color: #000;
        }

        .crew-action-btn.resume {
            background: var(--success);
            color: white;
        }

        .crew-action-btn.stop {
            background: var(--error);
            color: white;
        }

        .crew-action-btn:hover {
            opacity: 0.8;
        }

        /* Contenedor de entrada - Ultra Flat */
        .message-input-container {
            background: transparent;
            border-top: 1px solid var(--border);
            padding: 12px 16px;
        }

        .message-input {
            width: 100%;
            min-height: 48px;
            max-height: 160px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 12px 14px;
            color: var(--text-primary);
            font-size: 0.95rem;
            resize: none;
            font-family: inherit;
            line-height: 1.5;
        }

        .message-input:focus {
            outline: none;
            border-color: var(--border-light);
        }

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

        /* Acciones de entrada - Ultra Flat */
        .input-actions {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 2px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .input-action-btn {
            background: transparent;
            border: none;
            border-radius: var(--radius-sm);
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: none;
            color: var(--text-muted);
            position: relative;
        }

        .input-action-btn:hover {
            color: var(--text-primary);
        }

        .input-action-btn.primary {
            color: var(--primary);
            background: rgba(163, 163, 163, 0.1);
        }

        .input-action-btn.primary:hover {
            background: rgba(163, 163, 163, 0.2);
        }

        .input-action-btn.danger {
            color: var(--error);
            background: rgba(239, 68, 68, 0.08);
        }

        .input-action-btn.danger:hover {
            background: rgba(239, 68, 68, 0.16);
        }

        .input-action-btn.active {
            color: var(--primary);
            background: rgba(163, 163, 163, 0.15);
        }

        /* Grupos de acciones en el toolbar */
        .input-actions {
            gap: 4px;
        }

        .input-actions .divider {
            margin: 0 8px;
        }

        .input-action-btn i {
            width: 16px;
            height: 16px;
        }

        .divider {
            width: 1px;
            height: 16px;
            background: var(--border);
            margin: 0 6px;
            opacity: 0.5;
        }

        .input-controls {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* Mejoras para dispositivos móviles */
        @media (max-width: 768px) {
            .input-actions {
                overflow-x: auto;
                padding-bottom: 4px;
                -ms-overflow-style: none;  /* IE and Edge */
                scrollbar-width: none;     /* Firefox */
            }

            .input-actions::-webkit-scrollbar {
                display: none; /* Chrome, Safari, Opera */
            }

            .input-action-btn {
                flex-shrink: 0; /* Evitar que los botones se encogen */
            }
        }

        /* Indicadores de estado */
        .rag-status-indicator {
            position: absolute;
            top: 0;
            right: 0;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            border: 2px solid var(--bg-panel);
            pointer-events: none;
        }

        .rag-status-indicator.rag-off {
            background: var(--error);
        }

        .rag-status-indicator.rag-processing {
            background: var(--warning);
        }

        .message-input-small {
            width: 100%;
            min-height: 48px;
            max-height: 120px;
            height: 48px;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            color: var(--text-primary);
            font-size: 0.95rem;
            resize: none;
            overflow-y: auto;
        }

        .send-btn-smaller {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            padding: 8px 16px;
            font-weight: 500;
            font-size: 0.85rem;
            cursor: pointer;
            width: auto;
            align-self: flex-end;
        }

        .send-btn-smaller:hover {
            background: var(--primary-hover);
        }

        /* Botón de envío - Flat */
        .send-btn {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-md);
            padding: 10px 20px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .send-btn:hover {
            background: var(--primary-hover);
        }

        .send-btn:active {
            opacity: 0.9;
        }

        .send-btn-small {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            padding: 8px 16px;
            font-weight: 500;
            font-size: 0.85rem;
            cursor: pointer;
            width: auto;
            align-self: flex-end;
        }

        .send-btn-small:hover {
            background: var(--primary-hover);
        }

        /* Sidebar derecho - Flat */
        .sidebar-right {
            width: var(--sidebar-width);
            background: var(--bg-panel);
            border-left: 1px solid var(--border);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            position: fixed;
            right: 0;
            top: var(--header-height);
            bottom: 0;
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 900;
        }

        .sidebar-right::-webkit-scrollbar {
            display: none;
        }

        /* Botones de modelo mejorados */
        .model-btn {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 16px;
            background: rgba(40, 40, 40, 0.6);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: var(--border-radius-md);
            cursor: pointer;
            transition: var(--transition-normal);
            text-align: left;
            position: relative;
            width: 100%;
            overflow: hidden;
        }

        .model-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--gradient-primary);
            opacity: 0;
            transition: var(--transition-normal);
        }

        .model-btn:hover:not(:disabled) {
            border-color: var(--border-light);
        }

        .model-btn.active {
            background: rgba(163, 163, 163, 0.1);
            border-color: var(--primary);
        }

        .model-led {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
            position: relative;
            transition: var(--transition-normal);
            background: var(--error);
            box-shadow: 0 0 10px var(--error);
        }

        .model-led::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 4px;
            height: 4px;
            background: rgba(255, 255, 255, 0.4);
            border-radius: 50%;
        }

        .model-btn.active .model-led {
            background: var(--success);
            box-shadow: 0 0 15px var(--success);
            animation: led-pulse 2s ease-in-out infinite;
        }

        @keyframes led-pulse {
            0%, 100% {
                box-shadow: 0 0 12px var(--success);
                transform: scale(1);
            }
            50% {
                box-shadow: 0 0 20px var(--success), 0 0 30px rgba(16, 185, 129, 0.5);
                transform: scale(1.1);
            }
        }

        .model-info {
            flex: 1;
            position: relative;
            z-index: 1;
        }

        .model-name {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--text-primary);
            margin-bottom: 2px;
            transition: var(--transition-normal);
        }

        .model-btn:hover .model-name,
        .model-btn.active .model-name {
            color: white;
        }

        .model-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
            transition: var(--transition-normal);
        }

        .model-btn:hover .model-desc,
        .model-btn.active .model-desc {
            color: var(--text-secondary);
        }

        /* Workflow items mejorados */
        .workflow-item {
            padding: 10px 12px;
            background: rgba(64, 64, 64, 0.4);
            border-radius: var(--border-radius-sm);
            font-size: 0.8rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition-normal);
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            border: 1px solid transparent;
        }

        .workflow-item:hover {
            background: rgba(64, 64, 64, 0.6);
            color: white;
            border-color: rgba(163, 163, 163, 0.2);
            transform: translateX(4px);
        }

        .workflow-item i {
            transition: var(--transition-fast);
        }

        .workflow-item:hover i {
            transform: scale(1.1);
            color: var(--primary-light);
        }

        .provider-status-row {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.01);
        }

        .provider-led {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #ffffff;
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 6px rgba(255, 255, 255, 0.35);
            flex-shrink: 0;
        }

        .provider-led.ok {
            background: #8be7ae;
            box-shadow: 0 0 0 1px rgba(139, 231, 174, 0.35), 0 0 7px rgba(139, 231, 174, 0.5);
        }

        .provider-led.degraded {
            background: #f2f2f2;
            box-shadow: 0 0 0 1px rgba(242, 242, 242, 0.35), 0 0 6px rgba(242, 242, 242, 0.45);
        }

        .provider-led.down {
            background: #8a8a8a;
            box-shadow: 0 0 0 1px rgba(138, 138, 138, 0.35), 0 0 5px rgba(138, 138, 138, 0.4);
        }

        .provider-led.working {
            animation: provider-led-blink 0.75s ease-in-out infinite;
        }

        @keyframes provider-led-blink {
            0%, 100% { opacity: 0.35; transform: scale(0.92); }
            50% { opacity: 1; transform: scale(1.08); }
        }

        .provider-name {
            flex: 1;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .provider-meta {
            color: var(--text-muted);
            font-size: 0.68rem;
        }

        .provider-key-tag {
            font-size: 0.68rem;
        }

        .provider-key-tag.on {
            color: var(--success);
        }

        .provider-key-tag.off {
            color: var(--error);
        }

        /* Botones de acción */
        .action-btn {
            width: 100%;
            padding: 10px 14px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .action-btn:hover {
            background: var(--primary-hover);
        }

        .section-subheader {
            font-size: 0.7rem;
            font-weight: 600;
            color: #94a3b8;
            margin: 10px 0 6px 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .view-more-actions {
            margin-top: 8px;
        }

        .view-more-btn {
            width: 100%;
            padding: 6px 10px;
            background: rgba(64, 64, 64, 0.3);
            color: #cbd5e1;
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 6px;
            font-size: 0.7rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .view-more-btn:hover {
            background: rgba(74, 85, 104, 0.5);
            border-color: #a3a3a3;
            color: white;
        }

        .n8n-actions-list,
        .agents-actions-list,
        .e2b-actions-list {
            margin-bottom: 8px;
        }

        .n8n-workflows-list,
        .agents-list,
        .e2b-environments-list {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        /* Footer inferior */
        .bottom-footer {
            height: var(--footer-height);
            background: rgba(40, 40, 40, 0.9);
            backdrop-filter: blur(10px);
            border-top: 1px solid rgba(148, 163, 184, 0.1);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 48px; /* Más padding horizontal */
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            box-shadow: var(--neuro-shadow-light);
            gap: 32px; /* Separación entre elementos */
        }

        .footer-status {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
            color: #cbd5e1;
        }

        /* Responsive - Flat */
        @media (max-width: 1200px) {
            :root {
                --sidebar-width: 240px;
            }
        }

        @media (max-width: 992px) {
            :root {
                --sidebar-width: 220px;
            }
        }

        @media (max-width: 768px) {
            .sidebar-left, .sidebar-right {
                display: none;
            }
            
            .chat-area {
                margin-left: 0;
                margin-right: 0;
                border: none;
            }
            
            .top-header {
                padding: 0 16px;
            }
            
            .header-status {
                display: none;
            }
        }
        @media (max-width: 1200px) {
            :root {
                --sidebar-width: 200px;
            }
            
            .chat-area {
                margin-left: calc(var(--sidebar-width) + 8px);
                margin-right: calc(var(--sidebar-width) + 8px);
            }
        }

        @media (max-width: 992px) {
            :root {
                --sidebar-width: 180px;
            }
            
            .header-logo .logo-text {
                font-size: 1.2rem;
            }
            
            .chat-area {
                margin-left: calc(var(--sidebar-width) + 6px);
                margin-right: calc(var(--sidebar-width) + 6px);
            }
        }

        @media (max-width: 768px) {
            :root {
                --sidebar-width: 0px;
            }
            
            .sidebar-left, .sidebar-right {
                transform: translateX(-100%);
                width: 280px;
                z-index: 1001;
            }
            
            .sidebar-right {
                transform: translateX(100%);
                left: auto;
                right: 0;
            }
            
            .sidebar-left.visible {
                transform: translateX(0);
            }
            
            .sidebar-right.visible {
                transform: translateX(0);
            }
            
            .chat-area {
                margin-left: 12px;
                margin-right: 12px;
            }
            
            .mobile-sidebar-toggle {
                display: flex !important;
            }
            
            .top-header {
                padding: 0 12px;
            }
            
            .header-logo .logo-text {
                display: none;
            }
        }

        @media (max-width: 576px) {
            body {
                padding-top: calc(var(--header-height) + 8px);
            }
            
            .top-header {
                height: 56px;
            }
            
            .header-status {
                display: none;
            }
            
            .header-nav {
                display: none;
            }
            
            .chat-area {
                margin: 8px;
                padding: 12px;
                border-radius: var(--border-radius-md);
            }
            
            .message {
                padding: 10px 12px;
            }
            
            .message-avatar {
                width: 32px;
                height: 32px;
            }
            
            .message-input-container {
                padding: 12px;
            }
            
            .input-actions {
                gap: 6px;
                justify-content: center;
            }
            
            .input-action-btn {
                width: 34px;
                height: 34px;
            }

            /* Ajustes para menú móvil */
            .mobile-nav-menu {
                display: flex;
                position: fixed;
                top: 60px;
                left: 0;
                right: 0;
                background: rgba(40, 40, 40, 0.95);
                backdrop-filter: blur(10px);
                padding: 0.75rem;
                z-index: 999;
                flex-wrap: wrap;
                gap: 0.5rem;
                border-bottom: 1px solid rgba(148, 163, 184, 0.1);
            }

            .mobile-nav-item {
                flex: 1;
                min-width: 100px;
                padding: 0.75rem;
                background: rgba(64, 64, 64, 0.3);
                border: 1px solid rgba(148, 163, 184, 0.2);
                border-radius: 12px;
                cursor: pointer;
                transition: all 0.3s ease;
                text-align: center;
                font-size: 0.85rem;
            }

            .mobile-nav-item:hover {
                background: rgba(74, 85, 104, 0.5);
                border-color: #a3a3a3;
            }

            .main-content {
                flex-direction: column;
                margin: 0 !important;
                padding: 0 !important;
                border-radius: 0 !important;
                box-shadow: none !important;
                background: var(--bg-primary) !important;
                height: calc(100vh - var(--header-height)) !important;
            }

            .chat-area {
                padding: 65px 8px 100px 8px; /* Espacio para header fijo en la parte superior y input fijo en la parte inferior */
                margin: 0 !important;
                height: calc(100vh - var(--header-height)) !important;
            }

            /* Ajustes para elementos de chat */
            .message {
                padding: 10px 12px;
                margin-bottom: 8px;
                margin-left: 8px;
                margin-right: 8px;
                width: calc(100% - 16px); /* Aprovechar todo el espacio horizontal */
                max-width: 100% !important;
            }

            .message-content {
                max-width: 100% !important;
                width: calc(100% - 40px) !important; /* Considerando el avatar */
                word-break: break-word; /* Asegurar que el texto se rompa correctamente en pantallas estrechas */
            }

            .message-text {
                word-wrap: break-word;
                overflow-wrap: break-word;
            }

            .message-input-container {
                margin-bottom: 0;
                padding: 8px;
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                background: var(--bg-primary);
                border-top: 1px solid var(--border-color);
                z-index: 100;
            }

            .message-input {
                min-height: 60px;
                max-height: 120px;
                padding: 10px 12px;
                font-size: 0.9rem;
                width: 100%;
                box-sizing: border-box;
            }

            /* Ajustes para los botones de acciones */
            .input-actions {
                justify-content: center !important;
                flex-wrap: wrap;
                gap: 4px;
                max-width: 100%;
                overflow-x: auto;
                padding-bottom: 4px;
                -ms-overflow-style: none;
                scrollbar-width: none;
            }

            .input-actions::-webkit-scrollbar {
                display: none;
            }

            .input-action-btn {
                width: 32px;
                height: 32px;
                flex-shrink: 0;
            }

            .input-action-btn i {
                width: 16px !important;
                height: 16px !important;
            }

            .divider {
                display: none;
            }

            .send-btn {
                padding: 8px 16px;
                font-size: 0.8rem;
                min-height: 40px;
            }

            /* Ajustes para el header */
            .top-header {
                padding: 0 8px;
                height: 50px;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                z-index: 2000;
                margin: 0;
            }

            .header-logo .logo-text {
                font-size: 1.1rem;
            }

            .header-status {
                display: none; /* Ocultar información detallada en móviles pequeños */
            }

            /* Ajustes para los controles de funcionalidad */
            .input-controls {
                flex-direction: column;
                gap: 0;
                padding-top: 4px;
                width: 100%;
            }

            .input-actions {
                order: 2;
                width: 100%;
            }

            .input-controls {
                order: 1;
                width: 100%;
            }

            /* Ajustes para botones de funcionalidad para que usen mejor el espacio */
            .input-action-btn, .send-btn {
                flex-shrink: 0;
            }

            /* Ajustes para el área de mensajes - Aprovechar máximo espacio vertical */
            .chat-messages {
                padding: 8px;
                height: calc(100vh - 140px) !important; /* Considerando header fijo (50px) + input container fijo (90px) */
                overflow-y: auto;
                margin-bottom: 0;
                box-sizing: border-box;
            }
        }

        /* Punto de quiebre adicional para móviles pequeños */
        @media (max-width: 480px) {
            .top-header {
                padding: 0 8px;
                height: 46px;
            }

            .message-input {
                min-height: 70px;
                padding: 8px 10px;
                font-size: 0.85rem;
            }

            /* Ajustes específicos para mejor experiencia móvil */
            .message-input {
                min-height: 80px;
                max-height: 150px;
            }

            .message-input:focus {
                min-height: 100px;
                max-height: 200px;
            }

            .message-content {
                max-width: 80%;
            }

            .message {
                padding: 8px 10px;
            }

            .input-action-btn {
                width: 30px;
                height: 30px;
            }

            .header-logo .logo-text {
                font-size: 1.1rem;
            }

            .icon-btn {
                width: 36px;
                height: 36px;
            }

            .icon-btn i {
                width: 18px !important;
                height: 18px !important;
            }

            /* Ajustes para el contenedor de entrada de mensajes */
            .message-input-container {
                padding: 8px;
            }

            /* Asegurar que los botones no se superpongan */
            .input-controls {
                flex-direction: column;
                align-items: stretch;
                gap: 8px;
            }

            .input-actions {
                justify-content: center;
            }

            /* Mejoras específicas para experiencia táctil en móviles */
            .touch-target {
                min-height: 44px; /* Tamaño mínimo para toque en móviles */
                min-width: 44px;
            }

            .message-input {
                /* Asegurar buen tamaño para toque en móviles */
                line-height: 1.5;
            }
        }

        /* Ajustes para teclado virtual en móviles */
        @media (hover: none) and (pointer: coarse) {
            .message-input {
                font-size: 16px; /* Prevenir zoom automático en iOS */
            }

            /* Mejoras de rendimiento para dispositivos móviles */
            .chat-message, .input-action-btn, .icon-btn, .nav-item, .btn {
                -webkit-touch-callout: none; /* Evitar menú contextual en iOS */
                -webkit-user-select: none; /* Evitar selección de texto al tocar */
                -webkit-tap-highlight-color: transparent; /* Eliminar highlight en iOS */
            }
        }

        /* Mejoras de scroll para dispositivos móviles */
        @media (max-width: 768px) {
            .chat-messages {
                -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
                overflow-x: hidden;
            }

            body {
                -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
            }

            /* Evitar problemas de layout en móviles */
            .chat-area {
                -webkit-overflow-scrolling: touch;
            }
        }

        /* Ajustes para móviles muy pequeños */
        @media (max-width: 360px) {
            .message-content {
                max-width: 75%;
            }

            .input-action-btn {
                width: 28px;
                height: 28px;
            }

            .input-action-btn i {
                width: 14px !important;
                height: 14px !important;
            }

            .message-input {
                min-height: 60px;
                padding: 6px 8px;
                font-size: 0.8rem;
            }

            .send-btn {
                padding: 8px 12px;
                font-size: 0.75rem;
            }
        }

        /* Estilos para botones móviles de sidebar */
        .mobile-sidebar-toggle {
            display: none; /* Se muestra solo en móviles */
            flex-direction: column;
            gap: 8px;
        }

        /* Logo - Flat */
        .logo-link {
            text-decoration: none;
        }

        .logo-gradient {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--text-primary);
            letter-spacing: -0.02em;
        }

        /* Estilos específicos para la creación de grupo de trabajo */
        .crew-header {
            text-align: center;
            margin-bottom: 24px;
            padding: 0 16px;
        }

        .crew-logo-container {
            display: flex;
            justify-content: center;
            margin-bottom: 8px;
        }

        .crew-subtitle {
            color: #94a3b8;
            font-size: 0.9rem;
            margin-top: 4px;
        }

        .form-group-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .agent-selector-grid {
            display: grid;
            grid-template-columns: 1fr 1fr auto;
            gap: 12px;
            align-items: center;
            width: 100%;
        }

        .btn-small {
            padding: 8px 12px !important;
            font-size: 0.85rem !important;
        }

        /* Estilos adicionales para mejor maquetación */
        .form-header {
            text-align: center;
            margin-bottom: 24px;
            padding: 0 16px;
        }

        .form-logo-container {
            display: flex;
            justify-content: center;
            margin-bottom: 8px;
        }

        .form-subtitle {
            color: #94a3b8;
            font-size: 0.9rem;
            margin-top: 4px;
        }

        .page-header {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 24px;
            padding: 0 16px;
        }

        .header-icon {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            background: rgba(64, 64, 64, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .header-content {
            flex: 1;
        }

        .header-content h2 {
            margin: 0 0 4px 0;
            font-size: 1.5rem;
        }

        .page-subtitle {
            color: #94a3b8;
            font-size: 0.9rem;
            margin: 0;
        }

        .header-content-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 16px;
            margin-bottom: 16px;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }

        .chat-info-fields {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

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

        .info-field label {
            font-size: 0.8rem;
            color: #94a3b8;
            margin: 0;
        }

        .project-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
            font-size: 0.8rem;
            color: #94a3b8;
        }

        .project-models {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.75rem;
        }
