:root {
  --navy: #0B355B;
  --navy-deep: #07233d;
  --blue: #1f4fd8;
  --red: #E1171E;
  --yellow: #FFE600;
  --bg: #eef2f8;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #647085;
  --line: #d6deea;
  --ok: #17803d;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}

/* Barre du haut, dans l'esprit de la carte : bleu profond + vague rouge */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; color: #fff;
  background:
    radial-gradient(120% 220% at 100% 0%, rgba(225,23,30,.55) 0%, rgba(225,23,30,0) 45%),
    linear-gradient(110deg, var(--navy-deep), var(--navy) 55%, var(--blue));
}
.ribbon { height: 4px; background: linear-gradient(90deg, var(--red), var(--blue)); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.logo-badge { background: #fff; border-radius: 10px; padding: 4px 8px; display: grid; place-items: center; }
.logo-badge img { height: 40px; width: auto; display: block; }
.brand-text { display: flex; font-weight: 900; font-style: italic; font-size: 22px; letter-spacing: .5px; }
.brand-ada { background: var(--red); padding: 0 10px; transform: skewX(-8deg); display: inline-block; margin-right: 8px; }
.topnav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.topnav a { color: #fff; text-decoration: none; font-weight: 600; }
.topnav a:hover { text-decoration: underline; }
.who { opacity: .85; }

.container { width: 100%; max-width: 920px; margin: 24px auto; padding: 0 16px; flex: 1; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  box-shadow: 0 1px 2px rgba(11,53,91,.08), 0 8px 24px rgba(11,53,91,.06);
  border-top: 4px solid var(--navy);
}
.card.narrow { max-width: 460px; margin: 0 auto; }
.center { text-align: center; }
h1 { margin: 0 0 14px; color: var(--navy); font-size: 26px; }
h2 { margin: 0 0 6px; color: var(--navy); font-size: 19px; }
.muted, .hint { color: var(--muted); font-size: 14px; }
.hint { margin: 4px 0 0; }

form { margin: 0; }
label { display: block; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
input, select {
  width: 100%; margin-top: 5px; padding: 11px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, .btn:focus-visible { outline: 3px solid rgba(31,79,216,.35); border-color: var(--blue); }
input[type=checkbox] { width: auto; margin: 4px 10px 0 0; }
input[type=file] { padding: 9px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 4px; margin: 0 0 18px; }
legend { padding: 0 8px; font-weight: 700; color: var(--navy); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; font-weight: 400; }

.btn {
  display: inline-block; padding: 11px 20px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--navy); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.5); padding: 7px 12px; font-size: 14px; }
.card .btn-ghost { color: var(--navy); border-color: var(--line); }
.links { margin: 16px 0 0; font-size: 14px; }
.links a { color: var(--blue); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.alert-error { background: #fdecec; color: #9b1116; border: 1px solid #f3b6b8; }
.alert-success { background: #e8f6ed; color: var(--ok); border: 1px solid #b6e0c5; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { flex: 1 1 200px; padding: 16px; border-radius: 10px; background: var(--bg); text-decoration: none; color: var(--navy); }
.stat strong { display: block; font-size: 34px; line-height: 1.1; }
.stat-alert { background: #fff6cc; border-left: 5px solid var(--yellow); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: var(--bg); color: var(--navy); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a.active { background: var(--navy); color: #fff; }

.account { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.account header { margin-bottom: 8px; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 0 0 12px; }
.details div { min-width: 0; }
.details dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { margin: 0; width: 220px; }
.plain-list { padding-left: 20px; }

.footer { text-align: center; padding: 18px 12px 26px; color: var(--muted); font-size: 13px; }
.tag-247 { background: var(--yellow); color: #222; font-weight: 800; border-radius: 4px; padding: 1px 8px; margin-right: 8px; }

@media (max-width: 640px) {
  .grid2, .details { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { width: 100%; }
  .brand-text { font-size: 18px; }
}

/* ---- Étape 2 : véhicules, réservations, planning ---- */
.container:has(.wide) { max-width: 1200px; }
.card + .card { margin-top: 16px; }
h3 { margin: 12px 0 4px; color: var(--navy); font-size: 16px; }
details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details > summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.add-box { border: 0; padding: 0; margin: 0; }
.add-box > summary { display: inline-block; list-style: none; }
.add-box > form { margin-top: 14px; }
.vehicle-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.vehicle-off { opacity: .75; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--navy); vertical-align: middle; }
.badge-ok, .badge-confirmed { background: #e8f6ed; color: var(--ok); }
.badge-off, .badge-refused, .badge-cancelled { background: #fdecec; color: #9b1116; }
.badge-requested { background: #fff6cc; color: #7a6200; }
.badge-counter_proposed { background: #e6efff; color: var(--blue); }
.count { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.btn-small { padding: 4px 10px; font-size: 13px; }
.slot { display: grid; grid-template-columns: 110px 1fr 110px; gap: 8px; align-items: center; margin-bottom: 12px; }
.slot-label { font-weight: 600; font-size: 14px; }
.slot input, .slot select { margin: 0; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 400; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--navy); background: #f1f6fc; }
.choice input { width: auto; margin: 4px 0 0; }
.inline-form { display: inline-flex; margin-left: 8px; }

.planning-scroll { overflow-x: auto; }
.planning { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: fixed; }
.planning th, .planning td { border: 1px solid var(--line); padding: 6px; vertical-align: top; font-size: 13px; text-align: left; }
.planning thead th { background: var(--navy); color: #fff; text-align: center; }
.planning thead th:first-child { width: 150px; }
.planning th[scope=row] { background: #f5f8fc; color: var(--navy); }
.planning .today { background: #fffbe0; }
.planning thead th.today { background: var(--red); }
.chip { display: block; margin-bottom: 4px; padding: 3px 6px; border-radius: 6px; font-size: 12px; line-height: 1.3; text-decoration: none; color: inherit; }
.chip-confirmed { background: #d9f0e1; color: #11592a; }
.chip-requested { background: #fff1b8; color: #6b5500; }
.chip-counter_proposed { background: #dbe7ff; color: #1a3f9e; }
.chip-blocked { background: #e3e6ea; color: #444; }
a.chip:hover { outline: 2px solid var(--navy); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.legend .chip { display: inline-block; margin: 0; }
.week-nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

@media (max-width: 640px) {
  .slot { grid-template-columns: 1fr 110px; }
  .slot-label { grid-column: 1 / -1; }
}

/* Tableaux de listes (recherche, récapitulatifs, statistiques) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
.table th, .table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
progress { width: 100%; min-width: 120px; height: 14px; }
