:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --txt:#162033;
  --muted:#5b6b86;
  --line:rgba(22,32,51,.14);
  --accent:#1b67d2;
  --accent2:#0ea5a4;
}

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

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

.wrap{ max-width: 1100px; margin: 0 auto; padding: 18px; }

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(16,24,40,.08);
  padding: 16px;
}

.single-block{ padding: 18px; }

.divider{
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

h1{ margin:0; }
code{ color: var(--accent); }

.alert{
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  margin: 12px 0;
}
.alert ul{ margin: 8px 0 0 18px; }
.alert.error{ background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.22); }
.alert.warn{ background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.25); }
.alert.ok{ background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.22); }

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(27,103,210,.25);
  background: rgba(27,103,210,.10);
  color: var(--txt);
  text-decoration:none;
  cursor:pointer;
  font-weight: 650;
}
.btn:hover{ background: rgba(27,103,210,.14); }

.btn.secondary{
  border-color: var(--line);
  background: rgba(22,32,51,.04);
}
.btn.secondary:hover{ background: rgba(22,32,51,.07); }

/* ===== HERO (en-tête + texte dans le même bloc) ===== */
.hero-top{
  display:grid;
  grid-template-columns: 110px 1fr 110px;
  align-items:center;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-img{
  width: 110px;
  height: auto;
  display:block;
}

.hero-title{ text-align:center; }
.hero-kicker{
  font-weight: 750;
  color: var(--muted);
  letter-spacing: .2px;
}
.hero-title h1{
  margin: 6px 0 4px;
  font-size: clamp(20px, 2.6vw, 30px);
  color: var(--accent);
}
.hero-sub{
  font-weight: 750;
  color: var(--muted);
}

.hero-body p{
  margin: 0 0 10px;
  line-height: 1.55;
  color: var(--txt);
}

.cliptou-inline{
  float:right;
  width: 240px;
  max-width: 40vw;
  height: auto;
  margin: 4px 0 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.info-box{
  display:grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(14,165,164,.28);
  background: rgba(14,165,164,.08);
}

.hero-actions{ margin-top: 12px; }

/* ===== FORM ===== */
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field label{ display:block; margin-bottom:6px; font-weight:700; }
.field small{ display:block; margin-top:6px; color: var(--muted); line-height:1.25; }

.field input, .field select, .field textarea{
  width:100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--txt);
  outline: none;
}

.field input:focus, .field select:focus, .field textarea:focus{
  border-color: rgba(27,103,210,.45);
  box-shadow: 0 0 0 4px rgba(27,103,210,.12);
}

.field input.disabled, .field textarea.disabled{
  opacity: .6;
}

.field.checkbox{ align-self:end; }
.chk{ display:flex; gap:10px; align-items:center; user-select:none; }
.chk input{ width:18px; height:18px; }

.full{ grid-column: 1 / -1; }

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

.confirm-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 10px; }
.inline{ display:inline; margin:0; }

/* ===== TABLE ===== */
.pagebar{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom: 12px;
}
.page-title{
  margin:0;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--accent);
}
.page-sub{
  margin: 4px 0 0;
  color: var(--muted);
}
.page-actions{ display:flex; gap:10px; flex-wrap:wrap; }

.tablewrap{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--line);
}

table{
  width:100%;
  border-collapse: collapse;
  min-width: 980px; /* scroll horizontal sur mobile */
  background: #fff;
}

th, td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th{
  text-align:left;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.center{ text-align:center; }
.empty{ text-align:center; padding:16px; color: var(--muted); }

/* ===== FOOTER ===== */
.foot{ margin-top: 14px; color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 720px){
  .grid{ grid-template-columns: 1fr; }
  .hero-top{ grid-template-columns: 80px 1fr 80px; }
  .hero-img{ width: 80px; }

  .cliptou-inline{
    float:none;
    display:block;
    width: min(420px, 100%);
    max-width: 100%;
    margin: 10px auto 12px;
  }

  .pagebar{ flex-direction: column; }
}
