﻿/* SALES MOCKUP - DIMENSIONS FIXES */
.sales-mockup {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    width: 646px;
    height: 360px;
    position: absolute;
    top: 163px;
    right: -137px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    font-family: 'DM Sans', system-ui, sans-serif;
    /* Effet 3D identique au dashboard hero */
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: all 0.3s ease;
}

.sales-mockup:hover {
    transform: perspective(1000px) rotateY(-2deg) rotateX(2deg);
}

.demo-image {
    position: relative;
    min-height: 600px;
}

/* Header */
.sm-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.sm-title h2 { font-size: 14px; font-weight: 600; color: #1e293b; margin: 0 0 2px; }
.sm-title p { font-size: 9px; color: #64748b; margin: 0; }
.sm-controls { display: flex; gap: 8px; align-items: center; }
.sm-periods { display: flex; background: #f1f5f9; border-radius: 6px; padding: 3px; gap: 2px; }
.sm-periods span { padding: 4px 8px; font-size: 9px; color: #64748b; border-radius: 4px; cursor: pointer; font-weight: 500; }
.sm-periods span.active { background: white; color: #1e293b; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sm-date { display: flex; align-items: center; gap: 4px; padding: 5px 10px; background: white; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 9px; color: #64748b; }
.sm-date i { color: #64748b; font-size: 11px; }

/* Tabs - même design que périodes */
.sm-tabs { display: flex; background: #f1f5f9; border-radius: 6px; padding: 3px; gap: 2px; margin-bottom: 10px; width: fit-content; }
.sm-tabs span { padding: 4px 12px; font-size: 9px; color: #64748b; border-radius: 4px; cursor: pointer; font-weight: 500; }
.sm-tabs span.active { background: white; color: #1e293b; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Stats */
.sm-stats { display: flex; gap: 6px; margin-bottom: 8px; }
.sm-stat { flex: 1; background: white; border-radius: 8px; padding: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.sm-stat-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.sm-stat-top span { font-size: 6px; color: #94a3b8; font-weight: 500; letter-spacing: 0.3px; }
.sm-icon { width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.sm-icon i { font-size: 10px; }
.sm-icon.blue { background: #eff6ff; color: #3b82f6; }
.sm-icon.green { background: #f0fdf4; color: #22c55e; }
.sm-icon.emerald { background: #ecfdf5; color: #10b981; }
.sm-icon.violet { background: #f5f3ff; color: #8b5cf6; }
.sm-icon.amber { background: #fffbeb; color: #f59e0b; }
.sm-val { font-size: 12px; font-weight: 600; color: #1e293b; margin-bottom: 2px; }
.sm-sub { font-size: 7px; color: #94a3b8; }

/* Charts */
.sm-charts { display: flex; gap: 8px; flex: 1; min-height: 0; }
.sm-chart-line { flex: 2; background: white; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; }
.sm-chart-pie { flex: 1; background: white; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; min-width: 120px; overflow: hidden; }
.sm-chart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.sm-chart-head h3 { font-size: 9px; font-weight: 600; color: #1e293b; margin: 0 0 1px; }
.sm-chart-head p { font-size: 6px; color: #94a3b8; margin: 0; }
.sm-legend { display: flex; align-items: center; gap: 3px; font-size: 8px; color: #64748b; }
.sm-legend .dot { width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; }
.sm-svg { width: 100%; flex: 1; min-height: 60px; }

/* Donut - Design exact du logiciel */
.sm-donut { position: relative; width: 60px; height: 60px; margin: 0 auto 4px; flex-shrink: 0; aspect-ratio: 1 / 1; }
.sm-donut svg { width: 100%; height: 100%; display: block; aspect-ratio: 1 / 1; }
.sm-donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; pointer-events: none; }
.sm-donut-center .dc-value { display: block; font-size: 7px; font-weight: 700; color: #1e293b; line-height: 1; }
.sm-donut-center .dc-label { display: block; font-size: 7px; font-weight: 700; color: #1e293b; line-height: 1; margin-top: 1px; }

/* Legend - Grid 3 colonnes égales */
.sm-pie-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 100%; margin-top: 4px; }
.sm-pie-legend .leg-item { display: flex; align-items: flex-start; gap: 4px; padding: 3px 4px; background: #f8fafc; border-radius: 4px; }
.sm-pie-legend .leg-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.sm-pie-legend .leg-dot.yellow { background: #FFEA2C; }
.sm-pie-legend .leg-dot.green { background: #22c55e; }
.sm-pie-legend .leg-dot.dark { background: #374151; }
.sm-pie-legend .leg-text { display: flex; flex-direction: column; gap: 0; }
.sm-pie-legend .leg-name { font-size: 7px; color: #6b7280; }
.sm-pie-legend .leg-val { font-size: 7px; font-weight: 700; color: #1e293b; }

.sales-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.sales-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.sales-header p {
    font-size: 12px;
    color: #6b7280;
}

.sales-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sales-periods {
    display: flex;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.sales-periods span {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
}

.sales-periods span.active {
    background: white;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sales-date {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #111827;
}

.sales-date i {
    color: #3b82f6;
    font-size: 14px;
}

.sales-tabs {
    display: inline-flex;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.sales-tabs span {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
}

.sales-tabs span.active {
    background: white;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Stats Cards - 5 colonnes */
.sales-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.sales-stat {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.sales-stat-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.sales-stat-head span {
    font-size: 9px;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 16px;
}

.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #eff6ff; color: #3b82f6; }
.stat-icon.emerald { background: #ecfdf5; color: #10b981; }
.stat-icon.violet { background: #f5f3ff; color: #8b5cf6; }
.stat-icon.amber { background: #fffbeb; color: #f59e0b; }

.stat-val {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.stat-sub {
    font-size: 10px;
    color: #9ca3af;
}

/* Charts Grid */
.sales-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.sales-chart-line {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.sales-chart-pie {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.chart-head h3 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.chart-head p {
    font-size: 11px;
    color: #9ca3af;
}

.legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.line-svg {
    width: 100%;
    height: 140px;
    display: block;
}

/* Donut Chart */
.donut-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
}

.donut-wrap svg {
    width: 100%;
    height: 100%;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.donut-center span {
    font-size: 10px;
    color: #9ca3af;
}

/* Pie Legend */
.pie-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pie-legend > div {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    background: #f9fafb;
    padding: 8px 10px;
    border-radius: 8px;
}

.pie-legend > div.full {
    grid-column: 1 / -1;
}

.pie-legend b {
    margin-left: auto;
    color: #111827;
    font-weight: 600;
}

.pie-legend .d {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pie-legend .d.dark { background: #1f2937; }
.pie-legend .d.green { background: #22c55e; }
.pie-legend .d.yellow { background: #FFEA2C; }

/* Responsive */
@media (max-width: 1024px) {
    .sales-mockup {
        width: 100%;
        max-width: 600px;
        height: auto;
        min-height: 340px;
        position: relative;
        top: auto;
        right: auto;
        margin: 0 auto;
        /* Effet 3D atténué sur tablette */
        transform: perspective(1000px) rotateY(-2deg) rotateX(2deg);
    }
    
    .sales-mockup:hover {
        transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    }
    
    .demo-image {
        min-height: auto;
        padding: 20px 0;
    }
    
    .sm-stats {
        flex-wrap: wrap;
    }
    
    .sm-stat {
        flex: 1 1 calc(50% - 4px);
        min-width: 100px;
    }
}

@media (max-width: 900px) {
    .sales-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .sales-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sales-mockup {
        width: calc(100% - 32px);
        max-width: 100%;
        height: auto;
        min-height: 280px;
        padding: 12px;
        margin: 0 16px;
        border-radius: 12px;
        /* Pas d'effet 3D sur mobile */
        transform: none;
    }
    
    .sales-mockup:hover {
        transform: translateY(-4px);
    }
    
    .demo-image {
        min-height: auto;
        width: 100%;
    }
    
    /* Header mobile */
    .sm-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .sm-controls {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .sm-periods {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .sm-periods span {
        padding: 4px 6px;
        font-size: 8px;
        white-space: nowrap;
    }
    
    .sm-date {
        padding: 4px 8px;
        font-size: 8px;
    }
    
    /* Tabs mobile */
    .sm-tabs {
        overflow-x: auto;
        max-width: 100%;
    }
    
    .sm-tabs span {
        padding: 4px 8px;
        font-size: 8px;
        white-space: nowrap;
    }
    
    /* Stats mobile - 2 colonnes puis scroll */
    .sm-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    
    .sm-stat {
        flex: none;
        padding: 6px;
    }
    
    .sm-stat:last-child {
        grid-column: span 2;
    }
    
    .sm-stat-top span {
        font-size: 5px;
    }
    
    .sm-icon {
        width: 16px;
        height: 16px;
    }
    
    .sm-icon i {
        font-size: 8px;
    }
    
    .sm-val {
        font-size: 10px;
    }
    
    .sm-sub {
        font-size: 6px;
    }
    
    /* Charts mobile */
    .sm-charts {
        flex-direction: column;
        gap: 6px;
    }
    
    .sm-chart-line {
        flex: none;
        padding: 8px;
    }
    
    .sm-chart-pie {
        flex: none;
        padding: 8px;
        min-width: 0;
    }
    
    .sm-svg {
        min-height: 50px;
    }
    
    /* Donut mobile */
    .sm-donut {
        width: 50px;
        height: 50px;
    }
    
    .sm-donut-center .dc-value,
    .sm-donut-center .dc-label {
        font-size: 6px;
    }
    
    .sm-pie-legend {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }
    
    .sm-pie-legend .leg-item {
        padding: 2px 3px;
    }
    
    .sm-pie-legend .leg-name,
    .sm-pie-legend .leg-val {
        font-size: 6px;
    }
    
    .sm-pie-legend .leg-dot {
        width: 5px;
        height: 5px;
    }
}

@media (max-width: 480px) {
    .sales-mockup {
        width: calc(100% - 24px);
        margin: 0 12px;
        padding: 10px;
        min-height: 250px;
    }
    
    .sm-title h2 {
        font-size: 12px;
    }
    
    .sm-title p {
        font-size: 8px;
    }
    
    .sm-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sm-stat:last-child {
        grid-column: span 2;
    }
    
    .sm-val {
        font-size: 9px;
    }
    
    .sm-chart-head h3 {
        font-size: 8px;
    }
    
    .sm-chart-head p {
        font-size: 5px;
    }
    
    .sm-legend {
        font-size: 6px;
    }
    
    .sm-legend .dot {
        width: 4px;
        height: 4px;
    }
}
