/* Charte Scènes & Cinés (www.scenesetcines.fr) : bandeau bleu nuit, logo blanc,
   vert Théâtres #42b58c, or Concerts #d6a546, bleu Cinémas #0098ca ; Oswald (titres) et Open Sans (texte). */
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(fonts/open-sans.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: 300 800; font-display: swap; src: url(fonts/open-sans-italic.woff2) format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 200 700; font-display: swap; src: url(fonts/oswald.woff2) format("woff2"); }

:root {
  --sc-nuit: #07151b; --sc-vert: #42b58c; --sc-or: #d6a546; --sc-bleu: #0098ca;
  --bg: #f4f6f7; --card: #fff; --ink: #14191c; --muted: #5f6b72; --line: #dde3e6;
  /* bleu Cinémas assombri pour garder un contraste suffisant avec du texte blanc */
  --brand: #007ba5; --brand-d: #005d7d; --ok: #23805d; --warn: #96680f; --err: #b42318;
  --radius: 10px;
  --title: "Oswald", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
html.t-petite { font-size: 14.5px; } html.t-grande { font-size: 18px; }
body { margin: 0; font: .9375rem/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); }
.wrap { margin: 0 auto; padding: 0 clamp(14px, 2.2vw, 36px); }
.w-centree .wrap { max-width: 1180px; padding: 0 18px; }
.narrow { max-width: 560px; margin: 40px auto; }
main.wrap { padding-top: 22px; padding-bottom: 40px; }
h1, h2 { font-family: var(--title); font-weight: 500; letter-spacing: .01em; }
h1 { font-size: 1.75rem; margin: 0 0 16px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.muted, .hint { color: var(--muted); font-size: .9rem; }
.hint { background: #eef7fa; border-left: 3px solid var(--brand); padding: 8px 12px; border-radius: 4px; margin: 6px 0; }

.top { background: linear-gradient(120deg, #0d2536 0%, #12324a 55%, #17445f 100%); color: #fff; position: relative; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #0098ca, #42b58c); }
/* Charte Scènes & Cinés (thème de son espace) */
.theme-scenesetcines .top { background: var(--sc-nuit) url(brand/bandeau.jpg) center / cover; }
.theme-scenesetcines .top::after { background: linear-gradient(90deg, var(--sc-vert) 0 33.33%, var(--sc-or) 33.33% 66.66%, var(--sc-bleu) 66.66%); }
.brand-nom { font-family: var(--title); font-weight: 500; font-size: 1.25rem; letter-spacing: .02em; white-space: nowrap; }
.brand img { max-width: 180px; object-fit: contain; }
.top .bar { display: flex; align-items: center; gap: 22px; min-height: 64px; padding-bottom: 4px; flex-wrap: wrap; }
.top a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--title); font-weight: 500; font-size: 1.15rem; letter-spacing: .02em; }
.brand img { height: 44px; width: auto; display: block; }
.brand span { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.35); }
.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; font-weight: 600; }
.top nav a { padding: 6px 11px; border-radius: 6px; opacity: .9; white-space: nowrap; }
.top nav a:hover, .top nav a.on { background: rgba(255,255,255,.14); opacity: 1; }
.top nav a.on { box-shadow: inset 0 -2px 0 var(--sc-bleu); }
@media (max-width: 640px) { .brand span { display: none; } }
.top .user { font-size: .85rem; opacity: .9; white-space: nowrap; }
.foot { color: var(--muted); font-size: .8rem; padding-bottom: 30px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child { margin-top: 0; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.grow { flex: 1; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 7px; padding: 9px 16px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-d); }
.btn.secondary { background: #e3f2f8; color: var(--brand); }
.btn.secondary:hover { background: #cde8f3; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.ghost:hover { background: #eef6f9; }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--err); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.hidden { display: none !important; }

.flash { padding: 10px 14px; border-radius: 7px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #e8f6ee; border-color: #b6e2c8; color: #14532d; }
.flash.warn { background: #fff4e0; border-color: #f2d49b; color: #7a4a00; }
.flash.err { background: #fdecea; border-color: #f4b7b1; color: #8a1c13; }

.form label { display: block; font-size: .88rem; font-weight: 600; color: #344054; }
.form label.check { font-weight: 500; display: flex; align-items: center; gap: 8px; padding-top: 22px; }
.form label.check input { width: auto; margin: 0; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #c8d0db; border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid #8fcbe2; border-color: var(--brand); }
.form > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid2 > * { margin-top: 0 !important; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8fafc; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table.rows td { padding: 6px 6px; }
table.rows input, table.rows select { margin-top: 0 !important; }
.w60 { width: 64px !important; } .w70 { width: 76px !important; }
.total { font-weight: 700; }
.total.good { color: var(--ok); } .total.bad { color: var(--err); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #e3f2f8; color: var(--brand); white-space: nowrap; }
.badge.ok { background: #e1f4ea; color: var(--ok); }
.badge.warn { background: #fff0d6; color: var(--warn); }
.badge.err { background: #fde3e0; color: var(--err); }
.badge.grey { background: #eceff3; color: #555; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 15px; text-decoration: none; color: var(--muted); border-radius: 7px 7px 0 0; font-weight: 600; }
.tabs a.on { color: var(--brand); background: var(--card); border: 1px solid var(--line); border-bottom: 2px solid var(--card); margin-bottom: -2px; }

.kv { display: grid; grid-template-columns: 220px 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } }

.regime { border: 1px solid #b3dcec; background: #eef8fc; border-radius: 8px; padding: 12px 14px; }
.regime[data-regime=dispense] { background: #eef8f1; border-color: #b6e2c8; }
.regime[data-regime=formalisee] { background: #fff4e0; border-color: #f2d49b; }
.regime ul { margin: 6px 0 4px 18px; padding: 0; }
.regime small { color: var(--muted); }

/* Formulaire guidé */
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; counter-reset: s; }
.steps li { counter-increment: s; background: #e9edf3; color: #5b6676; padding: 6px 12px; border-radius: 99px; font-size: .85rem; cursor: pointer; }
.steps li::before { content: counter(s) ". "; font-weight: 700; }
.steps li.current { background: var(--brand); color: #fff; }
.steps li.done { background: #cde8f3; color: var(--brand-d); }
body.js .wizard .step { display: none; }
body.js .wizard .step.active { display: block; }
.wizard-nav { display: flex; gap: 10px; align-items: center; margin: 4px 0 30px; }
body:not(.js) .wizard .steps, body:not(.js) #btn-prev, body:not(.js) #btn-next { display: none; }
body:not(.js) #btn-save { display: inline-block; }
dl.recap { display: grid; grid-template-columns: 260px 1fr; gap: 6px 16px; margin: 0; }
dl.recap dt { color: var(--muted); font-size: .88rem; }
dl.recap dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 640px) { dl.recap { grid-template-columns: 1fr; } }

pre.code { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; font-size: .85rem; }
.rank1 { background: #f0faf4; }
.excluded { color: #8a8f98; text-decoration: line-through; }
.excluded td:last-child, .excluded td.keep { text-decoration: none; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.doc-item { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.doc-item h3 { margin: 0; }
.doc-item p { margin: 0; color: var(--muted); font-size: .88rem; flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

@media print {
  .top, .foot, .tabs, .actions, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}

/* Utilisateurs et choix du mot de passe */
input.copy { width: 100%; padding: 8px 10px; border: 1px solid #c8d0db; border-radius: 7px; font: .85rem ui-monospace, Menlo, monospace; background: #f7f9fc; }
form.inline select { margin: 0; padding: 4px 6px; border: 1px solid #c8d0db; border-radius: 6px; font: inherit; background: #fff; }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; font-size: .86rem; color: var(--muted); display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "✓ "; }
.pw-match { min-height: 1.3em; margin: 4px 0 0; }
.pw-match.ok { color: var(--ok); }
@media (max-width: 520px) { .pw-rules { grid-template-columns: 1fr; } }
.form textarea.mono { font: .85rem/1.5 ui-monospace, Menlo, Consolas, monospace; }

/* Contrôle de conformité */
.stat.conf-err b { color: var(--err); } .stat.conf-warn b { color: var(--warn); } .stat.conf-ok b { color: var(--ok); }
.conf-list { list-style: none; margin: 0 0 8px; padding: 0; }
.conf-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.conf-item:last-child { border-bottom: 0; }
.conf-item > .badge { flex: 0 0 auto; min-width: 104px; text-align: center; margin-top: 2px; }
.conf-body { flex: 1; min-width: 0; }
.conf-body .muted { margin-top: 2px; }
.conf-ref { font-size: .8rem; color: var(--muted); margin-top: 3px; font-style: italic; }
.conf-item form.inline { flex: 0 0 auto; }
.conf-comment { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--sc-or); background: #fbf7ec; border-radius: 4px; }
.conf-link { text-decoration: none; font-family: "Open Sans", sans-serif; font-size: 1rem; vertical-align: middle; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) { .conf-item { flex-wrap: wrap; } .conf-item > .badge { min-width: 0; } }

/* Création : point de départ et assistant guidé */
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 18px; }
.start-card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.start-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.start-card.reco { border: 2px solid var(--sc-vert); }
.start-card strong { font-family: var(--title); font-weight: 500; font-size: 1.2rem; }
.start-card span { color: var(--muted); font-size: .92rem; }
.start-card .badge { align-self: flex-start; }
.start-ico { font-size: 1.8rem; }
body.js .assistant .q-step { display: none; }
body.js .assistant .q-step.active { display: block; }
.q-titre { font-size: 1.45rem !important; margin-bottom: 6px !important; }
.q-aide { color: var(--muted); margin: 0 0 14px; }
.choix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.choix { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: #fff; font-weight: 600; font-size: .95rem; }
.choix:hover { border-color: var(--brand); }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix:has(input:checked) { border: 2px solid var(--brand); background: #eef7fa; }
.choix:has(input:focus-visible) { outline: 2px solid #8fcbe2; }
.choix-ico { font-size: 1.5rem; }
.fs { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 12px 0 0; }
.fs legend { font-weight: 600; font-size: .9rem; padding: 0 6px; color: #344054; }
.fs label.check { padding-top: 6px; font-weight: 400; }
.redac { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle; }
.redac .btn { font-weight: 500; }

/* Fenêtres de correction */
.conf-item > .btn { flex: 0 0 auto; }
dialog.conf-dlg { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
dialog.conf-dlg::backdrop { background: rgba(7, 21, 27, .55); }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-head h2 { margin: 0; flex: 1; font-size: 1.2rem; }
.dlg-head .badge { margin-top: 4px; }
.dlg-x { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.dlg-body { padding: 16px 20px 20px; }
.dlg-pourquoi { background: #f6f8f9; border-left: 3px solid var(--sc-or); padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; font-size: .92rem; }
.dlg-auto { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #e8f6ee; border-radius: 8px; margin-bottom: 12px; }
.dlg-help { display: block; color: var(--muted); margin-top: 3px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dlg-total { margin: 8px 0 0; } .dlg-total strong.bad { color: var(--err); }
.sugg-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.sugg { text-align: left; border: 1px dashed #b3dcec; background: #f4fafc; border-radius: 6px; padding: 5px 9px; font: inherit; font-size: .85rem; color: var(--brand-d); cursor: pointer; }
.sugg:hover { background: #e3f2f8; } .sugg.used { opacity: .5; }
.conf-dlg table.rows input, .conf-dlg table.rows select { width: 100%; padding: 6px 8px; border: 1px solid #c8d0db; border-radius: 6px; font: inherit; }

/* Guide juridique */
.titre-lien { color: inherit; text-decoration: none; }
.guide-search input[type=search] { width: min(420px, 70vw); padding: 8px 10px; border: 1px solid #c8d0db; border-radius: 7px; font: inherit; }
.themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; }
.themes-grid h3 { font-family: var(--title); font-weight: 500; font-size: 1.05rem; color: var(--brand-d); margin: 14px 0 6px; }
.fiche-liste { list-style: none; margin: 0; padding: 0; }
.fiche-liste li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.fiche-liste li:last-child { border-bottom: 0; }
.fiche { max-width: 900px; }
.fiche-titre { font-size: 1.6rem !important; }
.fiche-resume { font-size: 1.05rem; color: var(--brand-d); border-left: 4px solid var(--sc-vert); padding: 6px 12px; background: #f3faf6; border-radius: 4px; }
.fiche h3 { font-family: var(--title); font-weight: 500; font-size: 1.1rem; margin-top: 20px; }
.fiche ol, .fiche ul { padding-left: 20px; } .fiche li { margin: 4px 0; }
.refs { columns: 2; } @media (max-width: 640px) { .refs { columns: 1; } }
.voir { list-style: none; padding-left: 0 !important; }
.decision { max-width: 820px; }
.decision-q { font-size: 1.2rem; font-weight: 600; margin: 14px 0; }
.decision-choix { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.decision-choix .btn { text-align: left; padding: 12px 16px; font-size: 1rem; }
.decision-res { border-radius: 8px; padding: 14px 16px; border: 1px solid var(--line); }
.decision-res.res-ok { background: #f0faf4; border-color: #b6e2c8; }
.decision-res.res-warn { background: #fff8eb; border-color: #f2d49b; }
.decision-res.res-err { background: #fdf0ee; border-color: #f4b7b1; }
.decision-res h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.guide-lien { font-size: .82rem; white-space: nowrap; }

/* Publication */
.pub-etape { display: flex; gap: 16px; align-items: flex-start; }
.pub-etape > div { flex: 1; min-width: 0; }
.pub-num { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: var(--title); font-size: 1.1rem; }
.pub-champs { display: grid; grid-template-columns: 260px 1fr; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pub-champs dt { padding: 9px 12px; background: #f6f8f9; font-weight: 600; font-size: .88rem; border-bottom: 1px solid var(--line); }
.pub-champs dd { margin: 0; padding: 9px 12px; display: flex; gap: 10px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.pub-val { flex: 1; white-space: normal; }
.btn.copied { background: #e1f4ea; color: var(--ok); }
@media (max-width: 700px) { .pub-champs { grid-template-columns: 1fr; } .pub-champs dt { border-bottom: 0; } }

/* Suivi d'exécution */
.exec-titulaire { margin: 6px 0 12px; }
.jauge { height: 6px; background: #e6eaed; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.jauge.petite { display: inline-block; width: 70px; vertical-align: middle; margin: 0 6px 0 0; }
.jauge i { display: block; height: 100%; background: var(--sc-vert); }
.jauge i.mid { background: var(--sc-or); } .jauge i.bad { background: var(--err); }
.exec-alertes { list-style: none; padding: 0; margin: 0 0 12px; }
.exec-alertes li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.exec-ligne { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.exec-ligne:last-child { border-bottom: 0; }
.exec-ajout { margin-top: 12px; }
.exec-ajout summary { list-style: none; display: inline-block; }
.exec-ajout summary::-webkit-details-marker { display: none; }
.exec-ajout[open] summary { margin-bottom: 12px; }
.mini-date { padding: 3px 6px; border: 1px solid #c8d0db; border-radius: 6px; font: inherit; font-size: .85rem; }
.exec h3 { margin-top: 18px; }
.etapes-import { padding-left: 20px; } .etapes-import li { margin: 8px 0; }
details.card > summary { cursor: pointer; }
.login-oubli { margin: 12px 0 0; font-size: .92rem; }

/* Tableau de bord : niveau d'attention des marchés en cours */
.attention { --att-err: var(--err); --att-warn: #d68a00; --att-ok: var(--ok); }
.att-filtres { display: flex; flex-wrap: wrap; gap: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.att-chip b { font-weight: 700; }
.att-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.att-chip.att-err i { background: var(--att-err); } .att-chip.att-warn i { background: var(--att-warn); } .att-chip.att-ok i { background: var(--att-ok); }
.att-chip.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #eef7fa; }
.att-chip:disabled { opacity: .45; cursor: default; }
.att-barre { display: flex; height: 8px; border-radius: 99px; overflow: hidden; margin: 14px 0 16px; gap: 2px; }
.att-barre .att-err { background: var(--att-err); } .att-barre .att-warn { background: var(--att-warn); } .att-barre .att-ok { background: var(--att-ok); }
.att-phases { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.att-phase { background: #f6f8f9; border-radius: 8px; padding: 8px; min-width: 0; }
.att-phase h3 { margin: 0 0 6px; font-family: var(--title); font-weight: 500; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.att-vide { margin: 0; text-align: center; }
/* Une ligne par marché ; le détail apparaît dans une bulle au survol (ou au focus clavier) */
.att-tuile { position: relative; display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 5px; padding: 3px 7px; margin-bottom: 4px; color: var(--ink); text-decoration: none; font-size: .82rem; line-height: 1.35; }
.att-tuile:hover, .att-tuile:focus-visible { border-color: var(--brand); z-index: 5; }
.att-tuile.att-err { border-left-color: var(--att-err); background: #fff6f5; }
.att-tuile.att-warn { border-left-color: var(--att-warn); background: #fffaf0; }
.att-tuile.att-ok { border-left-color: var(--att-ok); }
.att-point { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.att-err .att-point { background: var(--att-err); } .att-warn .att-point { background: var(--att-warn); } .att-ok .att-point { background: var(--att-ok); }
.att-tuile strong { flex: 0 0 auto; white-space: nowrap; }
.att-objet { flex: 1 1 auto; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-bulle { position: absolute; top: calc(100% + 6px); left: 0; width: 290px; max-width: 80vw; background: var(--sc-nuit); color: #fff; border-radius: 7px; padding: 9px 11px; font-size: .8rem; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.25); opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; white-space: normal; }
.att-bulle::before { content: ""; position: absolute; top: -5px; left: 14px; border: 5px solid transparent; border-top: 0; border-bottom-color: var(--sc-nuit); }
.att-tuile:hover .att-bulle, .att-tuile:focus-visible .att-bulle { opacity: 1; visibility: visible; transition-delay: .15s; }
.att-phase:nth-child(n+4) .att-bulle { left: auto; right: 0; } .att-phase:nth-child(n+4) .att-bulle::before { left: auto; right: 14px; }
.att-bulle b { display: block; margin: 3px 0 2px; font-weight: 600; }
.att-pastille { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.att-err .att-pastille { color: #ff9b91; } .att-warn .att-pastille { color: #f5c46a; } .att-ok .att-pastille { color: #7fd9b4; }
.att-bulle ul { list-style: none; margin: 4px 0 0; padding: 0; }
.att-bulle li { position: relative; padding-left: 12px; margin-top: 3px; }
.att-bulle li::before { content: ""; position: absolute; left: 0; top: .45em; width: 6px; height: 6px; border-radius: 50%; background: #9fb0b8; }
.att-bulle li.m-err::before { background: #ff6b5e; } .att-bulle li.m-warn::before { background: #f5b335; }
.att-tuile[hidden] { display: none; }
@media (max-width: 980px) { .att-phases { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
@media print { .att-filtres { display: none; } }

/* Agent en charge */
.agent-ligne { font-size: .88rem; margin-top: 4px; color: var(--muted); }
.agent-ligne strong { color: var(--ink); }
.agent-changer { display: inline; }
.agent-changer summary { display: inline; cursor: pointer; color: var(--brand); text-decoration: underline; margin-left: 4px; }
.agent-changer[open] form { margin-top: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.agent-changer label { min-width: 240px; }
.att-chip.att-moi input { margin: 0; width: auto; }
.att-agent { display: block; color: #c9d6dc; font-size: .76rem; margin-bottom: 2px; }
.nowrap { white-space: nowrap; }

/* Menu engrenage : options de présentation */
.top .bar { position: relative; }
.prefs { position: relative; }
.prefs summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; opacity: .9; }
.prefs summary::-webkit-details-marker { display: none; }
.prefs summary:hover, .prefs[open] summary { background: rgba(255,255,255,.16); opacity: 1; }
.prefs[open] summary svg { transform: rotate(45deg); }
.prefs summary svg { transition: transform .2s; }
.prefs-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 300px; max-width: calc(100vw - 24px); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px; font-size: .88rem; }
.prefs-titre { display: block; font-family: var(--title); font-weight: 500; font-size: 1.05rem; margin-bottom: 6px; }
.prefs-menu fieldset { border: 0; padding: 0; margin: 0 0 10px; }
.prefs-menu legend { font-weight: 600; color: #344054; margin-bottom: 4px; padding: 0; }
.prefs-choix { display: flex; background: #eef2f4; border-radius: 7px; padding: 2px; gap: 2px; }
.prefs-choix label { flex: 1; cursor: pointer; }
.prefs-choix input { position: absolute; opacity: 0; pointer-events: none; }
.prefs-choix span { display: block; text-align: center; padding: 5px 6px; border-radius: 5px; line-height: 1.25; }
.prefs-choix input:checked + span { background: var(--card); color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.prefs-choix input:focus-visible + span { outline: 2px solid var(--brand); }
.prefs-note { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }

/* Menu toujours visible */
.menu-fixe .top { position: sticky; top: 0; z-index: 40; }

/* Densité compacte */
.d-compacte .card { padding: 13px 15px; margin-bottom: 12px; }
.d-compacte th, .d-compacte td { padding: 5px 8px; }
.d-compacte main.wrap { padding-top: 14px; }
.d-compacte h1 { margin-bottom: 10px; font-size: 1.55rem; }
.d-compacte .stats { gap: 10px; margin-bottom: 12px; }
.d-compacte .stat { padding: 9px 12px; }
.d-compacte .stat b { font-size: 1.45rem; }
.d-compacte .grid2 { gap: 12px; }
.d-compacte .top .bar { min-height: 54px; }
.d-compacte .brand img { height: 36px; }
@media print { .prefs { display: none; } }
@media (max-width: 640px) {
  .prefs { position: static; }
  .prefs-menu { left: 12px; right: 12px; width: auto; max-width: none; top: calc(100% - 2px); }
}

/* Messages : icône du menu, onglet Échanges, page Messages */
.msg-icone { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; opacity: .9; }
.msg-icone:hover, .msg-icone.on { background: rgba(255,255,255,.16); opacity: 1; }
.msg-icone b { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sc-or); color: var(--sc-nuit); font-size: .7rem; line-height: 18px; text-align: center; }
.pastille-nl { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--sc-or); color: var(--sc-nuit); font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; }
.att-tuile .pastille-nl { flex: 0 0 auto; }
.fil { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fbfcfc; max-width: 900px; }
.msg.mien { background: #eef7fa; border-color: #cde4ee; margin-left: auto; }
.msg.nouveau { border-left: 4px solid var(--sc-or); }
.msg header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.msg time { color: var(--muted); font-size: .8rem; }
.msg-avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .78rem; font-weight: 700; }
.msg.mien .msg-avatar { background: var(--sc-vert); }
.msg-suppr { margin-left: auto; }
button.lien { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; text-decoration: underline; }
button.lien:hover { color: var(--err); }
.msg-texte { overflow-wrap: anywhere; }
.msg-dest { margin-top: 6px; color: var(--muted); font-size: .78rem; }
.msg-form { border-top: 1px solid var(--line); padding-top: 14px; }
.msg-prevenir { border: 0; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.msg-prevenir legend { font-weight: 600; font-size: .88rem; color: #344054; margin-bottom: 4px; padding: 0; }
.msg-prevenir label.check { padding-top: 0; font-weight: 500; }
.fils { display: flex; flex-direction: column; }
.fil-ligne { display: block; padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.fil-ligne:hover { background: #f6f9fa; }
.fil-ligne.non-lu { background: #fffaf0; }
.fil-tete { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fil-objet { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil-date { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.fil-extrait { display: block; margin-top: 2px; font-size: .9rem; }
.non-lu .fil-extrait { font-weight: 600; }
.fil-meta { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* ---------- En-tête sur téléphone : menu repliable ---------- */
.menu-mobile { display: none; }
@media (max-width: 760px) {
  .top .bar { gap: 8px; min-height: 56px; flex-wrap: nowrap; }
  .brand img { height: 34px; }
  .menu-mobile { display: grid; gap: 4px; align-content: center; width: 40px; height: 40px; padding: 0 9px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; order: -1; }
  .menu-mobile span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .menu-mobile[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-mobile[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-mobile[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .top nav { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 45; flex-direction: column; background: var(--sc-nuit); padding: 8px 12px 14px; box-shadow: 0 10px 24px rgba(0,0,0,.3); }
  .top nav.ouvert { display: flex; }
  .top nav a { padding: 12px 12px; font-size: 1.05rem; }
  .top .user { margin-left: auto; font-size: .8rem; }
  .user-nom { display: none; }
  .brand span { display: none; }
}

/* ---------- Véhicules ---------- */
.titre-section { margin: 22px 0 12px; }
.immat { display: inline-block; font-family: "Arial Narrow", Arial, sans-serif; font-weight: 700; letter-spacing: .04em; background: #fff; color: #111; border: 1.5px solid #222;
  border-left: 7px solid #0055a4; border-right: 7px solid #0055a4; border-radius: 4px; padding: 0 6px; font-size: .9em; line-height: 1.5; white-space: nowrap; }
.immat-grand { font-size: 1.25rem; padding: 2px 10px; }
.btn-grand { padding: 14px 22px; font-size: 1.05rem; font-weight: 600; text-align: center; }
.parc-encours { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border-left: 5px solid var(--sc-or); }
.liste-resa { display: flex; flex-direction: column; }
.resa-ligne { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.resa-ligne:last-child { border-bottom: 0; }
.resa-info { flex: 1; min-width: 200px; color: var(--ink); text-decoration: none; }
.resa-info .badge { margin-left: 4px; }
.aide-agenda { margin-top: 10px; }
.aide-agenda summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.vehicules-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 18px; }
.vehicule-carte { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: 10px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
a.vehicule-carte:hover { box-shadow: 0 3px 12px rgba(0,0,0,.08); border-color: var(--brand); }
.vehicule-carte.v-warn { border-left-color: #d68a00; } .vehicule-carte.v-err { border-left-color: var(--err); }
.vehicule-carte.v-inactif { opacity: .75; }
.vehicule-carte.choix .btn { margin-top: 8px; }
.vc-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vc-alerte { font-size: .82rem; padding-left: 12px; position: relative; }
.vc-alerte::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.vc-alerte.m-err::before { background: var(--err); } .vc-alerte.m-warn::before { background: #d68a00; }
.vignettes { display: flex; flex-wrap: wrap; gap: 12px; }
.vignettes > div { display: flex; flex-direction: column; gap: 3px; width: 130px; font-size: .8rem; }
.vignette { display: grid; place-items: center; width: 130px; height: 100px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f4f6f7; text-decoration: none; color: var(--ink); }
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.vignette.doc { text-align: center; padding: 6px; } .vignette.doc span { font-weight: 700; color: var(--err); font-size: 1.1rem; display: block; } .vignette.doc small { font-size: .72rem; color: var(--muted); }
.vignettes.petites { margin-top: 6px; } .vignettes.petites .vignette { width: 56px; height: 44px; }
tr.ligne-alerte td { background: #fff8ec; }
.zone-danger summary { cursor: pointer; color: var(--err); font-weight: 600; }

/* Réservation et carnet de bord (téléphone d'abord) */
.resa-form, .trajet-form { max-width: 620px; }
.creneau { border: 0; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.creneau legend { font-weight: 600; font-size: .88rem; color: #344054; margin-bottom: 4px; padding: 0; }
.creneau input { width: 100%; padding: 10px; border: 1px solid #c8d0db; border-radius: 7px; font: inherit; background: #fff; color: var(--ink); min-height: 44px; }
.resa-detail .resa-quand { font-size: 1.15rem; font-weight: 600; margin: 4px 0 14px; }
.resa-actions { margin-top: 14px; }
.trajet-entete { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.champ-grand { font-size: 1.4rem !important; font-weight: 700; letter-spacing: .04em; text-align: center; min-height: 54px; }
.km-parcourus { text-align: center; margin: -4px 0 8px; min-height: 1.2em; }
.trajet-form fieldset { border: 0; padding: 0; margin: 4px 0 10px; }
.trajet-form legend { font-weight: 600; font-size: .88rem; color: #344054; margin-bottom: 6px; padding: 0; }
.choix-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.choix-boutons label { flex: 1 1 auto; }
.choix-boutons input { position: absolute; opacity: 0; pointer-events: none; }
.choix-boutons span { display: block; text-align: center; padding: 11px 10px; border: 1px solid #c8d0db; border-radius: 8px; font-weight: 600; cursor: pointer; background: #fff; }
.choix-boutons input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.choix-boutons input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.photo-bouton { display: block; border: 2px dashed #b9c6cd; border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; background: #f8fafb; font-weight: 600 !important; }
.photo-bouton input { display: block; margin: 8px auto 0; font-size: .85rem; }
.apercu-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.apercu-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.trajet-form details { margin: 6px 0 12px; } .trajet-form details summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-bottom: 8px; }

/* Planning */
.legende-planning { font-size: .85rem; color: var(--muted); }
.planning { min-width: 860px; table-layout: fixed; }
.planning th:first-child { width: 170px; }
.planning td { height: 58px; position: relative; padding: 4px; vertical-align: top; }
.planning td.aujourdhui, .planning th.aujourdhui { background: #f2f9fc; }
.planning td.passe { background: #fafafa; }
.pl-resa { display: block; font-size: .74rem; line-height: 1.3; background: #e3e9ec; color: var(--ink); border-radius: 4px; padding: 2px 5px; margin-bottom: 3px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-resa.pl-moi { background: var(--brand); color: #fff; }
.pl-resa.pl-attente { background: #fff0d6; color: var(--warn); border: 1px dashed #d68a00; }
.legende-planning .pl-resa { display: inline-block; margin-right: 6px; }
.pl-ajout { position: absolute; right: 4px; bottom: 3px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--brand); text-decoration: none; font-weight: 700; opacity: 0; }
.planning td:hover .pl-ajout, .pl-ajout:focus { opacity: 1; background: #e3f2f8; }
.planning-liste { display: none; }
.pl-ligne { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.pl-ligne .pl-resa { flex: 0 0 auto; }
@media (max-width: 760px) {
  .planning-grille { display: none; }
  .planning-liste { display: block; }
  .planning-liste .card { padding: 12px 14px; margin-bottom: 10px; }
  .planning-liste .card.aujourdhui { border-left: 4px solid var(--brand); }
  .planning-liste h3 { margin: 0 0 6px; }
}

/* Comparatif achat / LOA / LLD */
.cmp-colonnes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .cmp-colonnes { grid-template-columns: 1fr; } }
.cmp-col { border-top: 4px solid var(--line); }
.cmp-col.c-achat { border-top-color: var(--sc-vert); } .cmp-col.c-loa { border-top-color: var(--sc-or); } .cmp-col.c-lld { border-top-color: var(--sc-bleu); }
.cmp-col label { margin-bottom: 8px; }
.cmp-resultats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 700px) { .cmp-resultats { grid-template-columns: 1fr; } }
.cmp-res { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; border-left: 5px solid var(--line); }
.cmp-res.c-achat { border-left-color: var(--sc-vert); } .cmp-res.c-loa { border-left-color: var(--sc-or); } .cmp-res.c-lld { border-left-color: var(--sc-bleu); }
.cmp-res.meilleur { background: #f0faf5; }
.cmp-res b { font-size: 1.5rem; font-family: var(--title); font-weight: 500; }
.cmp-nom { font-weight: 600; }
.cmp-graphe { width: 100%; height: auto; max-height: 300px; margin: 6px 0 12px; font-size: 11px; }
.cmp-graphe text { fill: var(--muted); }
.cmp-graphe .grille { stroke: var(--line); stroke-width: 1; }
.cmp-graphe .serie { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.cmp-graphe .s-achat { stroke: var(--sc-vert); fill: var(--sc-vert); } .cmp-graphe polyline.s-achat { fill: none; }
.cmp-graphe .s-loa { stroke: var(--sc-or); fill: var(--sc-or); } .cmp-graphe polyline.s-loa { fill: none; }
.cmp-graphe .s-lld { stroke: var(--sc-bleu); fill: var(--sc-bleu); } .cmp-graphe polyline.s-lld { fill: none; }
.cmp-detail tr.total td { border-top: 2px solid var(--ink); }
.cmp-form .hint ul { margin: 6px 0; padding-left: 20px; }

/* Cibles tactiles confortables sur téléphone */
@media (max-width: 760px) {
  .form input, .form select, .form textarea { min-height: 44px; font-size: 16px; }   /* 16 px : évite le zoom automatique d'iOS */
  .btn { min-height: 44px; }
  .btn.small { min-height: 36px; }
  .resa-ligne .btn { flex: 1 1 100%; text-align: center; }
  .parc-encours .btn { width: 100%; }
  h1 { font-size: 1.45rem; }
}
.vehicule-carte { text-align: left; align-items: stretch; }
.vehicule-carte.choix .btn { width: 100%; }
.planning tbody th { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--ink); background: var(--card); }

/* ---------- Tableau de bord : deux colonnes et grands boutons ---------- */
.accueil-entete h1 { margin-bottom: 2px; }
.accueil-entete p { margin: 0 0 16px; }
.accueil { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .accueil { grid-template-columns: 1fr; } }
.accueil-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.accueil-droite { display: flex; flex-direction: column; gap: 18px; }

.panneau { --c: var(--brand); --c-fond: #eaf5fa; --c-fonce: var(--brand-d);
  position: relative; border-radius: 18px; padding: 18px; margin-bottom: 18px; border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--c-fond) 0, var(--card) 260px); overflow: hidden; }
.accueil-droite .panneau { margin-bottom: 0; }
.panneau::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.panneau.p-bleu { --c: var(--sc-bleu); --c-fond: #e6f4fa; --c-fonce: #005d7d; }
.panneau.p-vert { --c: var(--sc-vert); --c-fond: #e6f6ef; --c-fonce: #1d6b4e; }
.panneau.p-or { --c: var(--sc-or); --c-fond: #fbf3e2; --c-fonce: #7a5410; }
.panneau-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panneau-tete h2 { margin: 0; font-size: 1.35rem; color: var(--c-fonce); }
.panneau-tete small { color: var(--muted); font-size: .85rem; }
.panneau-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--c); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 35%, transparent); flex: 0 0 auto; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.accueil-droite .tuiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tuile { --c: var(--brand); --c-clair: #e3f2f8; --c-fonce: var(--brand-d);
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 118px; padding: 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(7,21,27,.04); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tuile:hover, .tuile:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(7,21,27,.10); border-color: var(--c); }
.tuile:focus-visible { outline: 3px solid color-mix(in srgb, var(--c) 45%, transparent); outline-offset: 2px; }
.tuile.t-bleu { --c: #0098ca; --c-clair: #e1f3fa; --c-fonce: #005d7d; }
.tuile.t-vert { --c: #2f9c75; --c-clair: #e2f5ed; --c-fonce: #1d6b4e; }
.tuile.t-or { --c: #c99330; --c-clair: #fbf0dc; --c-fonce: #7a5410; }
.tuile-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--c-clair); color: var(--c-fonce); transition: background .15s, color .15s; }
.tuile:hover .tuile-ico { background: var(--c); color: #fff; }
.tuile-txt { display: flex; flex-direction: column; gap: 2px; }
.tuile-txt strong { font-family: var(--title); font-weight: 500; font-size: 1.15rem; line-height: 1.2; letter-spacing: .01em; }
.tuile-txt small { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.tuile-nb { position: absolute; top: 12px; right: 12px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--c); color: #fff; font-size: .8rem; line-height: 26px; text-align: center; font-weight: 700; }
.tuile.primaire { background: linear-gradient(135deg, var(--c) 0%, var(--c-fonce) 100%); border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 35%, transparent); }
.tuile.primaire .tuile-ico { background: rgba(255,255,255,.18); color: #fff; }
.tuile.primaire:hover .tuile-ico { background: rgba(255,255,255,.28); }
.tuile.primaire .tuile-txt small { color: rgba(255,255,255,.85); }
.tuile.primaire .tuile-nb { background: #fff; color: var(--c-fonce); }
.tuile.large { flex-direction: row; align-items: center; min-height: 0; margin-bottom: 12px; }
.panneau .stats.mini { margin: 14px 0 0; }
.panneau .stats.mini .stat { background: rgba(255,255,255,.75); padding: 10px 14px; }
.panneau .stats.mini .stat b { font-size: 1.4rem; color: var(--c-fonce); }
.prochaine { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.8); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.prochaine > span:nth-child(2) { flex: 1; min-width: 0; font-size: .9rem; }
.prochaine:hover { border-color: var(--c); }
.mini-alertes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: .85rem; }
.mini-alertes a { color: var(--ink); text-decoration: none; }
.mini-alertes a:hover strong { color: var(--brand); }
.d-compacte .tuile { min-height: 96px; padding: 12px; gap: 6px; }
.d-compacte .panneau { padding: 14px; }
@media (max-width: 760px) {
  .tuiles, .accueil-droite .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tuile { min-height: 108px; padding: 13px; }
  .tuile-txt strong { font-size: 1.05rem; }
  .panneau { padding: 14px; border-radius: 16px; }
  .accueil-cartes { grid-template-columns: 1fr; }
}
@media print { .accueil-droite, .tuiles { display: none; } .accueil { display: block; } }
.accueil-gauche .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .accueil-gauche .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Écran étroit : boutons des marchés, puis véhicules et administration, puis le détail des marchés */
@media (max-width: 1100px) {
  .accueil { display: flex; flex-direction: column; gap: 0; }
  .accueil-gauche { display: contents; }
  .accueil-gauche > .panneau { order: 1; }
  .accueil-droite { order: 2; margin-bottom: 18px; }
  .accueil-gauche > :not(.panneau) { order: 3; }
}

/* Portail de l'adresse principale */
.portail main.wrap { padding-top: 34px; }
.portail-intro { max-width: 760px; margin-bottom: 26px; }
.portail-intro h1 { font-size: 2rem; margin-bottom: 8px; }
.portail-intro p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.portail-tuiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 26px; }
.portail-pied { margin-top: 30px; }
