/* Dashboard Avancé - Styles CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #2d3748;
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(145deg, #1a202c, #2d3748);
    color: white;
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.logo {
    text-align: center;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.logo h2 {
    font-size: 1.6em;
    margin-bottom: 5px;
    background: linear-gradient(45deg, #4299e1, #63b3ed);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo p {
    color: #a0aec0;
    font-size: 0.9em;
}

.nav-menu ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0 25px 25px 0;
    margin-right: 20px;
}

.nav-item a:hover {
    background: rgba(66, 153, 225, 0.2);
    color: white;
}

.nav-item.active a {
    background: linear-gradient(45deg, #4299e1, #63b3ed);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.badge {
    margin-left: auto;
    background: #e53e3e;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge.urgent {
    background: #e53e3e;
    animation: pulse 2s infinite;
}

.user-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #4299e1, #63b3ed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.user-details h4 {
    font-size: 0.9em;
    margin-bottom: 2px;
}

.user-details p {
    font-size: 0.8em;
    color: #a0aec0;
    margin-bottom: 4px;
}

.status-online {
    font-size: 0.7em;
    color: #48bb78;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    padding: 25px 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #1a202c;
    font-size: 2.2em;
    font-weight: 700;
}

.date-filter select {
    padding: 8px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-weight: 500;
    margin-top: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quick-actions {
    display: flex;
    gap: 10px;
}

.btn-quick {
    padding: 10px 20px;
    background: linear-gradient(45deg, #4299e1, #63b3ed);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-quick:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.3);
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notifications i {
    font-size: 1.3em;
    color: #4a5568;
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Alertes */
.alerts-section {
    margin-bottom: 25px;
}

.alert {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid;
}

.alert-urgent {
    border-left-color: #e53e3e;
    background: linear-gradient(90deg, rgba(229, 62, 62, 0.05), white);
}

.alert-info {
    border-left-color: #4299e1;
    background: linear-gradient(90deg, rgba(66, 153, 225, 0.05), white);
}

.alert i {
    font-size: 1.2em;
    margin-right: 15px;
}

.alert-urgent i {
    color: #e53e3e;
}

.alert-info i {
    color: #4299e1;
}

.alert-action {
    margin-left: auto;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
}

/* KPI Section */
.kpi-section {
    margin-bottom: 30px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-card.revenue::before {
    background: linear-gradient(45deg, #48bb78, #68d391);
}

.kpi-card.clients::before {
    background: linear-gradient(45deg, #4299e1, #63b3ed);
}

.kpi-card.conversion::before {
    background: linear-gradient(45deg, #ed8936, #f6ad55);
}

.kpi-card.pipeline::before {
    background: linear-gradient(45deg, #9f7aea, #b794f6);
}

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

.kpi-header h3 {
    color: #2d3748;
    font-size: 1.1em;
    font-weight: 600;
}

.kpi-period {
    color: #718096;
    font-size: 0.85em;
}

.kpi-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 10px;
}

.kpi-trend {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 15px;
}

.kpi-trend.positive {
    color: #48bb78;
}

.kpi-trend.negative {
    color: #e53e3e;
}

.kpi-trend i {
    margin-right: 5px;
}

.kpi-detail {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.detail-item {
    text-align: center;
}

.detail-item span {
    display: block;
    color: #718096;
    font-size: 0.8em;
    margin-bottom: 4px;
}

.detail-item strong {
    color: #2d3748;
    font-size: 1.2em;
}

.kpi-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.kpi-chart {
    height: 50px;
    margin-top: auto;
}

.kpi-chart canvas {
    height: 50px !important;
    max-height: 50px !important;
}

/* Charts Section */
.charts-section {
    margin-bottom: 30px;
}

.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 400px;
}

.chart-row:last-child {
    grid-template-columns: 1fr 1fr;
    min-height: 350px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

.chart-card.large {
    grid-column: span 1;
    min-height: 400px;
}

.chart-card.medium {
    grid-column: span 1;
    min-height: 350px;
}

.chart-card canvas {
    flex: 1;
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
}

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

.chart-header h3 {
    color: #2d3748;
    font-size: 1.3em;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-btn.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

/* Data Section */
.data-section {
    margin-bottom: 30px;
}

.data-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.data-row:first-child {
    grid-template-columns: 2fr 1fr;
}

.data-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: #2d3748;
    font-size: 1.2em;
    font-weight: 600;
}

.view-all {
    color: #4299e1;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
}

.task-count {
    background: #e53e3e;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

/* Tables */
.clients-table {
    padding: 0;
}

.clients-table table {
    width: 100%;
    border-collapse: collapse;
}

.clients-table th,
.clients-table td {
    padding: 15px 25px;
    text-align: left;
    border-bottom: 1px solid #f7fafc;
}

.clients-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.client-row:hover {
    background: #f7fafc;
}

.client-info {
    display: flex;
    align-items: center;
}

.client-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #4299e1, #63b3ed);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
}

.client-info strong {
    display: block;
    color: #2d3748;
    font-weight: 600;
}

.client-info p {
    color: #718096;
    font-size: 0.85em;
    margin: 0;
}

.sector-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.sector-tag.utilities {
    background: #e6fffa;
    color: #234e52;
}

.sector-tag.telecom {
    background: #ebf8ff;
    color: #2a4365;
}

.amount {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1em;
}

.trend.positive {
    color: #48bb78;
    font-weight: 600;
}

.trend.negative {
    color: #e53e3e;
    font-weight: 600;
}

.next-action {
    display: flex;
    flex-direction: column;
}

.action-date {
    font-size: 0.8em;
    color: #718096;
    margin-bottom: 2px;
}

.action-type {
    font-size: 0.85em;
    color: #4a5568;
    font-weight: 500;
}

.action-type.urgent {
    color: #e53e3e;
    font-weight: 600;
}

/* Activities */
.activities-list {
    padding: 20px 25px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.activity-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f7fafc;
}

.activity-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
}

.activity-icon.call {
    background: linear-gradient(45deg, #48bb78, #68d391);
}

.activity-icon.email {
    background: linear-gradient(45deg, #4299e1, #63b3ed);
}

.activity-icon.meeting {
    background: linear-gradient(45deg, #9f7aea, #b794f6);
}

.activity-content {
    flex: 1;
}

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

.activity-header strong {
    color: #2d3748;
    font-weight: 600;
}

.activity-time {
    color: #718096;
    font-size: 0.8em;
}

.activity-content p {
    color: #4a5568;
    margin-bottom: 10px;
    line-height: 1.5;
}

.activity-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 500;
}

.tag.high-value {
    background: #f0fff4;
    color: #22543d;
}

.tag.urgent {
    background: #fed7d7;
    color: #742a2a;
}

.tag.proposal {
    background: #ebf8ff;
    color: #2a4365;
}

.tag.success {
    background: #f0fff4;
    color: #22543d;
}

.tag.new-client {
    background: #faf5ff;
    color: #553c9a;
}

/* Tasks */
.tasks-list {
    padding: 20px 25px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f7fafc;
}

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

.task-priority {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    margin-right: 15px;
}

.task-item.urgent .task-priority {
    background: #e53e3e;
}

.task-item.high .task-priority {
    background: #ed8936;
}

.task-item.medium .task-priority {
    background: #4299e1;
}

.task-content {
    flex: 1;
}

.task-content h4 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 4px;
}

.task-content p {
    color: #718096;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.task-meta {
    display: flex;
    gap: 15px;
}

.task-client {
    color: #4299e1;
    font-size: 0.8em;
    font-weight: 500;
}

.task-due {
    color: #718096;
    font-size: 0.8em;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.btn-task-action {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
    transition: all 0.3s ease;
}

.btn-task-action:hover {
    background: #f7fafc;
    color: #4a5568;
}

/* Objectives */
.objectives-list {
    padding: 20px 25px;
}

.objectives-period {
    color: #718096;
    font-size: 0.9em;
}

.objective-item {
    margin-bottom: 20px;
}

.objective-item:last-child {
    margin-bottom: 0;
}

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

.objective-header span:first-child {
    color: #2d3748;
    font-weight: 500;
}

.objective-value {
    color: #4a5568;
    font-weight: 600;
}

.objective-progress {
    margin-bottom: 8px;
}

.progress-text {
    color: #718096;
    font-size: 0.85em;
}

.progress-fill.success {
    background: linear-gradient(45deg, #48bb78, #68d391);
}

.progress-fill.warning {
    background: linear-gradient(45deg, #ed8936, #f6ad55);
}

.progress-fill.danger {
    background: linear-gradient(45deg, #e53e3e, #fc8181);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.kpi-card, .chart-card, .data-card {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive */
@media (max-width: 1400px) {
    .chart-row {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .chart-card {
        min-height: 300px;
    }
    
    .chart-card canvas {
        height: 250px !important;
        min-height: 250px !important;
        max-height: 250px !important;
    }
}

@media (max-width: 1200px) {
    .data-row {
        grid-template-columns: 1fr;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        min-height: 250px;
        padding: 15px;
    }
    
    .chart-card canvas {
        height: 200px !important;
        min-height: 200px !important;
        max-height: 200px !important;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .quick-actions {
        flex-direction: column;
        width: 100%;
    }
}
