/* =========================================
   SXR v6 — module Opérations & Économie
   =========================================
   Mercato (transferts.php), finances (finances.php), mon écurie, candidatures
   (publique + staff), export, sauvegardes. Chargé automatiquement par entete.php.
   N'ajoute que ce que style.css et v6.css n'ont pas. */

/* ---- Montants ---- */
.positif { color: var(--vert); }
.negatif { color: #ff6b6b; }
.montant-tuile { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat-tuile strong.negatif { color: #ff6b6b; }
.stat-tuile.stat-lien { text-decoration: none; color: inherit; transition: border-color .2s; }
.stat-tuile.stat-lien:hover { border-color: var(--rouge); }
table tr.ecriture-annulee td { color: var(--texte-3); text-decoration: line-through; }
table tr.ecriture-annulee td.actions, table tr.ecriture-annulee td:last-child { text-decoration: none; }
table tfoot th { color: var(--texte); font-size: 13px; letter-spacing: 0; border-top: 2px solid var(--bordure); }
.pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 4px; border: 1px solid rgba(255, 255, 255, .25); }

/* ---- Mercato ---- */
.fleche { color: var(--rouge); font-weight: bold; margin: 0 4px; }
table tr.statut-publie td:first-child { border-left: 3px solid var(--vert); }
table tr.statut-valide td:first-child { border-left: 3px solid var(--bleu); }
table tr.statut-refuse td, table tr.statut-annule td { color: var(--texte-3); }
.detail-mouvement { margin-top: 6px; font-size: 13px; }
.detail-mouvement summary { cursor: pointer; color: var(--texte-2); }
.detail-mouvement div { margin-top: 4px; color: #ccc; }
.detail-mouvement.prive { padding-left: 10px; }
.detail-mouvement.prive::before { display: inline; margin-right: 6px; }
td.actions .form-publier { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; border: 1px dashed var(--bordure); border-radius: 6px; }
td.actions .form-publier label.case { font-size: 12px; }
td.actions .case-derogation { color: #fbbf24; }
td.actions input[type=text] { padding: 7px 8px; width: 150px; font-size: 12px; background: #ffffff; color: var(--texte); border: 1px solid var(--bordure-2); border-radius: 5px; }
td.actions input[type=date] { padding: 6px 8px; font-size: 12px; background: #ffffff; color: var(--texte); border: 1px solid var(--bordure-2); border-radius: 5px; }
.admin-form label.champ.prive { padding-left: 12px; }
.admin-form label.champ.prive::before { margin-bottom: 0; }

/* ---- Finances ---- */
.table-finances td.num, .table-finances th.num { white-space: nowrap; }
details.historique { margin-top: 12px; }
details.historique summary { cursor: pointer; color: var(--texte-2); font-size: 14px; }
details.historique .chronologie { margin-top: 12px; }

/* ---- Mon écurie ---- */
.fiche-entete img.logo-ecurie { object-fit: contain; background: #fff; padding: 8px; }
.champ-couleur-tp input[type=color] { width: 70px; height: 42px; padding: 2px; border: 1px solid var(--bordure); background: var(--fond); border-radius: 6px; cursor: pointer; }
.admin-form input:disabled { color: var(--texte-3); cursor: not-allowed; }

/* ---- Candidature publique ---- */
.section-candidature { max-width: 860px; margin: 0 auto; }
.formulaire-candidature label.case { align-self: center; color: #ddd; font-size: 14px; line-height: 1.5; }
.formulaire-candidature label.case a { color: var(--rouge); }
.formulaire-candidature .aide { margin: 4px 0 0; }
.formulaire-candidature input[type=number] { width: 100%; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* champ pot-de-miel : invisible, hors tabulation */
.encadre-confirmation { border-left: 4px solid var(--vert); }
.encadre-confirmation h2 { color: var(--vert); }

/* ---- Candidatures (staff) ---- */
dl.reponses { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: 8px 16px; font-size: 14px; }
dl.reponses dt { color: var(--texte-2); }
dl.reponses dd { margin: 0; color: #ddd; }
dl.reponses dd.prive { padding-left: 10px; }
.form-export { margin-top: 20px; }
.badge a, a.badge { text-decoration: none; }
h2.sous-section { margin-top: 30px; }

/* ---- Export ---- */
.grille-exports .carte-export { display: flex; flex-direction: column; gap: 10px; }
.grille-exports .carte-export .bouton-secondaire { align-self: flex-start; margin-top: auto; }
.grille-exports .carte-inactive { opacity: .55; }
.choix-export { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix-export select { background: #ffffff; color: var(--texte); border: 1px solid var(--bordure); border-radius: 6px; padding: 8px; font-size: 13px; }
.choix-export label.champ { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--texte-2); }

/* ---- Sauvegardes ---- */
.table-sauvegardes code { font-size: 12px; }
.encadre-restauration ol { margin: 10px 0 14px 22px; color: #ccc; line-height: 1.8; }
.encadre-restauration code { background: var(--panneau-2); padding: 2px 6px; border-radius: 4px; color: #ffb3b3; font-size: 13px; word-break: break-all; }
.encadre-restauration p { color: #ccc; line-height: 1.6; margin-bottom: 10px; }

/* ---- Petits écrans ---- */
@media (max-width: 700px) {
    dl.reponses { grid-template-columns: 1fr; }
    .choix-export { grid-template-columns: 1fr; }
    td.actions input[type=text] { width: 100%; }
}

/* ---- Dégâts (déclarations) ---- */
table.table-degats select, table.table-degats input[type=text], table.table-degats input[type=url] { width: 100%; min-width: 120px; padding: 7px 8px; font-size: 13px; background: #ffffff; color: var(--texte); border: 1px solid var(--bordure-2); border-radius: 4px; }
table.table-degats input[type=file] { font-size: 11px; max-width: 150px; color: var(--texte-2); }
table.table-degats td.centre { text-align: center; }
table.table-degats input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--vert); }
.tableau table.table-degats { min-width: 820px; }
.admin-form .tableau.pleine-largeur { grid-column: 1 / -1; }
table tr.ligne-alerte td:first-child { border-left: 3px solid var(--orange); }
.stat-tuile.actif { border-color: var(--rouge); }
.formulaire-degats button.btn-vert { justify-self: start; }

/* ---- Budget public (fiche écurie) ---- */
.budget-public .budget-solde { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.budget-public .budget-solde span { color: var(--texte-2); text-transform: uppercase; letter-spacing: 1.5px; font-family: var(--titre); font-size: 12px; }
.budget-public .budget-solde strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.liste-ecritures-publiques { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.liste-ecritures-publiques li { padding: 6px 0; border-bottom: 1px solid var(--bordure); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.liste-ecritures-publiques li:last-child { border-bottom: 0; }
.liste-ecritures-publiques .quand { color: var(--texte-3); font-size: 12px; min-width: 76px; }
.liste-ecritures-publiques small { color: var(--texte-2); }

/* ---- Qualifications Q1-Q3 ---- */
table.saisie-qualifs input[type=text] { width: 96px; min-width: 0; font-variant-numeric: tabular-nums; }
.tableau table.saisie-qualifs { min-width: 640px; }
.table-qualifs td.temps { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-qualifs td.temps.meilleur { color: #c084fc; font-weight: bold; }
.table-qualifs tr.elimine-q1 td, .table-qualifs tr.elimine-q2 td { color: var(--texte-2); }

/* ---- Statistiques ---- */
canvas.courbes { width: 100%; height: 220px; display: block; }
.stat-tuile small .positif, .stat-tuile small .negatif { font-weight: bold; }
