*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 15px;
  color: #1a1a1a;
  background: #fafaf8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  background: #1e3a5f;
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 54px;
  flex-wrap: wrap;
}
.site-title {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
}

/* ── Main ── */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
  width: 100%;
}

/* ── Footer ── */
footer {
  background: #1e3a5f;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 0.75rem;
  font-size: 12px;
}

/* ── Alertes ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 14px;
}
.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 1.5rem;
  position: relative;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1e3a5f;
}
.subtitle {
  color: #6b7280;
  font-size: 14px;
  margin-top: 4px;
}

/* ── Grille accueil ── */
.semestre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 1rem;
}
.semestre-card {
  background: #fff;
  border: 1px solid #e0e0d8;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 16px;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.semestre-card:hover {
  background: #eef2ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.semestre-arrow {
  color: #9ca3af;
  font-size: 18px;
}

.maquette-badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}
.semestre-card-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
}
.semestre-card-badge[data-sem="S1"] {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.semestre-card-badge[data-sem="S2"] {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.semestre-card-badge[data-sem="S3"] {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}
.semestre-card-badge[data-sem="S4"] {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}
.semestre-card-badge[data-sem="S5"] {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}
.semestre-card-badge[data-sem="S6"] {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}
.semestre-card-badge .semestre-arrow {
  color: currentColor;
  opacity: 0.5;
}

/* ── Tableau ressources ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e0e0d8;
}

.table-wrapper--semestre {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.ressources-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}
.ressources-table th {
  background: #1e3a5f;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
.table-wrapper--semestre .ressources-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.table-wrapper--semestre .maquette-table thead tr:nth-child(2) th {
  top: 37px;
}
.ressources-table th.col-h {
  text-align: center;
}

.ressources-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #f0f0e8;
  vertical-align: middle;
}
.ressources-table tr.group-odd td {
  background: #ffffff;
}
.ressources-table tr.group-even td {
  background: #f0f4fb;
}
.ressources-table tr:last-child td {
  border-bottom: none;
}

/* Séparation plus marquée entre les ressources */
.ressources-table tbody tr.row-main-resource td {
  border-top: 2px solid #9ca3af;
}
.ressources-table tbody tr.row-main-resource td:first-child {
  font-weight: 600;
}
.ressources-table tbody tr.row-main-resource:first-child td {
  border-top: none !important;
}

/* Séparation entre ressources — gérée par border-bottom de .row-group-ecart */

/* Lignes SAÉ et Portfolio */
.ressources-table tr.row-sae td {
  background: #bbf7d0 !important;
  color: #14532d;
  font-style: italic;
  border-top: 2px solid #4ade80 !important;
}
.ressources-table tr[data-sae="true"] td {
  background: #dcfce7 !important;
}
.ressources-table tr.row-portfolio td {
  font-weight: 600;
  color: #1e3a5f;
}

/* pied de tableau */
.ressources-table tfoot td {
  background: #eef2ff;
  font-weight: 600;
  color: #1e3a5f;
  border-top: 2px solid #c7d2fe;
  padding: 8px 12px;
  text-align: center;
}
.ressources-table tfoot .foot-label {
  text-align: left;
}

/* Colonnes */
.col-intitule {
  min-width: 300px;
}
.col-prev {
  min-width: 130px;
  font-size: 12px;
}
.col-enseignant {
  min-width: 220px;
}

.prev-badge {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  padding: 1px 5px;
  margin: 1px 2px;
  font-size: 11px;
  white-space: nowrap;
}
.col-h {
  width: 72px;
  text-align: center;
}

/* Select enseignant */
.select-enseignant {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}
.select-enseignant:focus {
  outline: 2px solid #6366f1;
  border-color: transparent;
}
.select-enseignant.select-empty {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
}
.select-enseignant.select-tit {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}
.select-enseignant.select-vac {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
option.ens-option[data-vac="false"] {
  background: #d1fae5;
  color: #065f46;
}
option.ens-option[data-vac="true"] {
  background: #dbeafe;
  color: #1e40af;
}
.input-h.input-zero {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
}

/* Widget stepper +/− */
.h-stepper {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
}
.step-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.12s;
}
.step-minus:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.step-plus:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

/* Inputs CM/TD/TP */
.input-h {
  width: 50px;
  padding: 5px 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  background: #fff;
}
.input-h:focus {
  outline: 2px solid #6366f1;
  border-color: transparent;
}

/* Cellule total */
.total-cell {
  font-weight: 600;
  color: #1e3a5f;
  text-align: center;
}

/* ── Actions ── */
.form-actions {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}
.btn-save {
  background: #1e3a5f;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-save:hover {
  background: #16304f;
}

.no-data {
  color: #6b7280;
  font-style: italic;
  margin-top: 1rem;
}

/* ── Auto-save status ── */
.autosave-status {
  min-height: 28px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  display: inline-block;
  margin-top: 0.75rem;
  transition: opacity 0.3s;
}
.autosave-status.saving {
  background: #fef9c3;
  color: #854d0e;
}
.autosave-status.saved {
  background: #dcfce7;
  color: #166534;
}
.autosave-status.error {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Boutons Maquette / Services dans la nav ── */
.nav-link-services {
  margin-left: 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  font-weight: 600;
}
.nav-link-services:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Boutons de navigation semestre ── */
.semestre-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.25rem;
}
.sem-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: filter 0.15s;
}
.sem-btn:hover {
  filter: brightness(0.9);
}
.sem-btn.active {
  font-weight: 700;
  box-shadow: 0 0 0 2px #1e3a5f;
}

.sem-btn[data-sem="S1"] {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.sem-btn[data-sem="S2"] {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.sem-btn[data-sem="S3"] {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}
.sem-btn[data-sem="S4"] {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}
.sem-btn[data-sem="S5"] {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}
.sem-btn[data-sem="S6"] {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

/* ── Page Maquette ── */
.maquette-table th {
  font-size: 12px;
}
th.group-header {
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
th.editable-header {
  background: #2d5f8a;
}
th.reel-header {
  background: #1e6645;
}
th.editable-col {
  background: #2d5f8a;
  font-size: 11px;
}
th.reel-col {
  background: #1e6645;
  font-size: 11px;
}
.reel-val {
  text-align: center;
  font-weight: 600;
  color: #14532d;
  background: #f0fdf4;
}
.group-even .reel-val {
  background: #dcfce7;
}

.input-editable {
  width: 58px;
  padding: 4px 4px;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  background: #eff6ff;
}
.input-editable:focus {
  outline: 2px solid #3b82f6;
  border-color: transparent;
}

th.pn-header {
  background: #5b4e8a;
}
th.pn-readonly-col {
  background: #6d5fa0;
  font-size: 11px;
}
th.pn-editable-col {
  background: #7c3aed;
  font-size: 11px;
}
.pn-readonly-val {
  text-align: center;
  font-weight: 600;
  color: #3b0764;
  background: #f5f3ff;
}
.group-even .pn-readonly-val {
  background: #ede9fe;
}
.input-pn-editable {
  width: 58px;
  padding: 4px 4px;
  border: 1px solid #c4b5fd;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  background: #faf5ff;
}
.input-pn-editable:focus {
  outline: 2px solid #7c3aed;
  border-color: transparent;
}

th.pct-header {
  background: #374151;
  font-size: 11px;
  text-align: center;
}
.pct-cell {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.pct-ok {
  color: #15803d;
}
.pct-low {
  color: #dc2626;
}
.pct-na {
  color: #9ca3af;
  font-weight: 400;
}

/* ── Page Pilotage ── */
.pilotage-table {
  max-width: 640px;
}
.pilotage-table th {
  text-align: center;
}
th.pilotage-sem-col {
  width: 160px;
  text-align: left;
}
th.pilotage-h-col {
  width: 90px;
  background: #2d5f8a;
}
th.pilotage-total-col {
  width: 160px;
  background: #1e6645;
  line-height: 1.3;
}
th.pilotage-total-col small {
  font-weight: 400;
  font-size: 10px;
  opacity: 0.85;
}
.pilotage-h-val {
  text-align: center;
  font-weight: 600;
}
.pilotage-total-val {
  text-align: center;
  font-weight: 700;
  color: #065f46;
  background: #f0fdf4;
}
.group-even .pilotage-total-val {
  background: #dcfce7;
}
.pilotage-total-row td {
  border-top: 2px solid #1e3a5f;
  background: #f1f5f9;
  font-size: 14px;
}
.pilotage-total-row .pilotage-total-val {
  background: #d1fae5;
  color: #064e3b;
  font-size: 15px;
}

.reel-val {
  font-weight: 600;
  color: #065f46;
  background: #f0fdf4;
}
.group-even .reel-val {
  background: #dcfce7;
}

/* ── Page Services ── */
.services-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  background: #fff;
  border: 1px solid #e0e0d8;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  color: #1e3a5f;
}

/* ── Bouton Tout déployer / Tout replier ── */
.btn-toggle-all {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-toggle-all:hover {
  background: #e5e7eb;
}

/* ── Boutons filtre titulaire / vacataire ── */
.btn-filter-type {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.btn-filter-type.active[data-type="titulaire"] {
  background: #dce8f7;
  color: #1e3a5f;
  border-color: #2563eb;
}
.btn-filter-type.active[data-type="vacataire"] {
  background: #ffedd5;
  color: #92400e;
  border-color: #fdba74;
}

/* ── Boutons + / − enseignants ── */
.btn-ens-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-ens-add {
  background: #22c55e;
  color: #fff;
}
.btn-ens-add:hover {
  background: #16a34a;
}
.btn-ens-edit {
  background: #f59e0b;
  color: #fff;
}
.btn-ens-edit:hover {
  background: #d97706;
}
.btn-ens-remove {
  background: #ef4444;
  color: #fff;
}
.btn-ens-remove:hover {
  background: #dc2626;
}

/* ── Formulaire carte ── */
.form-card {
  background: #fff;
  border: 1px solid #e0e0d8;
  border-radius: 10px;
  padding: 1.5rem 2rem;
  max-width: 480px;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 4px;
  font-size: 14px;
}
.form-group-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fafbfd;
}
.form-input:focus {
  outline: 2px solid #6366f1;
  border-color: transparent;
}
.required {
  color: #ef4444;
}
.btn-cancel {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.btn-cancel:hover {
  background: #f3f4f6;
}
.btn-delete {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-delete:hover {
  background: #dc2626;
}

/* ── Liste des enseignants (Gestion) ── */
.ressources-table tbody tr.enseignant-item td {
  background-color: #dce8f7 !important; /* Bleu (vacataires) */
  color: #1e3a5f !important;
}

.ressources-table tbody tr.enseignant-item[data-vac="false"] td {
  background-color: #bbf7d0 !important; /* Vert (titulaires) */
  color: #14532d !important;
}

.ressources-table tbody tr.enseignant-item td:first-child {
  box-shadow: inset 4px 0 0 0 #2563eb !important;
}
.ressources-table tbody tr.enseignant-item[data-vac="false"] td:first-child {
  box-shadow: inset 4px 0 0 0 #4ade80 !important;
}

.service-block {
  margin-bottom: 2.5rem;
}

.service-diff-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  vertical-align: middle;
}
.diff-ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.diff-manque {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.diff-surplus {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.service-eqtd-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 12px;
  vertical-align: middle;
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

.service-du-badge {
  display: inline-block;
  margin-left: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #1e6645;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 2px 10px;
  border-radius: 12px;
  vertical-align: middle;
}
.service-max-badge {
  display: inline-block;
  margin-left: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  background: #ffedd5;
  border: 1px solid #fdba74;
  padding: 2px 10px;
  border-radius: 12px;
  vertical-align: middle;
}

.service-nom {
  font-size: 17px;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 0;
  padding: 6px 12px;
  background: #dce8f7;
  border-left: 4px solid #2563eb;
  border-radius: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.service-block[data-vac="false"] .service-nom {
  background: #bbf7d0;
  border-left-color: #4ade80;
  color: #14532d;
}
.service-block[data-vac="false"] .service-nom:hover {
  background: #86efac;
}
.service-nom:hover {
  background: #cdddf4;
}
.service-toggle-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  color: #2563eb;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: transform 0.2s;
}
.service-block.is-open .service-toggle-btn {
  transform: rotate(180deg);
}
.service-details {
  display: none;
  margin-top: 0.4rem;
}
.service-block.is-open .service-details {
  display: block;
}

.col-semestre {
  width: 100px;
  white-space: nowrap;
}

.badge-semestre {
  display: inline-block;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.badge-semestre[data-sem="S1"] {
  background: #dbeafe;
  color: #1e40af;
}
.badge-semestre[data-sem="S2"] {
  background: #dcfce7;
  color: #166534;
}
.badge-semestre[data-sem="S3"] {
  background: #fef9c3;
  color: #854d0e;
}
.badge-semestre[data-sem="S4"] {
  background: #ffe4e6;
  color: #9f1239;
}
.badge-semestre[data-sem="S5"] {
  background: #f3e8ff;
  color: #6b21a8;
}
.badge-semestre[data-sem="S6"] {
  background: #ffedd5;
  color: #9a3412;
}

/* ── Cellule enseignant avec bouton + ── */
.enseignant-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-add-subrow {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #22c55e;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.btn-add-subrow:hover {
  background: #16a34a;
}

.btn-remove-subrow {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.btn-remove-subrow:hover {
  background: #dc2626;
}

.btn-edit-subrow {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #f59e0b;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.btn-edit-subrow:hover {
  background: #d97706;
}

/* ── Ligne écart prévisionnel / réalisé ── */
.row-group-ecart td {
  padding: 4px 12px;
  font-size: 12px;
  border-bottom: 4px solid #c7d2fe;
  text-align: center;
}
.row-group-ecart.group-odd td {
  background: #f8f9fc;
}
.row-group-ecart.group-even td {
  background: #eef2fb;
}
.group-ecart-label {
  text-align: left !important;
  color: #6b7280;
  font-style: italic;
}
.ecart-surplus {
  color: #b91c1c;
  font-weight: 700;
}
.ecart-manque {
  color: #15803d;
  font-weight: 700;
}

/* ── Sous-lignes dynamiques ── */
.row-subrow td {
  border-bottom: 1px solid #dde3ef;
}
.row-subrow.group-odd td {
  background: #f5f7fc;
}
.row-subrow.group-even td {
  background: #e8eef7;
}
.subrow-indent {
  border-left: 3px solid #86efac;
}

/* ── Ligne Responsable ── */
.row-responsable td {
  border-top: 1px dashed #c7d2fe;
  border-bottom: 2px solid #94a3b8;
  padding: 4px 8px;
  font-size: 13px;
}
.row-responsable.group-odd td {
  background: #eef0f8;
}
.row-responsable.group-even td {
  background: #e4e9f5;
}
.row-responsable.row-sae td {
  background: #d1fae5 !important;
}
.row-responsable.row-portfolio td {
  background: #dbeafe !important;
}
.responsable-label {
  font-weight: 600;
  color: #3730a3;
  font-style: italic;
  white-space: nowrap;
}

/* Ligne Total posé */
.ressources-table tr.row-total-pose td {
  background: #fff7ed !important;
  border-top: 2px solid #f97316;
  color: #7c2d12;
  font-weight: 700;
}
.total-pose-val {
  text-align: center;
  font-size: 14px;
  color: #c2410c;
}
.row-responsable .select-enseignant {
  width: auto;
  min-width: 220px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Ligne de sous-total par groupe ── */
.row-group-total.group-odd td {
  background: #e8ecf5;
}
.row-group-total.group-even td {
  background: #dce4f0;
}
.row-group-total td {
  font-weight: 600;
  color: #3730a3;
  border-top: 1px dashed #c7d2fe;
  border-bottom: 1px solid #c7d2fe;
  padding: 5px 12px;
  font-size: 12px;
  text-align: center;
}
.row-group-total .group-total-label {
  text-align: left;
  color: #6b7280;
  font-weight: 500;
  font-style: italic;
}

/* ── Journal des modifications ── */
.mod-row-blue {
  background-color: #dce8f7;
  color: #1e3a5f;
  box-shadow: inset 4px 0 0 0 #2563eb;
}
.mod-row-blue td {
  border-bottom: 1px solid #b8cfe8;
}
.mod-row-green {
  background-color: #bbf7d0;
  color: #14532d;
  box-shadow: inset 4px 0 0 0 #4ade80;
}
.mod-row-green td {
  border-bottom: 1px solid #86efac;
}
.mod-desc {
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

/* ── Lien Journal dans la nav (admin) ── */
.nav-link-admin {
  margin-left: 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  font-weight: 600;
}
.nav-link-admin:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Bandeau archive ── */
#archive-banner {
  background: #fef3c7;
  border-bottom: 2px solid #f59e0b;
  color: #92400e;
  padding: 8px 1.5rem;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-archive-version {
  padding: 4px 14px;
  border-radius: 14px;
  border: 1.5px solid #f59e0b;
  background: #fff;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-archive-version:hover {
  background: #fde68a;
}

/* ── Bouton ajout ressource ── */
.btn-add-res {
  background: #059669;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add-res:hover { background: #047857; }

/* ── Modal overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem 2rem;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-box h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0;
}
.modal-sub {
  font-size: 13px;
  color: #6b7280;
  margin: -0.5rem 0 0;
}
.modal-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.modal-group-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
  margin-top: 0.25rem;
}
.modal-field-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.modal-hint {
  font-weight: 400;
  color: #9ca3af;
  font-style: italic;
  font-size: 11px;
}
.modal-row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.modal-row4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.modal-err {
  font-size: 13px;
  color: #dc2626;
  margin: 0;
  font-weight: 600;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid #f3f4f6;
}

/* ── Barre impression / export ── */
.print-bar {
  display: flex;
  gap: 0.5rem;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.btn-print-action {
  background: #1e3a5f;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-print-action:hover { background: #2563eb; }
.btn-pdf-action {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-pdf-action:hover { background: #15803d; }

/* ── Impression ── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  @page { size: A4 landscape; margin: 1cm; }

  header, footer, .gh-footer, .toast, .print-bar,
  #archive-banner { display: none !important; }

  #app-root button { display: none !important; }
  #app-root select { border: none !important; background: transparent !important; }

  body   { background: #fff !important; }
  main   { padding: 0.5rem !important; max-width: 100% !important; }

  .table-wrapper { overflow: visible !important; box-shadow: none !important; }
  .ressources-table { font-size: 9px !important; width: 100% !important; }
  .page-header  { margin-bottom: 0.75rem !important; }
  .page-header h1 { font-size: 16px !important; }

  .semestre-grid, .semestre-nav-buttons { display: none !important; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  header {
    padding: 0 1rem;
  }
  .header-inner {
    height: auto;
    padding: 0.5rem 0;
    gap: 0.5rem;
  }
  main {
    padding: 1rem;
  }
  .col-intitule {
    min-width: 200px;
  }
  .col-enseignant {
    min-width: 160px;
  }
}
