/* ==========================================================================
   FerroCRM — Suite Nirvana Design System (Vanilla CSS)
   Paleta: Slate Dark / Navy Executive con Acentos Oro (#D4AF37) y Esmeralda (#10B981)
   ========================================================================== */

:root {
    --bg-main: #0B0F19;
    --bg-surface: #111827;
    --bg-card: #1F2937;
    --bg-card-hover: #283548;
    --bg-input: #111827;
    
    --navy-primary: #0B2545;
    --navy-light: #133E87;
    --gold-accent: #D4AF37;
    --gold-hover: #E5C158;
    
    --border-color: #374151;
    --border-subtle: #232D3F;
    
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 15px rgba(212, 175, 55, 0.25);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* LAYOUT PRINCIPAL */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.brand-core {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--gold-accent);
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    background-color: var(--color-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    position: relative;
    width: 100%;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(19, 62, 135, 0.4) 0%, rgba(11, 37, 69, 0.2) 100%);
    color: #fff;
    border-left: 3px solid var(--gold-accent);
}

.nav-icon {
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background-color: var(--navy-light);
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.nav-badge.alert {
    background-color: var(--color-danger);
    animation: pulse 1.5s infinite;
}

.nav-badge-dot.green {
    margin-left: auto;
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
    border: 1px solid var(--color-success);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.25);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.status-indicator.online {
    width: 8px;
    height: 8px;
    background-color: var(--color-success);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color-success);
}

.status-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.status-sub {
    font-size: 9.5px;
    color: var(--text-muted);
    display: block;
}

/* MAIN CONTENT */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TOPBAR */
.topbar {
    height: 68px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.view-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.view-tag {
    font-size: 11.5px;
    color: var(--text-secondary);
}

.topbar-kpis {
    display: flex;
    gap: 12px;
}

.kpi-chip {
    background-color: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kpi-label {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

.kpi-value.green { color: var(--color-success); }
.kpi-value.amber { color: var(--color-warning); }

.topbar-actions {
    display: flex;
    gap: 10px;
}

/* BOTONES */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-primary) 100%);
    color: #fff;
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    border-color: var(--gold-accent);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
}

/* VISTAS */
.views-wrapper {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.view-panel {
    display: none;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    padding: 24px;
}

.view-panel.active {
    display: block;
}

/* VISTA 1: CHAT INBOX */
#view-inbox {
    padding: 0;
    overflow: hidden;
}

.chat-container {
    display: flex;
    height: 100%;
}

.chat-sidebar {
    width: 340px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-search-bar {
    padding: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.chat-search-bar input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 12.5px;
    outline: none;
}

.chat-search-bar input:focus {
    border-color: var(--navy-light);
}

.chat-filters {
    padding: 8px 14px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-chip {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip.active {
    background-color: var(--navy-light);
    color: #fff;
    border-color: var(--navy-light);
}

.filter-chip.alert {
    border-color: rgba(239, 68, 68, 0.4);
    color: #F87171;
}

.filter-chip.alert.active {
    background-color: var(--color-danger);
    color: #fff;
}

.chat-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition);
}

.chat-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.chat-item.active {
    background-color: rgba(19, 62, 135, 0.2);
    border-left: 3px solid var(--gold-accent);
}

.chat-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--gold-accent);
    flex-shrink: 0;
}

.chat-details {
    flex-grow: 1;
    min-width: 0;
}

.chat-header-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.chat-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 10.5px;
    color: var(--text-muted);
}

.chat-snippet-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sla-badge-pill {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

/* CHAT VENTANA ACTIVA */
.chat-active-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
}

.chat-placeholder {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.chat-active-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.active-chat-header {
    height: 64px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.active-contact-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-avatar {
    width: 38px;
    height: 38px;
    background-color: var(--navy-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.contact-name {
    font-size: 14px;
    font-weight: 700;
}

.contact-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.branch-pill {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}

.messages-timeline {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: radial-gradient(circle at 50% 50%, rgba(19, 62, 135, 0.04) 0%, transparent 80%);
}

.message-bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    position: relative;
    font-size: 13px;
    line-height: 1.4;
}

.message-bubble.incoming {
    align-self: flex-start;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

.message-bubble.outgoing {
    align-self: flex-end;
    background: linear-gradient(135deg, #133E87 0%, #0B2545 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #fff;
    border-bottom-right-radius: 2px;
}

.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.tag-material {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-accent);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 6px;
}

.chat-compose-box {
    padding: 14px 20px;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-compose-box textarea {
    flex-grow: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-body);
    font-size: 13px;
    resize: none;
    outline: none;
}

.chat-compose-box textarea:focus {
    border-color: var(--gold-accent);
}

.btn-send {
    background: linear-gradient(135deg, var(--gold-accent) 0%, #B89628 100%);
    color: #0B2545;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-send:hover {
    box-shadow: var(--shadow-glow);
}

/* VISTA 2: GESTOR DE INSTANCIAS */
.instances-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.instance-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.instance-card:hover {
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.inst-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.inst-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inst-status-badge.connected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.inst-status-badge.qr-ready {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
    animation: pulse 2s infinite;
}

.inst-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.inst-phone {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.inst-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
    margin-top: 10px;
}

/* VISTA 3: KANBAN */
.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    height: calc(100% - 60px);
}

.kanban-col {
    background-color: rgba(31, 41, 55, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.kanban-col.win {
    border-top: 3px solid var(--color-success);
}

.col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.col-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
}

.col-count {
    background-color: var(--bg-surface);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.deal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.deal-card:hover {
    border-color: var(--gold-accent);
    transform: translateY(-2px);
}

.deal-title {
    font-weight: 600;
    font-size: 12.5px;
    margin-bottom: 6px;
}

.deal-amount {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    color: var(--color-success);
    margin-bottom: 6px;
}

.deal-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* VISTA 4: SLA TABLA */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.data-table th {
    background-color: var(--bg-surface);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
}

.data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* MODALES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 440px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 16px 0;
    padding: 16px;
    background-color: #fff;
    border-radius: var(--radius-md);
}

.qr-code-img {
    width: 220px;
    height: 220px;
}

.qr-timer {
    margin-top: 10px;
    font-size: 11px;
    color: #4B5563;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-pulse {
    width: 6px;
    height: 6px;
    background-color: var(--color-warning);
    border-radius: 50%;
}

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

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

.form-group input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    outline: none;
}

.form-group input:focus {
    border-color: var(--gold-accent);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   ESTILOS DEDICADOS: BOT DE AUTOMATIZACIONES & ALERTAS (CENTINELA)
   ========================================================================== */

.bot-view-header {
    background: linear-gradient(135deg, rgba(11, 37, 69, 0.7) 0%, rgba(19, 41, 61, 0.9) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.bot-badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34D399;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.status-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10B981;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.bot-header-metrics {
    display: flex;
    gap: 16px;
}

.bot-metric-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    text-align: center;
}

.bot-metric-card .m-val {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.bot-metric-card .m-val.green {
    color: #10B981;
}

.bot-metric-card .m-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.bot-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.bot-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

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

.bot-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-card-title h3 {
    font-size: 16px;
    font-weight: 700;
}

.bot-status-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bot-status-pill.connected {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.bot-status-pill.disconnected {
    background-color: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.bot-status-pill.scanning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.qr-canvas-holder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.bot-qr-image {
    width: 220px;
    height: 220px;
    object-fit: contain;
}

.qr-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #4B5563;
    font-size: 12px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #0B2545;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.qr-instructions p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.bot-connected-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 10px;
}

.connected-badge-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.connected-phone {
    font-size: 22px;
    font-weight: 800;
    color: #10B981;
    font-family: 'Outfit', sans-serif;
    margin: 8px 0;
}

.connected-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 380px;
    margin-bottom: 24px;
}

.connected-actions {
    display: flex;
    gap: 12px;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #EF4444;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.15);
}

.bot-switch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.switch-item-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.switch-item-info p {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 420px;
    line-height: 1.4;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #10B981;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.bot-trigger-box {
    margin-top: 16px;
    padding: 16px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-trigger-box h4 {
    font-size: 13.5px;
    color: #FBBF24;
    font-weight: 700;
    margin-bottom: 4px;
}

.bot-trigger-box p {
    font-size: 11.5px;
    color: var(--text-secondary);
}

.bot-destinatarios-box {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.bot-destinatarios-box h4 {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 10px;
}

.destinatarios-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.destinatarios-list li {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.bot-logs-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}

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

