/* ─── MSS Planning — Page Exportation ──────────────────────────────── */

.ex-layout {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Éditeur de modèle (panneau gauche) ── */
.ex-editor {
  width: 320px;
  flex: none;
  background: #fff;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  padding: 14px;
  max-height: 100%;
  overflow-y: auto;
}

.ex-editor-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a237e;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 10px;
}

.ex-editor label {
  display: block;
  font-size: 12px;
  color: var(--text-2, #5f6368);
  margin: 10px 0 4px;
}

.ex-editor .form-control { width: 100%; }

.ex-cols-title {
  font-size: 12px;
  color: var(--text-2, #5f6368);
  margin: 14px 0 6px;
}

.ex-cols-list {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  overflow: hidden;
}

.ex-col-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border, #eee);
  font-size: 12.5px;
  background: #fff;
}
.ex-col-item:last-child { border-bottom: none; }
.ex-col-item:hover { background: #f5f7ff; }

.ex-col-order {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8eaf6;
  color: #1a237e;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ex-col-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Titre de colonne modifiable (mémorisé avec le modèle) */
.ex-col-title {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 12.5px;
  font-family: inherit;
  padding: 2px 4px;
}
.ex-col-title:hover  { border-color: var(--border, #e0e0e0); background: #fff; }
.ex-col-title:focus  { border-color: #1a237e; background: #fff; outline: none; }
.ex-col-title-custom { font-weight: 600; color: #1a237e; }

.ex-col-src {
  font-size: 10px;
  color: var(--text-3, #9aa0a6);
  padding-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-col-btns { flex: none; display: flex; gap: 2px; }

.ex-col-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  color: #5f6368;
  padding: 3px 5px;
  border-radius: 4px;
}
.ex-col-btn:hover:not(:disabled) { background: #e8eaf6; color: #1a237e; }
.ex-col-btn:disabled { opacity: .25; cursor: default; }
.ex-col-del:hover:not(:disabled) { background: #fce8e6; color: #c5221f; }

.ex-cols-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-3, #9aa0a6);
  text-align: center;
}

/* ── Aperçu (table condensée centrée) ── */
.ex-preview {
  flex: 1;
  min-width: 0;
  max-height: 100%;
  overflow: auto;
}

.ex-meta {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-2, #5f6368);
  margin-bottom: 10px;
}
.ex-meta b { color: #1a237e; }
.ex-meta-sep { margin: 0 8px; color: var(--text-3, #c0c0c0); }

.ex-table {
  border-collapse: collapse;
  margin: 0 auto;
  background: #fff;
  font-size: 12.5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* Largeur de colonne limitée : l'en-tête passe à la ligne (et grandit
   en hauteur) plutôt que d'élargir la colonne */
.ex-table th {
  background: #1a237e;
  color: #fff;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: break-word;
  max-width: 110px;
  min-width: 55px;
  vertical-align: bottom;
  line-height: 1.25;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ex-table td {
  border: 1px solid var(--border, #e0e0e0);
  padding: 4px 8px;
  white-space: normal;
  overflow-wrap: break-word;
  max-width: 140px;
}

/* Les valeurs numériques restent sur une seule ligne */
.ex-table td.ex-num { white-space: nowrap; }

.ex-table tbody tr:nth-child(even) td { background: #fafbff; }
.ex-table tbody tr:hover td { background: #f0f3ff; }

.ex-num { text-align: right; font-variant-numeric: tabular-nums; }

.ex-total-row td {
  background: #e8eaf6 !important;
  font-weight: 700;
  color: #1a237e;
  border-top: 2px solid #1a237e;
}

/* ── Sélecteur multi-employés ── */
.ex-empdd { position: relative; }

.ex-empdd-btn { cursor: pointer; text-align: left; min-width: 180px; }

.ex-empdd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  width: 260px;
  max-height: 340px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 6px;
}
.ex-empdd-panel.hidden { display: none; }

.ex-empdd-actions {
  display: flex;
  gap: 6px;
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--border, #eee);
  margin-bottom: 4px;
}

.ex-empdd-actions button {
  flex: 1;
  border: 1px solid var(--border, #e0e0e0);
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 11.5px;
  padding: 4px;
  cursor: pointer;
}
.ex-empdd-actions button:hover { background: #e8eaf6; color: #1a237e; }

.ex-emp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12.5px;
  border-radius: 6px;
  cursor: pointer;
}
.ex-emp-row:hover { background: #f5f7ff; }

.ex-emp-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
