/* WSC Ferme — lot L7 : comptes (bandes, bilan, ateliers, écritures, pièces, export) et équipe. Système visuel des
   maquettes 05 (« Dernière bande vendue ») et 06 (bande de chair) : cartes blanches, gros chiffres, une seule couleur
   d'accent, vert et rouge réservés à leur sens. Toutes les règles sont rangées sous .l7 (page d'un espace du lot) ou
   .l7-modale (fenêtres du lot) : les feuilles des autres lots ne les touchent pas (D116). */

.l7 { --l7-orange-pale: #FDBA74; --l7-gris-part: #D9D0C5; }
.l7 .ok-texte { color: var(--ok); }
.l7 .ko-texte { color: var(--ko); }
.l7 .fort { font-weight: 700; }
.l7 .pile { display: flex; flex-direction: column; min-width: 0; }
.l7 .rangee { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.l7 .rangee-texte { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.l7 .entre { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.l7 .entre.haut { align-items: flex-end; }
.l7 .enveloppe { flex-wrap: wrap; }
.l7 .ecart-6 { gap: 6px; }
.l7 .ecart-12 { gap: 12px; }
.l7 .ecart-16 { gap: 16px; }
.l7 .grille { display: grid; gap: 16px; }
.l7 .grille.deux { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: start; }
.l7 .grille.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.l7 .grille.kpis.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.l7 .carte.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.l7 .chiffre { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.l7 .lien-carte { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; min-height: 44px; font-weight: 700;
	font-size: 14px; text-decoration: none; align-self: flex-start; }
.l7 .carte.bloc { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.l7 .c-titre { font-size: 15px; font-weight: 800; }
.l7 .sous-titre-section { font-size: 18px; font-weight: 800; }
.l7 h3 { font-size: 17px; font-weight: 800; }
.l7 .ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0;
	border-top: 1px solid var(--trait); }
.l7 .ligne:first-child, .l7 .c-titre + .ligne, .l7 .entre + .ligne { border-top: 0; }
.l7 .bandeau, .l7-modale .bandeau { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
	font-size: 14px; font-weight: 600; }
.l7 .bandeau > span { flex: 1; min-width: 0; }
.l7 .bandeau.ok { background: var(--ok-clair); color: var(--ok); }
.l7 .bandeau.ko { background: var(--ko-clair); color: var(--ko); }
.l7 .bandeau.info { background: var(--info-clair); color: var(--info); }
.l7 .bandeau .bouton { flex: none; }
.l7 .note { display: flex; align-items: flex-start; gap: 8px; background: var(--info-clair); color: var(--info); border-radius: 12px;
	padding: 10px 12px; font-size: 13px; font-weight: 600; margin: 0; }
.l7 .note .ic { margin-top: 2px; }
.l7 .vide { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; color: var(--gris); text-align: center; }
.l7 .vide .ic { width: 28px; height: 28px; color: var(--ok); }
.l7 .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.l7 .reperes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.l7 .decompte { display: block; background: var(--fond); border-radius: 12px; padding: 2px 12px; font-size: 14px; }

/* rubriques de l'espace */
.l7 .l7-onglets { display: flex; flex-wrap: wrap; gap: 6px; }
.l7 .l7-onglets a { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px;
	border: 1px solid var(--trait); background: var(--blanc); color: var(--gris); font-weight: 700; font-size: 14px; text-decoration: none; }
.l7 .l7-onglets a:hover { color: var(--encre); border-color: var(--trait-fort); }
.l7 .l7-onglets a[aria-current="page"] { background: var(--orange-clair); color: var(--orange-nuit); border-color: var(--orange-trait); }
.l7 .pastille { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ko); color: #fff; font-size: 12px;
	display: inline-grid; place-items: center; }

/* bandes en cours */
.l7 .bande-en-cours { gap: 14px; }
.l7 .deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.l7 .composition { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--gris-clair); margin: 2px 0 6px; }
.l7 .part.aliment { background: var(--orange); }
.l7 .part.animaux { background: var(--orange-fonce); }
.l7 .part.sante { background: var(--l7-orange-pale); }
.l7 .part.autres { background: var(--l7-gris-part); }
.l7 .legende-parts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--gris); padding-bottom: 4px; }
.l7 .legende-parts i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.l7 .estimation { background: var(--fond); border: 1px dashed var(--trait-fort); border-radius: 14px; padding: 12px 14px;
	display: flex; flex-direction: column; gap: 4px; }
.l7 .estimation p { font-size: 14px; color: var(--gris); }

/* tableaux (poste) et cartes (téléphone) */
.l7 .cadre-table { overflow-x: auto; }
.l7 table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.l7 table.t th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--gris);
	padding: 8px 10px; border-bottom: 1px solid var(--trait-fort); white-space: nowrap; }
.l7 table.t td { padding: 11px 10px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.l7 table.t tbody tr:last-child td { border-bottom: 0; }
.l7 table.t tfoot td { border-top: 1px solid var(--trait-fort); border-bottom: 0; }
.l7 table.t .d { text-align: right; white-space: nowrap; }
.l7 table.t a { text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.l7 table.t.serre td { padding: 9px 8px; }
.l7 .cartes-tel { display: none; }
.l7 a.bande-tel { text-decoration: none; color: var(--encre); gap: 4px; }

/* bilan d'une bande */
.l7 .tete-bilan { display: flex; flex-direction: column; gap: 6px; }
.l7 .lien-retour { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; text-decoration: none;
	min-height: 44px; align-self: flex-start; }
.l7 .compte-bande { display: flex; flex-direction: column; }
.l7 .ligne-compte { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0;
	border-top: 1px solid var(--trait); }
.l7 .ligne-compte:first-child { border-top: 0; }
.l7 .ligne-compte small { font-size: 13px; }
.l7 .ligne-compte b { font-size: 16px; white-space: nowrap; }
.l7 .ligne-compte.total { border-top: 2px solid var(--encre); margin-top: 4px; padding-top: 12px; }
.l7 .ligne-compte.total b { font-size: 22px; font-weight: 800; }
.l7 .verification { border-width: 2px; border-color: var(--orange-trait); }
.l7 ul.verifs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.l7 ul.verifs li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.l7 ul.verifs li > span:nth-child(2) { flex: 1; min-width: 0; }
.l7 .rond { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: var(--gris); }
.l7 ul.verifs li.ok .rond, .l7 .rond.ok { background: var(--ok); }
.l7 ul.verifs li.ko .rond, .l7 .rond.ko { background: var(--ko); }
.l7 .rond.info { background: var(--info); }
.l7 .rond .ic { width: 15px; height: 15px; stroke-width: 3; }
.l7 .pieces-comptables summary { cursor: pointer; font-weight: 800; font-size: 15px; min-height: 32px; display: flex; align-items: center; }
.l7 .pieces-comptables ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.l7 .pieces-comptables li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 6px 0;
	border-bottom: 1px solid var(--trait); }
.l7 .integrite { display: flex; align-items: center; gap: 6px; margin: 0; }
.l7 .imprime-pied { display: none; }

/* périodes, filtres */
.l7 .choix-periode { display: flex; flex-wrap: wrap; gap: 6px; }
.l7 .choix, .l7-modale .choix { min-height: 40px; padding: 0 14px; border: 1px solid var(--trait-fort); border-radius: 12px; background: var(--blanc);
	font-weight: 700; font-size: 14px; color: var(--encre); cursor: pointer; }
.l7 .choix.actif { border-color: var(--orange-fonce); background: var(--orange-clair); color: var(--orange-nuit); box-shadow: inset 0 0 0 1px var(--orange-fonce); }

/* écritures */
.l7 .liste-ecritures { list-style: none; margin: 0; padding: 0; }
.l7 .ecriture { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0;
	border-top: 1px solid var(--trait); }
.l7 .ecriture:first-child { border-top: 0; }
.l7 .ecriture-texte { gap: 2px; }
.l7 .ecriture-texte small { font-size: 13px; overflow-wrap: anywhere; }
.l7 .cause { display: flex; align-items: flex-start; gap: 6px; color: var(--ko); background: var(--ko-clair); border-radius: 10px;
	padding: 6px 10px; font-size: 13px; font-weight: 600; margin: 4px 0 2px; }
.l7 .cause .ic { margin-top: 2px; }

/* pièces et échéances */
.l7 .echeance { justify-content: flex-start; }
.l7 .echeance > .pile { flex: 1; }
.l7 .jourx { width: 48px; flex: none; display: flex; flex-direction: column; align-items: center; font-size: 20px; font-weight: 800;
	line-height: 1.05; background: var(--orange-clair); color: var(--orange-nuit); border-radius: 12px; padding: 6px 0; }
.l7 .jourx small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.l7 .piece { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--trait); }
.l7 .entre + .piece { border-top: 0; }
.l7 .piece.archivee { opacity: .7; }
.l7 .piece-texte { gap: 2px; }
.l7 .piece-texte small { font-size: 13px; overflow-wrap: anywhere; }
.l7 .actions-piece { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.l7 .archives summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--orange-nuit); min-height: 44px; display: flex; align-items: center; }
.l7 .deux-champs, .l7-modale .deux-champs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.l7 .champ input, .l7 .champ select, .l7-modale .champ select, .l7-modale .champ input { width: 100%; }
.l7-modale .champ small { font-weight: 500; font-size: 13px; }
.l7-modale select.saisie, .l7 select.saisie { min-height: 48px; background: var(--blanc); }

/* équipe */
.l7 .batiments { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.l7 .batiment { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--trait); }
.l7 .batiment:first-child { border-top: 0; }
.l7 .personne-ligne { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.l7 .personne-ligne > .pile { flex: 1; }
.l7 .personne-ligne small, .l7 .personne-puce small { font-size: 13px; }
.l7 .toute-la-ferme { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--trait); padding-top: 10px; }
.l7 .puces { display: flex; flex-wrap: wrap; gap: 8px; }
.l7 .personne-puce { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--trait);
	border-radius: 999px; background: var(--fond); }
.l7 .jours-personne { display: grid; grid-template-columns: minmax(0, 200px) 74px minmax(0, 1fr); gap: 12px; align-items: center;
	padding: 10px 0; border-top: 1px solid var(--trait); }
.l7 .note + .jours-personne { border-top: 0; }
.l7 .jours-qui { display: flex; align-items: center; gap: 10px; min-width: 0; }
.l7 .jours-qui small { font-size: 13px; }
.l7 .jours-chiffre { display: flex; align-items: baseline; gap: 4px; }
.l7 .jours-chiffre strong { font-size: 26px; font-weight: 800; }
.l7 .jours-chiffre span { font-size: 13px; }
.l7 .jours-bande { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.l7 .jours-bande small { font-size: 13px; }
.l7 .bande-jours { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; }
.l7 .bande-jours span { height: 18px; border-radius: 3px; }
.l7 .bande-jours .oui, .l7 .legende i.oui { background: var(--orange); }
.l7 .bande-jours .non, .l7 .legende i.non { background: var(--gris-clair); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.l7 .legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--gris); }
.l7 .legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.l7 .batiment-jours { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--trait); }
.l7 .c-titre + .batiment-jours { border-top: 0; }
.l7 .batiment-jours small { font-size: 13px; }

/* comparaison d'une bande à la précédente */
.l7 .ligne-comparee { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--trait); }
.l7 .c-titre + .ligne-comparee { border-top: 0; }
.l7 .ligne-comparee small { font-size: 13px; }

/* clôture avec des animaux encore présents : dépliée d'abord, jamais par mégarde */
.l7 .cloture-motivee { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--trait); padding-top: 8px; }
.l7 .cloture-motivee summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--orange-nuit); min-height: 44px;
	display: flex; align-items: center; }
.l7 .cloture-motivee[open] summary { margin-bottom: 6px; }
.l7 .cloture-motivee > * + * { margin-top: 8px; }
.l7 .note.avec-lien { align-items: center; flex-wrap: wrap; }
.l7 .note.avec-lien > span { flex: 1 1 320px; }
.l7 .date-ecrite, .l7-modale .date-ecrite { font-size: 13px; min-height: 18px; margin-top: 4px; }

/* écritures (tableau du poste) */
.l7 table.t.ecritures td { vertical-align: middle; }
.l7 table.t.ecritures tr.avec-cause td { border-bottom: 0; padding-bottom: 4px; }
.l7 table.t.ecritures tr.ligne-cause td { padding-top: 0; }
.l7 table.t.ecritures .cause { margin: 0; }
.l7 .carte .cartes-tel > .carte { box-shadow: none; background: var(--fond); }

/* fenêtres du lot */
.l7-modale { max-width: 520px; }
.l7-modale .message-erreur { margin: 0; }

/* ---------------------------------------------------------------- tablette et téléphone */
@media (max-width: 1180px) {
	.l7 .grille.deux { grid-template-columns: minmax(0, 1fr); }
	.l7 .grille.kpis.quatre { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
	.l7 .grille.kpis, .l7 .grille.kpis.quatre { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.l7 .grille.kpis.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.l7 .grille.kpis.compact .kpi { padding: 12px; }
	.l7 .grille.kpis.compact .kpi .petit { display: none; }
	.l7 .chiffre { font-size: 26px; }
	.l7 .deux-colonnes { grid-template-columns: minmax(0, 1fr); }
	.l7 .cadre-table { display: none; }
	.l7 .cartes-tel { display: flex; flex-direction: column; gap: 10px; }
	.l7 .l7-onglets a { min-height: 44px; padding: 0 12px; }
	.l7 .choix { min-height: 44px; }
	.l7 .entre.haut { flex-wrap: wrap; align-items: flex-start; }
	.l7 .tete-bilan .titre { font-size: 22px; }
	.l7 .jours-personne { grid-template-columns: minmax(0, 1fr) auto; }
	.l7 .jours-bande { grid-column: 1 / -1; }
	.l7 .bande-jours { gap: 1px; }
	.l7 .bande-jours span { height: 16px; border-radius: 2px; }
	.l7 .ecriture { grid-template-columns: auto minmax(0, 1fr); }
	.l7 .ecriture > .bouton { grid-column: 2; justify-self: start; min-height: 44px; }
	.l7 .piece { flex-direction: column; }
	.l7 .actions-piece { justify-content: flex-start; }
	.l7 .actions-piece .bouton, .l7 .bouton.petit { min-height: 44px; }
	.l7 table.t a { min-height: 44px; }
	.l7 .pieces-comptables ul { grid-template-columns: minmax(0, 1fr); }
	.l7 .pieces-comptables summary, .l7 .archives summary { min-height: 44px; }
	.l7 .note.avec-lien .bouton { min-height: 44px; }
}
@media (max-width: 400px) {
	.l7 .deux-champs, .l7-modale .deux-champs { grid-template-columns: minmax(0, 1fr); }
	.l7 .ligne-compte.total b { font-size: 20px; }
}

/* ---------------------------------------------------------------- impression (fiche de bilan d'une bande) */
@media print {
	.entete, .barre, .bandeau-reseau, .toasts, .file-page, .l7 .l7-onglets, .l7 .actions, .l7 .lien-retour, .l7 .verification,
	.l7 .bouton { display: none !important; }
	body { background: #fff; }
	.vue { padding: 0; }
	.l7 .carte { box-shadow: none; break-inside: avoid; }
	.l7 .grille.deux { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.l7 .grille.kpis.quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.l7 .pieces-comptables { display: block; }
	.l7 .imprime-pied { display: block; font-size: 12px; color: var(--gris); }
}
