    :root {
      --bg-base: #0b0f19;
      --bg-surface: #111827;
      --bg-card: rgba(17, 24, 39, 0.85);
      --border-color: rgba(255, 255, 255, 0.08);
      --accent-green: #10b981;
      --accent-green-glow: rgba(16, 185, 129, 0.25);
      --accent-blue: #3b82f6;
      --accent-cyan: #06b6d4;
      --accent-amber: #f59e0b;
      --accent-rose: #f43f5e;
      --text-main: #f9fafb;
      --text-muted: #9ca3af;
      --text-sub: #6b7280;
      --radius-sm: 8px;
      --radius-md: 14px;
      --radius-lg: 20px;
      --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 'Outfit', -apple-system, sans-serif;
      background: radial-gradient(circle at 15% 15%, #131c2e 0%, #0b0f19 60%, #070a10 100%);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    header {
      background: rgba(11, 15, 25, 0.8);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border-color);
      position: sticky;
      top: 0;
      z-index: 40;
      padding: 16px 32px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .brand-logo {
      width: 42px;
      height: 42px;
      background: linear-gradient(135deg, #10b981, #06b6d4);
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
    }

    .brand-text h1 {
      font-size: 19px;
      font-weight: 700;
      letter-spacing: -0.02em;
      background: linear-gradient(90deg, #ffffff, #d1d5db);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .brand-text p {
      font-size: 12px;
      color: var(--text-muted);
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .badge-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 500;
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.3);
      color: #34d399;
    }

    .badge-status::before {
      content: '';
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 8px #10b981;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 18px;
      border-radius: var(--radius-sm);
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: var(--transition);
      text-decoration: none;
    }

    .btn-primary {
      background: linear-gradient(135deg, #10b981, #059669);
      color: white;
      box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    }

    .btn-primary:hover {
      background: linear-gradient(135deg, #059669, #047857);
      transform: translateY(-1px);
    }

    .btn-secondary {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid var(--border-color);
      color: var(--text-main);
    }

    .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    .btn-danger {
      background: rgba(244, 63, 94, 0.12);
      border: 1px solid rgba(244, 63, 94, 0.3);
      color: #fb7185;
    }

    .btn-danger:hover {
      background: rgba(244, 63, 94, 0.22);
    }

    main {
      flex: 1;
      padding: 32px;
      max-width: 1400px;
      width: 100%;
      margin: 0 auto;
    }

    .hero-banner {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.06));
      border: 1px solid rgba(16, 185, 129, 0.18);
      border-radius: var(--radius-lg);
      padding: 24px 30px;
      margin-bottom: 28px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 20px;
    }

    .hero-info h2 {
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 6px;
    }

    .hero-info p {
      font-size: 13.5px;
      color: var(--text-muted);
      line-height: 1.5;
      max-width: 800px;
    }

    .section-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .section-title span {
      background: rgba(255, 255, 255, 0.08);
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 12px;
      color: var(--text-main);
    }

    .grid-instances {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
      gap: 20px;
    }

    .card-instance {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 22px;
      backdrop-filter: blur(12px);
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      transition: var(--transition);
      position: relative;
      overflow: hidden;
    }

    .card-instance:hover {
      border-color: rgba(255, 255, 255, 0.18);
      transform: translateY(-3px);
      box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    }

    .card-instance::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--card-accent, #3b82f6);
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 14px;
    }

    .category-pill {
      font-size: 11px;
      font-weight: 600;
      padding: 3px 8px;
      border-radius: 20px;
      background: rgba(16, 185, 129, 0.15);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .company-pill {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      padding: 3px 8px;
      border-radius: 6px;
      background: rgba(59, 130, 246, 0.15);
      border: 1px solid rgba(59, 130, 246, 0.3);
      color: #60a5fa;
    }

    .company-uphone {
      background: rgba(245, 158, 11, 0.15);
      border-color: rgba(245, 158, 11, 0.3);
      color: #fbbf24;
    }

    .instance-name {
      font-size: 17px;
      font-weight: 600;
      margin-top: 6px;
    }

    .instance-phone {
      font-family: 'JetBrains Mono', monospace;
      font-size: 13.5px;
      color: #34d399;
      margin-top: 3px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11.5px;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 999px;
    }

    .status-badge.CONNECTED {
      background: rgba(16, 185, 129, 0.15);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .status-badge.QR_READY {
      background: rgba(245, 158, 11, 0.15);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.3);
      animation: pulse 2s infinite;
    }

    .status-badge.DISCONNECTED,
    .status-badge.STARTING,
    .status-badge.RECONNECTING {
      background: rgba(244, 63, 94, 0.15);
      color: #fb7185;
      border: 1px solid rgba(244, 63, 94, 0.3);
    }

    @keyframes pulse {

      0%,
      100% {
        opacity: 1;
      }

      50% {
        opacity: 0.6;
      }
    }

    .card-body {
      margin: 14px 0 18px 0;
      padding-top: 14px;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .info-row {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-bottom: 10px;
    }

    .info-label {
      font-size: 11px;
      color: var(--text-sub);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .info-value {
      font-size: 12px;
      font-family: 'JetBrains Mono', monospace;
      color: var(--text-muted);
      word-break: break-all;
      background: rgba(0, 0, 0, 0.2);
      padding: 6px 10px;
      border-radius: 6px;
      border: 1px solid rgba(255, 255, 255, 0.04);
    }

    .card-actions {
      display: flex;
      gap: 8px;
    }

    .card-actions .btn {
      flex: 1;
      justify-content: center;
      font-size: 12px;
      padding: 8px 12px;
    }

    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(8px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 50;
      padding: 20px;
    }

    .modal-overlay.active {
      display: flex;
    }

    .modal-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      width: 100%;
      max-width: 520px;
      padding: 28px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
    }

    .modal-header h3 {
      font-size: 18px;
      font-weight: 700;
    }

    .btn-close {
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-size: 22px;
      cursor: pointer;
    }

    .form-group {
      margin-bottom: 16px;
    }

    .form-label {
      display: block;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      margin-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .form-input,
    .form-select,
    .form-textarea {
      width: 100%;
      background: rgba(0, 0, 0, 0.35);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: var(--radius-sm);
      padding: 10px 14px;
      color: var(--text-main);
      font-family: inherit;
      font-size: 13.5px;
      outline: none;
    }

    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
      border-color: var(--accent-green);
      box-shadow: 0 0 0 3px var(--accent-green-glow);
    }

    .presets-row {
      display: flex;
      gap: 8px;
      margin-top: 6px;
    }

    .preset-btn {
      font-size: 11px;
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid var(--border-color);
      color: var(--accent-cyan);
      padding: 4px 8px;
      border-radius: 4px;
      cursor: pointer;
    }

    .preset-btn:hover {
      background: rgba(255, 255, 255, 0.12);
    }

    .qr-container {
      text-align: center;
      padding: 18px;
      background: white;
      border-radius: var(--radius-md);
      margin: 16px 0;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 270px;
    }

    .qr-container img {
      max-width: 250px;
      width: 100%;
      height: auto;
      display: block;
    }

    .qr-instructions {
      font-size: 12.5px;
      color: var(--text-muted);
      line-height: 1.5;
      text-align: center;
      margin-bottom: 14px;
    }

    .empty-state {
      text-align: center;
      padding: 60px 20px;
      background: var(--bg-card);
      border: 1px dashed var(--border-color);
      border-radius: var(--radius-lg);
    }

    .format-helper-box {
      margin-top: 8px;
      padding: 10px 14px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.5;
      transition: var(--transition);
    }

    .format-helper-box strong {
      color: #60a5fa;
    }

    .format-helper-code {
      margin-top: 6px;
      background: rgba(0, 0, 0, 0.4);
      padding: 6px 10px;
      border-radius: 6px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: #a7f3d0;
      white-space: pre;
      overflow-x: auto;
    }

    .label-with-tooltip {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .tooltip-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: rgba(59, 130, 246, 0.2);
      color: #60a5fa;
      font-size: 11px;
      font-weight: bold;
      cursor: help;
      position: relative;
    }

    .tooltip-icon:hover::after {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 130%;
      left: 50%;
      transform: translateX(-50%);
      background: #111827;
      color: #f3f4f6;
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 11.5px;
      font-weight: normal;
      white-space: normal;
      width: max-content;
      max-width: 320px;
      line-height: 1.45;
      z-index: 9999;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.15);
      pointer-events: none;
    }

    /* Tabs y bloques de código para Modal Informativo de Formatos */
    .format-tabs {
      display: flex;
      gap: 10px;
      border-bottom: 1px solid var(--border-color);
      margin-bottom: 16px;
    }

    .format-tab-btn {
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--text-muted);
      padding: 8px 16px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
    }

    .format-tab-btn:hover {
      color: var(--text-main);
    }

    .format-tab-btn.active {
      color: var(--accent-cyan);
      border-bottom-color: var(--accent-cyan);
    }

    .format-tab-pane {
      display: none;
    }

    .format-tab-pane.active {
      display: block;
    }

    .code-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(0, 0, 0, 0.45);
      padding: 7px 12px;
      border-top-left-radius: 6px;
      border-top-right-radius: 6px;
      border: 1px solid var(--border-color);
      border-bottom: none;
      font-size: 11.5px;
      color: var(--text-muted);
    }

    .code-copy-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: var(--text-main);
      padding: 3px 9px;
      border-radius: 4px;
      font-size: 11px;
      cursor: pointer;
      transition: var(--transition);
    }

    .code-copy-btn:hover {
      background: rgba(255, 255, 255, 0.18);
      color: var(--accent-cyan);
    }

    .format-code-block {
      background: rgba(0, 0, 0, 0.55);
      border: 1px solid var(--border-color);
      border-bottom-left-radius: 6px;
      border-bottom-right-radius: 6px;
      padding: 10px 14px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      color: #a7f3d0;
      white-space: pre;
      overflow-x: auto;
      line-height: 1.45;
    }
