:root {
  --navy:        #05274A;
  --navy-800:    #0a3460;
  --navy-700:    #0e4178;
  --navy-600:    #15538f;
  --orange:      #EE7F1A;
  --orange-600:  #d96d0c;
  --orange-50:   #fff3e6;
  --ink:         #16202e;
  --muted:       #5b6b80;
  --line:        #e6eaf0;
  --bg:          #eef1f6;
  --card:        #ffffff;
  --green:       #12b76a;
  --green-600:   #079455;
  --red:         #e5484d;
  --radius:      18px;
  --radius-sm:   12px;
  --shadow-sm:   0 1px 2px rgba(16,32,55,.06), 0 1px 3px rgba(16,32,55,.05);
  --shadow-md:   0 4px 12px rgba(16,32,55,.08), 0 12px 32px rgba(16,32,55,.07);
  --shadow-lg:   0 10px 30px rgba(5,39,74,.12), 0 30px 60px rgba(5,39,74,.10);
  --ring:        0 0 0 4px rgba(238,127,26,.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, #0a3460 0%, #05274A 45%, #041b34 100%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

/* halos colorés animés en fond */
.login-aurora {
  position: absolute; inset: -40% -10% auto -10%;
  height: 90vh;
  background:
    radial-gradient(40% 40% at 20% 30%, rgba(238,127,26,.35), transparent 70%),
    radial-gradient(45% 45% at 80% 20%, rgba(21,83,143,.55), transparent 70%),
    radial-gradient(35% 35% at 60% 70%, rgba(238,127,26,.18), transparent 70%);
  filter: blur(20px);
  animation: drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-30px,0) scale(1.08); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 34px;
  text-align: center;
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  width: 200px; height: auto;
  margin: 2px auto 26px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(5,39,74,.18));
}
.login-title {
  margin: 6px 0 2px;
  font-size: 23px; font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy);
}
.login-sub {
  margin: 0 0 24px;
  font-size: 14.5px; color: var(--muted);
}

.login-form { text-align: left; }

.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--navy); margin-bottom: 7px;
  letter-spacing: .01em; text-transform: uppercase;
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
  position: absolute; left: 13px;
  width: 19px; height: 19px; color: var(--muted);
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit;
  background: #fbfcfe;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input-wrap input::placeholder { color: #9aa7b8; }
.input-wrap input:focus {
  outline: none;
  border-color: var(--orange);
  background: #fff;
  box-shadow: var(--ring);
}
.toggle-pw {
  position: absolute; right: 8px;
  border: none; background: none; cursor: pointer;
  color: #9aa7b8; padding: 6px; border-radius: 8px;
  display: flex; transition: color .15s;
}
.toggle-pw:hover, .toggle-pw.on { color: var(--navy); }

.login-footer {
  position: relative;
  margin-top: 22px;
  color: rgba(255,255,255,.6);
  font-size: 12.5px; letter-spacing: .04em;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 9px;
  border: none; border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: transform .06s ease, box-shadow .18s ease, background .18s ease, filter .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--navy-700), var(--navy));
  box-shadow: 0 6px 16px rgba(5,39,74,.28);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 22px rgba(5,39,74,.34); }

.btn-success {
  color: #fff;
  background: linear-gradient(135deg, #16c172, var(--green-600));
  box-shadow: 0 6px 16px rgba(7,148,85,.30);
}
.btn-success:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(7,148,85,.38); }

.btn-secondary {
  color: var(--navy);
  background: #eef2f7;
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-secondary:hover { background: #e3e9f1; }

.btn-block { width: 100%; padding: 14px; margin-top: 6px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }

/* CTA orange (accent marque) pour le bouton de choix de fichier */
#browseBtn {
  background: linear-gradient(135deg, #f7902f, var(--orange-600));
  box-shadow: 0 6px 16px rgba(238,127,26,.32);
}
#browseBtn:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(238,127,26,.4); }

/* ============================================================
   TOPBAR (page upload)
   ============================================================ */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
}
.topbar-logo { height: 52px; width: auto; }
.topbar-titles { flex: 1; min-width: 0; }
.topbar-titles h1 {
  margin: 0; font-size: 19px; font-weight: 800;
  color: var(--navy); letter-spacing: -.02em;
}
.topbar-titles p {
  margin: 2px 0 0; font-size: 13px; color: var(--muted);
}
.logout-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--muted); text-decoration: none;
  padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--line);
  transition: all .15s;
}
.logout-link:hover { color: var(--navy); border-color: #cdd6e3; background: #f6f8fb; }

/* ============================================================
   CONTENEUR
   ============================================================ */
.container {
  max-width: 1000px; margin: 0 auto;
  padding: 32px 24px 40px;
}

/* ============================================================
   DROPZONE
   ============================================================ */
.dropzone {
  background: var(--card);
  border: 2px dashed #c3cedd;
  border-radius: var(--radius);
  padding: 54px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s, box-shadow .18s;
  box-shadow: var(--shadow-sm);
}
.dropzone:hover { border-color: var(--orange); box-shadow: var(--shadow-md); }
.dropzone.dragover {
  border-color: var(--orange);
  background: var(--orange-50);
  transform: scale(1.005);
  box-shadow: var(--shadow-md);
}
.dz-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: radial-gradient(circle at 50% 35%, #eaf1f9, #dde8f4);
  box-shadow: inset 0 0 0 1px rgba(5,39,74,.06);
}
.dropzone:hover .dz-icon { color: var(--orange-600); }
.dz-title { margin: 4px 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.dz-or { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }
.dz-file {
  margin: 16px auto 0; min-height: 20px;
  color: var(--navy); font-size: 13.5px; font-weight: 600;
  max-width: 80%; word-break: break-all;
}

/* ============================================================
   PANELS
   ============================================================ */
.panel {
  margin-top: 22px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 26px;
  animation: rise .35s ease both;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.panel-header h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }

.badge {
  font-size: 11.5px; font-weight: 800;
  padding: 5px 12px; border-radius: 999px;
  letter-spacing: .04em; text-transform: uppercase;
  background: #e9f0f8; color: var(--navy-600);
  box-shadow: inset 0 0 0 1px rgba(21,83,143,.18);
}
.badge.savoye { background: var(--orange-50); color: var(--orange-600); box-shadow: inset 0 0 0 1px rgba(238,127,26,.25); }

/* Progress */
.progressbar {
  position: relative; height: 12px;
  background: #e7ecf3; border-radius: 999px; overflow: hidden;
}
.progressbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--navy-600), var(--orange));
  border-radius: 999px;
  transition: width .3s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 12px rgba(238,127,26,.5);
}
.progress-meta {
  display: flex; justify-content: flex-end;
  margin: 8px 0 4px; font-size: 13px; font-weight: 700; color: var(--navy);
}

/* Steps */
.steps {
  list-style: none; margin: 14px 0 0; padding: 0;
  font-size: 14px; max-height: 260px; overflow-y: auto;
}
.steps li {
  padding: 9px 0; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #f1f4f8; color: var(--muted);
  animation: fadein .25s ease both;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: #c7d0dd; flex-shrink: 0; transition: background .2s;
}
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active::before {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(238,127,26,.16);
  animation: pulse 1.1s infinite;
}
.steps li.done::before  { background: var(--green); }
.steps li.error { color: var(--red); }
.steps li.error::before { background: var(--red); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.45); } }
@keyframes fadein { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   RÉSULTATS
   ============================================================ */
.result-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 20px; flex-wrap: wrap;
}
.result-head-left { display: flex; align-items: center; gap: 14px; }
.result-check {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #16c172, var(--green-600));
  box-shadow: 0 6px 16px rgba(7,148,85,.34);
}
.result-header h2 { margin: 0 0 3px; font-size: 20px; font-weight: 800; color: var(--ink); }
.result-summary { margin: 0; color: var(--muted); font-size: 14.5px; font-weight: 600; }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: auto; max-height: 520px;
  margin-bottom: 18px;
}
.refs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.refs-table th, .refs-table td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid #f1f4f8; white-space: nowrap;
}
.refs-table th {
  background: #f7f9fc; font-weight: 700; color: var(--navy);
  position: sticky; top: 0; z-index: 1;
  font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase;
}
.refs-table tbody tr { transition: background .12s; }
.refs-table tbody tr:hover { background: #f9fbfd; }
.refs-table tr.not-found { background: #fef3f2; }
.refs-table tr.not-found:hover { background: #fde9e7; }
.refs-table tr.not-found td { color: #b42318; }
.status-found   { color: var(--green-600); font-weight: 700; }
.status-missing { color: #d92d20; font-weight: 700; }
.refs-table .filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: #475467;
  white-space: normal; word-break: break-all; max-width: 240px;
}

/* Erreur */
.panel-error { border: 1px solid #fecdca; background: #fffbfa; }
.error-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; color: #b42318; }
.error-head h2 { margin: 0; color: #b42318; font-size: 18px; }
#errorMessage { color: #912018; margin: 4px 0 18px; }

.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 18px; text-align: left;
}
.alert-error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }

.app-footer {
  text-align: center; color: var(--muted);
  font-size: 12.5px; letter-spacing: .03em;
  padding: 10px 0 30px;
}

@media (max-width: 560px) {
  .topbar-titles p { display: none; }
  .topbar-logo { height: 42px; }
  .result-header { flex-direction: column; align-items: stretch; }
  .result-header .btn { width: 100%; }
  .login-card { padding: 32px 24px 28px; }
  .db-cards { grid-template-columns: 1fr !important; }
}

/* ============================================================
   Liste fichiers sélectionnés + barre de validation
   ============================================================ */
.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow-sm);
  animation: fadein .2s ease both;
}
.file-row svg { color: var(--navy-600); flex-shrink: 0; }
.file-name { flex: 1; font-size: 14px; color: var(--ink); word-break: break-all; }
.file-del {
  border: none; background: #f0f3f8; color: var(--muted);
  width: 26px; height: 26px; border-radius: 8px; font-size: 18px; line-height: 1;
  cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.file-del:hover { background: #fde9e7; color: var(--red); }
.validate-bar { margin-top: 16px; display: flex; gap: 12px; }

/* ============================================================
   Résultats
   ============================================================ */
.results-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.result-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  background: #fbfcfe; flex-wrap: wrap; animation: rise .3s ease both;
}
.result-card-error { background: #fef3f2; border-color: #fecdca; }
.rc-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rc-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.rc-sub { font-size: 13px; font-weight: 600; margin-top: 2px; }
.rc-sub.ok { color: var(--green-600); }
.rc-sub.warn { color: var(--orange-600); }
.rc-err { color: #b42318; font-size: 13px; margin-top: 3px; }

/* ============================================================
   Tables génériques (historique)
   ============================================================ */
.hint { font-size: 12px; color: var(--muted); background: #f0f3f8; padding: 3px 10px; border-radius: 999px; }
.empty-msg { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 0; }
.muted { color: var(--muted); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f4f8; }
.data-table th { background: #f7f9fc; font-weight: 700; color: var(--navy); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.data-table tbody tr:hover { background: #f9fbfd; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; color: var(--navy-600);
  background: #eef2f8; text-decoration: none; transition: all .15s;
}
.icon-btn:hover { background: var(--navy); color: #fff; }

/* steps sub-label */
.step-sub { color: var(--muted); font-weight: 400; }

/* ============================================================
   Base de plans — cartes
   ============================================================ */
.db-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.db-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fbfcfe; }
.db-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.db-logo { height: 46px; width: auto; max-width: 150px; object-fit: contain; }
.db-date { font-size: 13px; color: var(--muted); line-height: 1.4; margin-left: auto; text-align: right; }
.db-date strong { color: var(--navy); font-size: 15px; }
.db-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.db-actions .btn { flex: 1; min-width: 150px; font-size: 13px; padding: 10px 14px; }
.db-updates { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.db-updates-t { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }
.db-updates ul { list-style: none; margin: 0; padding: 0; }
.db-updates li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f1f4f8; }
.db-updates li:last-child { border-bottom: none; }
.upd-date { color: var(--ink); font-weight: 600; }
.upd-count { color: var(--green-600); font-weight: 600; }
.db-updates li .icon-btn { margin-left: auto; width: 30px; height: 30px; }

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,20,40,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein .15s ease both;
}
.modal {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; padding: 26px; animation: rise .25s ease both;
}
.modal h3 { margin: 0 0 4px; font-size: 19px; color: var(--navy); }
.modal-sub { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.dup-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.dup-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 14px;
}
.dup-row:hover { border-color: var(--navy-600); background: #f9fbfd; }
.dup-row input { width: 18px; height: 18px; accent-color: var(--orange); flex-shrink: 0; }
.dup-row span { flex: 1; }
.dup-file { color: var(--muted); font-size: 12px; }
.dup-tag { background: var(--orange-50); color: var(--orange-600); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex: 0 0 auto !important; }
.dropzone-sm { padding: 30px 18px; margin-top: 6px; }
.upd-progress { margin-top: 14px; }

/* ============================================================
   App shell : sidebar + main
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #06294d, #041d38);
  display: flex; flex-direction: column; padding: 22px 16px;
}
.sidebar-logo { width: 152px; background: #fff; border-radius: 12px; padding: 10px 12px; margin: 0 auto 28px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: none; background: transparent; color: #aebfd4;
  font-size: 14.5px; font-weight: 600; font-family: inherit;
  padding: 12px 14px; border-radius: 11px; cursor: pointer; text-align: left; transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(238,127,26,.35); }
.nav-item svg { flex-shrink: 0; }
.nav-badge { margin-left: auto; background: #fff; color: var(--navy); font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.nav-item.active .nav-badge { color: var(--orange-600); }
.sidebar-logout { display: flex; align-items: center; gap: 8px; color: #8fa4c0; text-decoration: none; font-size: 13px; padding: 10px 14px; border-radius: 10px; }
.sidebar-logout:hover { background: rgba(255,255,255,.08); color: #fff; }
.main-area { flex: 1; min-width: 0; padding: 32px 36px 60px; }
.view { max-width: 1000px; }
.view-title { font-size: 24px; font-weight: 800; color: var(--navy); margin: 0 0 22px; letter-spacing: -.02em; }

/* ============================================================
   Commandes en cours
   ============================================================ */
.orders-list { display: flex; flex-direction: column; gap: 14px; }
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 18px 20px; animation: rise .3s ease both; }
.order-card.controlled { border-left: 4px solid var(--green); }
.oc-top { display: flex; align-items: center; gap: 14px; }
.oc-id { flex: 1; min-width: 0; }
.oc-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.oc-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.oc-stats { display: flex; align-items: center; gap: 28px; margin: 16px 0; flex-wrap: wrap; }
.oc-stat { display: flex; flex-direction: column; }
.oc-num { font-size: 20px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.oc-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.oc-chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.chip-done { background: #e7f7ee; color: var(--green-600); }
.chip-prod { background: var(--orange-50); color: var(--orange-600); }
.chip-ok { background: #e7f0fb; color: var(--navy-600); }
.oc-actions { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.icon-btn.danger { background: #fdeceb; color: var(--red); }
.icon-btn.danger:hover { background: var(--red); color: #fff; }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(229,72,77,.3); }
.btn-danger:hover { filter: brightness(1.08); }

/* ============================================================
   Renommage base (#5)
   ============================================================ */
.modal-lg { max-width: 580px; }
.rename-list { max-height: 360px; overflow-y: auto; margin-top: 6px; }
.rename-head { font-size: 13px; font-weight: 700; color: var(--navy); margin: 0 0 10px; }
.rename-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f1f4f8; }
.rn-orig { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rename-row > svg { color: var(--orange); flex-shrink: 0; }
.rn-input { display: flex; align-items: center; flex: 1.2; }
.rn-input input { flex: 1; min-width: 0; padding: 7px 9px; border: 1.5px solid var(--line); border-radius: 8px 0 0 8px; font-size: 13px; font-family: ui-monospace, monospace; }
.rn-input input:focus { outline: none; border-color: var(--orange); }
.rn-ext { background: #eef2f7; border: 1.5px solid var(--line); border-left: none; border-radius: 0 8px 8px 0; padding: 7px 9px; font-size: 12px; color: var(--muted); }

/* ============================================================
   Contrôle production
   ============================================================ */
.ctrl-result { margin-top: 6px; }
.ctrl-ok { display: flex; align-items: center; gap: 10px; background: #e7f7ee; color: var(--green-600); font-weight: 700; padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; }
.ctrl-bad { background: #fef3f2; color: #b42318; padding: 13px 15px; border-radius: 12px; margin-bottom: 12px; }
.missing-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 240px; overflow-y: auto; }
.missing-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid #fecdca; border-radius: 10px; margin-bottom: 6px; font-family: ui-monospace, monospace; font-size: 13px; }

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
  .sidebar-logo { width: 84px; margin: 0 14px 0 0; }
  .nav { flex-direction: row; flex: 1; gap: 4px; }
  .nav-item { padding: 9px 11px; font-size: 13px; }
  .nav-item span:not(.nav-badge) { display: none; }
  .sidebar-logout { padding: 8px; }
  .main-area { padding: 20px 16px 40px; }
  .oc-chips { margin-left: 0; width: 100%; }
}
