/* Dashboard Stat Detail Modal - 2026 */

.dsd-wrap {
    font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 0;
}

.dsd-error {
    padding: 24px;
    text-align: center;
    color: #dc2626;
    font-weight: 600;
}

.dsd-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border-radius: 16px;
    margin-bottom: 20px;
    color: #fff;
    flex-wrap: wrap;
}

.dsd-hero-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dsd-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.dsd-hero-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}

.dsd-hero-sub {
    margin: 0;
    opacity: 0.9;
    font-size: 13px;
}

.dsd-hero-total {
    text-align: right;
}

.dsd-hero-total-label {
    display: block;
    font-size: 12px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dsd-hero-total-value {
    font-size: 28px;
    font-weight: 800;
}

.dsd-hero-blue { background: linear-gradient(135deg, #2563eb, #4f46e5); }
.dsd-hero-green { background: linear-gradient(135deg, #059669, #10b981); }
.dsd-hero-amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.dsd-hero-red { background: linear-gradient(135deg, #dc2626, #ef4444); }
.dsd-hero-purple { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.dsd-hero-emerald { background: linear-gradient(135deg, #047857, #10b981); }
.dsd-hero-cyan { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.dsd-hero-pink { background: linear-gradient(135deg, #db2777, #ec4899); }
.dsd-hero-indigo { background: linear-gradient(135deg, #4f46e5, #6366f1); }

.dsd-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.dsd-alert a {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
}

.dsd-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.dsd-summary-pill {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    border-top: 3px solid var(--pill-color, #6366f1);
}

.dsd-summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.dsd-summary-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.dsd-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dsd-cities {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
}

.dsd-city-row {
    display: grid;
    grid-template-columns: 140px 1fr 50px;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.dsd-city-row:last-child {
    margin-bottom: 0;
}

.dsd-city-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dsd-city-bar-wrap {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.dsd-city-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    min-width: 4px;
    transition: width 0.3s ease;
}

.dsd-city-count {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    text-align: right;
}

.dsd-table-section {
    margin-bottom: 16px;
}

.dsd-detail-table {
    font-size: 13px;
    margin-bottom: 0;
}

.dsd-detail-table thead th {
    background: #f3f4f6;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
}

.dsd-detail-table tbody td {
    vertical-align: middle;
}

.dsd-code-link {
    color: #4f46e5;
    font-weight: 700;
    text-decoration: none;
}

.dsd-code-link:hover {
    color: #4338ca;
    text-decoration: underline;
}

.dsd-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: color-mix(in srgb, var(--badge-color) 15%, white);
    color: var(--badge-color);
    white-space: nowrap;
}

.dsd-empty {
    text-align: center;
    padding: 32px !important;
    color: #9ca3af;
    font-weight: 500;
}

.dsd-footer-actions {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.dsd-full-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dsd-full-list-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    color: #fff !important;
}

/* Clickable dashboard cards */
.stat-card-clickable {
    cursor: pointer;
    user-select: none;
}

.stat-card-clickable::after {
    content: "Voir détails →";
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stat-card-clickable:hover::after {
    opacity: 1;
}

.stat-card-clickable:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.kpi-card.stat-card-clickable::after,
.pipeline-item.stat-card-clickable::after {
    display: none;
}

@media (max-width: 768px) {
    .dsd-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .dsd-hero-total {
        text-align: left;
    }

    .dsd-city-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .dsd-city-count {
        text-align: left;
    }
}
