@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #8DC63F; /* Verde Lima Vibrante */
    --primary-light: #C5E1A5;
    --primary-dark: #4A7729; /* Verde Escuro para Títulos */
    --accent-color: #7CB342;
    --accent-light: #E9F5DB; /* Fundo suave verdeado */
    --bg-color: #F8FBF4;
    --surface-color: #FFFFFF;
    --text-color: #2E3D23; /* Cinza esverdeado muito escuro */
    --text-muted: #6B7C5E;
    --border-color: #DAE5D0;
    --success: #689F38;
    --danger: #D32F2F;
    --border-radius: 16px;
    --shadow-sm: 0 2px 8px rgba(74, 119, 41, 0.08);
    --shadow-md: 0 8px 24px rgba(74, 119, 41, 0.12);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Header */
header {
    background-color: var(--surface-color);
    padding: 15px 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.desktop-only { display: none; }

.header-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-logo {
    max-height: 40px;
    width: auto;
}

header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Main Container */
main {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Views */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

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

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

/* Typography */
h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-dark);
}

p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

/* Dashboard Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 24px;
}

.metric-card {
    background: linear-gradient(135deg, var(--surface-color), var(--accent-light));
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--primary-light);
}

.metric-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.metric-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background-color: var(--bg-color);
    transition: var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--surface-color);
    box-shadow: 0 0 0 3px rgba(216, 167, 177, 0.2);
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 24px;
}

.search-bar input {
    padding-left: 45px;
    border-radius: 30px;
}

.search-bar .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--primary-dark);
    pointer-events: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(216, 167, 177, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(216, 167, 177, 0.5);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
}

.fab:hover {
    transform: scale(1.05);
    background-color: #c59b27;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 90;
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    flex: 1;
}

.nav-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: var(--transition);
}

.icon-svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.nav-item.active .icon-svg {
    stroke: var(--primary-color);
}

.nav-item.active .icon {
    transform: translateY(-2px);
}

/* List Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-content h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.list-item-content p {
    font-size: 0.85rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-ativo { background-color: rgba(40, 167, 69, 0.1); color: var(--success); }
.status-inativo { background-color: rgba(220, 53, 69, 0.1); color: var(--danger); }
.status-lead { background-color: var(--accent-light); color: var(--accent-color); }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background-color: var(--surface-color);
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

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

/* Helpers */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-right { text-align: right; }
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.price-tag { font-weight: 600; color: var(--accent-color); font-size: 1.1rem; }

/* Responsive adjustments */
@media (min-width: 768px) {
    .desktop-only { display: block; }
    
    header {
        justify-content: space-between;
        padding-left: 280px;
    }

    .header-logo-container {
        display: none;
    }

    .sidebar-logo-container {
        padding: 20px;
        text-align: center;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        margin-bottom: 20px;
    }

    .sidebar-logo {
        margin-top:-250px;
        max-width: 95%;
        height: auto;
    }

    .bottom-nav {
        top: 0;
        left: 0;
        width: 200px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
    /*  padding-top: 80px; */
        border-top: none;
        border-right: 1px solid var(--border-color);
    }
    
    .nav-item {
        flex: none;
        padding: 20px;
        width: 100%;
        flex-direction: row;
    }
    
    .nav-item .icon {
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    body {
        padding-bottom: 0;
        padding-left: 200px;
    }
    
    .fab {
        bottom: 30px;
        right: 30px;
    }
}

/* Action Buttons */
.flex-center {
    display: flex;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    margin-left: 5px;
    transition: var(--transition);
    border-radius: 8px;
}

.action-btn:hover {
    background-color: var(--accent-light);
    transform: scale(1.1);
}

.action-btn.delete:hover {
    background-color: rgba(220, 53, 69, 0.1);
}
/* Chat Modal & Bubbles */
#chat-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 5px;
    max-height: 400px;
    overflow-y: auto;
    background-color: #F0F2F5; /* Cor de fundo chat estilo WA */
    border-radius: 12px;
    padding: 15px;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    position: relative;
    line-height: 1.4;
    word-wrap: break-word;
}

.bubble-cliente {
    align-self: flex-start;
    background-color: var(--surface-color);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.bubble-staff, .bubble-ia, .bubble-humano {
    align-self: flex-end;
    background-color: #E7F3D3; /* Verde claro estilo WA/Marca */
    color: var(--text-color);
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.bubble-humano {
    background-color: #DCF8C6; /* Verde Lima Suave (Estilo WhatsApp Clássico) */
}

.bubble-ia {
    background-color: #D3E7F3; /* Azul claro para IA */
    border: 1px dashed #A5C5E1;
}

.chat-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
    text-align: right;
}

.chat-sender-tag {
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

/* Dashboard Interações */
.interaction-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.interaction-item:hover {
    background-color: var(--accent-light);
}

.interaction-item:last-child {
    border-bottom: none;
}

.interaction-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 700;
}

.interaction-info {
    flex: 1;
}

.interaction-time {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}

.chat-date-header {
    text-align: center;
    margin: 15px 0 5px 0;
}

.chat-date-header span {
    background-color: #E1E2E4;
    color: #4A4A4A;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

