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

:root {
    --primary: #B0886C;         /* Dourado bege */
    --primary-dark: #D18F67;    /* Caramelo glow (hover) */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --hot: #D18F67;             /* Quente */
    --warm: #CCAB8E;            /* Bege sofisticado */
    --cold: #56524F;            /* Grafite quente */
    --dark: #FAF2E6;            /* Champagne claro */
    --light: #1C1715;           /* Preto café profundo */
    --border: #56524F;          /* Grafite quente */
    --text: #FAF2E6;            /* Champagne claro */
    --text-support: #CCAB8E;    /* Bege sofisticado */
    --card-bg: #4E3324;         /* Marrom espresso */
    --shadow: #4E3324;          /* Marrom espresso */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #6b7280;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--light);
    color: var(--text-support);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--light);
    border-color: var(--primary);
}

/* Content */
.content {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.tab-content {
    display: none;
}

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

/* Forms */
.form-section {
    margin-bottom: 30px;
}

.form-section h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.info-text {
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid var(--border);
    background: var(--light);
    color: var(--text);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(176, 136, 108, 0.4);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-success {
    background: var(--success);
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Results */
.results {
    margin-top: 30px;
}

.lead-card {
    background: var(--light);
    border: 1px solid var(--border);
    border-left: 4px solid var(--cold);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lead-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.lead-card.hot {
    border-left-color: var(--hot);
    background: rgba(209, 143, 103, 0.08);
}

.lead-card.warm {
    border-left-color: var(--warm);
    background: rgba(204, 171, 142, 0.06);
}

.lead-card.cold {
    border-left-color: var(--cold);
    background: rgba(86, 82, 79, 0.04);
}

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

.lead-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
}

.lead-score {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.lead-score.hot {
    background: var(--hot);
}

.lead-score.warm {
    background: var(--warm);
    color: var(--dark);
}

.lead-score.cold {
    background: var(--cold);
}

.lead-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.85rem;
}

.info-value {
    color: var(--dark);
    margin-top: 2px;
}

.lead-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Pipeline */
.pipeline-section {
    margin-top: 30px;
}

.pipeline-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--dark);
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Stats Box */
.stats-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-card.hot {
    background: linear-gradient(135deg, var(--hot), #ff5252);
}

.stat-card.warm {
    background: linear-gradient(135deg, var(--warm), #ffb300);
}

.stat-card.cold {
    background: linear-gradient(135deg, var(--cold), #666);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.pipeline-list {
    display: grid;
    gap: 15px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    padding: 20px 0;
}

.modal.active {
    display: block;
}

.modal-content {
    background: var(--card-bg);
    margin: 40px auto;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 700px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

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

.modal-close {
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.breakdown-item {
    background: var(--light);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

.breakdown-label {
    font-weight: 600;
    color: #6b7280;
}

.breakdown-value {
    font-weight: 700;
    color: var(--primary);
}

.trend-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.trend-point {
    text-align: center;
    padding: 10px;
    background: var(--light);
    border-radius: 8px;
}

.trend-date {
    font-size: 0.8rem;
    color: #6b7280;
}

.trend-value {
    font-weight: 700;
    margin-top: 5px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

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

    .btn {
        align-self: stretch;
    }

    .lead-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-box {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
}
