/* ==========================================================================
   HomologPort — charte sobre aux trois couleurs du drapeau gabonais
   Vert #009E60  : actions principales, étapes réussies, navigation active
   Jaune #FCD116 : ce qui demande votre attention (à faire, en attente, alertes)
   Bleu #3A75C4  : information, dossiers en cours, liens
   Tout le reste est neutre (blanc, gris, texte foncé).
   Polices : Tahoma (texte) et Futura (titres) ; Jost sert de substitut libre à Futura.
   ========================================================================== */
:root {
  --green: #009E60;  --green-d: #007A4A;  --green-l: #E6F5EE;
  --yellow: #FCD116; --yellow-d: #D9AE00; --yellow-l: #FFF7D1;
  --blue: #3A75C4;   --blue-d: #2C5E9F;   --blue-l: #EAF1FB;
  --ink: #1C2421;  --ink-2: #3E4945;  --muted: #6B7671;
  --line: #E4E8E6; --soft: #F5F7F6;   --bg: #F1F3F2; --card: #fff;
  --r: 18px;
  --f-body: Tahoma, Verdana, Geneva, sans-serif;
  --f-title: Futura, "Futura PT", "Futura Std", Jost, "Century Gothic", "Trebuchet MS", sans-serif;
  --shadow: 0 1px 2px rgba(28, 36, 33, .05), 0 6px 20px rgba(28, 36, 33, .05);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: var(--f-body); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
h1, h2, h3, h4, .brand strong, .kpi-val, .money strong, .rc-amount strong, .count {
  font-family: var(--f-title); font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.2;
}
a { color: var(--blue-d); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: .92em; letter-spacing: .02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid rgba(58, 117, 196, .5); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ Structure */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; width: 100%; max-width: 1320px; margin: 0 auto; padding: 20px 28px 48px; display: flex; flex-direction: column; gap: 16px; }

/* ------------------------------------------------------------ Menu latéral (clair) */
.side {
  position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line);
  padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 16px; z-index: 30; overflow-y: auto;
}
.side::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--green) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--blue) 66.6%); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 4px; }
.brand strong { display: block; font-size: 18px; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px;
  color: var(--ink-2); font: 14.5px var(--f-body); text-decoration: none; border: 0; background: none; width: 100%; cursor: pointer; text-align: left;
}
.nav-item:hover { background: var(--soft); text-decoration: none; color: var(--ink); }
.nav-item.is-active { background: var(--green-l); color: var(--green-d); font-weight: 700; }
.nav-ic { position: relative; display: grid; place-items: center; width: 24px; height: 24px; flex: none; }
.badge {
  position: absolute; top: -8px; right: -12px; font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px;
  border-radius: 10px; padding: 0 5px; display: grid; place-items: center; background: var(--yellow); color: var(--ink); border: 2px solid #fff;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.me-t { min-width: 0; display: flex; flex-direction: column; }
.me-t strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-t small { color: var(--muted); font-size: 12px; }
.ios-hint { margin: 0; padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); background: var(--soft); border-radius: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--green); color: #fff; font: 600 14px var(--f-title);
}

/* ------------------------------------------------------------ En-tête */
.top { display: flex; align-items: center; gap: 14px; min-height: 48px; }
.top-brand { display: none; }
.hello { flex: 1; min-width: 0; }
.hello h1 { font-size: 26px; }
.hello p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.hello .top-title { margin: 0; font: 600 15px var(--f-title); color: var(--muted); }
.search {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px;
  height: 46px; width: min(360px, 40vw); color: var(--muted);
}
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 158, 96, .15); }
.search input, .search input[type=search] { border: 0 !important; border-radius: 0 !important; outline: 0; background: none !important; font: inherit; color: var(--ink); width: 100%; min-width: 0; min-height: 0; padding: 0 !important; box-shadow: none !important; }
.top-avatar { display: none; }
.scrim { display: none; }
.tabbar { display: none; }

.demo-banner { display: flex; align-items: center; gap: 8px; background: var(--yellow-l); color: var(--ink-2); border-radius: 12px; padding: 8px 14px; font-size: 13px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; }
.flash .ic { margin-top: 1px; }
.flash-ok { background: var(--green-l); color: var(--green-d); }
.flash-err { background: var(--yellow-l); color: var(--ink); border-left: 4px solid var(--yellow-d); font-weight: 700; }

/* ------------------------------------------------------------ Cartes */
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 18px; }
.card-head p { margin: 2px 0 0; }
.head-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.link { font-size: 14px; font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.d-green { background: var(--green); } .d-blue { background: var(--blue); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.page-title { font-size: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.back { font-size: 14px; display: inline-flex; align-items: center; min-height: 32px; font-weight: 700; }

/* ------------------------------------------------------------ Tableau de bord */
.todo-card { border-top: 4px solid var(--yellow); }
.count { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 22px; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-size: 20px; }
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 700; font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.kpi-label .ic { color: var(--green); }
.kpi-val { font-size: 34px; line-height: 1; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-sub b { color: var(--green-d); }

.row { display: grid; gap: 12px; }
.row-chart { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.row-lists { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--f-body); }
.chart .axis-today { fill: var(--ink); font-weight: 700; }
.chart .val { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--f-body); }
.chart .today { fill: var(--yellow-l); }
.chart .b-green { fill: var(--green); } .chart .b-blue { fill: var(--blue); }

.funnel { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.fn-row { display: grid; grid-template-columns: 104px 1fr 40px; align-items: center; gap: 10px; font-size: 13.5px; min-height: 26px; }
.fn-label { color: var(--ink-2); }
.fn-bar { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.fn-bar i { display: block; height: 100%; border-radius: 5px; background: var(--green); }
.fn-row b { text-align: right; font-family: var(--f-title); font-size: 15px; }
.drop { margin: 0 0 2px 114px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.drop::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow-d); flex: none; }

.money { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--soft); margin-bottom: 12px; }
.money small { color: var(--muted); }
.money strong { font-size: 26px; }
.plus { color: var(--green-d); }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.alerts li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--soft); color: var(--muted); }
.alerts li .ic { color: var(--green); }
.alerts .al-warn { background: var(--yellow-l); color: var(--ink); }
.alerts .al-warn .ic { color: var(--ink); }

/* ------------------------------------------------------------ Listes (lignes cliquables) */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rows a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 12px; background: var(--soft); color: var(--ink); text-decoration: none; }
.rows a:hover { background: #ECF0EE; }
.rows-plain { gap: 0; }
.rows-plain li + li { border-top: 1px solid var(--line); }
.rows-plain a { background: none; border-radius: 0; padding: 10px 4px; }
.rows-plain a:hover { background: var(--soft); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main strong { font-size: 15px; }
.row-main small, .row-side small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.row-act { flex: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--green-d); }
.empty { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 6px 0; }
.empty .ic { color: var(--green); }

/* ------------------------------------------------------------ Tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: var(--soft); }
.table tr:last-child td { border-bottom: 0; }
.table td.go { text-align: right; color: var(--muted); }
.row-link { color: var(--ink); }
.sub { display: block; color: var(--muted); font-size: 13px; }
.only-narrow { display: none; }
.list-card { padding: 8px 16px 12px; }

.search-page { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; color: var(--muted); }
.search-page:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 158, 96, .15); }
.search-page input { border: 0 !important; box-shadow: none !important; padding: 8px 0 !important; min-width: 0; flex: 1; }
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; text-decoration: none; }
.fchip b { background: var(--soft); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.fchip:hover { text-decoration: none; border-color: var(--green); }
.fchip.on { background: var(--green); border-color: var(--green); color: #fff; }
.fchip.on b { background: rgba(255, 255, 255, .22); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 4px; font-size: 14px; color: var(--muted); gap: 8px; }
.inline-filter select { min-height: 44px; }

.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-list li { padding: 12px 2px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.audit-list li:last-child { border-bottom: 0; }
.al-top { display: flex; justify-content: space-between; gap: 10px; }
.al-top small, .audit-list > li > small { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ Étiquettes de statut */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; font-family: var(--f-body); white-space: nowrap; line-height: 1.5; }
.st-gray { background: var(--soft); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.st-blue { background: var(--blue-l); color: var(--blue-d); }
.st-warn { background: var(--yellow); color: var(--ink); }
.st-green-soft { background: var(--green-l); color: var(--green-d); }
.st-green { background: var(--green); color: #fff; }

/* ------------------------------------------------------------ Boutons et formulaires */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px;
  border: 1px solid transparent; font: 700 15px var(--f-body); cursor: pointer; text-decoration: none; transition: filter .12s, transform .12s; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--green); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); filter: none; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }

.form-card { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.compact { gap: 12px; }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13.5px; color: var(--ink-2); font-weight: 700; padding: 0; }
input[type=text], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 46px; font: 15px var(--f-body); color: var(--ink); background: #fff; border: 1px solid #CFD6D3; border-radius: 12px; padding: 10px 14px;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 158, 96, .15); }
input[readonly] { background: var(--soft); color: var(--muted); }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
textarea { resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.radios { display: flex; flex-direction: row; gap: 10px; flex-wrap: wrap; }
.radios legend { width: 100%; margin-bottom: 6px; }
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.mode { cursor: pointer; flex: 1; min-width: 130px; position: relative; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid #CFD6D3; background: #fff; font-weight: 700; font-size: 14px; text-align: center; }
.mode input:checked + span { border-color: var(--green); background: var(--green-l); color: var(--green-d); }
.mode-bad input:checked + span { border-color: var(--yellow-d); background: var(--yellow-l); color: var(--ink); }
.mode input:focus-visible + span { outline: 3px solid rgba(58, 117, 196, .5); outline-offset: 2px; }
.pay-form .field { margin-bottom: 10px; }

.hint { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.hint .ic { margin-top: 2px; }
.note { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; font-size: 14px; }
.wait { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); margin: 0; }
.wait .ic { color: var(--blue); margin-top: 2px; }

/* ------------------------------------------------------------ Fiche véhicule */
.stepper { list-style: none; margin: 0; padding: 16px 18px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); display: flex; overflow-x: auto; }
.step { flex: 1 0 92px; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; text-align: center; font-size: 12.5px; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.step:first-child::before { display: none; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; position: relative; z-index: 1; font-size: 13px; }
.s-done { color: var(--ink-2); }
.s-done::before { background: var(--green); }
.s-done .step-dot { background: var(--green); border-color: var(--green); color: #fff; }
.s-current { color: var(--ink); font-weight: 700; }
.s-current .step-dot { border-color: var(--yellow-d); background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 5px rgba(252, 209, 22, .3); }
.s-bad { color: var(--ink); font-weight: 700; }
.s-bad .step-dot { background: var(--yellow); border-color: var(--yellow-d); color: var(--ink); }
.s-bad::before { background: var(--green); }
.progress-m { display: none; }

.action-card.is-mine { border: 2px solid var(--green); box-shadow: 0 0 0 4px var(--green-l), var(--shadow); }
.action-card.is-mine .card-head h3 { color: var(--green-d); }
.action-card.is-wait { background: var(--blue-l); box-shadow: none; padding: 16px 20px; }
.action-card.is-wait .card-head { margin-bottom: 6px; }
.action-card.is-wait .card-head h3 { font-size: 16px; color: var(--blue-d); }

.cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fold > summary { list-style: none; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .ic { color: var(--muted); transition: transform .15s; transform: rotate(90deg); }
.fold:not([open]) > summary { margin-bottom: 0; }
.fold:not([open]) > summary .ic { transform: none; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.kv-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insp { padding: 12px; border-radius: 12px; background: var(--soft); margin-bottom: 8px; }
.insp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pay { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--soft); margin-bottom: 8px; flex-wrap: wrap; }
.mini { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.mini td { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.mini .r { text-align: right; white-space: nowrap; }
.mini .tot td { font-weight: 700; border-bottom: 0; padding-top: 10px; }

.lock-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.lock-head h3 { font-size: 18px; margin-bottom: 2px; }
.lock-head p { margin: 0; color: var(--muted); font-size: 14px; }
.lock-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.lock-shut .lock-ic { background: var(--yellow); color: var(--ink); }
.lock-open .lock-ic, .lock-done .lock-ic { background: var(--green); color: #fff; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.checks .ic { margin-top: 1px; }
.ck-ok { color: var(--ink-2); } .ck-ok .ic { color: var(--green); }
.ck-no { color: var(--ink); font-weight: 700; } .ck-no .ic { color: var(--yellow-d); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { display: flex; gap: 14px; padding: 0 0 14px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 6px; flex: none; position: relative; z-index: 1; }
.timeline strong { display: block; font-size: 14px; }
.timeline small { display: block; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ Intégrité du journal */
.integrity { display: flex; align-items: center; gap: 16px; }
.integrity p { margin: 2px 0 0; color: var(--muted); }
.int-ok .ic { color: var(--green); }
.int-bad { background: var(--yellow); }
.int-bad p { color: var(--ink); }

/* ------------------------------------------------------------ Connexion et vérification */
.login-body { background: var(--bg); }
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-hero { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 48px; background: var(--green); }
.login-hero .shape { position: absolute; border-radius: 50%; }
.s1 { width: 320px; height: 320px; background: var(--yellow); right: -120px; top: -100px; }
.s2 { width: 280px; height: 280px; background: var(--blue); left: -110px; bottom: -120px; }
.s3 { display: none; }
.login-hero-in { position: relative; z-index: 1; max-width: 440px; }
.login-hero-in > svg { background: #fff; border-radius: 16px; padding: 4px; box-sizing: content-box; }
.login-hero h1 { font-size: 44px; margin: 18px 0 8px; }
.lead { font-size: 18px; line-height: 1.5; margin: 0 0 22px; }
.hero-points { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-points li { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .14); padding: 12px 16px; border-radius: 12px; }
.hero-foot { font-size: 12.5px; opacity: .85; margin: 0; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 48px; max-width: 540px; width: 100%; margin: 0 auto; gap: 10px; }
.login-card h2 { font-size: 30px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.demo-box { margin-top: 18px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.demo-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 700; font-size: 14px; flex-wrap: wrap; }
.demo-title .ic { color: var(--yellow-d); }
.demo-title small { font-weight: 400; color: var(--muted); }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-user { text-align: left; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); cursor: pointer; font: inherit; display: flex; flex-direction: column; justify-content: center; color: var(--ink); }
.demo-user:hover { border-color: var(--green); background: var(--green-l); }
.demo-user strong { font-size: 13.5px; }
.demo-user small { color: var(--muted); }

.verify-wrap { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.verify-top { display: flex; align-items: center; gap: 14px; }
.verify-top strong { font-family: var(--f-title); font-size: 22px; display: block; }
.verify-top small { color: var(--muted); }
.verify-res { border-radius: var(--r); padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; box-shadow: var(--shadow); }
.verify-res h1 { font-size: 26px; }
.verify-res p { margin: 0; }
.verify-res .kv { text-align: left; width: 100%; margin-top: 10px; }
.v-ok { background: var(--green-l); color: var(--green-d); } .v-ok .ic { color: var(--green); }
.v-bad { background: var(--yellow-l); color: var(--ink); }

/* ------------------------------------------------------------ Documents imprimables */
.doc-body { background: #DDE2DF; padding: 20px 12px 40px; }
.doc-tools { max-width: 820px; margin: 0 auto 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cert { position: relative; max-width: 820px; margin: 0 auto; background: #fff; padding: 36px 44px 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, .15); font-size: 12.5px; line-height: 1.45; overflow: hidden; }
.cert-flag { position: absolute; left: 0; right: 0; top: 0; height: 10px; display: flex; }
.cert-flag i { flex: 1; } .cert-flag i:nth-child(1) { background: var(--green); } .cert-flag i:nth-child(2) { background: var(--yellow); } .cert-flag i:nth-child(3) { background: var(--blue); }
.cert-watermark { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-title); font-weight: 700; font-size: 64px; color: rgba(28, 36, 33, .07); transform: rotate(-28deg); pointer-events: none; text-align: center; line-height: 1.1; }
.cert-head { display: flex; justify-content: space-between; gap: 20px; margin-top: 8px; }
.cert-head p { margin: 0; font-size: 11px; } .cert-head .sm { font-size: 10.5px; }
.cert-rep { text-align: center; } .cert-date { margin-top: 10px !important; }
.cert-num { margin: 12px 0 8px; font-size: 13px; }
.cert-title { text-align: center; font-size: 22px; letter-spacing: .08em; border: 2px solid var(--ink); padding: 8px 12px; width: max-content; max-width: 100%; margin: 6px auto 14px; font-family: var(--f-title); }
.cert-visas p { margin: 0 0 3px; }
.cert-certify { margin: 12px 0 6px; }
.cert-owner { margin: 0 0 12px; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: 6px; font-size: 13px; }
.cert-owner span { color: #555; font-size: 11px; margin-right: 6px; }
.cert-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cert-box { border: 1.5px solid var(--ink); border-radius: 6px; padding: 10px 12px; }
.cert-box h2 { font-size: 12.5px; margin-bottom: 6px; font-family: var(--f-title); letter-spacing: .02em; }
.cert-box table { width: 100%; border-collapse: collapse; }
.cert-box th { text-align: left; font-weight: 400; padding: 2px 6px 2px 0; width: 48%; color: #333; vertical-align: top; }
.cert-box td { font-weight: 700; padding: 2px 0; overflow-wrap: anywhere; }
.cert-benefit { margin: 14px 0; font-size: 11.5px; }
.cert-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: end; margin-top: 10px; }
.cert-verify { display: flex; gap: 12px; align-items: flex-start; }
.qr { width: 104px; height: 104px; flex: none; padding: 6px; border: 1px solid #CCC; border-radius: 6px; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.vtxt { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: #444; }
.cert-sig { text-align: center; }
.cert-sig p { margin: 0 0 4px; }
.esign { margin: 10px auto 0; padding: 10px 12px; border: 1.5px dashed var(--green); border-radius: 8px; color: var(--green-d); display: inline-block; font-size: 11.5px; }
.cert-foot { margin: 18px 0 0; padding-top: 8px; border-top: 1px solid #999; text-align: center; font-size: 10px; color: #555; }

.receipt { position: relative; max-width: 480px; margin: 0 auto; background: #fff; padding: 34px 28px 26px; box-shadow: 0 10px 40px rgba(0, 0, 0, .15); display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.rc-brand { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.rc-brand strong { display: block; font-size: 20px; } .rc-brand small { color: var(--muted); }
.rc-amount { text-align: center; padding: 16px; border-radius: 14px; background: var(--green-l); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rc-amount strong { font-size: 32px; }

/* ==========================================================================
   Adaptation à tous les écrans
   ========================================================================== */

/* Grands écrans */
@media (min-width: 1600px) {
  .main { max-width: 1480px; }
  body { font-size: 15.5px; }
}

/* Petits ordinateurs et tablettes en paysage */
@media (max-width: 1240px) {
  .row-chart, .row-lists { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablettes : le menu devient un rail d'icônes */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .side { padding: 16px 10px 12px; align-items: center; }
  .brand { padding: 4px 0; }
  .brand-t, .nav-t, .me-t, .ios-hint { display: none; }
  .nav, .side-foot { width: 100%; align-items: center; }
  .nav-item { justify-content: center; padding: 0; width: 52px; height: 48px; }
  .me { padding: 4px 0; justify-content: center; }
  .main { padding: 18px 20px 40px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .search { width: min(320px, 38vw); }
}

/* Tablettes en portrait et téléphones : listes en cartes */
@media (max-width: 900px) {
  .only-wide { display: none; }
  .only-narrow { display: block; }
}

/* Téléphones : barre d'onglets en bas, menu en tiroir */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .shell { display: block; }
  .main { padding: 0 14px calc(var(--tabbar-h) + var(--safe-b) + 24px); gap: 14px; }

  .side {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(300px, 86vw); align-items: stretch;
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); z-index: 60;
    padding: 20px 14px calc(14px + var(--safe-b));
  }
  .side.open { transform: none; }
  .side .brand-t, .side .ios-hint { display: block; }
  .side .me-t { display: flex; }
  .side .nav-t { display: inline; }
  .side .nav-item { justify-content: flex-start; padding: 0 12px; width: 100%; height: auto; min-height: 48px; }
  .side .me { justify-content: flex-start; padding: 6px 8px; }
  .side .nav, .side .side-foot { align-items: stretch; }
  .side .brand { padding: 6px 8px 4px; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(28, 36, 33, .45); z-index: 50; }

  .top {
    position: sticky; top: 0; z-index: 40; margin: 0 -14px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: rgba(241, 243, 242, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); gap: 10px;
  }
  .top-brand { display: block; line-height: 0; }
  .hello h1 { font-size: 19px; }
  .hello p { font-size: 12.5px; }
  .hello .top-title { color: var(--ink); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search { display: none; }
  .top-avatar { display: grid; width: 36px; height: 36px; font-size: 13px; }

  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(28, 36, 33, .06);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
    font: 11.5px var(--f-body); text-decoration: none; border: 0; background: none; cursor: pointer; padding: 0; position: relative;
  }
  .tab:hover { text-decoration: none; }
  .tab-ic { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; }
  .tab.is-active { color: var(--green-d); font-weight: 700; }
  .tab.is-active .tab-ic { background: var(--green-l); }
  .tab .badge { top: -6px; right: 2px; }

  .card { padding: 16px; border-radius: 16px; }
  .card-head h2, .card-head h3 { font-size: 17px; }
  .page-title { font-size: 22px; }
  .page-head { align-items: stretch; }
  .page-head > .btn { width: 100%; }
  .card-head { flex-wrap: wrap; }
  .card-head > div:first-child { flex: 1; min-width: 0; }
  .todo-card .head-actions:has(.btn) { width: 100%; }
  .todo-card .head-actions .btn { flex: 1; }
  .rows-plain .row-side small { display: none; }
  .count { min-width: 40px; height: 40px; font-size: 18px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-val { font-size: 28px; }
  .kpi-label { font-size: 13px; }
  .fn-row { grid-template-columns: 92px 1fr 34px; }
  .drop { margin-left: 102px; }
  .row-act { font-size: 0; gap: 0; }   /* sur téléphone : flèche seule */
  .row-act .ic { width: 20px; height: 20px; }
  .rows a { padding: 10px 12px; }

  .list-card { padding: 4px 14px; }

  .form-grid, .kv, .cert-boxes, .cert-sign, .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .kv-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input[type=text], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea { font-size: 16px; } /* évite le zoom iOS */
  .form-actions .btn, .action-card .btn { width: 100%; min-height: 52px; }
  .mode { min-width: 0; flex-basis: 100%; }

  .stepper { display: none; }
  .progress-m { display: block; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; }
  .pm-top { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
  .pm-top b { font-size: 13px; color: var(--muted); }
  .pm-top span { font-weight: 700; }
  .pm-bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
  .pm-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
  .vh .btn { width: 100%; }

  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 28px 20px 26px; padding-top: calc(28px + env(safe-area-inset-top, 0px)); }
  .login-hero h1 { font-size: 30px; margin-top: 12px; }
  .lead { font-size: 15.5px; margin: 0; }
  .hero-points, .hero-foot { display: none; }
  .s1 { width: 180px; height: 180px; right: -60px; top: -70px; }
  .s2 { width: 140px; height: 140px; left: auto; right: 30px; bottom: -90px; }
  .login-card { padding: 24px 16px 40px; }
  .login-card h2 { font-size: 24px; }

  .doc-body { padding: 10px 6px 24px; }
  .cert { padding: 26px 16px 20px; font-size: 12px; }
  .cert-head { flex-direction: column; gap: 8px; }
}

/* Très petits téléphones */
@media (max-width: 360px) {
  .main { padding-left: 10px; padding-right: 10px; }
  .top { margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi-val { font-size: 24px; }
  .tab { font-size: 10.5px; }
}

/* Application installée (mode autonome) */
@media (display-mode: standalone) {
  .install-btn, .ios-hint { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  .no-print, .tabbar, .side { display: none !important; }
  body, .doc-body { background: #fff; padding: 0; }
  .cert, .receipt { box-shadow: none; max-width: none; padding: 8mm 6mm 4mm; }
  .cert { font-size: 10.5pt; }
  .cert-head { flex-direction: row; }
  .cert-boxes, .cert-sign { grid-template-columns: 1fr 1fr; }
}
