/* ZT Continental Trans — feuille de style
   Sobre : fond gris très clair, cartes blanches, bleu marine du logo, rouge réservé aux urgences. */
:root {
  --navy: #0B2A5E;
  --navy-700: #0a2350;
  --navy-50: #eef2f9;
  --red: #E30613;
  --red-700: #b9050f;
  --red-50: #fdeced;
  --blue: #1D55B3;
  --orange: #C26A00;
  --orange-50: #fdf2e0;
  --green: #1E7F3A;
  --green-50: #e8f4ec;
  --bg: #f6f7f9;
  --card: #fff;
  --line: #e3e6ec;
  --text: #1c2433;
  --muted: #667085;
  --radius: 8px;
  --sidebar-w: 236px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--navy); font-weight: 650; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75em; }
code { font-size: .85em; background: #eef0f4; padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.icon { width: 1.3em; height: 1.3em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.25em; }

/* ---------- Structure ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transform: translateX(-100%); transition: transform .18s; }
body.nav-open .sidebar { transform: none; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.sidebar-brand img { width: 44px; height: 44px; }
.sidebar-brand strong { color: var(--navy); font-size: .95rem; line-height: 1.2; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.nav-title { font-size: .75rem; color: var(--muted); padding: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: var(--text); margin-bottom: 1px; }
.nav-link .icon { color: var(--muted); }
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link.active { background: var(--navy-50); color: var(--navy); font-weight: 600; }
.nav-link.active .icon { color: var(--navy); }
.sidebar-user { padding: 12px 16px 16px; border-top: 1px solid var(--line); font-size: .88rem; }
.sidebar-user strong { display: block; color: var(--text); }
.sidebar-user .role { color: var(--muted); font-size: .82rem; }
.sidebar-user .links { display: flex; gap: 8px; margin-top: 10px; }
.sidebar-user .btn { flex: 1; justify-content: center; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 30; }
body.nav-open .backdrop { display: block; }

.topbar { position: sticky; top: 0; z-index: 20; background: #fff; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 650; flex: 1; min-width: 0; color: var(--navy); }
.topbar .brand img { width: 34px; height: 34px; }
.topbar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: transparent; border: 0; color: var(--navy); padding: 8px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--bg); }

.main { padding: 16px 14px 96px; max-width: 1140px; margin: 0 auto; }

.bottomnav { position: fixed; inset: auto 0 0 0; z-index: 25; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a, .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: .72rem; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer; }
.bottomnav a:hover { text-decoration: none; }
.bottomnav .icon { width: 1.45em; height: 1.45em; }
.bottomnav .active { color: var(--navy); font-weight: 650; }

@media (min-width: 960px) {
  .sidebar { transform: none; }
  .topbar, .bottomnav, .backdrop { display: none !important; }
  .app { padding-left: var(--sidebar-w); }
  .main { padding: 28px 32px 48px; }
}

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb { font-size: .85rem; margin-bottom: 4px; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card > h2:first-child { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 14px 16px 6px; margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid .card { margin-bottom: 0; }

/* ---------- Chiffres clés ---------- */
.figures { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.figure { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: inherit; display: block; }
a.figure:hover { background: #fafbfc; text-decoration: none; }
.figure .label { font-size: .82rem; color: var(--muted); }
.figure .value { font-size: 1.7rem; font-weight: 650; color: var(--navy); line-height: 1.25; }
.figure .value small { font-size: .95rem; color: var(--muted); font-weight: 400; }
.figure.warn .value { color: var(--orange); }
.figure.alert .value { color: var(--red); }
@media (min-width: 760px) { .figures.f4 { grid-template-columns: repeat(4, 1fr); } .figures.f5 { grid-template-columns: repeat(5, 1fr); } .figures.f3 { grid-template-columns: repeat(3, 1fr); } .figure { border-bottom: 0; } .figure:last-child { border-right: 0; } }
.figures > .figure:nth-last-child(1) { border-bottom: 0; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border-radius: 7px; border: 1px solid var(--navy); font: inherit; font-weight: 600; cursor: pointer; background: var(--navy); color: #fff; min-height: 40px; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--navy-700); text-decoration: none; color: #fff; }
.btn-light { background: #fff; color: var(--navy); border-color: #c9d0dc; }
.btn-light:hover { background: var(--bg); color: var(--navy); }
.btn-danger { background: #fff; color: var(--red-700); border-color: #efb4b8; }
.btn-danger:hover { background: var(--red-50); color: var(--red-700); }
.btn-solid-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-solid-red:hover { background: var(--red-700); color: #fff; }
.btn-blue { background: var(--blue); border-color: var(--blue); }
.btn-ghost { background: transparent; color: var(--navy); border-color: #c9d0dc; }
.btn-ghost:hover { background: var(--bg); color: var(--navy); }
.btn-sm { padding: 4px 10px; min-height: 32px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------- États (pastille discrète) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; white-space: nowrap; color: var(--text); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b3bbc8; flex: none; }
.badge-green::before { background: #2f9e57; }
.badge-blue::before { background: var(--blue); }
.badge-orange::before { background: #e08a00; }
.badge-red::before { background: var(--red); }
.badge-red { color: var(--red-700); font-weight: 600; }
.badge-orange { color: var(--orange); }

/* ---------- Messages ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.alert-success { background: var(--green-50); border-color: #c4e1cf; color: #14532b; }
.alert-error { background: var(--red-50); border-color: #f3c3c6; color: #8a0710; }
.alert-warning { background: var(--orange-50); border-color: #f1d9ad; color: #7a4300; }
.alert-info { background: var(--navy-50); border-color: #d3dcee; color: var(--navy); }
.danger-banner { background: var(--red); color: #fff; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 650; }
.danger-banner small { display: block; font-weight: 400; opacity: .95; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .82rem; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
td { padding: 11px 14px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.row-critical td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* ---------- Listes simples ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid #eef0f4; }
.rows li:first-child { border-top: 0; }
.rows a.row-link { color: inherit; display: contents; }
.rows .main-text { min-width: 0; }
.rows .main-text strong { font-weight: 600; }
.rows .side { text-align: right; white-space: nowrap; font-size: .88rem; }
.rows.empty-row li { color: var(--muted); }
.card:not(.flush) > .rows li { padding-left: 0; padding-right: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid #eef0f4; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.list li:last-child { border-bottom: 0; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .span-2 { grid-column: span 2; } }
.field { display: flex; flex-direction: column; gap: 5px; }
label, .label { font-weight: 600; font-size: .88rem; color: var(--text); }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #c9d0dc; border-radius: 7px; font: inherit; background: #fff; color: var(--text); min-height: 42px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db8e6; outline-offset: 0; border-color: var(--blue); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--text); }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--navy); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .field { flex: 1 1 150px; min-width: 130px; }
.filters .field.grow { flex: 2 1 220px; }
.filters .actions { display: flex; gap: 8px; }

/* ---------- Pagination ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 16px; border-top: 1px solid #eef0f4; }
.page-link { padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--navy); font-size: .88rem; }
.page-link:hover { background: var(--bg); text-decoration: none; }
.page-link.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager-info { margin-left: auto; color: var(--muted); font-size: .85rem; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.tab { padding: 10px 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; font-size: .95rem; cursor: pointer; }
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.active { color: var(--navy); font-weight: 650; border-bottom-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Clé / valeur ---------- */
.kv { display: grid; grid-template-columns: 1fr; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef0f4; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }

/* ---------- Camions ---------- */
.truck-head { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .truck-head { grid-template-columns: 260px 1fr; } }
.truck-photo { background: var(--bg); border-radius: var(--radius); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #aab3c2; border: 1px solid var(--line); }
.truck-photo img { width: 100%; height: 100%; object-fit: cover; }
.truck-photo .icon { width: 56px; height: 56px; stroke-width: 1.3; }
.plate { display: inline-block; font-weight: 700; letter-spacing: .05em; border: 1.5px solid var(--navy); border-radius: 5px; padding: 0 7px; background: #fff; color: var(--navy); font-size: .9rem; white-space: nowrap; }

/* ---------- Photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid a, .photo-item { position: relative; display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #e9edf5; aspect-ratio: 4/3; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-dl { position: absolute; right: 6px; bottom: 6px; background: rgba(255,255,255,.92); color: var(--navy); border-radius: 6px; padding: 4px 6px; display: inline-flex; border: 1px solid var(--line); }
.photo-dl:hover { background: #fff; text-decoration: none; }
.check-cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .check-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .check-cards { grid-template-columns: repeat(3, 1fr); } }
.check-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; color: inherit; }
.check-card:hover { text-decoration: none; border-color: #b9c3d4; }
.check-card .thumb { aspect-ratio: 16/9; background: var(--bg); display: flex; align-items: center; justify-content: center; color: #aab3c2; }
.check-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.check-card .body { padding: 10px 12px; display: grid; gap: 3px; }
.compare { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .compare { grid-template-columns: 1fr 1fr; } }

/* ---------- Sélecteur de photos ---------- */
.photo-picker { border: 1px dashed #b4bfd3; border-radius: var(--radius); padding: 14px; background: #fafbfc; }
.photo-picker .buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-picker .btn { min-height: 52px; }
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-previews:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #e9edf5; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(16,24,40,.75); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 1.1rem; }
.photo-count { margin-top: 8px; font-size: .85rem; color: var(--muted); }

/* ---------- Espace conducteur ---------- */
.hello { margin-bottom: 14px; }
.hello h1 { font-size: 1.5rem; margin-bottom: 2px; }
.truck-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.truck-line .plate { font-size: 1.15rem; padding: 1px 9px; }
.truck-line .meta { color: var(--muted); font-size: .92rem; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .actions-grid { grid-template-columns: repeat(4, 1fr); } }
.action-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 18px 10px; min-height: 104px; border-radius: var(--radius); background: #fff; border: 1px solid #c9d0dc; color: var(--navy); font-weight: 650; font-size: 1.02rem; line-height: 1.25; }
.action-tile:hover { text-decoration: none; background: var(--navy-50); }
.action-tile .icon { width: 1.8em; height: 1.8em; stroke-width: 1.6; margin-bottom: 2px; }
.action-tile .state { font-size: .8rem; font-weight: 400; color: var(--muted); }
.action-tile.done { border-color: #b7dcc4; }
.action-tile.done .state { color: var(--green); }
.action-tile.problem { background: var(--red); border-color: var(--red); color: #fff; }
.action-tile.problem:hover { background: var(--red-700); }
.action-tile.disabled { opacity: .5; pointer-events: none; }

/* ---------- Connexion ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px; }
.auth-card .logo { width: 120px; margin: 0 auto 8px; }
.auth-card h1 { text-align: center; font-size: 1.2rem; margin-bottom: 18px; }
.auth-footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }

/* ---------- Divers ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 16px; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: #9aa6bb; }
.timeline .when { font-size: .82rem; color: var(--muted); }
.comment-text, .desc { white-space: pre-wrap; word-break: break-word; }
.doc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #eef0f4; }
.doc-row:last-child { border-bottom: 0; }
.doc-row .info { flex: 1 1 260px; min-width: 0; }
.doc-row .btns { display: flex; flex-wrap: wrap; gap: 6px; }
details.box { border: 1px solid var(--line); border-radius: 7px; margin-top: 8px; background: #fafbfc; }
details.box summary { cursor: pointer; padding: 8px 12px; font-weight: 500; color: var(--navy); }
details.box .inner { padding: 4px 12px 12px; }
.empty-state { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty-state p { margin: 0; }
.err-page { text-align: center; padding: 48px 16px; }
.err-page .code { font-size: 3.5rem; font-weight: 700; color: var(--navy); line-height: 1; margin-bottom: 8px; }

@media print {
  .sidebar, .topbar, .bottomnav, .btn, .filters, .tabs, .backdrop { display: none !important; }
  .app { padding: 0; }
}

/* =====================================================================
   Smartphone (< 760 px) : tableaux en cartes, filtres repliables, boutons larges
   ===================================================================== */
.filters-toggle { display: none; }
@media (max-width: 759px) {
  body { font-size: 16px; }
  .main { padding: 14px 12px 92px; }
  h1 { font-size: 1.3rem; }
  .page-head > div:first-child, .page-head > h1 { flex: 1 1 100%; }
  .page-head .actions { flex: 1 1 100%; }
  .page-head .actions .btn, .page-head .actions form { flex: 1 1 auto; }
  .page-head .actions form .btn { width: 100%; }

  .filters-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .filters-toggle .count { background: var(--navy); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .8rem; margin-left: 6px; }
  form.card.filters.collapsed { display: none; }
  .filters .field, .filters .field.grow { flex: 1 1 100%; min-width: 0; }
  .filters .actions { flex: 1 1 100%; }
  .filters .actions .btn { flex: 1; }
  input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea { font-size: 16px; }

  .card.flush { background: transparent; border: 0; overflow: visible; }
  .card.flush > h2 { padding: 0 2px 8px; }
  .card.flush > .rows { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
  .table-wrap { overflow: visible; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.responsive tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 4px 14px; }
  table.responsive tbody tr:hover { background: #fff; }
  table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid #eef0f4; text-align: right; min-height: 38px; }
  table.responsive td:last-child { border-bottom: 0; }
  table.responsive td::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; font-size: .82rem; color: var(--muted); }
  table.responsive td[data-label=""]::before, table.responsive td:not([data-label])::before { content: none; }
  table.responsive td[data-label=""] { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
  table.responsive td.empty { display: block; text-align: center; border: 0; }
  table.responsive tr.row-critical { border-left: 4px solid var(--red); }
  table.responsive .row-critical td:first-child { box-shadow: none; }
  .card.flush .pager { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }

  .card { padding: 14px; }
  .grid { gap: 12px; }
  .btn { min-height: 46px; }
  .btn-sm { min-height: 40px; padding: 6px 12px; }
  .form-actions .btn { flex: 1 1 100%; }
  .doc-row .btns { width: 100%; }
  .doc-row .btns .btn, .doc-row .btns form { flex: 1; }
  .doc-row .btns form .btn { width: 100%; }
  .kv > div { flex-wrap: wrap; }
  .tabs { margin-left: -12px; margin-right: -12px; padding: 0 12px; position: sticky; top: 50px; background: var(--bg); z-index: 10; }
  .tab { padding: 12px 14px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .pager { padding: 10px; }
  .pager-info { flex: 1 1 100%; margin-left: 0; }
  .sidebar { width: min(84vw, 300px); box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .nav-link { padding: 12px 10px; }
}

/* Finitions */
.figure:focus { outline: none; }
.figure:focus-visible { outline: 2px solid #9db8e6; outline-offset: -2px; }
.sidebar-user .links { flex-direction: column; }
@media (max-width: 759px) {
  .figures > .figure:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
  .figure { padding: 12px 14px; }
  .figure .value { font-size: 1.5rem; }
}
@media (max-width: 759px) {
  table.responsive td, table.responsive td.nowrap { white-space: normal; overflow-wrap: anywhere; flex-wrap: wrap; }
  table.responsive td .btn, table.responsive td form { white-space: normal; }
  table.responsive td[data-label=""] { justify-content: flex-end; }
}
@media (max-width: 759px) { .hide-sm { display: none !important; } }

.rental-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; background: #fafbfc; min-width: 0; }
.rental-fields legend { font-weight: 600; font-size: .88rem; padding: 0 6px; color: var(--navy); }

/* Planning des tournées */
.section-title { font-size: 1rem; margin: 22px 0 10px; }
.tour-row { border: 1px solid #e4e7ee; border-radius: 10px; padding: 14px; margin-bottom: 12px; display: grid; gap: 12px; }
.tour-row [data-tour-remove] { justify-self: start; }
.wa-preview { background: #f4f6fa; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.wa-preview .wa-to { font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.wa-preview pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .92rem; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #d5d9e2; border-radius: 8px; }
[data-tour-add] { margin: 4px 0 18px; }
