/* Design Ovelio : couche de motifs par-dessus le thème de base (lib/shell.js).
   Langage visuel tire du logo : carre + entaille diagonale + petit triangle en haut a droite.
   - entaille / hachures diagonales = mouvement, progression
   - triangle d'angle = repere "Ovelio" sur chaque bloc
   - rail de points = parcours client en etapes
   Ce fichier est partage : le futur portail client le reutilise tel quel. */

/* ---------- Fond : hachures (le logo n'est jamais reproduit, tourne ou teinte : charte) ---------- */
.main { overflow-x: clip; }
.sidebar { padding-bottom: 84px; }
.sidebar::before {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 240px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(var(--accent-rgb,249,192,65),0.06) 10px 11px);
  -webkit-mask-image: linear-gradient(to top, #000, transparent);
  mask-image: linear-gradient(to top, #000, transparent);
  pointer-events: none;
}

/* ---------- Navigation : icones + entaille sur l'element actif ---------- */
.nav-item { display: flex; align-items: center; gap: 12px; transition: background 0.15s, color 0.15s; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
a.nav-item:not(.nav-item--active):hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item--active { clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); border-radius: 10px 0 10px 10px; }
.nav-item--disabled { opacity: 0.7; }
.nav-item--disabled em { margin-left: auto; }

/* ---------- Titres de page ---------- */
.page-title::after {
  content: ''; display: block; width: 52px; height: 3px; margin-top: 12px;
  background: linear-gradient(90deg, var(--yellow), transparent);
  border-radius: 2px;
}

/* ---------- Blocs : triangle d'angle + marqueur de titre ---------- */
.panel { position: relative; transition: border-color 0.2s; }
.panel:hover { border-color: rgba(var(--accent-rgb,249,192,65),0.22); }
.panel::after {
  content: ''; position: absolute; right: 14px; bottom: 14px;
  width: 14px; height: 14px;
  background: linear-gradient(135deg, transparent 50%, rgba(var(--accent-rgb,249,192,65),0.55) 50%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.panel--note::after { opacity: 0.4; }
.panel h2 { padding-left: 24px; }
.panel h2::before { left: 0; top: 2px; bottom: auto; width: 4px; height: 15px; border-radius: 2px; background: var(--yellow); }

/* ---------- Cartes de chiffres : hachures qui s'estompent dans l'angle ---------- */
.card { transition: transform 0.2s, border-color 0.2s; }
.card:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb,249,192,65),0.3); }
.card::before {
  content: ''; position: absolute; right: -14px; bottom: -14px; width: 110px; height: 110px;
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(var(--accent-rgb,249,192,65),0.12) 7px 8px);
  -webkit-mask-image: radial-gradient(circle at 100% 100%, #000, transparent 68%);
  mask-image: radial-gradient(circle at 100% 100%, #000, transparent 68%);
  pointer-events: none;
}

/* ---------- Production : rail de parcours en 5 etapes ---------- */
.kanban { counter-reset: etape; }
.kanban-col { counter-increment: etape; position: relative; padding-top: 28px; }
.kanban-col::before {
  content: ''; position: absolute; top: 6px; left: 0; right: -16px; height: 2px;
  background: linear-gradient(90deg, var(--yellow), rgba(var(--accent-rgb,249,192,65),0.12));
}
.kanban-col:last-child::before { right: 0; background: linear-gradient(90deg, var(--yellow), rgba(var(--accent-rgb,249,192,65),0.35)); }
.kanban-col::after {
  content: ''; position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 14px rgba(var(--accent-rgb,249,192,65),0.75), 0 0 0 4px var(--bg);
}
.kanban-col-titre::before {
  content: counter(etape, decimal-leading-zero);
  color: var(--yellow); font-weight: 700; letter-spacing: 0.5px;
}
.kanban-cards > p {
  border: 1px dashed var(--border); border-radius: 12px; padding: 18px 14px;
  text-align: center; margin: 0;
}
.kanban-card { transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.kanban-card:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb,249,192,65),0.4); box-shadow: 0 10px 26px rgba(0,0,0,0.35); }

/* ---------- Tuiles, onglets ---------- */
.module-tile { transition: border-color 0.15s, transform 0.15s; }
a.module-tile:hover, .module-tile:hover { border-color: rgba(var(--accent-rgb,249,192,65),0.35); transform: translateY(-1px); }
.tab { transition: background 0.15s, color 0.15s; }
a.tab:not(.tab--active):hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* ---------- Pastille d'alerte dans le menu ---------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e5483b; color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }

/* ---------- Ambiance dorée : fond en couches (palette officielle uniquement : #F9C041, #C9B37E, blanc, noir) ----------
   Les dégradés sont réservés au décor (fond, lueurs, jauges, grands chiffres). Le logo et les boutons restent à plat. */
body {
  background:
    radial-gradient(1100px 650px at 10% -8%, rgba(var(--accent-rgb,249,192,65),0.22), transparent 62%),
    radial-gradient(900px 600px at 102% 6%, rgba(201,179,126,0.14), transparent 58%),
    radial-gradient(1000px 700px at 55% 118%, rgba(var(--accent-rgb,249,192,65),0.12), transparent 62%),
    linear-gradient(135deg, rgba(var(--accent-rgb,249,192,65),0.06) 0%, transparent 34%, transparent 66%, rgba(201,179,126,0.07) 100%),
    #000000;
  background-attachment: fixed;
}
/* faisceau diagonal lent, écho de l'entaille du logo (derrière le contenu) */
body::after {
  content: ''; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(var(--accent-rgb,249,192,65),0.045) 46%, rgba(255,255,255,0.05) 50%, rgba(var(--accent-rgb,249,192,65),0.045) 54%, transparent 60%);
  animation: faisceau 26s ease-in-out infinite alternate;
}
@keyframes faisceau { from { transform: translateX(-7%); } to { transform: translateX(9%); } }

/* blocs : reflet doré en haut, filet lumineux */
.panel, .card, .kanban-card {
  background-image: linear-gradient(165deg, rgba(var(--accent-rgb,249,192,65),0.075), rgba(var(--accent-rgb,249,192,65),0) 42%);
  background-color: var(--surface);
}
.panel, .card { box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 40px -24px rgba(0,0,0,0.9); }
.phase--actif, .alerte--attente { box-shadow: inset 0 1px 0 rgba(var(--accent-rgb,249,192,65),0.45), 0 18px 50px -20px rgba(var(--accent-rgb,249,192,65),0.28); }

/* menu latéral : filet doré dégradé sur le bord droit */
.sidebar::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; pointer-events: none; background: linear-gradient(180deg, rgba(var(--accent-rgb,249,192,65),0.55), transparent 38%, transparent 68%, rgba(201,179,126,0.3)); }

/* jauges, traits de progression et grands chiffres : or dégradé */
.jauge-barre div, .pa-jauge > span, .pa-jauge--large > span, .etape-ligne i, .trait i { background: linear-gradient(90deg, #C9B37E, #F9C041); }
.card-value--gradient, .jauge-texte strong { background: linear-gradient(135deg, var(--yellow,#F9C041) 20%, #C9B37E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-title::after { background: linear-gradient(90deg, var(--yellow,#F9C041), #C9B37E 60%, transparent); width: 72px; }

@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }

/* ---------- Icônes animées des états (engrenage qui tourne, flèche qui pointe, coche qui se dessine) ---------- */
.ico { width: 1.25em; height: 1.25em; margin-right: 0.45em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.tag:has(.ico), .pa-tag:has(.ico) { display: inline-flex; align-items: center; }
.ico-engrenage { animation: tourne 4.5s linear infinite; transform-origin: 50% 50%; }
.ico-synchro { animation: tourne 1s linear infinite; transform-origin: 50% 50%; }
.ico-fleche { animation: pointe 1.2s ease-in-out infinite; }
.ico-coche path { stroke-dasharray: 1; animation: dessine 0.7s ease-out 0.2s both; }
/* interactif : l'engrenage s'emballe quand on survole l'étiquette ou la ligne */
.tag:hover .ico-engrenage, .pa-tag:hover .ico-engrenage, .jalon:hover .ico-engrenage, .pa-jalon:hover .ico-engrenage, .phase > summary:hover .ico-engrenage { animation-duration: 0.9s; }
.tag:hover .ico-fleche, .jalon:hover .ico-fleche { animation-duration: 0.55s; }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes pointe { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes dessine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* pastille "Mise à jour…" quand l'avancement change en direct */
.sync-chip { position: fixed; top: 14px; left: 50%; transform: translate(-50%, -30px); z-index: 9999; display: inline-flex; align-items: center; gap: 0; padding: 9px 18px; border-radius: 999px; background: #1C1C1C; border: 1px solid rgba(var(--accent-rgb,249,192,65),0.55); color: #FFFFFF; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .25s, transform .35s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.sync-chip.visible { opacity: 1; transform: translate(-50%, 0); }
.sync-chip .ico { color: #F9C041; }
@media (prefers-reduced-motion: reduce) { .ico-engrenage, .ico-synchro, .ico-fleche, .ico-coche path { animation: none !important; } }

.ico-calendrier .jour { fill: currentColor; stroke: none; transform-box: fill-box; transform-origin: center; animation: battement 2.4s ease-in-out infinite; }
@keyframes battement { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) { .ico-calendrier .jour { animation: none; } }
