/**
 * Qwerty Dashboard — styles partagés (tous profils)
 * Palette : primaire #ee0e51, ventes #1cd46c, texte #1b2e4b, bordure #e4e4e7
 */

/* ===== Stat cards premium ===== */
.qw-stat-card {
    border-radius: 10px;
    border: 1px solid #e4e4e7;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border-top: 3px solid transparent;
    overflow: hidden;
}

/* Hauteur égale des cartes KPI dans une même ligne,
   y compris quand la carte est enveloppée par un lien */
.qw-dash-row > [class*="col"] > .qw-stat-card,
.qw-dash-row > [class*="col"] > a.qw-stat-card {
    height: 100%;
}
.qw-dash-row > [class*="col"] > a:not(.qw-stat-card) {
    display: block;
    height: 100%;
}
.qw-dash-row > [class*="col"] > a:not(.qw-stat-card) > .qw-stat-card {
    height: 100%;
}
.qw-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(238, 14, 81, 0.12);
    border-top-color: #ee0e51;
}
.qw-stat-card.qw-accent-success { border-top-color: rgba(28, 212, 108, 0.6); }
.qw-stat-card.qw-accent-success:hover { border-top-color: #1cd46c; box-shadow: 0 12px 28px rgba(28, 212, 108, 0.14); }
.qw-stat-card.qw-accent-danger { border-top-color: rgba(238, 14, 81, 0.45); }
.qw-stat-card.qw-accent-info { border-top-color: rgba(1, 148, 218, 0.5); }
.qw-stat-card.qw-accent-info:hover { border-top-color: #0194da; box-shadow: 0 12px 28px rgba(1, 148, 218, 0.14); }
.qw-stat-card.qw-accent-warning { border-top-color: rgba(255, 193, 7, 0.55); }
.qw-stat-card.qw-accent-warning:hover { border-top-color: #ffc107; box-shadow: 0 12px 28px rgba(255, 193, 7, 0.16); }

/* Icône dans cercle coloré */
.qw-stat-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 14px;
}
.qw-stat-icon.qw-icon-primary { background: rgba(238, 14, 81, 0.10); color: #ee0e51; }
.qw-stat-icon.qw-icon-success { background: rgba(28, 212, 108, 0.12); color: #16a34a; }
.qw-stat-icon.qw-icon-danger { background: rgba(238, 14, 81, 0.10); color: #ee0e51; }
.qw-stat-icon.qw-icon-info { background: rgba(1, 148, 218, 0.10); color: #0194da; }
.qw-stat-icon.qw-icon-warning { background: rgba(255, 193, 7, 0.14); color: #d69a00; }
.qw-stat-icon.qw-icon-purple { background: rgba(124, 58, 237, 0.10); color: #7c3aed; }

[dir="rtl"] .qw-stat-icon { margin-right: 0; margin-left: 14px; }

/* ===== Chiffre KPI — typographie normalisée =====
   Même police / taille / graisse sur tous les tableaux de bord,
   quel que soit le tag utilisé (h1, h3, h4...) */
.qw-stat-card .qw-count,
.qw-kpi-number {
    font-family: 'Rubik', 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.5px;
    color: #1b2e4b;
    margin-bottom: 0;
}
@media (max-width: 767.98px) {
    .qw-stat-card .qw-count,
    .qw-kpi-number { font-size: 24px; }
}

/* ===== Skeleton shimmer (chargement) ===== */
@keyframes qwShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.qw-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: qwShimmer 1.4s infinite;
    border-radius: 6px;
    height: 20px;
}
.qw-skeleton.qw-skeleton-sm { height: 14px; }
.qw-skeleton.qw-skeleton-lg { height: 28px; }
.qw-skeleton.qw-skeleton-circle { border-radius: 50%; }

/* ===== Entrée slide-up des sections ===== */
@keyframes qwSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.qw-dash-row { animation: qwSlideUp 0.45s ease both; }
.qw-dash-row:nth-child(2) { animation-delay: 0.08s; }
.qw-dash-row:nth-child(3) { animation-delay: 0.16s; }
.qw-dash-row:nth-child(4) { animation-delay: 0.24s; }
.qw-dash-row:nth-child(5) { animation-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
    .qw-dash-row, .qw-skeleton { animation: none !important; }
    .qw-stat-card, .qw-quick-link { transition: none !important; }
}

/* ===== Quick-link modernisé ===== */
.qw-quick-link {
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid #e4e4e7;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 15px;
    color: inherit;
    height: 100%;
}
.qw-quick-link:hover,
.qw-quick-link:focus {
    background: #fff4f7 !important;
    border-color: rgba(238, 14, 81, 0.25);
    box-shadow: 0 4px 12px rgba(238, 14, 81, 0.10);
    text-decoration: none;
    color: inherit;
}
.qw-quick-link:hover i { color: #ee0e51 !important; }

/* ===== Chart wrappers ===== */
.qw-chart-wrap { position: relative; }

/* ===== Badge tendance ===== */
.qw-trend-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.qw-trend-up { background: rgba(28, 212, 108, 0.12); color: #16a34a; }
.qw-trend-down { background: rgba(238, 14, 81, 0.10); color: #dc2626; }
.qw-trend-neutral { background: rgba(113, 113, 122, 0.12); color: #71717a; }

/* ===== Légende custom (doughnut) ===== */
.qw-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #596882;
    margin: 0 10px;
}
.qw-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ===== Cartes résumé trimestriel ===== */
.qw-quarter-card {
    border-radius: 10px;
    border: 1px solid #e4e4e7;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.qw-quarter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(27, 46, 75, 0.10);
}

/* ===== Barres de progression animées (qw-fill) ===== */
.qw-fill {
    transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
    .qw-fill { transition: none !important; }
}

/* ===== Bannière d'offre (proposition de plan / pack) =====
   Une offre n'est pas un avertissement : pas de jaune « alert-warning ».
   Fond rosé léger, filet couleur marque, pastille d'icône, bouton plein.
   Utilisée par layouts.partials.module_sans_abonnement et
   layouts.partials.proposition_ordoncee. */
.qw-offre {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    position: relative;
    margin-bottom: 10px;
    padding: 10px 14px;
    border: 1px solid #f6c9d7;
    border-left: 4px solid #ee0e51;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(238, 14, 81, 0.07) 0%, #ffffff 65%);
    color: #1b2e4b;
    font-size: 13px;
    line-height: 1.45;
}
.qw-offre-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ee0e51;
    color: #ffffff;
}
.qw-offre-icone svg { width: 15px; height: 15px; }
.qw-offre-texte { flex: 1 1 260px; min-width: 0; }
.qw-offre-prix { color: #ee0e51; font-weight: 600; white-space: nowrap; }
.qw-offre-barre { color: #8392a5; margin-right: 3px; }
.qw-offre-note { color: #637388; font-size: 12px; }
.qw-offre-deduit { color: #10b759; font-size: 12px; }
.qw-offre-cta,
.qw-offre-cta:visited {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    background: #ee0e51;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background .15s ease, box-shadow .15s ease;
}
.qw-offre-cta:hover,
.qw-offre-cta:focus {
    background: #c90b44;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(238, 14, 81, 0.25);
}
.qw-offre-lien,
.qw-offre-lien:visited { color: #637388; font-size: 12px; text-decoration: underline; }
.qw-offre-lien:hover { color: #ee0e51; }
.qw-offre-fermer {
    margin-left: auto;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: #8392a5;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.qw-offre-fermer:hover { color: #1b2e4b; }

/* Variante fidélité : le même cadre, en vert « gagné ». */
.qw-offre.qw-offre--fidelite {
    border-color: #bfeccf;
    border-left-color: #10b759;
    background: linear-gradient(90deg, rgba(16, 183, 89, 0.08) 0%, #ffffff 65%);
}
.qw-offre--fidelite .qw-offre-icone,
.qw-offre--fidelite .qw-offre-cta { background: #10b759; }
.qw-offre--fidelite .qw-offre-cta:hover { background: #0d9a4b; box-shadow: 0 4px 12px rgba(16, 183, 89, 0.25); }
.qw-offre--fidelite .qw-offre-prix { color: #10b759; }

/* Thème sombre (le sélecteur de thème pose body.dark-mode). */
body.dark-mode .qw-offre {
    border-color: rgba(238, 14, 81, 0.35);
    border-left-color: #ee0e51;
    background: linear-gradient(90deg, rgba(238, 14, 81, 0.18) 0%, rgba(255, 255, 255, 0.03) 70%);
    color: #e5e9f2;
}
body.dark-mode .qw-offre.qw-offre--fidelite {
    border-color: rgba(16, 183, 89, 0.35);
    border-left-color: #10b759;
    background: linear-gradient(90deg, rgba(16, 183, 89, 0.16) 0%, rgba(255, 255, 255, 0.03) 70%);
}
body.dark-mode .qw-offre-prix { color: #ff5c8a; }
body.dark-mode .qw-offre--fidelite .qw-offre-prix { color: #3ddc84; }
body.dark-mode .qw-offre-note,
body.dark-mode .qw-offre-lien,
body.dark-mode .qw-offre-barre,
body.dark-mode .qw-offre-fermer { color: #a6b0c2; }
body.dark-mode .qw-offre-fermer:hover { color: #ffffff; }
