:root{
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container{
  max-width: 1600px;
  margin: 0 auto;
  padding: 60px;
}

.header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

h1{
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

h2{
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
}

/* ==============================
   Layout
============================== */

.grid{
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.grid-editor{
  grid-template-columns: 580px 1fr;
  align-items: start;
}

.card{
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
  border: 1px solid var(--border);
}

/* ==============================
   Formulaire
============================== */

.row{ margin-bottom: 14px; }

label{
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input, select, textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border .2s ease;
}

input:focus,
select:focus,
textarea:focus{
  border-color: var(--accent);
}

textarea{ resize: vertical; }

/* ==============================
   Champs avancés
============================== */

.grid-4{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.input-small{
  padding: 8px 10px;
  font-size: 13px;
}

.options-admin{
  display:grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 1100px){
  .options-admin{ grid-template-columns: repeat(3, 1fr); }
}

.opt-title{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.price-admin-wrap{
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.price-admin-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.price-admin-table th,
.price-admin-table td{
  border: 1px solid var(--border);
  padding: 6px;
  text-align: center;
  vertical-align: middle;
}

.price-admin-table thead th{
  background: #f3f4f6;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.price-admin-table input{
  width: 100%;
  padding: 8px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
}

.hint{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.actions, .form-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==============================
   Boutons
============================== */

.btn{
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s ease;
}

.btn:hover{
  background: #f9fafb;
}

.btn-secondary{
  background: #f3f4f6;
}

.btn-danger{
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.btn-small{
  padding: 5px 8px;
  font-size: 12px;
}

.muted{ color: var(--muted); }

.msg{
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.msg.info{ background: #eef2ff; }
.msg.ok{ background: #dcfce7; }
.msg.err{ background: #fee2e2; }

.divider{
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ==============================
   TABLE PRODUITS
============================== */

#tableFiches{
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  table-layout: fixed;
  font-size: 14px;
}

#tableFiches th,
#tableFiches td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tableFiches th{
  font-size: 12px;
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

#tableFiches th:nth-child(1),
#tableFiches td:nth-child(1){
  width: 200px;
  white-space: nowrap;
}

#tableFiches th:nth-child(2),
#tableFiches td:nth-child(2){
  width: auto;
  white-space: nowrap;
}

#tableFiches th:nth-child(3),
#tableFiches td:nth-child(3){
  width: 170px;
  white-space: nowrap;
}

/* ==============================
   PREVIEW IFRAME
============================== */

.preview-header{
  margin-bottom: 12px;
}

.a4-wrap{
  width: 100%;
  height: 1200px;
  overflow-y: auto;   /* ✅ permet de voir le bas */
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fafb;
}

.a4-iframe{
  width: 100%;
  height: 1150px;
  border: solid 1px black;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);

  overflow: auto; /* important */
}

.a4-wrap{
  overflow: hidden; /* important aussi */
}


/* ==============================
   Responsive
============================== */

@media (max-width: 1300px){
  .grid-editor{
    grid-template-columns: 520px 1fr;
  }
}

@media (max-width: 1100px){
  .grid-editor{
    grid-template-columns: 1fr;
  }
  .a4-wrap{
    height: 70vh;
  }
}


#description_longue
{
    min-height:400px;
}

