/* Admin (Management) and the vehicle & equipment check: design/management/README.md and its mockups. Built on the tokens
   of app.css (colours, radius, shadows, 48 px targets). Phone up to 599 px: one column, sections that fold, never two
   columns side by side. */

/* ---------------------------------------------------------------- the head of every Admin screen */
.adm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.adm-h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; min-width: 0; }
.adm-h1 h1 { font-size: 34px; }
.adm-open { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
.adm-open .ic { width: 20px; height: 20px; color: var(--g600); }
.adm-open b { color: var(--ok-ink); font-weight: 600; }
.adm-title { font-size: 28px; overflow-wrap: anywhere; }
.adm-part { font-size: 20px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--brand, #12382a); }
.adm .crumb { margin-bottom: 8px; }
.adm-co { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 18px; }
.adm-co > span { font-weight: 600; color: var(--ink); margin-right: 6px; }
.seg-b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--field); background: var(--card); color: var(--ink); font-weight: 500; cursor: pointer; text-align: center; }
.seg-b .ic { width: 18px; height: 18px; }
.seg-b.on { background: var(--g800); border-color: var(--g800); color: #fff; font-weight: 600; }
.seg-b.bad.on { background: var(--red); border-color: var(--red); }

/* ---------------------------------------------------------------- the lock and its keypad */
.adm-lock-wrap { display: grid; place-items: start center; padding-top: 10px; }
.adm-lock { width: min(460px, 100%); text-align: center; padding: 28px 24px 22px; }
.adm-lock-ic { display: inline-grid; place-items: center; color: var(--g800); }
.adm-lock-ic .ic { width: 52px; height: 52px; }
.adm-lock h1 { font-size: 34px; margin: 6px 0 4px; }
.adm-lock-t { font-size: 18px; color: var(--ink); margin: 0; }
.adm-lock-n { margin: 2px 0 14px; }
.adm-lock-msg { min-height: 24px; color: var(--bad-ink); font-weight: 500; font-size: 15px; margin: 8px 0; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 8px 0 4px; }
.pin-dots i { width: 46px; height: 52px; border-radius: 12px; border: 1.5px solid var(--field); background: var(--card); display: grid; place-items: center; }
.pin-dots i.on::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.pin-dots.bad i { border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 330px; margin: 8px auto 14px; }
.pk { min-height: 56px; border-radius: 12px; border: 0; background: var(--panel); color: var(--ink); font-size: 24px; font-weight: 600; cursor: pointer; display: grid; place-items: center; }
.pk.fn { font-size: 16px; font-weight: 500; color: var(--text); }
.pk:active { background: var(--mint); }
.pk:disabled { opacity: .45; cursor: default; }
.link-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; text-decoration: none; }
.link-back .ic { transform: none; }

/* ---------------------------------------------------------------- Admin home */
.adm-todo { background: #fff6f5; border-color: var(--bad-line); }
.adm-todo > h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.adm-todo-row .grow { display: grid; min-width: 0; }
.adm-todo-row small, .adm-row small, .adm-list small { color: var(--muted); font-size: 14px; display: block; overflow-wrap: anywhere; }
.adm-todo-row .btn { pointer-events: none; min-height: 40px; }
.adm-todo .tile-ic.bad { background: var(--bad-bg); color: var(--bad-ink); }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; align-items: start; }
.adm-card { padding: 0; overflow: hidden; margin: 0; }
.adm-card > h2 { margin: 0; padding: 16px 20px; font-size: 19px; }
.adm-card.people > h2 { background: #e8f0fb; }
.adm-card.fleet > h2 { background: var(--ok-bg); }
.adm-card.idg > h2 { background: var(--fair-bg); }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-top: 1px solid var(--line); }
.adm-row-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; min-height: 56px; padding: 4px 6px; color: var(--text); text-decoration: none; border-radius: 10px; }
.adm-row-main:hover { background: var(--panel-2); }
.adm-row-main .grow { min-width: 0; }
.adm-row-main b { color: var(--ink); font-weight: 600; }
.adm-more { margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.adm-foot { margin-top: 18px; }
.adm-st { flex: none; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 8px; background: var(--grey-bg); color: var(--grey-ink); white-space: nowrap; }
.adm-st.draft { background: var(--blue-bg); color: var(--blue-ink); }
.adm-st.signing, .adm-st.open { background: var(--fair-bg); color: var(--fair-ink); }
.adm-st.closed { background: var(--ok-bg); color: var(--ok-ink); }
.adm-st.void { background: var(--bad-bg); color: var(--bad-ink); }
.adm .row-link.void { opacity: .7; }
.adm .row-link.void b { text-decoration: line-through; }
.adm-list .grow { min-width: 0; }

/* ---------------------------------------------------------------- one document */
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 20px; margin: 4px 0 16px; }
.doc-head > div:first-child { min-width: 0; }
.doc-head p { margin: 4px 0 0; }
.doc-head-r { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.adm-saved { font-size: 14px; color: var(--ok-ink); }
.adm-saved.bad { color: var(--bad-ink); font-weight: 600; }
.doc-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.doc-cols.one { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.doc-main { min-width: 0; }
.adm.doc .banner { margin-bottom: 14px; }
.adm-sec { padding: 0; }
.adm-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 12px 20px; }
.adm-sec > summary::-webkit-details-marker { display: none; }
.adm-sec > summary::after { content: ''; width: 10px; height: 10px; border-right: 2px solid var(--g800); border-bottom: 2px solid var(--g800); transform: rotate(45deg); margin-top: -4px; flex: none; }
.adm-sec[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.adm-sec > summary h3 { font-size: 18px; color: var(--g900); }
.adm-sec > p, .adm-sec-body, .adm-sec.ref > .f, .adm-sec.ref > .f-static { padding: 0 20px; }
.adm-sec-body { display: grid; gap: 14px; padding-bottom: 18px; }
.adm-sec.ref { padding-bottom: 12px; }
.f-l { font-weight: 600; color: var(--ink); font-size: 15px; }
.f-h { font-weight: 400; color: var(--muted); font-size: 14px; }
.f.sm .f-l { font-size: 13px; font-weight: 500; }
.f-static h4 { margin: 4px 0; font-size: 16px; color: var(--ink); }
.f-static p, .f-static ul { margin: 0 0 6px; color: var(--text); font-size: 15px; }
.f-static ul { padding-left: 20px; }
.kvx b { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; color: var(--ink); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ticks li { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); }
.ticks li.on { color: var(--ink); }
.ticks .ic { width: 18px; height: 18px; color: var(--ok-ink); margin-top: 2px; }
.ticks .box { width: 16px; height: 16px; border: 1.5px solid var(--field); border-radius: 4px; flex: none; margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { background: var(--mint); color: var(--g800); white-space: normal; text-align: left; }
.opts { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; }
.opts.long { grid-template-columns: minmax(0, 1fr); }
.opts.row { grid-template-columns: repeat(2, minmax(0, 140px)); }
.opts legend { margin-bottom: 8px; padding: 0; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 10px; cursor: pointer; font-weight: 400; color: var(--ink); }
.opt:hover { background: var(--panel-2); }
.opt input { width: 22px; height: 22px; flex: none; accent-color: var(--g800); margin: 0; font-size: 16px; }
.opt.sm { min-height: 44px; padding: 4px 8px; font-size: 14px; }
.opt.big { border: 1.5px solid var(--line-2); background: var(--card); min-height: 60px; }
.opt.big span { display: grid; }
.opt.big small { color: var(--muted); }
.topics { margin: 0; padding-left: 26px; display: grid; gap: 6px; }
.topics.edit { padding-left: 24px; }
.rowcards { display: grid; gap: 10px; }
.rowcard { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 12px; padding: 12px 12px 12px 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.rc-n { position: absolute; left: 12px; top: 14px; font-weight: 600; color: var(--muted); }
.rtable { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.rtable table { border-collapse: collapse; width: 100%; font-size: 14px; }
.rtable th, .rtable td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rtable th { background: var(--panel); font-weight: 600; color: var(--ink); }
.rtable tr:last-child td { border-bottom: 0; }
.ins { justify-self: start; }
.adm-photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adm-ph { position: relative; width: 132px; height: 100px; border-radius: 10px; overflow: hidden; background: var(--panel); display: grid; place-items: center; cursor: zoom-in; }
.adm-ph img { width: 100%; height: 100%; object-fit: cover; }
.adm-ph-del { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(21, 38, 31, .7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.adm-ph-del .ic { width: 18px; height: 18px; }
.addph { cursor: pointer; }
.bad-t { color: var(--bad-ink); }
.fin { border-color: var(--g700); }
.fin h3 { margin-bottom: 6px; }

/* the steps of the weekly report */
.adm-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.step-b { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 14px 4px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; line-height: 1.2; }
.step-b .sn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grey-bg); color: var(--grey-ink); font-weight: 600; flex: none; }
.step-b .sn .ic { width: 16px; height: 16px; }
.step-b.done .sn { background: var(--ok); color: #fff; }
.step-b.on { border-color: var(--g800); background: var(--mint); color: var(--ink); font-weight: 600; }
.step-b.on .sn { background: var(--g800); color: #fff; }
.step-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 10px 0 18px; }
.step-nav .btn { max-width: 100%; }

/* facts from the app, beside the report (above it on narrower screens) */
.facts-panel { position: sticky; top: 96px; }
.facts-panel h3 { margin-bottom: 4px; }
.facts-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.facts-list li { display: flex; gap: 12px; align-items: flex-start; }
.facts-list .ic { width: 22px; height: 22px; color: var(--g800); flex: none; }
.facts-list small { display: block; color: var(--muted); }
.draw-box .actions { margin-top: 8px; }
.draw-st { display: grid; gap: 4px; }
.ds { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.ds b { min-width: 28px; }

/* signatures */
.sig-panel h3 { margin: 16px 0 6px; }
.sig-list { margin: 0 0 12px; padding-left: 24px; display: grid; gap: 6px; }
.sig-rows { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.sig-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.sig-row.done { background: var(--ok-bg); border-color: #cfe5d4; }
.sig-row .grow { display: grid; min-width: 0; flex: 1 1 220px; }
.sig-n { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--field); display: grid; place-items: center; flex: none; color: var(--ok-ink); }
.sig-row.done .sig-n { border-color: var(--ok); background: #fff; }
.sig-n .ic { width: 16px; height: 16px; }
.sig-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sig-panel small { color: var(--muted); }
.sigpad { position: relative; border: 1.5px solid var(--field); border-radius: 12px; background: #fff; margin: 6px 0 4px; }
.sigpad canvas { display: block; width: 100%; aspect-ratio: 5 / 2; touch-action: none; cursor: crosshair; }
.sig-clear { position: absolute; right: 6px; bottom: 6px; }
.adm-dlg .err, .sg-pad .err { color: var(--bad-ink); font-weight: 500; min-height: 22px; margin: 6px 0; }

/* the follow-up of a capital improvement */
.dec-panel h2 { font-size: 18px; }
.timeline { list-style: none; margin: 0 0 14px; padding: 0 0 0 22px; border-left: 2px solid var(--line-2); display: grid; gap: 14px; }
.timeline li { position: relative; display: grid; }
.timeline li::before { content: ''; position: absolute; left: -29px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--g800); }
.timeline small { color: var(--muted); overflow-wrap: anywhere; }
.add-dec { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.add-dec .opts { grid-template-columns: minmax(0, 1fr); gap: 0; }

/* a vehicle check, read at the office */
.fl-item h2 { font-size: 19px; }
.fl-pt { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.fl-pt:first-of-type { border-top: 0; }
.fl-pt-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.tag { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag.bad { background: var(--bad-bg); color: var(--bad-ink); }
.adm .banner.ok, .fleet .banner.ok { background: #f6fbf7; border-color: #cfe5d4; }

/* ---------------------------------------------------------------- signing mode (M4) */
.top.for-signing { justify-content: flex-start; }
.top.for-signing .brand { pointer-events: none; }
.signing { max-width: 1240px; }
.sg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.sg-doc { min-width: 0; }
.sg-doc h1 { font-size: 30px; margin-bottom: 12px; }
.sg-doc .card h3 { margin-bottom: 8px; }
.sg-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 14px; }
.sg-facts span { display: block; color: var(--muted); font-size: 14px; }
.sg-side { position: sticky; top: 90px; display: grid; gap: 14px; }
.sg-pad { margin: 0; display: grid; gap: 8px; }
.sg-count { margin: 0; font-size: 18px; color: var(--ink); }
.sg-ok { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.sg-ok .ic { width: 20px; height: 20px; }
.sg-sign { min-height: 56px; font-size: 18px; }
.sg-done { text-align: center; margin: 0; }
.sg-done > .ic { width: 44px; height: 44px; color: var(--ok); }
.sg-exit { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0; text-align: left; cursor: pointer; background: #eef3fb; border-color: #d3dff2; font: inherit; color: var(--ink); min-height: 72px; }
.sg-exit .ic { width: 34px; height: 34px; color: var(--g900); flex: none; }
.sg-exit span { display: grid; }
.sg-exit small { color: var(--muted); }
.pin-dlg { text-align: center; max-width: 400px; }
/* M21: the PIN gate covers the whole app with an opaque screen: nothing of what is under it can be read. */
.adm-gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: var(--bg); }
.adm-gate .pin-dlg { width: 100%; }
.adm-gate-ic .ic { width: 40px; height: 40px; color: var(--g900); }

/* ---------------------------------------------------------------- assets */
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.add-asset h2 { font-size: 19px; }
.asset { flex-wrap: wrap; }
.asset .grow { min-width: 0; flex: 1 1 200px; }
.adm .panel .pad { padding: 4px 10px; margin: 0; }
.adm details.panel > summary { list-style: none; cursor: pointer; }
.adm details.panel > summary::-webkit-details-marker { display: none; }
.adm details.panel > summary h2 { margin: 0; padding: 16px 22px; font-size: 19px; }

/* ---------------------------------------------------------------- the vehicle & equipment check (technician) */
.fleet .page-head .pill { min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); display: inline-flex; align-items: center; gap: 8px; }
.fleet .banner { margin-bottom: 14px; }
.fleet h3 { margin: 14px 0 8px; }
.fl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.fl-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.fl-rail { padding: 16px; }
.fl-rail-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.fl-rail-h h2 { font-size: 18px; }
.fl-rail ol { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.fl-rail-b { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; background: none; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.fl-rail-b.on { background: var(--mint); border-color: #cfe5d4; }
.fl-rail-b .grow { display: grid; min-width: 0; }
.fl-rail-b small { color: var(--muted); }
.fl-rail-b .sn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grey-bg); color: var(--grey-ink); font-weight: 600; flex: none; }
.fl-rail-b .sn.ok { background: var(--ok); color: #fff; }
.fl-rail-b .sn .ic { width: 16px; height: 16px; }
.fl-main { min-width: 0; }
.fl-title { font-size: 22px; overflow-wrap: anywhere; }
.fl-seg { display: inline-flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- the office's six tabs on a computer (Admin added) */
@media (min-width: 1300px) {
  .top.for-office .nav.adm-tabs { gap: 4px; }
  .top.for-office .nav.adm-tabs a { padding: 0 12px; gap: 7px; }
}

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1099px) {
  .doc-cols { grid-template-columns: minmax(0, 1fr); }
  .doc-cols > aside { order: -1; }
  .facts-panel, .sg-side { position: static; }
  .sg-cols { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 899px) {
  .sg-cols { grid-template-columns: minmax(0, 1fr); }
  .sg-side { order: -1; }
  .fl-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  /* six tabs for the office (Admin added): the same row, tighter (design/management/tirages/home_tel_1) */
  .top.for-office .nav.adm-tabs { gap: 1px; }
  .top.for-office .nav.adm-tabs a { padding: 4px 2px; }
  .adm-h1 h1 { font-size: 28px; }
  .adm-title { font-size: 24px; }
  .adm-head .actions { margin-left: auto; }
  .adm-co .seg-b { flex: 1 1 100%; }
  .adm-cards { grid-template-columns: minmax(0, 1fr); }
  .adm-sec > summary { padding: 12px 16px; }
  .adm-sec > p, .adm-sec-body, .adm-sec.ref > .f, .adm-sec.ref > .f-static { padding-left: 16px; padding-right: 16px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .opts.row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rowcard { grid-template-columns: minmax(0, 1fr); padding-left: 36px; }
  .step-b { flex: 1 1 100%; }
  .doc-head-r { justify-content: flex-start; }
  .adm-ph { width: calc(50% - 5px); }
  .pk { min-height: 60px; }
  .pin-dots i { width: 52px; height: 56px; }
  .sg-doc h1 { font-size: 24px; }
  .fl-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .fl-pt-h { display: grid; }
  .step-nav .btn { flex: 1 1 100%; }
}
