/* ============================================================
   STYLE GLOBAL (Comparaison + Alertes)
   ============================================================ */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f7f8fa;
    color: #333;
}

h3 {
    margin-bottom: 10px;
}

.table-container {
    margin: 20px 50px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 20px;
}

/* ============================================================
   TABLEAUX
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 8px 10px;
    text-align: center;
}

/* En-têtes colorés selon contexte */
thead {
    color: white;
    position: sticky;
    top: 0;
	z-index: 2;
}
.table-comparison th.sorted-asc::after {
  content: " ▲";
  color: #1b73e8;
}

.table-comparison th.sorted-desc::after {
  content: " ▼";
  color: #1b73e8;
}

.table-comparison input.col-filter {
  width: 90%;
  font-size: 12px;
  padding: 3px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.filter-row th {
  padding: 4px;
  background: #fafafa;
}

.range-filter {
  display: flex;
  gap: 2px;
}

.range-filter input {
  width: 45%;
  font-size: 11px;
  padding: 2px;
}

/* Style pour indiquer qu'une colonne est triable */
.table-comparison th[data-sort]:not([data-sort="none"]) {
  cursor: pointer;
  position: relative;
}

.table-comparison th[data-sort]:not([data-sort="none"])::after {
  content: "⇅"; /* ou "↕", ou même "⬍" */
  font-size: 10px;
  color: #aaa;
  margin-left: 5px;
  opacity: 0.6;
}

/* Effet au survol */
.table-comparison th[data-sort]:hover::after {
  color: #333;
  opacity: 1;
}

/* Indicateur visuel du sens du tri */
th.sorted-asc::after {
  content: "▲";
  color: #16a34a;
  opacity: 1;
}

th.sorted-desc::after {
  content: "▼";
  color: #dc2626;
  opacity: 1;
}

.table-comparison th {
    background-color: #0078D7; /* bleu comparaison */
}

.table-alerts th {
    background-color: #c0392b; /* rouge alertes */
}

tr:nth-child(even) {
    background-color: #f2f6f9;
}

tr:hover {
    background-color: #e5f1ff;
}

.table-alerts tr:hover {
    background-color: #fdecea;
}
#priceTable th:first-child,
#priceTable td:first-child {
    width: 35px;
    text-align: center;
}

.row-check {
    transform: scale(1.1);
    cursor: pointer;
}

#updateSelectedBtn {
    padding: 8px 16px;
    font-weight: 600;
}

#batchActions {
	margin : 10px;
}
/* ============================================================
   STATUTS ET ALERTES
   ============================================================ */
.status {
    font-weight: bold;
}

.status[data-status="⚠️ Différence de prix"] {
    color: #e67e22;
}

.status[data-status="❌ Absente de SAGE"] {
    color: #c0392b;
}

.status[data-status="❌ Absente de PRESTA"] {
    color: #8e44ad;
}

.status[data-status="✅ Identique"] {
    color: #27ae60;
}

.status-critical {
    color: #e74c3c;
    font-weight: bold;
}

.status-warning {
    color: #f39c12;
    font-weight: bold;
}
/* ============================================================
   CONTEXTE SELECTOR
   ============================================================ */
.menu {
	width:50%;
}
.console {
	width:50%;
}
.context-handler {
	display:flex;
	margin:10px 50px;
}
.shopSelectorHandler {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
}
.context-selector {
	
}
#shopSelector {
	padding: 10px 15px;
    border-radius: 5px;
}
.mode-filter {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.mode-filter label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background 0.2s;
}

.mode-filter label:hover {
  background: #f2f2f2;
}

/* ============================================================
   CONSOLE
   ============================================================ */
.sub-title {
	text-align:center;
	font-weight:500;
}

#console {
	font-family: monospace;
    background: #fff;
    border: 1px solid;
    padding: 5px;
    height: 150px;
    margin: 5px 50px;
    overflow: auto;	  
}
/* ============================================================
   FILTRES
   ============================================================ */
.filters {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.filters label {
    margin-right: 10px;
    font-weight: 600;
}

.filters select,
.filters input {
    padding: 5px;
    font-size: 13px;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.details-btn,
.update-btn {
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.details-btn {
    background-color: #0078D7;
}
.details-btn:hover {
    background-color: #005ea3;
}

.update-btn.active {
    background-color: #ff9800;
}
.update-btn.active:hover {
    background-color: #f57c00;
}
.update-btn.disabled,
.update-btn[disabled] {
    background-color: #ddd;
    color: #888;
    cursor: not-allowed;
    opacity: 0.6;
}
.update-btn.updated {
    background-color: #4aae27 !important;
    color: white !important;
    cursor: not-allowed;
    opacity: 0.8;
}
.btn {
	color: white;
	border: none;
	padding: 10px 20px;
    border-radius: 25px;
	cursor: pointer;
	font-weight: 600;
	transition: 0.2s ease;
}
.btn:active {
	transform: scale(0.97);
}
.validate-btn {
	background-color: #4aae27;
}
.validate-btn:hover {
	background-color: #1e8449;
}
.alert-btn {
	background-color: #ae2727;
}
.alert-btn:hover {
	background-color: #df2424;
}
/* ============================================================
   BOUTONS D’ACTION (Activation / Déclinaison / Devis / Prix)
   ============================================================ */

.action-btn {
    border: none;
    padding: 5px 10px;
    margin: 2px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease-in-out;
    color: white;
    display: inline-block;
}

/* 🔵 Actions neutres */
.btn-info {
    background-color: #0078D7;
}
.btn-info:hover {
    background-color: #005ea3;
}

/* 🟢 Activation */
.btn-on {
    background-color: #27ae60;
}
.btn-on:hover {
    background-color: #1e8449;
}

/* 🔴 Désactivation */
.btn-off {
    background-color: #c0392b;
}
.btn-off:hover {
    background-color: #992d22;
}

/* 🟠 Mode devis */
.btn-quote {
    background-color: #e67e22;
}
.btn-quote:hover {
    background-color: #cf6d14;
}

/* 🔵 Retour mode normal */
.btn-normal {
    background-color: #2980b9;
}
.btn-normal:hover {
    background-color: #1f6391;
}

/* 🟣 Ajouter tranche manquante */
.btn-add-price {
    background-color: #8e44ad;
}
.btn-add-price:hover {
    background-color: #732d91;
}

/* 🟡 Mise à jour prix */
.btn-update {
    background-color: #f1c40f;
    color: #333;
}
.btn-update:hover {
    background-color: #d4ac0d;
}

/* Indicateur une fois mis à jour */
.btn-update.updated {
    background-color: #2ecc71 !important;
    color: white !important;
}

/* Désactivation du bouton */
.action-btn:disabled,
.action-btn.disabled {
    opacity: 0.5;
    filter: grayscale(40%);
    cursor: not-allowed;
}

/* Alignement propre des boutons */
.action-cell {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}
.btn-success {
    background-color: #27ae60 !important;
    color: white !important;
    cursor: default !important;
    opacity: 0.9;
}

.btn-warning {
    background-color: #e67e22 !important;
    color: white !important;
}


/* ============================================================
   POPUP
   ============================================================ */
#popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-content {
	display: flex;
    flex-direction: column;
    align-items: center;	
}

.popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 18px;
    cursor: pointer;
}

#disableScreenMask {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
}

.loadingWheelHandler {
	position: absolute;
    top: 50%;
    left: 50%;
    z-index: 100;
}

#loadingWheel {
	width: 180px;
	font-weight: 500;
	color: #2563eb; /* bleu doux */
	font-size: 16px;
}

#loadingWheel .dots::after {
	content: '';
	animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75% { content: '...'; }
}

/* ============================================================
   COULEURS THÉMATIQUES
   ============================================================ */
:root {
    --color-blue: #0078D7;
    --color-orange: #ff9800;
    --color-green: #27ae60;
    --color-red: #c0392b;
    --color-warning: #f39c12;
    --color-light-bg: #f7f8fa;
}
