:root {
  --bg: #f7f6f2;
  --card: #ffffff;
  --ink: #131a17;
  --muted: #5d6a63;
  --line: #e6e1d6;
  --accent: #0e3b2c;
  --accent-deep: #0a2b20;
  --accent-soft: #e8f1ec;
  --gold: #c19a3f;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 26, 23, .05), 0 8px 24px -12px rgba(19, 26, 23, .18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Barre de navigation ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 28px; background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.12rem; text-decoration: none; color: var(--ink); letter-spacing: -0.01em; }
.brand span { font-weight: 400; color: var(--muted); }
.topbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500; }
.topbar nav a:hover { color: var(--accent); }
.inline { display: inline; margin: 0; }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .92rem; padding: 0; font-weight: 500; }
.linklike:hover { color: var(--ink); text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 36px 20px 72px; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 28px 20px; border-top: 1px solid var(--line); }
.footer a { color: var(--ink); font-weight: 600; }

/* ---------- Typographie ---------- */
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0 0 10px; letter-spacing: -0.025em; line-height: 1.15; font-weight: 800; }
h2 { font-size: 1.35rem; margin: 32px 0 12px; letter-spacing: -0.015em; font-weight: 750; }
h3 { font-size: 1.05rem; margin: 20px 0 8px; font-weight: 700; letter-spacing: -0.01em; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 660px; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.eyebrow::before { content: ""; display: inline-block; width: 22px; height: 2px; background: var(--gold); vertical-align: middle; margin-right: 8px; }

/* ---------- Hero (page d'accueil publique) ---------- */
.hero {
  text-align: center; padding: 72px 24px 56px; margin: 0 -20px 40px;
  background:
    radial-gradient(620px 300px at 50% -60px, rgba(14, 59, 44, .10), transparent 70%),
    linear-gradient(180deg, #fffdf8 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); max-width: 760px; margin: 0 auto 14px; }
.hero .lead { margin: 0 auto 26px; font-size: 1.12rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin: 16px 0; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  padding: 13px 26px; border-radius: 10px; cursor: pointer; text-decoration: none;
  font-size: .96rem; font-weight: 650; letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 6px 16px -8px rgba(14, 59, 44, .55);
}
.btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--card); }
.btn.danger { background: var(--danger); box-shadow: 0 6px 16px -8px rgba(185, 28, 28, .5); }
.btn.small { padding: 8px 14px; font-size: .85rem; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 650; font-size: .9rem; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: .96rem; background: #fff; font-family: inherit; color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 59, 44, .12);
}
textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--muted); font-size: .85rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- Tableaux ---------- */
table { width: 100%; border-collapse: collapse; font-size: .93rem; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; background: #fbfaf7; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 650;
  background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); white-space: nowrap;
}
.badge.nouveau { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.badge.qualifié, .badge.envoyée { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.badge.accepté, .badge.acceptée { background: #dcfce7; border-color: #86efac; color: #166534; }
.badge.client { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; }
.badge.perdu, .badge.refusée, .badge.expirée { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.badge.brouillon, .badge.soumission_envoyée { background: #f3f4f6; color: #374151; }
.badge.placeholder { background: #fff7ed; border-color: #fdba74; color: #9a3412; }

/* ---------- Alertes ---------- */
.alert { padding: 13px 17px; border-radius: 10px; margin: 16px 0; font-size: .93rem; border: 1px solid transparent; }
.alert.ok { background: #dcfce7; color: #166534; border-color: #86efac; }
.alert.warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.alert.error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kcol { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kcol h3 { margin: 0 0 10px; font-size: .9rem; text-transform: capitalize; }
.kcard { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; font-size: .88rem; }
.kcard a { color: var(--ink); font-weight: 650; text-decoration: none; }
.kcard a:hover { color: var(--accent); text-decoration: underline; }
.kcard .meta { color: var(--muted); font-size: .8rem; }

/* ---------- Messagerie ---------- */
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 11px 15px; margin: 8px 0; max-width: 75%; background: #fff; }
.msg.moi { background: var(--accent); color: #fff; margin-left: auto; border-color: var(--accent); }
.msg.lui { background: #fff; }
.msg .quand { font-size: .75rem; opacity: .7; margin-top: 4px; }

.checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
.checks input { margin-top: 5px; }

.itemline { display: grid; grid-template-columns: 1fr 90px 130px 40px; gap: 8px; align-items: end; margin-bottom: 8px; }
.itemline label { margin: 0 0 4px; font-size: .8rem; }

/* ---------- Mobile ---------- */
img { max-width: 100%; height: auto; }
@media (max-width: 640px) {
  .topbar { flex-direction: column; gap: 10px; align-items: stretch; padding: 12px 18px; }
  .topbar nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .topbar nav a, .topbar nav .linklike, .topbar nav .inline { white-space: nowrap; flex-shrink: 0; }
  .container { padding: 28px 16px 56px; }
  .hero { padding: 52px 20px 44px; margin: 0 -16px 32px; }
  .itemline { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  /* Tableaux : défilement horizontal plutôt que débordement */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card { padding: 20px; }
}
