:root{
  --bg:#0f172a; --card:#111827; --muted:#9ca3af; --text:#e5e7eb;
  --accent:#22c55e; --danger:#ef4444; --line:#1f2937;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font:14px/1.5 system-ui,Segoe UI,Arial}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit}
.wrapper{max-width:1100px;margin:24px auto;padding:0 16px}
.header{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:16px}
.title{font-weight:700;font-size:20px;letter-spacing:.2px}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.btn{background:#1f2937;border:1px solid var(--line);color:var(--text);padding:9px 14px;border-radius:10px;cursor:pointer;transition:.15s ease;}
.btn:hover{transform:translateY(-1px)}
.btn.primary{background:var(--accent);color:#0b0f19;border-color:transparent;font-weight:700}
.btn.danger{background:var(--danger);color:#fff;border-color:transparent}
.searchbar{display:flex;gap:8px;background:#0b1020;border:1px solid var(--line);padding:8px;border-radius:10px;align-items:center}
.searchbar input[type="text"]{background:transparent;border:none;outline:none;color:var(--text);width:260px}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px}
.table{width:100%;border-collapse:collapse;overflow:hidden;border-radius:10px}
.table th,.table td{border-top:1px solid var(--line);padding:10px 10px;text-align:left;vertical-align:middle}
.table thead th{background:#0b1020;border-top:none;font-weight:600;color:#cfd3db}

/* Miniatures strictes */
.thumb{width:0c161px;height:90px;object-fit:cover;border-radius:8px;border:1px solid var(--line);background:#0b1020}
.preview{width:96px;height:96px;border-radius:10px;border:1px solid var(--line);object-fit:cover;background:#0b1020}

.meta{display:flex;gap:16px;flex-wrap:wrap;margin:14px 0;color:var(--muted)}
.badge{background:#0b1020;border:1px solid var(--line);padding:6px 10px;border-radius:999px}
.notice{margin:10px 0;padding:10px 12px;background:#052b17;border:1px solid #0f3e26;border-radius:10px;color:#b2f1c8}
.form{display:grid;gap:12px;grid-template-columns:1fr 1fr}
.form .full{grid-column:1/-1}
.input{display:flex;flex-direction:column;gap:6px}
.input input[type="text"],.input input[type="number"],.input select{
  background:#0b1020;color:var(--text);border:1px solid var(--line);padding:10px;border-radius:10px
}
/* Colonne Actions */
.actions-col {
  white-space: nowrap;
  width: 180px; /* ajuste selon la place */
}

.actions-col .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  padding: 6px 10px;
  min-width: 70px; /* largeur mini pour éviter chevauchement */
  text-align: center;
}

.upload{display:flex;gap:12px;align-items:center}

/* Dropzone SANS contenteditable, pour fiabiliser le drop */
.dropzone{
  display:flex;gap:12px;align-items:center;justify-content:flex-start;
  background:#0b1020;border:2px dashed #314155;border-radius:12px;padding:12px;
  transition:.15s; min-height:120px; position:relative;
}
.dropzone:hover{border-color:#4d6785}
.dropzone.dragover{border-color:var(--accent);background:#0c1610}
.dropzone .dz-text{color:#aab3c0}
.dropzone .dz-actions{display:flex;gap:8px;flex-wrap:wrap}

/* Empêche toute image collée d'exploser l'UI */
.dropzone img{max-width:96px;max-height:96px;border-radius:10px;border:1px solid var(--line);object-fit:cover}

.hide{display:none}

/* zone de collage cachée */
#pasteCatcher{
  position:absolute; left:-9999px; top:-9999px; width:1px; height:1px; opacity:0;
  background:transparent; color:transparent; border:none; outline:none;
}

@media (max-width:800px){
  .form{grid-template-columns:1fr}
  .searchbar input[type="text"]{width:100%}
  .table .hide-sm{display:none}
}

@media print{
  body{background:#fff;color:#000}
  .header,.actions,.searchbar,.footer-actions,.notice{display:none !important}
  .card{border:none}
  .table th,.table td{border-color:#ccc}
  .thumb{border-color:#ccc}
  th.actions-col, td.actions-col{display:none !important} /* 👈 Ajouté */
  a:link:after,a:visited:after{content:""}
  @page { margin: 12mm }
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed; inset: 0;
  background: #000c;
  display: none; /* hidden by default */
  align-items: center; justify-content: center;
  z-index: 9999;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  position: relative;
  max-width: 95vw; max-height: 95vh;
  background: #0b1020;
  border: 1px solid #1f2937; border-radius: 12px;
  overflow: hidden;
}
.lightbox-toolbar {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 6px;
}
.lb-btn {
  background: #111827; border: 1px solid #334155; color: #e5e7eb;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.lb-btn:hover { transform: translateY(-1px); }
.lightbox-stage {
  position: relative; width: 80vw; height: 80vh;
  max-width: min(1200px, 95vw);
  max-height: min(90vh, 900px);
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.lightbox-img {
  max-width: 100%; max-height: 100%;
  user-select: none; -webkit-user-drag: none;
  transform-origin: center center;
  cursor: grab;
}
.lightbox-img.dragging { cursor: grabbing; }
.lightbox-footer {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  color: #cbd5e1; font-size: 12px; background: #0b102099;
  padding: 4px 8px; border-radius: 999px; border: 1px solid #1f2937;
}
.comment-cell{
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table th a { text-decoration: none; }
.table th a:hover { text-decoration: underline; }
