/* ============================================================
   WEDORIA FICHES — Refonte back office · Phase 4 (2026-08)
   Fiches détail (client, événement, galerie) : KPI sans bordure,
   badges du héros sombre en chip verre + point, boutons calmes.
   Chargé après dashboard.css.
   ============================================================ */

/* ── KPI de fiche : sans bordure, ombre douce, lift ── */
.ep-event-kpi {
    border: none;
    box-shadow: var(--wd-shadow-soft);
    transition: transform 250ms var(--wd-ease), box-shadow 250ms var(--wd-ease);
}
a.ep-event-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--wd-shadow-lift);
    text-decoration: none;
}
.ep-kpi-value { font-variant-numeric: tabular-nums; }

/* ── Badges de statut sur le héros sombre : chip verre + point ── */
.ep-event-hero .badge[class*="bg-"] {
    background: rgba(250, 247, 242, 0.14) !important;
    color: var(--wd-ivoire);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 11px 4px 9px;
    border-radius: 999px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ep-event-hero .badge[class*="bg-"]::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: #cfc9bf;
    flex: none;
}
.ep-event-hero .badge.bg-success::before { background: #8fb894; }
.ep-event-hero .badge.bg-warning::before { background: #e0b06a; }
.ep-event-hero .badge.bg-danger::before { background: #d98a7c; }
.ep-event-hero .badge.bg-info::before { background: #a8b2c4; }
.ep-event-hero .badge.bg-primary::before { background: var(--wd-or); }
.ep-event-hero .badge.bg-dark::before { background: #cfc9bf; }
.ep-event-hero .badge.bg-light::before { background: #cfc9bf; }
.ep-event-hero .badge.bg-secondary::before { background: #cfc9bf; }

/* Compteurs dans les boutons du héros (ex. badge du Programme) : neutres */
.ep-event-hero-actions .badge {
    background: rgba(250, 247, 242, 0.2) !important;
    color: var(--wd-ivoire) !important;
}
.ep-event-hero-actions .badge::before { display: none; }

/* ── Boutons du héros : verre affiné ── */
.ep-event-hero-actions .btn {
    background: rgba(250, 247, 242, 0.1);
    border: 1px solid rgba(250, 247, 242, 0.22);
    transition: background 200ms var(--wd-ease), border-color 200ms var(--wd-ease), transform 200ms var(--wd-ease);
}
.ep-event-hero-actions .btn:hover {
    background: rgba(250, 247, 242, 0.18);
    border-color: rgba(250, 247, 242, 0.35);
    color: #fff;
    transform: translateY(-1px);
}
.ep-event-hero-actions .btn:active { transform: scale(0.98); }

/* ============================================================
   PARAMÈTRES — la section EST la carte (tête intégrée sous
   hairline), barre d'enregistrement collante, champs raffinés.
   ============================================================ */
.wd-settings-section {
    background: var(--ep-bg-surface);
    border-radius: var(--wd-r-card);
    box-shadow: var(--wd-shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.wd-settings-section-head {
    margin: 0;
    padding: 1.1rem 1.5rem 0.9rem;
    border-bottom: 1px solid var(--wd-hairline);
}
.wd-settings-section-head .wd-eyebrow { margin-bottom: 0.15rem; }
.wd-settings-section-title { margin: 0; }
.wd-settings-section-lede { margin: 0.2rem 0 0; }
.wd-settings-card,
.wd-settings-section .card {
    background: transparent;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 1.35rem 1.5rem 1.5rem;
    flex: 1;
    max-width: none !important;
}
.wd-settings-grid { align-items: stretch; gap: 1.2rem; }

/* Barre d'enregistrement collante : toujours visible, jamais orpheline */
.wd-settings-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 1.4rem;
    padding: 0.85rem 0 calc(0.85rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--wd-hairline-2);
    background: rgba(250, 247, 242, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.wd-settings-footer .btn {
    background: var(--wd-onyx);
    border: none;
    color: var(--wd-ivoire);
    border-radius: 999px !important;
    padding: 0.55rem 1.35rem;
    font-weight: 600;
    font-size: 0.86rem;
    box-shadow: var(--wd-shadow-soft);
    transition: transform 250ms var(--wd-ease), box-shadow 250ms var(--wd-ease);
}
.wd-settings-footer .btn:hover {
    background: var(--wd-onyx);
    color: var(--wd-ivoire);
    transform: translateY(-1px);
    box-shadow: var(--wd-shadow-lift);
}
.wd-settings-footer .btn:active { transform: scale(0.98); }
.wd-settings-footer .btn i { color: var(--wd-or); }

/* ── Super admin : badges des cartes plateforme en dot+texte ── */
.ep-partner-card .badge[class*="bg-"],
.ep-section-header .badge[class*="bg-"] {
    background: transparent !important;
    color: var(--ep-text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0 0 0 13px;
    position: relative;
}
.ep-partner-card .badge[class*="bg-"]::before,
.ep-section-header .badge[class*="bg-"]::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 7px; height: 7px; border-radius: 50%;
    background: #9b968f;
}
.ep-partner-card .badge.bg-success::before,
.ep-section-header .badge.bg-success::before { background: var(--ep-success); }
.ep-partner-card .badge.bg-warning::before,
.ep-section-header .badge.bg-warning::before { background: var(--ep-warning); }
.ep-partner-card .badge.bg-danger::before,
.ep-section-header .badge.bg-danger::before { background: var(--ep-danger); }
.ep-partner-card .badge.bg-secondary::before,
.ep-section-header .badge.bg-secondary::before { background: var(--ep-secondary-gray); }
/* bg-dark (« Engagé » du budget) : texte ivoire global → illisible sans fond */
.ep-section-header .badge.bg-dark { color: var(--wd-onyx) !important; border-color: var(--ep-border-color); }
.ep-section-header .badge.bg-dark::before { background: var(--wd-onyx); }
.ep-partner-card .badge i,
.ep-section-header .badge i { display: none; }

/* Sélecteur de fichier : pill onyx au lieu du bouton natif (global) */
input[type="file"]::file-selector-button,
.wd-settings-card input[type="file"]::file-selector-button {
    background: var(--wd-onyx);
    color: var(--wd-ivoire);
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    margin-right: 0.85rem;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Nuanciers (couleurs du portail) : vraie pastille encadrée */
.wd-settings-card input[type="color"] {
    width: 52px;
    height: 36px;
    padding: 3px;
    border: 1px solid var(--wd-hairline-2);
    border-radius: 10px !important;
    background: var(--ep-bg-surface);
    cursor: pointer;
}

/* ── Budget : enveloppe, projection et dépassement ──
   Jauge partagée par la page Budget du planner et le portail couple :
   payé (sauge) | engagé à régler (onyx) | prévu pas encore engagé (hachures),
   le trait vertical marquant l'enveloppe. */
.wd-budget-env {
    background: var(--ep-bg-surface);
    border: 1px solid var(--ep-border-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--wd-shadow-soft);
}
.wd-budget-env-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.9rem;
}
.wd-budget-env-figure { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.wd-budget-env-figure--end { text-align: right; }
.wd-budget-env-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--wd-fumee-fonce);
}
.wd-budget-env-value {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--wd-onyx);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.wd-budget-env-value--empty { font-size: 1rem; font-weight: 500; color: var(--ep-text-muted); }
.wd-budget-env--over .wd-budget-env-figure--end .wd-budget-env-value { color: var(--ep-danger); }

.wd-budget-gauge { position: relative; padding: 4px 0; }
.wd-budget-gauge-track {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--wd-papier);
}
.wd-budget-gauge-seg { display: block; height: 100%; flex: none; }
.wd-budget-gauge-seg--paid { background: var(--ep-success); }
.wd-budget-gauge-seg--committed { background: var(--wd-onyx); }
.wd-budget-gauge-seg--planned {
    background: repeating-linear-gradient(-45deg, var(--wd-fumee) 0 4px, #d6ccb9 4px 8px);
}
.wd-budget-gauge-cap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--wd-onyx);
    border-radius: 1px;
}
.wd-budget-env--over .wd-budget-gauge-cap { background: var(--ep-danger); }

.wd-budget-legend {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    font-size: 0.8rem;
    color: var(--wd-fumee-fonce);
}
.wd-budget-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.wd-budget-legend strong { color: var(--wd-onyx); font-weight: 600; font-variant-numeric: tabular-nums; }
.wd-budget-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.wd-budget-legend-dot--paid { background: var(--ep-success); }
.wd-budget-legend-dot--committed { background: var(--wd-onyx); }
.wd-budget-legend-dot--planned { background: repeating-linear-gradient(-45deg, var(--wd-fumee) 0 2px, #d6ccb9 2px 4px); }

.wd-budget-env-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.9rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--ep-border-color);
    font-size: 0.85rem;
    color: var(--wd-fumee-fonce);
}
.wd-budget-env-note i { flex: none; margin-top: 0.1rem; }
.wd-budget-env-note strong { color: var(--wd-onyx); font-variant-numeric: tabular-nums; }
.wd-budget-env-note--over { color: var(--ep-danger); }
.wd-budget-env-note--over strong { color: var(--ep-danger); }

/* Signal sous le donut Budget de la fiche événement */
.wd-budget-flag { display: block; margin-top: 0.15rem; font-size: 0.75rem; color: var(--ep-text-muted); }
.wd-budget-flag--over { color: var(--ep-danger); font-weight: 600; }

/* Écart engagé / prévu sur une ligne de budget */
.wd-budget-variance { font-variant-numeric: tabular-nums; }
.wd-budget-variance--up { color: var(--ep-danger); }
.wd-budget-variance--down { color: var(--ep-success); }

@media (max-width: 575.98px) {
    .wd-budget-env { padding: 1rem; }
    .wd-budget-env-value { font-size: 1.1rem; }
}
