/**
 * nationdatatable/css/nationdatatable.css
 *
 * Styles du tableau genere par le module. Remplace les styles inline autrefois presents
 * dans le PHP (chapitre 18 du referentiel).
 */

#datatable_datepicker {
	display: inline-block;
	margin-bottom: 8px;
}

.datatable_devis {
	background-color: #eef6ff;
}

.datatable_commande {
	background-color: #eefbee;
}

.datatable_facture {
	background-color: #fff8e6;
}

.datatable_entrepot {
	background-color: #f5f0ff;
}

/* 2.0.7 - Filtre de statut, a cote du selecteur de periode */
.ndt-filtre-statut {
	display: inline-block;
	margin: 0 0 8px 16px;
}

/* 2.0.7 - Encours au-dela de l encours autorise */
.ndt-encours-depasse {
	color: #c0392b;
	font-weight: bold;
}

/* 2.0.7 - Fond pastel d une commande qui a un retour, selon l etat le plus urgent.
   Pose sur les cellules (td) : les couleurs de groupe (devis, commande, facture,
   entrepot) et le tri de DataTables coloreraient sinon par-dessus. */
#datatable tbody tr.ndt-retour-rouge > td {
	background-color: #fbdcdc !important;
}
#datatable tbody tr.ndt-retour-orange > td {
	background-color: #fde9cf !important;
}
#datatable tbody tr.ndt-retour-vert > td {
	background-color: #dff3dc !important;
}
#datatable tbody tr.ndt-retour-blanc > td {
	background-color: #f2f2f2 !important;
}
@media (prefers-color-scheme: dark) {
	#datatable tbody tr.ndt-retour-rouge > td { background-color: #5a2a2a !important; }
	#datatable tbody tr.ndt-retour-orange > td { background-color: #5a4220 !important; }
	#datatable tbody tr.ndt-retour-vert > td { background-color: #2a4a2a !important; }
	#datatable tbody tr.ndt-retour-blanc > td { background-color: #3a3a3a !important; }
}

/* 2.0.8 - Acomptes : bleu si inferieurs au TTC de la commande, vert fonce si egaux */
.ndt-acompte-partiel {
	color: #1f5fbf;
	font-weight: bold;
}
.ndt-acompte-solde {
	color: #1e6b2e;
	font-weight: bold;
}
@media (prefers-color-scheme: dark) {
	.ndt-acompte-partiel { color: #7fb0ff; }
	.ndt-acompte-solde { color: #6fd08a; }
}

/* 2.0.10 - Libelle d etat present pour la recherche et le tri, invisible a l ecran
   (l etat s affiche en picto Premibel, libelle en infobulle). */
.ndt-texte-masque {
	display: none;
}

/* 2.0.15 - Recherche cote serveur ; devis dont la fin de validite est depassee */
.ndt-recherche {
	display: inline-block;
	margin: 0 0 8px 16px;
}
.ndt-recherche input {
	width: 220px;
}
.ndt-devis-echu {
	color: #c0392b;
	font-weight: bold;
}

/* 2.0.20, 2.0.21 - Tableau a largeurs minimales (toute la largeur) : les titres longs passent a la ligne au lieu de
   deborder sur la colonne voisine ; marges d en-tete resserrees (la fleche de tri de
   DataTables garde sa place a droite) ; dates, montants et pictos sur une seule ligne. */
table.ndt-largeurs-fixes thead th {
	white-space: normal;
	word-break: normal;
	overflow-wrap: anywhere;
	padding: 6px 16px 6px 4px !important;
	line-height: 1.15;
	vertical-align: bottom;
}
table.ndt-largeurs-fixes tbody td {
	padding: 4px 4px !important;
}
table.ndt-largeurs-fixes tbody td[data-sort],
table.ndt-largeurs-fixes tbody td img {
	white-space: nowrap;
}

/* 2.0.23 - Le minimum d une colonne inclut ses marges internes (100 px = 100 px a l ecran),
   et, en dernier recours, le tableau defile dans son propre cadre au lieu d elargir la page. */
table.ndt-largeurs-fixes th,
table.ndt-largeurs-fixes td {
	box-sizing: border-box;
}
.datatable-content .dataTables_wrapper {
	overflow-x: auto;
	max-width: 100%;
}


/* 2.0.27 - Commande annulee avant expedition : les cellules de l entrepot (BP, BR)
   en couleur d alerte, par-dessus le fond pastel du retour. */
#datatable tbody tr.ndt-annulation > td.datatable_entrepot {
	background-color: #e53935 !important;
	color: #fff !important;
	font-weight: bold;
}
#datatable tbody tr.ndt-annulation > td.datatable_entrepot a {
	color: #fff !important;
}

/* 2.0.29 - Tableau multi-entite : lisere de 5 px de la couleur de l entite, a gauche et a droite. */
#datatable tbody tr[data-ndt-ent] > td:first-child {
	border-left: 5px solid var(--ndt-ent) !important;
}
#datatable tbody tr[data-ndt-ent] > td:last-child {
	border-right: 5px solid var(--ndt-ent) !important;
}
