/* ==========================================================================
   CSS CUSTOM PROPERTIES & GENERAL STYLES
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-main: #0a0b10;
    --bg-card: rgba(20, 22, 34, 0.65);
    --bg-card-border: rgba(255, 255, 255, 0.05);
    --sidebar-width: 260px;
    
    /* Neon Colors */
    --color-primary: #8a2be2;      /* Neon Violet */
    --color-primary-glow: rgba(138, 43, 226, 0.4);
    --color-accent: #00f0ff;       /* Neon Cyan */
    --color-accent-glow: rgba(0, 240, 255, 0.3);
    --color-success: #00ff88;      /* Neon Emerald */
    --color-warning: #ffb700;      /* Warning Amber */
    
    /* Text Colors */
    --text-main: #f0f2f5;
    --text-muted: #8b92ad;
    --text-glow: rgba(240, 242, 245, 0.15);
    
    /* UI Sizing & Transitions */
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* ==========================================================================
   APP LAYOUT (SIDEBAR + MAIN CONTENT)
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(12, 13, 21, 0.95);
    border-right: 1px solid var(--bg-card-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 28px;
    color: var(--color-accent);
    filter: drop-shadow(0 0 8px var(--color-accent-glow));
}

.logo h2 {
    font-size: 22px;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.logo span {
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 18px;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background-color: rgba(138, 43, 226, 0.08);
    border: 1px solid rgba(138, 43, 226, 0.15);
}

.nav-item.active {
    background-color: rgba(138, 43, 226, 0.15);
    border: 1px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.1);
}

.nav-item.active i {
    color: var(--color-accent);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--bg-card-border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-mini {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

.user-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.user-info span {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-success);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 40px;
    background: radial-gradient(circle at top right, rgba(138, 43, 226, 0.06), transparent 45%),
                radial-gradient(circle at bottom left, rgba(0, 240, 255, 0.04), transparent 40%),
                #08090d;
    min-height: 100vh;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.panel-header h1 {
    font-size: 32px;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.panel-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ==========================================================================
   TAB 1: INTERACT PANELS (HOLOGRAM + CHAT)
   ========================================================================== */
.interact-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 30px;
    height: calc(100vh - 180px);
    min-height: 550px;
}

/* Hologram Viewer Card */
.hologram-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 30px 20px;
    background: linear-gradient(180deg, rgba(20, 22, 34, 0.8), rgba(12, 13, 21, 0.9));
}

.hologram-viewport {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.hologram-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.avatar-ring-outer {
    position: absolute;
    width: 256px;
    height: 256px;
    border-radius: 50%;
    border: 2px dashed rgba(0, 240, 255, 0.2);
    z-index: 2;
}

/* Speaking pulse animation class */
.avatar-ring-outer.speaking {
    animation: rotateOuterRing 15s linear infinite, pulseOuterRing 1.5s ease-in-out infinite alternate;
    border: 2px dashed rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.avatar-ring-inner {
    position: absolute;
    width: 242px;
    height: 242px;
    border-radius: 50%;
    border: 1px solid rgba(138, 43, 226, 0.3);
    z-index: 2;
    animation: rotateInnerRing 20s linear infinite reverse;
}

.avatar-container {
    position: relative;
    width: 226px;
    height: 226px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 3;
    border: 3px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.05);
    transition: transform 0.5s ease;
}

/* Avatar speaking subtle scale/motion effect */
.avatar-container.speaking img {
    animation: microScaleAvatar 2s ease-in-out infinite alternate;
}

.avatar-scan-line {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(180deg, transparent, var(--color-accent), transparent);
    opacity: 0.5;
    z-index: 4;
    pointer-events: none;
    animation: scanAnimation 4s linear infinite;
}

.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(transparent 50%, rgba(10, 11, 16, 0.3) 100%);
    z-index: 5;
    pointer-events: none;
}

.waveform-container {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--bg-card-border);
    padding-top: 15px;
}

.waveform-container canvas {
    width: 100%;
    height: 100%;
}

.speech-info {
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding-top: 10px;
}

.speech-state-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.speech-state-indicator i {
    font-size: 15px;
}

/* Speaking indicator */
.clone-badge-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bg-card-border);
    padding: 8px 16px;
    border-radius: 30px;
}

.clone-badge-status span {
    font-size: 13px;
    font-weight: 500;
}

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

.pulse-indicator.thinking {
    background-color: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
    animation: pulseWarn 1s ease-in-out infinite alternate;
}

.pulse-indicator.speaking {
    background-color: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    animation: pulseCyan 0.6s ease-in-out infinite alternate;
}

/* Interactive Chat Pane */
.chat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.chat-messages {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Scrollbar tweaks */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.round-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.message.clone .message-bubble {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-top-left-radius: 4px;
    color: var(--text-main);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--color-primary), #6314bb);
    border-top-right-radius: 4px;
    color: #fff;
}

.message-time {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.6);
}

.chat-input-bar {
    padding: 16px 24px;
    background-color: rgba(12, 13, 21, 0.5);
    border-top: 1px solid var(--bg-card-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--bg-card-border);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.mic-btn.active {
    background-color: rgba(255, 0, 0, 0.2);
    border-color: #ff3b30;
    color: #ff3b30;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.3);
    animation: pulseWarn 1s ease-in-out infinite alternate;
}

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

.send-btn:hover {
    background-color: #9b42fc;
    box-shadow: 0 0 12px var(--color-primary-glow);
}

.chat-input-bar input {
    flex-grow: 1;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bg-card-border);
    padding: 12px 18px;
    border-radius: 30px;
    color: var(--text-main);
    font-size: 14.5px;
    outline: none;
    transition: var(--transition-smooth);
}

.chat-input-bar input:focus {
    border-color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 8px rgba(138, 43, 226, 0.15);
}

/* ==========================================================================
   TAB 2: BRAIN & INTEGRATIONS
   ========================================================================== */
.brain-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
}

/* OAuth Services List */
.oauth-services-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.oauth-service-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bg-card-border);
    padding: 16px;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
    gap: 12px;
}

.oauth-service-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.oauth-service-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.oauth-service-context {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    width: 100%;
}

.sync-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.context-textarea {
    width: 100%;
    margin-top: 4px;
    resize: vertical;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.service-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.03);
}

.icon-gmail { color: #ea4335; background-color: rgba(234, 67, 53, 0.06); }
.icon-drive { color: #34a853; background-color: rgba(52, 168, 83, 0.06); }
.icon-calendar { color: #4285f4; background-color: rgba(66, 133, 244, 0.06); }
.icon-youtube { color: #ff0000; background-color: rgba(255, 0, 0, 0.06); }

.service-meta h4 {
    font-size: 15px;
    margin-bottom: 2px;
}

.service-meta span {
    font-size: 12px;
    color: var(--text-muted);
}

.oauth-btn.connected {
    background-color: rgba(0, 255, 136, 0.12) !important;
    color: var(--color-success) !important;
    border-color: rgba(0, 255, 136, 0.3) !important;
}

.oauth-btn.connected::after {
    content: "conectado";
    text-transform: capitalize;
}

/* File Uploader dashed box */
.file-uploader-box {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: var(--border-radius-lg);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 24px;
    position: relative;
}

.file-uploader-box:hover, .file-uploader-box.dragover {
    border-color: var(--color-primary);
    background-color: rgba(138, 43, 226, 0.03);
}

.uploader-icon {
    font-size: 36px;
    color: var(--color-accent);
    margin-bottom: 16px;
    filter: drop-shadow(0 0 6px var(--color-accent-glow));
}

.file-uploader-box h4 {
    font-size: 16px;
    margin-bottom: 6px;
}

.file-uploader-box p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.privacy-warning {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 0 16px;
}

.privacy-warning i {
    color: var(--color-accent);
    margin-right: 4px;
}

/* Image Upload section */
.image-uploader-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
}

.current-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-primary);
}

.current-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-controls small {
    color: var(--text-muted);
    font-size: 12px;
}

.hidden-file-input {
    display: none;
}

/* Processing indicators */
.whatsapp-status {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bg-card-border);
    padding: 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
}

.status-loader {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: rotateInnerRing 1s linear infinite;
}

.whatsapp-insights h5 {
    color: var(--color-success);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whatsapp-insights ul {
    list-style: none;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whatsapp-insights li {
    color: var(--text-muted);
}

.whatsapp-insights strong {
    color: var(--text-main);
}

.word-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.word-tags span {
    background-color: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--color-accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* ==========================================================================
   TAB 3: INSIGHTS & GAPS
   ========================================================================== */
.insights-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
}

/* Tables & Gaps list */
.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.gap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.gap-table th, .gap-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg-card-border);
}

.gap-table th {
    font-family: 'Outfit', sans-serif;
    color: var(--text-muted);
    font-weight: 500;
}

.gap-table td {
    color: var(--text-main);
}

.completed-gap td {
    opacity: 0.6;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.badge-warning {
    background-color: rgba(255, 183, 0, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(255, 183, 0, 0.2);
}

.badge-success {
    background-color: rgba(0, 255, 136, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.btn-small {
    padding: 6px 12px !important;
    font-size: 11px !important;
}

/* Inline training overlay panel */
.training-box {
    border-color: var(--color-accent);
    margin-bottom: 30px;
    grid-column: span 2;
    animation: slideDown 0.3s ease-out;
}

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

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

.question-to-train {
    margin-bottom: 16px;
    font-size: 14.5px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Conversation audits items list */
.audit-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 15px;
}

.audit-item {
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--bg-card-border);
    padding: 16px;
    border-radius: var(--border-radius-md);
}

.audit-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.audit-dialog {
    font-size: 13.5px;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    border-left: 2px solid var(--color-primary);
}

.dialog-user {
    margin-bottom: 6px;
    color: var(--text-muted);
}

.dialog-clone {
    color: var(--text-main);
    line-height: 1.4;
}

.audit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

/* ==========================================================================
   TAB 4: CONFIGURATION & SETTINGS
   ========================================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
}

.settings-grid .prompt-card {
    grid-column: span 2;
}

/* Inputs, Textareas, Sliders */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
}

.input-dark {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.input-dark option {
    background-color: #141622 !important;
    color: var(--text-main) !important;
}

.input-dark:focus {
    border-color: var(--color-accent);
    background-color: rgba(255, 255, 255, 0.05);
}

.input-password-wrapper {
    position: relative;
    display: flex;
}

.input-password-wrapper input {
    width: 100%;
    padding-right: 48px;
}

.btn-toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.input-hint {
    font-size: 11.5px;
    color: var(--text-muted);
}

.code-font {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12.5px;
    line-height: 1.5;
}

/* Sliders */
.settings-sliders-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.slider-group {
    flex: 1;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.slider-dark {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    outline: none;
    margin-top: 6px;
}

.slider-dark::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--color-accent-glow);
    transition: transform 0.1s ease;
}

.slider-dark::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* General Buttons */
.btn {
    border: 1px solid transparent;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.2);
}

.btn-primary:hover {
    background-color: #9b42fc;
    box-shadow: 0 6px 16px rgba(138, 43, 226, 0.35);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--bg-card-border);
    color: var(--text-main);
}

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

/* Helpers */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.font-semibold { font-weight: 600; }
.font-google { color: #4285f4; }
.font-whatsapp { color: #25d366; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes rotateOuterRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotateInnerRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseOuterRing {
    0% { transform: scale(0.99); opacity: 0.7; }
    100% { transform: scale(1.03); opacity: 1; }
}

@keyframes microScaleAvatar {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.025); }
}

@keyframes scanAnimation {
    0% { top: -10px; }
    50% { top: 236px; }
    100% { top: -10px; }
}

@keyframes pulseWarn {
    0% { box-shadow: 0 0 4px rgba(255, 183, 0, 0.2); opacity: 0.8; }
    100% { box-shadow: 0 0 12px rgba(255, 183, 0, 0.5); opacity: 1; }
}

@keyframes pulseCyan {
    0% { box-shadow: 0 0 4px rgba(0, 240, 255, 0.2); opacity: 0.8; }
    100% { box-shadow: 0 0 12px rgba(0, 240, 255, 0.6); opacity: 1; }
}

.mock-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    background: rgba(255, 183, 0, 0.08);
    border: 1px solid rgba(255, 183, 0, 0.35);
    border-radius: 10px;
    color: var(--color-warning);
    font-size: 13.5px;
    line-height: 1.4;
}

.mock-banner i {
    font-size: 16px;
    flex-shrink: 0;
}

.mock-banner-link {
    color: var(--color-accent);
    text-decoration: underline;
    font-weight: 600;
}

.mock-banner.hidden {
    display: none;
}

/* Edge browser warning banner */
.edge-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    background: rgba(255, 120, 0, 0.08);
    border: 1px solid rgba(255, 120, 0, 0.35);
    border-radius: 10px;
    color: #ff9640;
    font-size: 13px;
    line-height: 1.5;
}

.edge-banner i {
    font-size: 18px;
    flex-shrink: 0;
    color: #ff8c00;
}

.edge-banner strong {
    color: #ffad5c;
}

.edge-banner-close {
    background: none;
    border: none;
    color: #ff9640;
    font-size: 22px;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    padding: 0 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.edge-banner-close:hover {
    opacity: 1;
}

.edge-banner.hidden {
    display: none;
}

.info-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    margin: 6px 0 14px;
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 8px;
    color: #cfeff5;
    font-size: 12.5px;
    line-height: 1.45;
}
.info-callout i {
    color: var(--color-accent);
    margin-top: 2px;
}

.oauth-service-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.oauth-service-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.oauth-service-context {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px dashed var(--bg-card-border);
    border-radius: 8px;
}
.oauth-service-context.hidden {
    display: none;
}
.context-textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 12.5px;
    resize: vertical;
    min-height: 80px;
}
.save-context-btn {
    align-self: flex-end;
}
.sync-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sync-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}
.whatsapp-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.wa-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
}
.wa-file-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    min-width: 0;
}
.wa-file-info strong {
    color: var(--color-accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wa-file-info span {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.5);
}
.wa-file-remove {
    flex-shrink: 0;
    border-color: rgba(255, 90, 90, 0.35) !important;
    color: #ffb4b4 !important;
}

.qr-import-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--bg-card-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.qr-import-section h4 {
    margin: 0;
    font-size: 14px;
}
.warn-callout {
    background: rgba(255, 90, 90, 0.06) !important;
    border-color: rgba(255, 90, 90, 0.35) !important;
    color: #ffd0d0 !important;
}
.warn-callout i { color: #ff8a8a !important; }

.qr-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.qr-status-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
}
.qr-status-pill.online { color: var(--color-success); border-color: rgba(0, 255, 136, 0.35); }
.qr-status-pill.offline { color: #ff8a8a; border-color: rgba(255, 90, 90, 0.35); }
.qr-status-pill.connecting { color: var(--color-warning); border-color: rgba(255, 183, 0, 0.35); }

.qr-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px;
    background: white;
    border-radius: 10px;
}
.qr-display p {
    color: #202124;
    font-size: 12px;
    margin: 0;
    text-align: center;
}
.qr-display.hidden { display: none; }
.qr-display img { width: 240px; height: 240px; }

.qr-chats.hidden { display: none; }
.qr-chats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.qr-chats-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}
.inline-num {
    width: 70px;
    padding: 4px 8px !important;
    text-align: center;
}
.qr-chats-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.02);
}
.qr-chat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12.5px;
}
.qr-chat-row:hover { background: rgba(255, 255, 255, 0.04); }
.qr-chat-row input[type="checkbox"] { flex-shrink: 0; }
.qr-chat-row .qr-chat-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qr-chat-row .qr-chat-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}
.qr-chat-row .group-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(138, 43, 226, 0.2);
    color: var(--color-primary);
}

.data-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.data-mgmt-grid .btn {
    justify-content: flex-start;
    text-align: left;
    gap: 8px;
}
.btn-danger-soft {
    border-color: rgba(255, 90, 90, 0.35) !important;
    color: #ffb4b4 !important;
}
.btn-danger-soft:hover {
    background: rgba(255, 90, 90, 0.08) !important;
    border-color: rgba(255, 90, 90, 0.7) !important;
}
.btn-danger {
    background: linear-gradient(135deg, #c8324d, #7a1a2b) !important;
    color: white !important;
    border: none !important;
}
.btn-danger:hover {
    filter: brightness(1.1);
}

/* Synced Data Preview Boxes */
.sync-preview-box {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    padding: 10px 14px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sync-preview-box.hidden {
    display: none !important;
}
.sync-preview-item {
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 6px;
    color: var(--text-main);
    line-height: 1.4;
}
.sync-preview-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sync-preview-item .item-title {
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 2px;
}
.sync-preview-item .item-meta {
    color: var(--text-muted);
    font-size: 10.5px;
    margin-right: 8px;
    display: inline-block;
}
.sync-preview-item .item-snippet {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    font-size: 11px;
    display: block;
    margin-top: 2px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Chat Context Indicator Bar */
.chat-context-indicator {
    background: rgba(0, 240, 255, 0.04);
    border-bottom: 1px solid var(--bg-card-border);
    padding: 8px 20px;
    font-size: 11.5px;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease-out;
}
.chat-context-indicator i {
    font-size: 13px;
}
.chat-context-indicator.hidden {
    display: none !important;
}

/* Chat Header & End Conversation Button */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--bg-card-border);
}
.chat-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-title i {
    color: var(--color-primary);
}

/* Animated talking avatar (mouth and face distortion) */
.avatar-container.speaking img {
    animation: avatar-speaking-bob 0.15s infinite ease-in-out;
    filter: url(#talking-displacement);
}

@keyframes avatar-speaking-bob {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scaleY(1.02) scaleX(0.99) translateY(1px); }
    100% { transform: scale(1) translateY(0); }
}

/* ElevenLabs UI styles */
.elevenlabs-card {
    border-color: rgba(138, 43, 226, 0.2) !important;
}
.elevenlabs-card h3 i {
    color: #8a2be2; /* violet elevenlabs color */
}

/* Shake animation for blocked send button */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* ==========================================================================
   HELP TAB
   ========================================================================== */

.help-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.help-grid > .help-card:first-child {
    grid-column: 1 / -1;
}

@media (min-width: 800px) {
    .help-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.help-card {
    position: relative;
    padding: 28px 24px 24px;
}

.help-card h3 {
    margin-bottom: 10px;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-card > p {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 14px;
}

/* Highlight card (What is Clonify) */
.help-card-highlight {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.08) 0%, rgba(0, 240, 255, 0.06) 100%);
    border-color: rgba(138, 43, 226, 0.25);
}

.help-card-highlight h3 {
    font-size: 20px;
    color: var(--color-accent);
}

/* Icon badges */
.help-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
    background: rgba(138, 43, 226, 0.12);
    color: var(--color-primary);
}

.help-card-icon.icon-steps {
    background: rgba(255, 149, 0, 0.12);
    color: #ff9500;
}

.help-card-icon.icon-interact {
    background: rgba(0, 240, 255, 0.12);
    color: var(--color-accent);
}

.help-card-icon.icon-brain {
    background: rgba(255, 214, 10, 0.12);
    color: #ffd60a;
}

.help-card-icon.icon-insights {
    background: rgba(48, 209, 88, 0.12);
    color: #30d158;
}

.help-card-icon.icon-settings {
    background: rgba(94, 92, 230, 0.12);
    color: #5e5ce6;
}

.help-card-icon.icon-requirements {
    background: rgba(0, 199, 190, 0.12);
    color: #00c7be;
}

/* Feature badges row */
.help-features-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.help-feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.help-feature i {
    font-size: 13px;
    color: var(--color-primary);
}

/* Steps list */
.help-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.help-steps li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.help-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.help-steps li > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-steps li > div:last-child strong {
    font-size: 14px;
    color: var(--text-primary);
}

.help-steps li > div:last-child span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Help list (ul) */
.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.help-list li > i {
    flex-shrink: 0;
    margin-top: 3px;
    width: 18px;
    text-align: center;
}

.help-list li strong {
    color: var(--text-primary);
}
