/* ===========================================================
   CG CARS - HBL  —  Feuille de style
   Palette : fond blanc, boutons rouges, accents noirs
   =========================================================== */

:root{
  --red: #d2191f;
  --red-dark: #a80f14;
  --red-light: #ffe7e8;
  --black: #111111;
  --gray-900: #1a1a1a;
  --gray-700: #4a4a4a;
  --gray-400: #8a8a8a;
  --gray-200: #e6e6e6;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.18);
}

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

body{
  margin:0;
  font-family:'Inter', Arial, sans-serif;
  background:var(--white);
  color:var(--gray-900);
  -webkit-font-smoothing:antialiased;
}

a{color:inherit;text-decoration:none;}
code{
  background:var(--gray-100);
  padding:2px 6px;
  border-radius:4px;
  font-size:0.85em;
  color:var(--red-dark);
}

/* ---------- TOPBAR ---------- */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:var(--black);
  border-bottom:3px solid var(--red);
}
.topbar-inner{
  max-width:1200px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 24px;
}
.brand{display:flex;align-items:center;gap:12px;}
.brand-logo{height:40px;width:auto;object-fit:contain;}
.brand-text{display:flex;flex-direction:column;line-height:1.1;}
.brand-title{color:var(--white);font-weight:800;font-size:1.1rem;letter-spacing:0.5px;}
.brand-subtitle{color:var(--gray-400);font-size:0.72rem;}
.topbar-nav{display:flex;gap:22px;}
.topbar-nav a{
  color:var(--gray-200);
  font-size:0.9rem;
  font-weight:500;
  display:flex;
  align-items:center;
  gap:6px;
  transition:color .2s;
}
.topbar-nav a:hover{color:var(--red);}

/* ---------- HERO ---------- */
.hero{
  background:linear-gradient(135deg, var(--black) 0%, #2a0607 60%, var(--red-dark) 100%);
  padding:64px 24px;
  text-align:center;
}
.hero-inner{max-width:820px;margin:0 auto;}
.hero h1{
  color:var(--white);
  font-size:2.1rem;
  font-weight:800;
  line-height:1.25;
  margin:0 0 18px;
}
.hero h1 span{color:var(--red);}
.hero p{
  color:#e8e8e8;
  font-size:1.02rem;
  line-height:1.6;
  margin:0 0 28px;
}
.hero-badges{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  justify-content:center;
}
.badge{
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.18);
  color:var(--white);
  padding:8px 14px;
  border-radius:30px;
  font-size:0.85rem;
  display:flex;
  align-items:center;
  gap:8px;
}
.badge i{color:var(--red);}

/* ---------- SECTIONS ---------- */
main{max-width:1200px;margin:0 auto;padding:0 24px;}
.section{padding:56px 0;border-bottom:1px solid var(--gray-200);}
.section:last-of-type{border-bottom:none;}
.section-head{
  display:flex;
  align-items:flex-start;
  gap:18px;
  margin-bottom:28px;
}
.step-number{
  flex:0 0 auto;
  width:40px;
  height:40px;
  border-radius:50%;
  background:var(--red);
  color:var(--white);
  font-weight:800;
  font-size:1.1rem;
  display:flex;
  align-items:center;
  justify-content:center;
}
.section-head h2{
  margin:0 0 6px;
  font-size:1.5rem;
  font-weight:800;
  color:var(--black);
}
.section-desc{
  margin:0;
  color:var(--gray-700);
  font-size:0.95rem;
  line-height:1.55;
}

/* ---------- IMPORT ---------- */
.import-grid{
  display:grid;
  grid-template-columns:1.4fr 1fr;
  gap:24px;
}
.dropzone{
  border:2px dashed var(--gray-200);
  border-radius:var(--radius);
  background:var(--gray-100);
  padding:48px 24px;
  text-align:center;
  cursor:pointer;
  transition:border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragover{
  border-color:var(--red);
  background:var(--red-light);
}
.dropzone i{
  font-size:2.6rem;
  color:var(--red);
  margin-bottom:14px;
}
.dz-title{font-weight:700;font-size:1.05rem;margin:0 0 6px;color:var(--black);}
.dz-sub{color:var(--gray-400);font-size:0.85rem;margin:0 0 18px;}

.import-side{display:flex;flex-direction:column;gap:18px;}
.info-card{
  background:var(--white);
  border:1px solid var(--gray-200);
  border-radius:var(--radius);
  padding:18px 20px;
  box-shadow:var(--shadow);
}
.info-card h3{
  font-size:0.95rem;
  margin:0 0 12px;
  color:var(--black);
  display:flex;
  align-items:center;
  gap:8px;
}
.info-card h3 i{color:var(--red);}
.required-cols{
  list-style:none;
  margin:0 0 16px;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.required-cols li code{display:inline-block;}
.info-card p{font-size:0.88rem;color:var(--gray-700);margin:0;}

/* ---------- BUTTONS ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:none;
  border-radius:8px;
  padding:11px 20px;
  font-size:0.92rem;
  font-weight:600;
  cursor:pointer;
  transition:transform .15s, box-shadow .15s, background .15s;
  font-family:inherit;
}
.btn:disabled{opacity:0.5;cursor:not-allowed;}
.btn-primary{background:var(--red);color:var(--white);}
.btn-primary:hover:not(:disabled){background:var(--red-dark);box-shadow:var(--shadow);}
.btn-outline{background:transparent;color:var(--red);border:2px solid var(--red);}
.btn-outline:hover{background:var(--red);color:var(--white);}
.btn-ghost{background:var(--gray-100);color:var(--gray-900);}
.btn-ghost:hover{background:var(--gray-200);}
.btn-sm{padding:8px 14px;font-size:0.82rem;}
.btn-lg{padding:16px 32px;font-size:1.05rem;}
.btn-icon{
  background:var(--gray-100);
  color:var(--red);
  border-radius:6px;
  padding:7px 10px;
  font-size:0.82rem;
}
.btn-icon:hover{background:var(--red);color:var(--white);}

/* ---------- ALERT ---------- */
.alert{
  margin-top:20px;
  padding:14px 18px;
  border-radius:8px;
  font-size:0.9rem;
  display:flex;
  align-items:flex-start;
  gap:10px;
}
.alert-success{background:#e7f7ec;color:#1a7a3d;border:1px solid #bdeccb;}
.alert-error{background:#fdeaea;color:var(--red-dark);border:1px solid #f6c6c6;}

/* ---------- TABLE ---------- */
.table-wrap{
  overflow-x:auto;
  border:1px solid var(--gray-200);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.clients-table{
  width:100%;
  border-collapse:collapse;
  font-size:0.86rem;
  min-width:900px;
}
.clients-table thead th{
  background:var(--black);
  color:var(--white);
  text-align:left;
  padding:12px 14px;
  font-weight:600;
  white-space:nowrap;
}
.clients-table tbody td{
  padding:12px 14px;
  border-bottom:1px solid var(--gray-200);
  color:var(--gray-900);
  vertical-align:top;
}
.clients-table tbody tr:hover{background:var(--gray-100);}
.clients-table tbody tr:last-child td{border-bottom:none;}
.empty-row td{
  text-align:center;
  color:var(--gray-400);
  padding:32px;
}

/* ---------- GENERATE ---------- */
.generate-box{
  text-align:center;
  padding:36px;
  background:var(--gray-100);
  border-radius:var(--radius);
}
.progress-wrap{max-width:420px;margin:22px auto 0;}
.progress-bar{
  height:10px;
  background:var(--gray-200);
  border-radius:10px;
  overflow:hidden;
}
.progress-bar-fill{
  height:100%;
  width:0%;
  background:var(--red);
  transition:width .2s;
}
.progress-text{
  margin:10px 0 0;
  font-size:0.85rem;
  color:var(--gray-700);
}

/* ---------- FOOTER ---------- */
.footer{
  text-align:center;
  padding:24px;
  background:var(--black);
  color:var(--gray-400);
  font-size:0.8rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 800px){
  .topbar-nav{display:none;}
  .hero h1{font-size:1.6rem;}
  .import-grid{grid-template-columns:1fr;}
  .section-head{flex-direction:column;}
}

/* ---------- MODÈLES PAR CLIENT ---------- */
.alert-warn{background:#fff6e0;color:#8a5a00;border:1px solid #f3dca2;}
.template-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:16px 28px;
  padding:16px 20px;
  margin-bottom:18px;
  background:var(--gray-100);
  border-radius:var(--radius);
}
.tpl-counter{min-width:220px;flex:0 1 280px;}
.tpl-counter-label{display:flex;align-items:center;gap:8px;font-size:0.9rem;margin-bottom:8px;}
.tpl-counter-label i{color:var(--red);}
.tpl-counter .progress-bar{height:8px;background:var(--gray-200);}
.tpl-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;flex:1 1 360px;justify-content:flex-end;}
.tpl-bulk-hint{font-size:0.78rem;color:var(--gray-700);max-width:360px;line-height:1.4;}

.clients-table{min-width:1180px;}
.tpl-cell{min-width:230px;}
.btn-upload{
  background:var(--white);
  color:var(--red);
  border:1.5px dashed var(--red);
  padding:7px 12px;
  font-size:0.8rem;
  border-radius:6px;
}
.btn-upload:hover{background:var(--red-light);}
.tpl-hint{font-size:0.72rem;color:var(--gray-400);margin-top:5px;}
.tpl-chip{
  display:flex;
  align-items:center;
  gap:8px;
  background:#e7f7ec;
  border:1px solid #bdeccb;
  border-radius:6px;
  padding:6px 6px 6px 10px;
}
.tpl-chip > i{color:#1d5fb8;font-size:1.05rem;}
.tpl-info{display:flex;flex-direction:column;min-width:0;flex:1;}
.tpl-name{font-size:0.8rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;}
.tpl-meta{font-size:0.7rem;color:var(--gray-700);}
.tpl-action{
  border:none;
  background:transparent;
  color:var(--gray-700);
  cursor:pointer;
  padding:5px 6px;
  border-radius:4px;
  font-size:0.8rem;
}
.tpl-action:hover{background:var(--white);color:var(--red);}
.clients-table tbody tr.row-dragover{background:var(--red-light);outline:2px dashed var(--red);outline-offset:-2px;}
.btn-icon:disabled:hover{background:var(--gray-100);color:var(--red);}
.generate-status{margin:14px 0 0;font-size:0.88rem;color:var(--gray-700);}
