/*
 * Soumissions : éditeur et listes de l'administration (js/soumissions-admin.js),
 * bloc de la soumission dans le tableau de bord du client
 * (js/soumissions-client.js). Feuille séparée de style.css : les deux pages
 * la chargent explicitement, et le reste du site n'en paie pas le poids.
 * Couleurs tirées des variables du thème (sombre par défaut, clair via
 * [data-theme="light"]).
 */

/* Statut de la demande « Soumission envoyée » (badges de style.css). */
.badge-quote-sent { background: rgba(14, 165, 233, 0.15); color: #0EA5E9; border: 1px solid rgba(14,165,233,0.3); }
[data-theme="light"] .badge-quote-sent { color: #075985; }

/* Statuts propres aux soumissions. */
.soum-statut { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.soum-statut-brouillon { background: rgba(148, 163, 184, 0.15); color: var(--color-text-muted); border-color: rgba(148,163,184,0.3); }
.soum-statut-envoyee { background: rgba(14, 165, 233, 0.15); color: #0EA5E9; border-color: rgba(14,165,233,0.3); }
.soum-statut-expiree { background: rgba(245, 158, 11, 0.15); color: #F59E0B; border-color: rgba(245,158,11,0.3); }
.soum-statut-changements_demandes { background: rgba(139, 92, 246, 0.15); color: #A78BFA; border-color: rgba(139,92,246,0.3); }
.soum-statut-acceptee { background: rgba(16, 185, 129, 0.15); color: #10B981; border-color: rgba(16,185,129,0.3); }
.soum-statut-refusee, .soum-statut-annulee { background: rgba(239, 68, 68, 0.12); color: #EF4444; border-color: rgba(239,68,68,0.3); }
.soum-statut-remplacee { background: rgba(148, 163, 184, 0.12); color: var(--color-text-muted); border-color: rgba(148,163,184,0.25); }
[data-theme="light"] .soum-statut-envoyee { color: #075985; }
[data-theme="light"] .soum-statut-expiree { color: #92400E; }
[data-theme="light"] .soum-statut-changements_demandes { color: #5B21B6; }
[data-theme="light"] .soum-statut-acceptee { color: #065F46; }
[data-theme="light"] .soum-statut-refusee, [data-theme="light"] .soum-statut-annulee { color: #B91C1C; }

.soum-encadre { padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--glass-bg); margin-bottom: 1rem; font-size: 0.9rem; }
.soum-avertissement { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.soum-succes { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); }
.soum-info { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.08); }
.soum-encadre p { margin: 0.25rem 0; }
.soum-encadre ul { margin: 0.25rem 0 0 1.1rem; }
.soum-petit { font-size: 0.8rem; color: var(--color-text-muted); }
.soum-titre { font-weight: 700; margin: 1rem 0 0.5rem; font-size: 0.95rem; }
.soum-entete { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.soum-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }
.soum-actions .auth-btn { width: auto; }

/* Tableaux (lignes, totaux, échéancier) : défilement horizontal contenu dans
   le bloc, jamais dans la page (390 px). */
.soum-defile { overflow-x: auto; max-width: 100%; }
.soum-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.soum-table th, .soum-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--glass-border); text-align: left; vertical-align: top; }
.soum-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); font-weight: 600; }
.soum-table .n { text-align: right; white-space: nowrap; }
.soum-table tr.soum-total td { font-weight: 700; border-top: 2px solid var(--color-cta); }
.soum-provenance { display: block; font-size: 0.72rem; color: var(--color-text-muted); margin-top: 0.2rem; }

/* Éditeur (admin) */
.soum-editeur input.auth-input, .soum-editeur select.auth-input, .soum-editeur textarea.auth-input { font-size: 0.85rem; padding: 0.4rem 0.55rem; }
.soum-ligne-edition td { padding: 0.3rem; }
.soum-ligne-edition .soum-qte { width: 4.5rem; }
.soum-ligne-edition .soum-prix { width: 7rem; }
.soum-ligne-edition .soum-freq { width: 6.5rem; }
.soum-a-saisir input.soum-prix { border-color: var(--color-warning, #F59E0B); }
.soum-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.soum-grille label, .soum-champ label { display: block; font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: 0.2rem; }
.soum-champ { margin-top: 0.75rem; }
.soum-champ textarea { width: 100%; min-height: 4.5rem; resize: vertical; }
.soum-retirer { background: none; border: none; color: var(--color-error); cursor: pointer; font-size: 1.1rem; }
.soum-modifie { color: var(--color-warning, #F59E0B); font-size: 0.8rem; font-weight: 600; }
.soum-historique li { margin: 0.25rem 0; }
.soum-historique a, .soum-lien { color: var(--color-cta); }

/* Barème (admin) */
.soum-bareme td input.auth-input { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.soum-bareme .soum-prix { width: 7.5rem; }
/* Libellé lisible en entier (la colonne « Poste » se rétrécissait au minimum). */
.soum-bareme td:first-child { min-width: 18rem; }
.soum-bareme td:first-child input.auth-input { width: 100%; min-width: 16rem; }
.soum-badge-confirmer { display: inline-block; font-size: 0.7rem; font-weight: 700; color: #F59E0B; border: 1px solid rgba(245,158,11,0.4); border-radius: 6px; padding: 0 0.35rem; margin-left: 0.35rem; }
.soum-badge-public { display: inline-block; font-size: 0.7rem; font-weight: 700; color: #10B981; border: 1px solid rgba(16,185,129,0.4); border-radius: 6px; padding: 0 0.35rem; margin-left: 0.35rem; }

/* Bloc client */
.soumission-client { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--glass-border); }
.soum-formulaire { margin-top: 1rem; padding: 1rem; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-bg); }
.soum-formulaire fieldset { border: none; padding: 0; margin: 0.75rem 0; }
.soum-formulaire legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.soum-choix { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.35rem 0; font-size: 0.9rem; cursor: pointer; }
.soum-choix input { margin-top: 0.2rem; flex-shrink: 0; }
.soum-mentions { margin-top: 0.75rem; }
.soum-mentions dt { font-weight: 700; margin-top: 0.5rem; }
.soum-mentions dd { margin: 0.15rem 0 0; }
.soum-erreur { color: var(--color-error); font-size: 0.85rem; margin-top: 0.5rem; }
.soum-details summary { cursor: pointer; font-weight: 600; margin-top: 0.75rem; }
.soum-texte { white-space: pre-line; }

@media (max-width: 600px) {
  .soum-table { font-size: 0.8rem; }
  .soum-actions .auth-btn, .soum-actions .btn-outline, .soum-actions .btn-danger { flex: 1 1 100%; }
}

/* Estimation gratuite (js/estimation.js) dans le tableau de bord et l'admin. */
.estimation-gratuite .estimation-titre { display: block; margin-bottom: 0.25rem; }
.estimation-gratuite .estimation-fourchette { font-size: 1.15rem; font-weight: 700; color: var(--color-text); margin: 0.25rem 0; }
.estimation-gratuite .estimation-interne { font-size: 0.8rem; color: var(--color-text-muted); }
.estimation-gratuite .estimation-mention { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--glass-border); font-weight: 600; font-size: 0.85rem; }
