:root{
  --bg:#f5f7fb; --surface:#fff; --ink:#111827; --muted:#6b7280;
  --brand:#0d6efd; --danger:#ef4444; --line:#e5e7eb;
  --r:12px; --shadow:0 6px 18px rgba(0,0,0,.06);
  --gap:16px; --pad:18px; --inputh:38px;
}

/* ===== Base ===== */
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--ink)}
.container{max-width:1080px; margin:0 auto; padding:22px 16px 28px}

/* ===== Header simple (igual patrón a Emballage) ===== */
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}
.page-header h1{margin:0;font-size:22px;color:#0f172a;font-weight:700}

/* ===== Cards & Typography ===== */
.card{
  background:var(--surface);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:20px;
  margin-bottom:18px;
}
.section-title{margin:0 0 12px;font-size:16px;color:#0f172a}
.muted{color:var(--muted)}

/* ===== Form layout ===== */
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--gap)}
@media (max-width:980px){.grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:640px){.grid{grid-template-columns:1fr}}

label{font-size:13px;color:#111827;margin-bottom:6px;display:block}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea{
  height:var(--inputh);
  width:100%;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  font-size:14px;
}

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

/* ===== Radios ===== */
.radio-line{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.radio-group{display:flex;align-items:center;gap:10px}

/* ===== Alert ===== */
.help{
  font-size:13px;
  color:#b91c1c;
  background:#fee2e2;
  border:1px solid #fecaca;
  padding:8px 10px;
  border-radius:10px;
}

/* ===== Table ===== */
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;background:#fff}
th,td{border:1px solid #eef0f3;padding:10px 12px;text-align:left;font-size:14px}
th{background:#f7fafc}
tfoot td{font-weight:bold;background:#f9fafb}

input.in-table{
  height:34px;
  width:100%;
  padding:0 8px;
  border:1px solid var(--line);
  border-radius:8px;
}

/* ===== Buttons ===== */
.btn{
  height:38px;
  border:none;
  border-radius:10px;
  padding:0 14px;
  cursor:pointer;
  font-weight:700;
}
.btn-primary{background:var(--brand);color:#fff}
.btn-ghost{background:#f3f4f6}
.btn-danger{background:var(--danger);color:#fff}
.btn-outline{
  background:transparent;
  border:1px dashed #93c5fd;
  color:#0d6efd;
  border-radius:12px;
  padding:8px 12px;
  font-weight:700;
  cursor:pointer;
}
.btn-lg{min-width:320px;height:46px;font-size:16px}

.actions{display:flex;gap:10px;flex-wrap:wrap}
.actions.between{justify-content:space-between}
.right{margin-left:auto}

/* ===== Responsables (UI como tu captura) ===== */
#responsablesList{
  display:flex;
  flex-direction:column;
  gap:14px;
  max-width:560px;
  margin:0 auto;
}
.resp-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
}
.resp-row select{height:38px}

/* ===== Mini notas ===== */
.small-note{font-size:12px;margin-top:6px}
.small-note.error{color:#b91c1c}
.small-note.ok{color:#065f46}

/* ===== Layout para priorizar LOTES (main) y aside compacto ===== */
.layout{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(280px,1fr);
  gap:var(--gap);
  align-items:start;
}
@media (max-width:980px){
  .layout{ grid-template-columns:1fr; }
}

/* Aside/compact cards */
.card--compact{
  padding:16px;
  box-shadow:0 3px 10px rgba(0,0,0,.05);
}
.section-title.sm{
  font-size:14px;
  color:var(--muted);
  margin-bottom:10px;
}

/* Responsables en aside compacto */
#responsablesList .resp-row select{ height:34px; }
#responsablesList .btn-outline{ padding:6px 10px; }

/* Sticky aside opcional */
.sticky{ position:sticky; top:10px; }
/* Cabecera dentro de tarjetas (título + acciones a la derecha) */
.card-header{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;
}
.card-header .title{ margin:0; font-size:16px; color:#0f172a }

/* Botón pequeño (para "+ Ajouter un lot") */
.btn-sm{ height:30px; padding:0 10px; font-weight:700 }
/* ==== CTA bar global (estandar para todos los forms) ==== */
.cta-bar{
  display:flex; gap:22px; justify-content:center; flex-wrap:wrap;
  margin-top:6px;
}
a.cta, button.cta{
  appearance:none; -webkit-appearance:none;
  display:inline-flex; align-items:center; gap:10px;
  background:#0d6efd; color:#fff; text-decoration:none; border:0;
  padding:14px 22px; border-radius:16px; font-weight:800; font-size:20px;
  line-height:1; cursor:pointer; box-shadow:0 6px 16px rgba(13,110,253,.25);
  transition:transform .05s ease, box-shadow .2s ease, background .2s ease;
}
a.cta:hover, button.cta:hover{ background:#0b5ed7; box-shadow:0 8px 20px rgba(13,110,253,.35); }
a.cta:active, button.cta:active{ transform:translateY(1px); }
a.cta:focus-visible, button.cta:focus-visible{ outline:3px solid rgba(13,110,253,.4); outline-offset:2px; }

/* Tamaño variante pequeño si alguna vez lo necesitas */
.cta.cta-sm{ padding:10px 16px; font-size:16px; border-radius:12px; }
/* === CTA compact global override === */
.cta-bar{ gap:16px; justify-content:center; flex-wrap:wrap; }
a.cta, button.cta{
  padding:10px 16px;           /* antes 14px 22px */
  border-radius:12px;          /* antes 16px */
  font-size:16px;              /* antes 20px */
  box-shadow:0 4px 12px rgba(13,110,253,.20);
}
a.cta:hover, button.cta:hover{ background:#0b5ed7; box-shadow:0 6px 16px rgba(13,110,253,.28); }
/* Placeholders más pequeños y con color tenue */
:root{
  --ph-size: 10px;
  --ph-color: #9ca3af; /* gris suave */
}

/* Modern browsers */
input::placeholder,
textarea::placeholder {
  font-size: var(--ph-size);
  color: var(--ph-color);
  opacity: 1; /* que no se vea deslavado de más */
}

/* Tabla (inputs dentro del tfoot y filas) */
input.in-table::placeholder {
  font-size: var(--ph-size);
  color: var(--ph-color);
}

/* Compatibilidad (WebKit/Edge/IE viejitos) */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder { font-size: var(--ph-size); color: var(--ph-color); }
input:-ms-input-placeholder,
textarea:-ms-input-placeholder { font-size: var(--ph-size); color: var(--ph-color); }
/* =======================
   Toast / avisos flotantes
   ======================= */
.toast-wrap{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 10px;
}

.toast{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  border-left: 4px solid #e5e7eb;
  min-width: 280px;
  max-width: 360px;
  animation: toastIn .25s ease both;
}

.toast.success{ border-color: #10b981; }  /* verde */
.toast.error{   border-color: #ef4444; }  /* rojo  */

.toast .icon{
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

.toast .body{
  flex: 1;
  font-size: 14px;
  color: #111827;
}

.toast .title{
  font-weight: 700;
  margin: 0 0 2px 0;
}

.toast .muted{
  font-size: 12px;
  color: #6b7280;
}

.toast .close{
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 2px;
}

@keyframes toastIn{
  from{ opacity: 0; transform: translateY(-6px); }
  to{   opacity: 1; transform: translateY(0); }
}
/* === Produit: ancho y layout limpio === */
.produit-wrap{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.produit-wrap label{ min-width:90px; margin:0; }
#produit{
  width:100%;
  max-width:520px;   /* ajusta este número si tu card es más ancha/angosta */
  height:var(--inputh);
}
/* opcional: card del produit con el mismo ancho visual que "Lots" */
.card--produit{ max-width:980px; margin:0 auto 14px; }
/* Encabezado de card con producto + botón */
.card-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.head-left{ display:flex; flex-direction:column; gap:6px; }

.produit-inline{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.produit-inline label{
  font-size:13px; color:#111827; margin:0;
}
.produit-inline select{
  height:var(--inputh);
  width:100%;
  max-width:540px; /* ajusta si tu card es más angosta */
}

/* Botón pequeño estándar */
.btn-sm{
  height:30px;
  padding:0 10px;
  font-size:13px;
  border-radius:8px;
}

/* Responsive: apila en pantallas angostas */

@media (max-width: 720px){
  .card-head{
    flex-direction:column;
    align-items:stretch;
  }
  .head-right{ display:flex; justify-content:flex-end; }
  .produit-inline select{ max-width:100%; }
}
/* FromApp – stub rápido para evitar 404 y mostrar toasts */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 10px;
  border-radius: 10px;
  display: none;
  z-index: 9999;
}


