* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.logo {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 12px;
    opacity: 0.8;
}

.menu {
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: #3498db;
}

.menu-item.active {
    background: rgba(52, 152, 219, 0.2);
    border-left-color: #3498db;
}

.menu-item .icon {
    margin-right: 12px;
    font-size: 20px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 30px;
    width: calc(100% - 260px);
    overflow-x: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
}

.header h2 {
    font-size: 32px;
    color: #2c3e50;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-right: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #7f8c8d;
}

.btn-logout {
    padding: 8px 16px !important;
    font-size: 13px !important;
    background: #e74c3c !important;
}

.btn-logout:hover {
    background: #c0392b !important;
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* KPI Cards */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.kpi-card::after {
    content: '👉';
    position: absolute;
    right: 20px;
    bottom: 15px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.kpi-card:hover::after {
    opacity: 0.5;
    transform: translateX(5px);
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.kpi-card:active {
    transform: translateY(-2px);
}

.kpi-card.hot {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.kpi-card.hot::after {
    opacity: 0.3;
}

.kpi-card.hot:hover::after {
    opacity: 0.7;
}

.kpi-icon {
    font-size: 40px;
    margin-right: 15px;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.kpi-content h3 {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 24px;
    font-weight: bold;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.chart-card h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 16px;
}

/* Card */
.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.card h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filters select,
.filters input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.filters input {
    flex: 1;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-hot {
    background: #ff4444;
    color: white;
}

.badge-warm {
    background: #FFA500;
    color: white;
}

.badge-cold {
    background: #4444ff;
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

/* Pipeline */
.pipeline-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.pipeline-column {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-height: 400px;
}

.pipeline-column h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.pipeline-count {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.pipeline-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    cursor: move;
    transition: transform 0.2s, opacity 0.2s;
    overflow: hidden;
}

.pipeline-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.pipeline-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.pipeline-column {
    transition: background-color 0.3s;
    min-height: 400px;
}

.pipeline-card h4 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-card p {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
    word-break: break-word;
}

.pipeline-card .valor {
    font-weight: bold;
    color: #27ae60;
    font-size: 14px;
    word-break: break-word;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    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.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-value {
        font-size: 22px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .kpi-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-card {
        padding: 18px;
    }
    
    .kpi-icon {
        font-size: 38px;
    }
    
    .kpi-value {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .logo p,
    .sidebar .menu-item span:not(.icon) {
        display: none;
    }
    
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        padding: 20px 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header h2 {
        font-size: 24px;
    }
    
    .header-actions {
        width: 100%;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .header-actions button {
        flex: 1;
        min-width: 140px;
    }
    
    .kpi-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .kpi-card {
        padding: 18px;
    }
    
    .kpi-icon {
        font-size: 36px;
        margin-right: 12px;
    }
    
    .kpi-value {
        font-size: 20px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        padding: 20px 15px;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .card {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .sidebar {
        width: 70px;
    }
    
    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
        padding: 15px 10px;
    }
    
    .header h2 {
        font-size: 20px;
    }
    
    .kpi-card {
        padding: 15px;
    }
    
    .kpi-icon {
        font-size: 32px;
        margin-right: 10px;
    }
    
    .kpi-content h3 {
        font-size: 12px;
    }
    
    .kpi-value {
        font-size: 18px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .btn-small {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .pipeline-container {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 15px;
    }
    
    .chart-card {
        padding: 15px;
    }
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 40px;
}

.activity-item {
    position: relative;
    padding-bottom: 30px;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
}

.activity-item::after {
    content: '';
    position: absolute;
    left: -23px;
    top: 20px;
    width: 2px;
    height: calc(100% - 10px);
    background: #e0e0e0;
}

.activity-item:last-child::after {
    display: none;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.activity-type {
    font-weight: 600;
    color: #2c3e50;
}

.activity-date {
    font-size: 12px;
    color: #95a5a6;
}

.activity-description {
    font-size: 14px;
    color: #7f8c8d;
}

/* ==================== CHATGPT STYLES ==================== */

.chatgpt-status {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.status-badge.success {
    background: #4CAF50;
    color: white;
}

.status-badge.warning {
    background: #ff9800;
    color: white;
}

.status-badge.error {
    background: #f44336;
    color: white;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.help-text a {
    color: #2196F3;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: #757575;
}

.btn-secondary:hover {
    background: #616161;
}

.chatgpt-features {
    padding: 20px;
    background: #e3f2fd;
    border-radius: 8px;
}

.chatgpt-features h4 {
    margin: 0 0 15px 0;
    color: #1976d2;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 8px 0;
    color: #333;
}

.text-muted {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Animações para notificações */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
