/* manage_etiquettes.php - new unified theme (from your app CSS) */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e2e8f0;
  --shadow:0 10px 30px rgba(15,23,42,.08);
  --radius:16px;
  --radius-sm:12px;
  --focus:0 0 0 3px rgba(59,130,246,.25);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--text);
  max-width:1180px;        /* remplace tes anciens max-width */
  margin:28px auto;
  padding:16px;
}

a{color:#0b63ff;text-decoration:none}
a:hover{text-decoration:underline}

/* Top bar */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:16px;
}

/* Cards / Boxes */
.box{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
  margin-top:12px;
}

/* Forms */
label{font-weight:700;font-size:13px;display:block;margin-top:8px}
input,select{
  width:100%;
  height:44px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  outline:none;
  background:#fff;
  margin-top:6px;
}
input:focus,select:focus{box-shadow:var(--focus);border-color:#93c5fd}

.small{font-size:12px;color:var(--muted)}
.muted{color:var(--muted)}

/* Grid rows */
.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:44px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--border);
  text-decoration:none;
  font-weight:750;
  font-size:13px;
  color:var(--text);
  background:#fff;
  cursor:pointer;
}
.btn:focus{outline:none;box-shadow:var(--focus)}
.btn:hover{
  background:#f8fafc;
  color:#0f172a;
}

.btnP{ /* primary */
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}
.btnP:hover{filter:brightness(1.05)}

.btnD{ /* danger */
  background:#d9534f;
  color:#fff;
  border:0;
}
.btnD:hover{filter:brightness(1.05)}

/* Actions row */
.actions{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}

/* Alerts / flash / errors */
.err,
.flashErr{
  border-radius:var(--radius);
  padding:14px 16px;
  border:1px solid #fecaca;
  background:#fff1f2;
}

.flash{
  border-radius:var(--radius);
  padding:14px 16px;
  border:1px solid #bbf7d0;
  background:#f0fdf4;
}

/* Table */
table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
}
th,td{
  border-bottom:1px solid var(--border);
  padding:10px;
  text-align:left;
  vertical-align:top;
}
th{
  background:#f8fafc;
  font-weight:750;
  font-size:13px;
}
tr:last-child td{border-bottom:0}

/* Pills */
.pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.7);
}
.ok{background:#f0fdf4;border-color:#bbf7d0}
.ko{background:#fff1f2;border-color:#fecaca}

/* Image preview */
.imgprev{
  width:120px;
  height:auto;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}

/* Responsive */
@media (max-width: 980px){
  body{max-width:100%;margin:0 auto;padding:12px}
  .row{grid-template-columns:1fr}
  .topbar{flex-direction:column;align-items:stretch}
  .actions{flex-direction:column;align-items:stretch}
  .btn{width:100%}
}
/* ====== Edit: section suppression (danger zone) ====== */
.dangerZone{
  margin-top:14px;
  border:1px solid #fecaca;
  background:linear-gradient(180deg, #fff 0%, #fff7f8 100%);
  border-radius:var(--radius);
  padding:12px;               /* moins de padding */
}

.dangerHead{ margin-bottom:10px; }

.checkRow{
  padding:10px;               /* moins haut */
  border-radius:12px;
}

.checkTitle{ font-size:12.5px; }
.checkPath{ font-size:11.5px; }

.dangerForm{ gap:10px; }

/* bouton supprimer moins massif */
.dangerZone .btnD{
  height:40px;
  padding:0 12px;
  border-radius:12px;
}
.dangerHead{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:12px;
}

.dangerTitle{
  font-weight:850;
  font-size:13px;
  letter-spacing:.2px;
  color:#991b1b;
}

.dangerSub{
  font-size:12px;
  color:#7f1d1d;
  opacity:.9;
}

.checkRow:hover{
  background:#fffafb;
}

.checkBox{
  width:18px;
  height:18px;
  margin-top:2px;
  accent-color:#ef4444; /* rouge moderne */
}

.checkText{
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height:1.2;
}

.checkTitle{
  font-weight:800;
  font-size:13px;
  color:#0f172a;
}

.checkPath{
  font-size:12px;
  color:var(--muted);
  word-break:break-all;
}

/* Bouton full width cohérent */


/* ====== File input plus propre (optionnel) ====== */
.fileInput{
  height:auto;
  padding:4px !important;
}
.fileInput::file-selector-button{
  height:36px;
  padding:0 12px;
  margin-right:12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:800;
  cursor:pointer;
}
.fileInput::file-selector-button:hover{
  background:#f8fafc;
}
/* ====== Layout edit: rangées 3 colonnes + boutons inline ====== */
.row3{
  grid-template-columns: 1fr 1fr 1fr;
}

.span2{
  grid-column: span 2;
}

.btnRow{
  display:flex;
  gap:10px;
  margin-top:14px;
}

.btnRow .btn{
  height:40px;          /* un peu plus petit */
  padding:0 12px;
}

@media (max-width: 980px){
  .row3{ grid-template-columns:1fr; }
  .span2{ grid-column:auto; }
  .btnRow{ flex-direction:column; }
  .btnRow .btn{ width:100%; }
}

/* =========================
   OUTIL ETIQUETTE (panel)
   ========================= */

/* Conteneur global du bloc outil */
.toolBox{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* Layout canvas + panel : en colonne (tu as déjà forcé ça en JS) */
.toolBox .wrap{
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:stretch;
  margin:0;
}

/* Canvas: cadre propre */
.toolBox canvas{
  width:100%;
  height:auto;
  display:block;
  border-radius: 14px;
  border:1px solid var(--border);
  background:#fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}

/* Petit texte sous le canvas */
.toolBox .small{
  margin-top:10px;
  line-height:1.35;
  color:var(--muted);
}

/* Panel */
.toolBox .panel{
  width:100%;
  border:1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}

/* Titres de sections (labels) */
.toolBox .panel > label{
  display:block;
  font-weight: 850;
  font-size: 12px;
  letter-spacing: .2px;
  margin: 10px 0 6px;
  color: var(--text);
}

/* Inputs/select du panel (un peu plus compacts que le global) */
.toolBox .panel input[type="number"],
.toolBox .panel select{
  width:100%;
  height:40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline:none;
  background:#fff;
}
.toolBox .panel input[type="number"]:focus,
.toolBox .panel select:focus{
  box-shadow: var(--focus);
  border-color:#93c5fd;
}

/* Grille X/Y et W/H */
.toolBox .panel .row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.toolBox .panel .row > div > label{
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
}

/* Bloc font size (même style) */
#fontWrap{
  margin-top: 8px;
}

/* =========================
   Toggles (LOT / DATE / QTY) - compacts en ligne
   ========================= */
.toolBox .toggles{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

/* Carte toggle compacte */
.toolBox .toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
  min-height: 44px; /* aligné avec les inputs */
}
.toolBox .toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15,23,42,.07);
  border-color:#cbd5e1;
}

/* Texte plus petit */
.toolBox .toggle > div{
  font-weight: 900;
  letter-spacing: .3px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

/* Switch plus petit */
.toolBox .toggle input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  position: relative;
  cursor:pointer;
  outline:none;
  transition: background .15s ease, border-color .15s ease;
  flex: 0 0 auto;
}

.toolBox .toggle input[type="checkbox"]::after{
  content:"";
  position:absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:#fff;
  box-shadow: 0 6px 14px rgba(15,23,42,.18);
  transition: transform .15s ease;
}

.toolBox .toggle input[type="checkbox"]:checked{
  background: #0b63ff;
  border-color: #0b63ff;
}
.toolBox .toggle input[type="checkbox"]:checked::after{
  transform: translateX(16px);
}

/* Responsive: 2 par ligne puis 1 */
@media (max-width: 980px){
  .toolBox .toggles{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .toolBox .toggles{ grid-template-columns: 1fr; }
}
