    :root {
      --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
      --panel-bg: rgba(30, 41, 59, 0.7);
      --border-color: rgba(255, 255, 255, 0.08);
      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --primary: #3b82f6;
      --primary-hover: #2563eb;
      --success: #10b981;
      --success-glow: rgba(16, 185, 129, 0.15);
      --danger: #ef4444;
      --danger-glow: rgba(239, 68, 68, 0.15);
      --warning: #f59e0b;
      --warning-glow: rgba(245, 158, 11, 0.15);
      --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }

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

    body {
      font-family: 'Inter', sans-serif;
      background: var(--bg-gradient);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
    }

    header {
      background: rgba(15, 23, 42, 0.6);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border-color);
      padding: 1.25rem 2rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .logo-container {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .logo-badge {
      background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
      color: white;
      font-family: 'Outfit', sans-serif;
      font-weight: 800;
      padding: 0.5rem 0.75rem;
      border-radius: 12px;
      font-size: 1.25rem;
      box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    }

    .logo-title {
      font-family: 'Outfit', sans-serif;
      font-size: 1.35rem;
      font-weight: 700;
      letter-spacing: -0.5px;
    }

    .logo-title span {
      background: linear-gradient(to right, #3b82f6, #60a5fa);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .header-status {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .badge-mode {
      background: rgba(59, 130, 246, 0.15);
      border: 1px solid rgba(59, 130, 246, 0.3);
      color: #93c5fd;
      padding: 0.35rem 0.75rem;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .badge-db {
      background: rgba(16, 185, 129, 0.15);
      border: 1px solid rgba(16, 185, 129, 0.3);
      color: #34d399;
      padding: 0.35rem 0.75rem;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .badge-status-mode {
      padding: 0.35rem 0.75rem;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 700;
      letter-spacing: 0.5px;
    }

    .badge-status-mode.pruebas {
      background: var(--warning-glow);
      border: 1px solid rgba(245, 158, 11, 0.3);
      color: #fbbf24;
    }

    .badge-status-mode.produccion {
      background: var(--danger-glow);
      border: 1px solid rgba(239, 68, 68, 0.3);
      color: #f87171;
    }

    #bot-reception-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.3);
      color: #34d399;
      font-weight: 700;
      padding: 0.35rem 0.75rem;
      border-radius: 20px;
      font-size: 0.8rem;
      letter-spacing: 0.5px;
    }

    .main-container {
      flex: 1;
      display: grid;
      grid-template-columns: 420px 1fr 400px;
      gap: 1.5rem;
      padding: 1.5rem;
      margin: 0;
      width: 100%;
      max-width: 100%;
    }

    @media (max-width: 1400px) {
      .main-container {
        grid-template-columns: 360px 1fr 340px;
      }
    }

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

    /* Estilos de Paneles/Tarjetas */
    .glass-panel {
      background: var(--panel-bg);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid var(--border-color);
      border-radius: 20px;
      padding: 1.5rem;
      box-shadow: var(--glass-shadow);
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .panel-title {
      font-family: 'Outfit', sans-serif;
      font-size: 1.15rem;
      font-weight: 600;
      border-bottom: 1px solid var(--border-color);
      padding-bottom: 0.75rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    /* Form Controles */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0.75rem 1.25rem;
      font-family: 'Inter', sans-serif;
      font-size: 0.9rem;
      font-weight: 600;
      border-radius: 12px;
      border: none;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      width: 100%;
      gap: 0.5rem;
    }

    .btn-primary {
      background: var(--primary);
      color: white;
    }

    .btn-primary:hover {
      background: var(--primary-hover);
      transform: translateY(-1px);
    }

    .btn-secondary {
      background: rgba(255, 255, 255, 0.08);
      color: var(--text-main);
      border: 1px solid var(--border-color);
    }

    .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.15);
    }

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

    .btn-success:hover {
      background: #059669;
      transform: translateY(-1px);
    }

    .btn-gear {
      background: rgba(255, 255, 255, 0.07);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      padding: 0.5rem 1rem;
      border-radius: 12px;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      transition: background 0.2s;
    }

    .btn-gear:hover {
      background: rgba(255, 255, 255, 0.15);
    }

    /* Switch de Bot */
    .switch-container {
      background: rgba(15, 23, 42, 0.4);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.75rem;
      text-align: center;
    }

    .bot-state-label {
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-muted);
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 60px;
      height: 34px;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #475569;
      transition: .4s;
      border-radius: 34px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 26px;
      width: 26px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      transition: .4s;
      border-radius: 50%;
      box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    input:checked + .slider {
      background-color: var(--success);
    }

    input:checked + .slider:before {
      transform: translateX(26px);
    }

    .status-indicator {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 1.1rem;
      font-weight: 700;
      font-family: 'Outfit', sans-serif;
      margin-top: 0.25rem;
    }

    .status-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      display: inline-block;
    }

    .status-dot.active {
      background-color: var(--success);
      box-shadow: 0 0 12px var(--success);
      animation: pulse 1.5s infinite;
    }

    .status-dot.inactive {
      background-color: var(--danger);
      box-shadow: 0 0 12px var(--danger);
    }

    /* Radar Pulse para el Bot de Recepción */
    .radar-container {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 12px;
      height: 12px;
      margin-right: 0.15rem;
    }

    .radar-dot {
      width: 8px;
      height: 8px;
      background-color: var(--success);
      border-radius: 50%;
      z-index: 2;
    }

    .radar-wave {
      position: absolute;
      width: 8px;
      height: 8px;
      background-color: var(--success);
      border-radius: 50%;
      animation: radar-wave-anim 1.8s infinite linear;
      z-index: 1;
    }

    @keyframes radar-wave-anim {
      0% { transform: scale(1); opacity: 0.8; }
      100% { transform: scale(3); opacity: 0; }
    }

    @keyframes pulse {
      0% { transform: scale(0.9); opacity: 0.6; }
      50% { transform: scale(1.1); opacity: 1; }
      100% { transform: scale(0.9); opacity: 0.6; }
    }

    /* Tabla de Citas */
    .table-container {
      overflow-x: auto;
      overflow-y: auto;
      border: 1px solid var(--border-color);
      border-radius: 14px;
      background: rgba(15, 23, 42, 0.3);
      position: relative;
    }

    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      text-align: left;
      font-size: 0.85rem;
    }

    th {
      position: sticky;
      top: 0;
      background: rgba(15, 23, 42, 0.95);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 10;
      padding: 0.85rem 1rem;
      font-weight: 600;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border-color);
    }

    td {
      padding: 0.85rem 1rem;
      border-bottom: 1px solid var(--border-color);
      vertical-align: middle;
    }

    tr:last-child td {
      border-bottom: none;
    }

    tr:hover td {
      background: rgba(255, 255, 255, 0.02);
    }

    /* Checkbox personalizado */
    .checkbox-col {
      width: 45px;
      text-align: center;
    }

    input[type="checkbox"].appt-check, input[type="checkbox"].select-all-check {
      cursor: pointer;
      width: 18px;
      height: 18px;
      accent-color: var(--primary);
    }

    /* Badges */
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 0.25rem 0.5rem;
      border-radius: 6px;
      font-size: 0.75rem;
      font-weight: 600;
    }

    .badge-reservado {
      background: var(--warning-glow);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .badge-reservado-sc {
      background: rgba(245, 158, 11, 0.08);
      color: #fbbf24;
      border: 1px dashed rgba(245, 158, 11, 0.5);
    }

    .badge-confirmado {
      background: var(--success-glow);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .badge-cancelado {
      background: var(--danger-glow);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .badge-neutral {
      background: rgba(255, 255, 255, 0.07);
      color: var(--text-muted);
      border: 1px solid var(--border-color);
    }

    .badge-valid-phone {
      background: rgba(16, 185, 129, 0.1);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.2);
    }

    .badge-invalid-phone {
      background: rgba(239, 68, 68, 0.1);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.2);
    }

    .badge-test-phone {
      background: var(--warning-glow);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.3);
      font-size: 0.7rem;
      margin-left: 0.25rem;
    }

    .badge-confirmado1 {
      background: rgba(59, 130, 246, 0.15);
      color: #60a5fa;
      border: 1px solid rgba(59, 130, 246, 0.3);
    }

    /* Bell and Notification dropdown styles */
    .btn-bell {
      transition: transform 0.2s ease, opacity 0.2s ease;
    }
    .btn-bell:hover {
      transform: scale(1.1);
      opacity: 0.85;
    }
    .notification-bell-container {
      margin-left: 0.5rem;
    }
    .notification-dropdown {
      backdrop-filter: blur(8px);
      background: rgba(24, 24, 27, 0.95) !important; /* Force a beautiful dark transparent background */
    }
    .notification-item {
      padding: 0.65rem 0.75rem;
      border-radius: 8px;
      font-size: 0.78rem;
      line-height: 1.25;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.05);
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      position: relative;
      text-align: left;
    }
    .notification-item:hover {
      background: rgba(255, 255, 255, 0.06);
      border-color: var(--primary);
    }
    .notification-item.unread {
      background: rgba(59, 130, 246, 0.08);
      border-color: rgba(59, 130, 246, 0.2);
    }
    .notification-item.unread::after {
      content: '';
      position: absolute;
      top: 8px;
      right: 8px;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #3b82f6;
    }
    .notification-item .meta {
      font-size: 0.68rem;
      color: var(--text-muted);
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 0.25rem;
    }
    .notification-item .meta .time {
      color: var(--text-muted);
    }

    /* Row highlight glow */
    @keyframes row-glow {
      0% {
        background-color: rgba(59, 130, 246, 0.4);
        box-shadow: inset 0 0 15px rgba(59, 130, 246, 0.5);
      }
      100% {
        background-color: transparent;
      }
    }
    .highlight-row {
      animation: row-glow 2.5s ease-out;
      border: 2px solid #3b82f6 !important;
    }

    /* Style select to match badges */
    .status-select {
      background: transparent;
      cursor: pointer;
      padding: 0.2rem 0.4rem;
      border-radius: 6px;
      font-size: 0.72rem;
      font-weight: 600;
      transition: all 0.2s ease;
      text-align: center;
      width: 100%;
    }
    .status-select:hover {
      filter: brightness(1.15);
    }
    .status-select option {
      background: #18181b;
      color: #fff;
    }

    /* Filtros */
    .filter-tabs {
      display: flex;
      background: rgba(15, 23, 42, 0.5);
      border-radius: 12px;
      padding: 0.25rem;
      border: 1px solid var(--border-color);
      width: fit-content;
    }

    .tab-btn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      padding: 0.5rem 1rem;
      font-size: 0.85rem;
      font-weight: 600;
      border-radius: 9px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .tab-btn.active {
      background: var(--primary);
      color: white;
    }

    /* Historial de Mensajes */
    .msg-list {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      overflow-y: auto;
      max-height: 380px;
      padding-right: 0.25rem;
    }

    .msg-list::-webkit-scrollbar {
      width: 6px;
    }

    .msg-list::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.15);
      border-radius: 10px;
    }

    .msg-card {
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 0.75rem 1rem;
      font-size: 0.8rem;
      position: relative;
    }

    .msg-card.salida {
      background: rgba(59, 130, 246, 0.08);
      border-left: 3px solid var(--primary);
    }

    .msg-card.entrada {
      background: rgba(16, 185, 129, 0.08);
      border-left: 3px solid var(--success);
    }

    .msg-header {
      display: flex;
      justify-content: space-between;
      color: var(--text-muted);
      margin-bottom: 0.35rem;
      font-size: 0.75rem;
    }

    .msg-body {
      color: var(--text-main);
      line-height: 1.4;
    }

    /* Simulación panel */
    .sim-panel {
      background: rgba(15, 23, 42, 0.4);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .form-group {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }

    label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-muted);
    }

    select, input[type="text"], textarea {
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      padding: 0.6rem 0.85rem;
      border-radius: 8px;
      outline: none;
      font-family: inherit;
      font-size: 0.85rem;
      width: 100%;
    }

    select:focus, input[type="text"]:focus, textarea:focus {
      border-color: var(--primary);
    }

    textarea {
      resize: vertical;
      font-family: 'Courier New', Courier, monospace;
      font-weight: bold;
      font-size: 0.8rem;
      line-height: 1.4;
    }

    .input-date-container {
      display: flex;
      gap: 0.5rem;
      align-items: center;
    }

    .input-date-container input {
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      padding: 0.5rem;
      border-radius: 8px;
      font-family: inherit;
      font-size: 0.85rem;
    }

    /* Configuración modo de trabajo */
    .mode-selector {
      display: flex;
      gap: 0.5rem;
      background: rgba(15, 23, 42, 0.6);
      border-radius: 10px;
      padding: 0.2rem;
      border: 1px solid var(--border-color);
    }

    .mode-btn {
      flex: 1;
      background: transparent;
      border: none;
      color: var(--text-muted);
      padding: 0.45rem;
      font-size: 0.8rem;
      font-weight: 700;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .mode-btn.active.pruebas {
      background: var(--warning);
      color: #0f172a;
    }

    .mode-btn.active.produccion {
      background: var(--danger);
      color: white;
    }

    /* Loader */
    .loader {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 3px solid rgba(255,255,255,0.3);
      border-radius: 50%;
      border-top-color: white;
      animation: spin 1s ease-in-out infinite;
    }

    /* Estilos del Modal */
    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(15, 23, 42, 0.8);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 1000;
      display: none;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .modal-overlay.open {
      display: flex;
      opacity: 1;
    }

    .modal-window {
      background: #1e293b;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 24px;
      width: 550px;
      max-width: 90%;
      box-shadow: 0 20px 50px rgba(0,0,0,0.5);
      transform: translateY(-30px);
      transition: transform 0.3s ease;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .modal-overlay.open .modal-window {
      transform: translateY(0);
    }

    .modal-header {
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(15, 23, 42, 0.3);
    }

    .modal-title {
      font-family: 'Outfit', sans-serif;
      font-size: 1.25rem;
      font-weight: 700;
    }

    .modal-close-btn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-size: 1.5rem;
      cursor: pointer;
      line-height: 1;
    }

    .modal-close-btn:hover {
      color: white;
    }

    .modal-body {
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      max-height: 70vh;
      overflow-y: auto;
    }

    .modal-footer {
      padding: 1.25rem 1.5rem;
      border-top: 1px solid var(--border-color);
      display: flex;
      gap: 0.75rem;
      justify-content: flex-end;
      background: rgba(15, 23, 42, 0.3);
    }

    /* Vinculación Card (QR) */
    .qr-link-card {
      background: rgba(15, 23, 42, 0.5);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 1rem;
      display: flex;
      gap: 1rem;
      align-items: center;
    }

    .qr-status-indicator {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }

    .qr-badge {
      background: rgba(16, 185, 129, 0.12);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
      padding: 0.25rem 0.5rem;
      border-radius: 6px;
      font-size: 0.7rem;
      font-weight: 700;
      width: fit-content;
    }

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

    /* Estilos del Navegador Principal */
    .main-nav {
      display: flex;
      gap: 1rem;
      padding: 0.5rem 1.5rem;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border-color);
      max-width: 1650px;
      margin: 0 auto;
      width: 100%;
      border-radius: 0 0 16px 16px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .nav-link {
      background: none;
      border: 1px solid transparent;
      color: var(--text-muted);
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      padding: 0.5rem 1.2rem;
      border-radius: 8px;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .nav-link:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.05);
    }
    
    .nav-link.active {
      color: #fff;
      background: rgba(99, 102, 241, 0.15);
      border-color: rgba(99, 102, 241, 0.4);
      box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
    }

    /* Estilos del Editor de Flujos */
    .editor-grid {
      display: grid;
      grid-template-columns: 380px 1fr;
      gap: 1.5rem;
      width: 100%;
      margin-top: 1rem;
    }

    .properties-panel {
      display: flex;
      flex-direction: column;
      gap: 1.2rem;
    }

    .canvas-panel {
      overflow: auto;
      min-height: 600px;
      max-height: 800px;
      position: relative;
      background: rgba(10, 10, 15, 0.4);
      border-radius: 20px;
      border: 1px solid var(--border-color);
      padding: 2rem;
    }

    .flow-tree-container {
      position: relative;
    }

    .flow-tree ul {
      list-style-type: none;
      padding-left: 36px;
      position: relative;
      margin: 0;
    }

    .flow-tree ul::before {
      content: '';
      position: absolute;
      left: 12px;
      top: 0;
      bottom: 0;
      width: 2px;
      background: rgba(255, 255, 255, 0.08);
    }

    .flow-tree li {
      position: relative;
      margin: 16px 0;
    }

    .flow-tree li::before {
      content: '';
      position: absolute;
      left: -24px;
      top: 22px;
      width: 24px;
      height: 2px;
      background: rgba(255, 255, 255, 0.08);
    }

    .flow-node-card {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 14px;
      padding: 12px 16px;
      display: inline-flex;
      flex-direction: column;
      gap: 6px;
      cursor: pointer;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      user-select: none;
      min-width: 240px;
      max-width: 320px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .flow-node-card:hover {
      background: rgba(255, 255, 255, 0.06);
      border-color: rgba(255, 255, 255, 0.2);
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .flow-node-card.selected {
      background: rgba(99, 102, 241, 0.12);
      border-color: rgba(99, 102, 241, 0.6);
      box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
    }

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

    .node-title {
      font-weight: 600;
      font-size: 0.85rem;
      color: #fff;
    }

    .node-badge {
      font-size: 0.65rem;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 6px;
      text-transform: uppercase;
    }

    /* Tipos de nodo */
    .node-msg {
      border-left: 4px solid #10b981;
    }
    .node-msg .node-badge {
      background: rgba(16, 185, 129, 0.15);
      color: #34d399;
    }

    .node-cond {
      border-left: 4px solid #3b82f6;
    }
    .node-cond .node-badge {
      background: rgba(59, 130, 246, 0.15);
      color: #60a5fa;
    }

    .node-act {
      border-left: 4px solid #8b5cf6;
    }
    .node-act .node-badge {
      background: rgba(139, 92, 246, 0.15);
      color: #a78bfa;
    }

    .node-desc {
      font-size: 0.75rem;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }

    .branch-label {
      font-size: 0.65rem;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 4px;
      position: absolute;
      left: -28px;
      top: 10px;
      z-index: 10;
    }

    .branch-yes {
      background: rgba(16, 185, 129, 0.2);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .branch-no {
      background: rgba(239, 68, 68, 0.2);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .var-pill {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 6px;
      padding: 2px 6px;
      font-size: 0.7rem;
      cursor: pointer;
      display: inline-block;
      margin: 2px;
      color: #93c5fd;
      transition: background 0.15s;
    }

    .var-pill:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
    }

    .patient-link {
      color: #60a5fa;
      text-decoration: none;
      font-weight: 600;
      transition: color 0.15s ease;
      cursor: pointer;
    }
    .patient-link:hover {
      color: #3b82f6;
      text-decoration: underline;
    }

    /* Caja de totales */
    .stats-row {
      display: flex;
      gap: 0.5rem;
      justify-content: space-between;
      margin-bottom: 1rem;
      width: 100%;
    }

    .stat-card {
      flex: 1 1 0px;
      background: rgba(30, 41, 59, 0.4);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 0.6rem 0.8rem;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 0.2rem;
      position: relative;
      overflow: hidden;
    }

    .stat-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: transparent;
      transition: background-color 0.2s ease;
    }

    .stat-card.active::before {
      background-color: var(--card-color, var(--primary));
    }

    .stat-card:hover {
      background: rgba(30, 41, 59, 0.6);
      border-color: rgba(255, 255, 255, 0.15);
      transform: translateY(-2px);
    }

    .stat-card.active {
      background: rgba(30, 41, 59, 0.75);
      border-color: var(--card-color, var(--primary));
      box-shadow: 0 0 12px rgba(59, 130, 246, 0.12);
    }

    .stat-label {
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      white-space: nowrap;
    }

    .stat-value-container {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 0.4rem;
    }

    .stat-value {
      font-family: 'Outfit', sans-serif;
      font-size: 1.25rem;
      font-weight: 700;
      color: #ffffff;
      line-height: 1;
    }

    .stat-percent {
      font-size: 0.75rem;
      font-weight: 600;
    }

    /* Estilos de Burbujas de Chat */
    .chat-bubble {
      max-width: 75%;
      padding: 0.6rem 0.85rem;
      font-size: 0.82rem;
      line-height: 1.35;
      position: relative;
      word-break: break-word;
      border-radius: 12px;
    }

    .chat-bubble.outbound {
      align-self: flex-end;
      background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
      color: #ffffff;
      border-radius: 14px 14px 4px 14px;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .chat-bubble.inbound {
      align-self: flex-start;
      background: rgba(255, 255, 255, 0.06);
      color: var(--text-main);
      border-radius: 14px 14px 14px 4px;
      border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .chat-meta {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 0.25rem;
      font-size: 0.65rem;
      color: rgba(255, 255, 255, 0.4);
      margin-top: 0.25rem;
    }

    .chat-status-icon {
      font-weight: bold;
    }
    .chat-status-pending { color: #fbbf24; }
    .chat-status-sent { color: #34d399; }
    .chat-status-failed { color: #f87171; }