:root {
    --bg-sidebar: #0a0a0a;
    --bg-main: #000000;
    --bg-input: rgba(30, 30, 30, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --primary: #ffffff;
    --primary-hover: #e4e4e7;
    --primary-glow: rgba(255, 255, 255, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #3f3f46 transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05), transparent 70%), var(--bg-main);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}

/* =========================================
   State Management (chat-active vs initial)
   ========================================= */
body:not(.chat-active) .chat-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


body:not(.chat-active) .header-actions {
    display: none;
}

body:not(.chat-active) .chat-header {
    background: transparent;
    box-shadow: none;
    border-bottom: none;
}
body:not(.chat-active) .chat-scroll-container {
    flex: 0;
    padding-top: 0;
    overflow: visible;
}
body:not(.chat-active) .messages-wrapper {
    display: none;
}
body:not(.chat-active) .empty-state {
    position: static;
    transform: none;
    margin-bottom: 20px;
    animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
body:not(.chat-active) .floating-input {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: 0 auto;
}
body.chat-active .empty-state {
    display: none !important;
}
body.chat-active .floating-input {
    bottom: 24px;
    transform: translateX(-50%);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s;
    overflow: hidden;
}

.app-container.sidebar-collapsed .sidebar {
    width: 0;
    opacity: 0;
    visibility: hidden;
    border-right: none;
}

.sidebar-header {
    padding: 16px;
}

.new-chat-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
}

.icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.icon-wrapper i {
    width: 16px;
    height: 16px;
}

.shortcut {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

.history-group h4 {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin: 16px 0 8px 8px;
}

.chat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 12.5px;
    position: relative;
    z-index: 1;
}

.chat-item.menu-open {
    z-index: 50;
}

.chat-item i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

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

.chat-item.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-weight: 500;
}

.chat-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 28px; /* Espaço reservado para o botão de opções não sobrepor o texto */
}

/* History Context Menu */
.chat-item-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.btn-history-options {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: none;
    transition: var(--transition);
}

.chat-item:hover .btn-history-options, .chat-item.active .btn-history-options {
    display: flex;
}

.btn-history-options:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.2);
}

.history-options-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: auto;
    background: #202123;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 220px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 1000;
}

.history-options-menu.show {
    display: flex;
    animation: fadeInDown 0.2s ease forwards;
}

.history-opt-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 13px;
}

.history-opt-btn-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-opt-shortcut {
    font-size: 11px;
    opacity: 0.5;
    font-family: monospace;
}

.history-opt-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 8px;
}

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

.history-opt-btn.delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.history-opt-btn i,
.history-opt-btn svg,
.history-opt-btn-left i,
.history-opt-btn-left svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #333333, #111111);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar i {
    width: 18px;
    height: 18px;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-plan {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

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

.settings-btn i {
    width: 18px;
    height: 18px;
}

/* Main Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(24, 24, 27, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

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

/* Mode Dropdown */
.mode-dropdown-container {
    position: relative;
    z-index: 100;
}

.mode-dropdown-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

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

.mode-dropdown-btn i {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.mode-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #202123;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 320px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.mode-dropdown-menu.show {
    display: flex;
    animation: fadeInDown 0.2s ease forwards;
}

.mode-option {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    color: var(--text-secondary);
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mode-option.active {
    color: var(--text-primary);
}

.mode-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-option-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.mode-option-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.mode-option-check {
    opacity: 0;
    color: var(--text-primary);
}

.mode-option.active .mode-option-check {
    opacity: 1;
}

.mode-option-check i {
    width: 18px;
    height: 18px;
}

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

/* Webhook Toggle */
.webhook-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
}

.toggle-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

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

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

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

input:checked+.slider {
    background-color: rgba(255, 255, 255, 0.6);
}

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

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

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

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

.share-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.share-btn i {
    width: 14px;
    height: 14px;
}

/* Call AI Button */
.call-ai-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.call-ai-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.call-ai-btn i {
    width: 16px;
    height: 16px;
}

/* Chat Container */
.chat-scroll-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    padding-top: 64px;
    /* Space for absolute header */
}

.scroll-spacer {
    height: 140px;
    /* Spacing for floating input */
    flex-shrink: 0;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-text {
    text-align: center;
    margin-bottom: 48px;
}

.gradient-text {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 16px;
}

#current-mode-label {
    color: var(--text-primary);
    font-weight: 600;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.suggestion-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 14px;
    backdrop-filter: blur(8px);
}

.suggestion-card:hover {
    background: rgba(43, 111, 101, 0.08);
    border-color: rgba(43, 111, 101, 0.4);
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 20px rgba(43, 111, 101, 0.1);
}

.sugg-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

.suggestion-card:hover .sugg-icon {
    background: #2b6f65;
    color: white;
    box-shadow: 0 4px 12px rgba(43, 111, 101, 0.3);
}

.sugg-icon i {
    width: 20px;
    height: 20px;
}

.sugg-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Messages Wrapper */
.messages-wrapper {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    50% {
        opacity: 1;
        transform: translateY(-4px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-block {
    display: flex;
    gap: 20px;
}

.message-block.user {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: slideInBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    transform-origin: center;
}

.msg-avatar.ai {
    background: #10a37f;
    color: white;
}

.msg-avatar.human {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.msg-avatar i {
    width: 18px;
    height: 18px;
}

.msg-content {
    flex: 1;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 85%;
    animation: slideInBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    animation-delay: 0.15s;
    transform-origin: bottom center;
}

.message-block.user .msg-content {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 20px;
    border-radius: 20px;
    border-top-right-radius: 4px;
    flex: 0 1 auto;
    max-width: fit-content;
}

.message-block:not(.user) .msg-content {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
}

.msg-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.message-block:not(.user) .msg-content-wrapper {
    max-width: 90%;
}

.msg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.message-block:not(.user):hover .msg-actions {
    opacity: 1;
}

.msg-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.msg-action-btn i {
    width: 14px;
    height: 14px;
}

.msg-content p {
    margin-bottom: 12px;
}

.msg-content p:last-child {
    margin-bottom: 0;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Floating Input Area */
.floating-input {
    position: absolute;
    left: 50%;
    width: 100%;
    max-width: 800px;
    padding: 0 24px;
    z-index: 20;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, rgba(255,255,255,0.05), rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border-radius: calc(var(--radius-lg) + 1px);
    z-index: -1;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: glow-rotate 6s linear infinite;
}

@keyframes glow-rotate {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.input-container:focus-within.glow-effect::before {
    opacity: 0.5;
}

.input-container {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    gap: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.input-container:focus-within {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    background: rgba(25, 25, 25, 0.85);
}

.attachment-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.attachment-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.attachment-btn i {
    width: 18px;
    height: 18px;
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    padding: 6px 0;
    resize: none;
    outline: none;
    max-height: 200px;
    overflow-y: auto;
}

textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.send-btn {
    background: white;
    color: black;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    margin-bottom: 2px;
}

.send-btn:hover {
    transform: scale(1.05);
    background: var(--text-primary);
}

.send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
}

.send-btn i {
    width: 18px;
    height: 18px;
}

.input-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 14px;
    font-weight: 500;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 10px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* Lead Form */
.lead-form-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 12px;
    animation: iaSlideIn 0.3s ease-out;
}

.lead-form-container h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

#chat-lead-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#chat-lead-form input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

#chat-lead-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.lead-submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
}

.lead-submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

@keyframes iaSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Voice Feature Styles */
.voice-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 17, 0.95);
    backdrop-filter: blur(20px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 60px 20px 40px 20px;
    transition: opacity 0.3s ease;
}

.voice-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.voice-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: pulse-glow 4s infinite alternate ease-in-out;
}

@keyframes pulse-glow {
    0% { transform: scale(0.8) translate(-50%, -50%); opacity: 0.1; }
    100% { transform: scale(1.2) translate(-50%, -50%); opacity: 0.25; }
}

.voice-center-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 48px;
    z-index: 2;
}

.call-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.call-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.call-status {
    font-size: 15px;
    color: var(--primary);
    font-weight: 500;
}

.voice-waves-container {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wave-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wave-rings .ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--primary);
    opacity: 0;
}

.wave-rings .ring-1 { width: 140px; height: 140px; }
.wave-rings .ring-2 { width: 190px; height: 190px; }
.wave-rings .ring-3 { width: 240px; height: 240px; }

.listening ~ .wave-rings .ring {
    animation: wave-ripple 2s linear infinite;
}
.listening ~ .wave-rings .ring-2 { animation-delay: 0.6s; }
.listening ~ .wave-rings .ring-3 { animation-delay: 1.2s; }

.speaking ~ .wave-rings .ring {
    border-color: #10b981;
    animation: wave-ripple 1.5s linear infinite;
}
.speaking ~ .wave-rings .ring-2 { animation-delay: 0.5s; }
.speaking ~ .wave-rings .ring-3 { animation-delay: 1.0s; }

@keyframes wave-ripple {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.voice-status-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), #1f5049);
    border-radius: 50%;
    box-shadow: 0 8px 32px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.voice-status-icon i {
    width: 40px;
    height: 40px;
    color: white;
}

.voice-status-icon.listening {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.voice-status-icon.speaking {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

.voice-text-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 100px;
}

.status-indicator-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.transcript-container {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-transcript {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 90%;
    text-align: center;
    font-weight: 400;
    line-height: 1.5;
}

.call-controls-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 32px;
    border-radius: 100px;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.close-voice-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}
.close-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.6);
}

.close-voice-btn i {
    width: 24px;
    height: 24px;
}

.voice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.voice-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.voice-btn i {
    width: 18px;
    height: 18px;
}

.call-ai-btn {
    background: #2b6f65;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(43, 111, 101, 0.3);
}

.call-ai-btn:hover {
    background: #1f5049;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(43, 111, 101, 0.4);
}

.call-ai-btn i {
    width: 16px;
    height: 16px;
}

/* =========================================
   Mobile Responsiveness
   ========================================= */
@media (max-width: 768px) {

    /* Menu Button */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Sidebar - off-screen drawer on mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        left: 0;
    }

    /* Overlay for sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Header Adjustments */
    .chat-header {
        padding: 0 16px;
        justify-content: space-between;
    }

    .header-left {
        gap: 8px;
    }

    /* Reduce mode switch size */
    .mode-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Floating input adjustments */
    .floating-input {
        padding: 0 16px;
        bottom: 16px;
    }

    .messages-wrapper {
        padding: 16px;
        gap: 20px;
    }

    .msg-content {
        max-width: 90%;
        font-size: 14px;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .gradient-text {
        font-size: 28px;
    }

    .empty-state {
        padding: 16px;
    }

    .webhook-toggle {
        display: none;
        /* Hide webhook toggle on mobile to save space */
    }

    .call-ai-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .call-ai-btn i {
        width: 14px;
        height: 14px;
    }
}

/* Custom Modal */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal {
    background: #202123;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.custom-modal-overlay.show .custom-modal {
    transform: translateY(0) scale(1);
}

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

.custom-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.custom-modal-body {
    padding: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.custom-modal-body input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    margin-top: 10px;
}

.custom-modal-body input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.custom-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.custom-modal-footer button {
    font-weight: 500;
    font-size: 14px;
}

.custom-modal-footer .btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.custom-modal-footer .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.custom-modal-footer .btn-confirm {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.custom-modal-footer .btn-confirm:hover {
    background: #0ea5e9;
}

.custom-modal-footer .btn-confirm.danger {
    background: #ef4444;
}
.custom-modal-footer .btn-confirm.danger:hover {
    background: #dc2626;
}

.calendar-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.calendar-link-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}
.calendar-link-btn i {
    width: 18px;
    height: 18px;
}

/* Custom Modal */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal {
    background: #202123;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.custom-modal-overlay.show .custom-modal {
    transform: translateY(0) scale(1);
}

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

.custom-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.custom-modal-body {
    padding: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.custom-modal-body input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    margin-top: 10px;
}

.custom-modal-body input:focus {
.custom-modal-body input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #10a37f; /* Verde DN */
}

.custom-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.custom-modal-footer button {
    font-weight: 500;
    font-size: 14px;
}

.custom-modal-footer .btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.custom-modal-footer .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.custom-modal-footer .btn-confirm {
    background: #2b6f65;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.custom-modal-footer .btn-confirm:hover {
    background: #205c53;
}

.custom-modal-footer .btn-confirm.danger {
    background: #ef4444;
}
.custom-modal-footer .btn-confirm.danger:hover {
    background: #dc2626;
}

/* Formulário de Lead no Chat */
.lead-form-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lead-form-container h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.lead-form-container form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-form-container input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.lead-form-container input:focus {
    outline: none;
    border-color: #2b6f65;
    background: rgba(255, 255, 255, 0.1);
}

.lead-submit-btn {
    background: #2b6f65;
    border: none;
    color: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
}

.lead-submit-btn:hover {
    background: #205c53;
    transform: translateY(-2px);
}

/* =========================================
   Mobile Responsiveness
   ========================================= */
@media (max-width: 768px) {
    .sidebar-toggle-desktop { display: none !important; }
    .mobile-menu-btn { display: flex !important; }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 90;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .sidebar {
        position: absolute !important;
        top: 0;
        left: 0;
        height: 100%;
        width: 80% !important;
        max-width: 300px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .empty-state h2 { font-size: 24px; }
    .empty-state p { font-size: 14px; }
    
    .message-block { padding: 16px 12px; }
    
    .floating-input {
        width: 95%;
        padding: 0 10px;
        bottom: 10px;
    }
    
    .input-container { padding: 6px 12px; }
    .chat-header { padding: 10px 16px; }
    .header-actions { gap: 8px; }
    .call-controls-dock { padding: 12px 24px; }
    .voice-status-icon { width: 80px; height: 80px; }
}