/* Signeo — Groupe Suneo */
@font-face { font-family: "Signeo Hand"; src: url("../fonts/caveat.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --navy: #0b1f3a; --navy-2: #13305a; --sun: #f59e0b; --sun-2: #d97706;
  --bg: #f5f6f9; --surface: #ffffff; --line: #e3e7ee; --line-2: #eef1f5;
  --text: #0f172a; --muted: #5b6577; --soft: #8a93a3;
  --blue: #2563eb; --green: #059669; --red: #dc2626; --amber: #b45309;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.05);
  --focus: 0 0 0 3px rgba(245,158,11,.35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--navy-2); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; word-break: break-all; }
.muted { color: var(--muted); } .soft { color: var(--soft); } .small { font-size: .86rem; } .tiny { font-size: .78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Barre supérieure */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 24px; }
.wide .topbar-in { max-width: none; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; }
.brand small { font-weight: 500; color: #9fb0c8; font-size: .78rem; margin-left: 2px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #c7d2e2; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .93rem; }
.nav a:hover, .nav a.on { color: #fff; background: rgba(255,255,255,.08); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: #c7d2e2; }
.userbox form { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sun); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: .85rem; text-decoration: none; }
.linkbtn { background: none; border: 0; color: #c7d2e2; cursor: pointer; font: inherit; padding: 6px 8px; border-radius: 6px; }
.linkbtn:hover { color: #fff; background: rgba(255,255,255,.08); }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card h2 { margin-bottom: .8em; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grid-2, .grid-cols-2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 20px; }

/* Statistiques */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
.stat b { display: block; font-size: 1.7rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .86rem; }
.stat.on { border-color: var(--sun); box-shadow: 0 0 0 1px var(--sun), var(--shadow); }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr 1fr; } }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text); font: 600 .92rem/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #f8fafc; border-color: #cfd6e1; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--navy); }
.btn-sun:hover { background: #fbb024; border-color: #fbb024; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: #fef2f2; border-color: #fecaca; }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 7px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d4dae4; border-radius: 9px; background: #fff; font: inherit; color: var(--text); transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: #b9c2d0; }
input:focus, select:focus, textarea:focus { border-color: var(--sun); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--navy); flex: none; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }
@media (max-width: 640px) { .row { flex-direction: column; gap: 0; } }
.otp-input { font: 600 1.8rem/1 ui-monospace, Menlo, monospace !important; letter-spacing: .45em; text-align: center; padding: 14px !important; }

.dropzone { border: 2px dashed #cdd5e1; border-radius: var(--radius); padding: 30px; text-align: center; background: #fafbfd; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.dropzone:hover, .dropzone.drag { border-color: var(--sun); background: #fffbeb; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; background: var(--navy); display: grid; place-items: center; color: var(--sun); font-weight: 800; }
.dropzone b { display: block; }
.dropzone .file-name { margin-top: 8px; color: var(--green); font-weight: 600; }

.recipient-row { display: grid; grid-template-columns: 28px 1.2fr 1.4fr 170px 36px; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.recipient-row .num { width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--muted); }
@media (max-width: 760px) { .recipient-row { grid-template-columns: 1fr; } .recipient-row .num { display: none; } }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--soft); font-size: 1.2rem; line-height: 1; }
.icon-btn:hover { background: #fef2f2; color: var(--red); }

/* Alertes */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .93rem; border: 1px solid; }
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; padding: 12px 16px; border-radius: 10px; font-size: .9rem; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85rem; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
.row-link { color: var(--text); text-decoration: none; font-weight: 600; }
.row-link:hover { color: var(--navy-2); text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-grey { background: #f1f5f9; color: #475569; } .badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: #ecfdf5; color: #047857; } .badge-red { background: #fef2f2; color: #b91c1c; } .badge-amber { background: #fffbeb; color: #b45309; }

.progress { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.people { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--muted); }
.chip.ok { background: #ecfdf5; color: #047857; }
.chip.ko { background: #fef2f2; color: #b91c1c; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .88rem; font-weight: 600; }
.tabs a.on { background: var(--navy); color: #fff; }
.tabs a:not(.on):hover { background: var(--line-2); }
.toolbar form { margin-left: auto; display: flex; gap: 8px; }
.toolbar input[type=search] { width: 240px; padding: 8px 12px; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .big { font-size: 2.2rem; margin-bottom: 6px; }

/* Destinataires (détail) */
.rcpt { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.rcpt:last-child { border-bottom: 0; }
.rcpt .dot { width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--c, #2563eb); display: grid; place-items: center; font-weight: 700; flex: none; font-size: .85rem; }
.rcpt .info { flex: 1; min-width: 0; }
.rcpt .info b { display: block; }

/* Chronologie */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--sun); }
.timeline b { display: block; font-size: .9rem; font-weight: 600; }
.timeline span { font-size: .8rem; color: var(--muted); }

dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; font-size: .9rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; }

/* Écrans d'authentification */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 85% -10%, rgba(245,158,11,.16), transparent 60%), linear-gradient(180deg, #0b1f3a 0, #0b1f3a 300px, var(--bg) 300px); }
.auth-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px 30px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide-card { max-width: 720px; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; justify-content: center; margin-bottom: 26px; text-decoration: none; }
.auth-brand img { width: 44px; height: 44px; }
.auth-brand b { font-size: 1.5rem; display: block; letter-spacing: -.02em; }
.auth-brand span { color: #9fb0c8; font-size: .85rem; }
.auth-card .card { padding: 30px; }
.auth-foot { text-align: center; font-size: .8rem; color: var(--soft); padding: 18px; }
.auth-foot a { color: var(--muted); }
.secure-line { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; margin-top: 18px; }
.lock { display: inline-block; width: 10px; height: 8px; border: 2px solid currentColor; border-radius: 2px; position: relative; top: 1px; }
.lock::before { content: ""; position: absolute; left: 0; top: -7px; width: 6px; height: 6px; border: 2px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }

/* Préparation et signature */
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 60px); }
.side { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.side h3 { font-size: .95rem; color: var(--text); margin: 0 0 8px; }
.viewer { overflow: auto; padding: 24px; background: #e9ecf2; position: relative; }
.pages { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.page-wrap { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.15); }
.page-wrap canvas { display: block; }
.page-label { position: absolute; top: -1px; right: -1px; transform: translateY(-100%); font-size: .72rem; color: var(--muted); padding: 2px 4px; }
.layer { position: absolute; inset: 0; }
.placing .layer { cursor: crosshair; }
.fld { position: absolute; border: 2px solid var(--c, #2563eb); background: color-mix(in srgb, var(--c, #2563eb) 12%, transparent); border-radius: 4px; font-size: 11px; font-weight: 700; color: var(--c, #2563eb); display: flex; align-items: center; justify-content: center; text-align: center; user-select: none; cursor: move; overflow: hidden; line-height: 1.1; padding: 2px; }
.fld.sel { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.fld .rz { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; background: var(--c); cursor: nwse-resize; border-radius: 3px 0 3px 0; }
.fld .del { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; background: var(--c); color: #fff; border: 0; border-radius: 0 3px 0 4px; font-size: 11px; line-height: 16px; cursor: pointer; padding: 0; display: none; }
.fld.sel .del, .fld:hover .del { display: block; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 10px 8px; cursor: pointer; font: 600 .84rem inherit; font-family: inherit; color: var(--text); text-align: left; display: flex; gap: 8px; align-items: center; }
.tool:hover { border-color: #cbd3df; background: #fafbfd; }
.tool.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.tool i { width: 22px; height: 22px; border-radius: 6px; background: var(--line-2); display: grid; place-items: center; font-style: normal; font-size: .8rem; color: var(--navy); flex: none; }
.tool.on i { background: var(--sun); }
.signer-pick { display: flex; flex-direction: column; gap: 6px; }
.signer-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: .88rem; }
.signer-opt.on { border-color: var(--c); box-shadow: inset 3px 0 0 var(--c); background: color-mix(in srgb, var(--c) 6%, #fff); }
.signer-opt .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.signer-opt small { color: var(--muted); display: block; font-size: .76rem; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.save-state { font-size: .8rem; color: var(--muted); text-align: center; min-height: 1.2em; }
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .viewer { padding: 12px; min-height: 70vh; }
}

/* Champs côté signataire */
.sfld { position: absolute; border: 2px dashed var(--sun-2); background: rgba(245,158,11,.12); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #92400e; cursor: pointer; text-align: center; overflow: hidden; padding: 1px; line-height: 1.1; }
.sfld:hover { background: rgba(245,158,11,.22); }
.sfld.done { border-style: solid; border-color: var(--green); background: rgba(5,150,105,.06); color: var(--green); }
.sfld img { max-width: 100%; max-height: 100%; }
.sfld input { width: 100%; height: 100%; border: 0; background: transparent; font: 12px inherit; padding: 0 4px; border-radius: 0; }
.signbar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; z-index: 20; }
.sign-steps { font-size: .88rem; color: var(--muted); }

/* Modale */
.modal { position: fixed; inset: 0; background: rgba(11,31,58,.55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font: 600 .86rem inherit; font-family: inherit; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pad-wrap { border: 1px solid #d4dae4; border-radius: 12px; background: #fff; position: relative; touch-action: none; }
.pad-wrap canvas { width: 100%; height: 200px; display: block; border-radius: 12px; cursor: crosshair; }
.pad-wrap .baseline { position: absolute; left: 24px; right: 24px; bottom: 46px; border-bottom: 1px dashed #cbd3df; pointer-events: none; }
.pad-wrap .pad-hint { position: absolute; left: 24px; bottom: 18px; font-size: .78rem; color: var(--soft); pointer-events: none; }
.typed-preview { font-family: "Signeo Hand", "Brush Script MT", cursive; font-size: 46px; color: #0b1f3a; text-align: center; padding: 26px 10px; border: 1px solid #d4dae4; border-radius: 12px; min-height: 110px; overflow: hidden; white-space: nowrap; }
.legal-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: .84rem; color: var(--muted); }

.steps { display: flex; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: .75rem; }
.steps li.on { color: var(--text); font-weight: 600; } .steps li.on b { background: var(--navy); color: #fff; }
.steps li.ok b { background: var(--green); color: #fff; }
.steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--line); }

.doc-hero { display: flex; gap: 16px; align-items: center; }
.doc-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--navy); color: var(--sun); display: grid; place-items: center; flex: none; }
.doc-icon .ic { width: 28px; height: 28px; }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: #ecfdf5; color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; font-size: 2rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.ok-t { color: var(--green); font-weight: 700; } .ko-t { color: var(--amber); font-weight: 700; }
.footer { text-align: center; color: var(--soft); font-size: .8rem; padding: 26px 16px; }
.footer a { color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-pages { text-align: center; color: var(--muted); padding: 40px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 720px) {
  .topbar-in { gap: 10px; padding: 0 12px; }
  .nav a { padding: 8px; font-size: .85rem; }
  .brand small, .userbox .uname { display: none; }
  .page { padding: 20px 14px 50px; }
  .toolbar form { margin-left: 0; width: 100%; } .toolbar input[type=search] { width: 100%; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; } dl.kv dd { margin-bottom: 8px; }
}
.spacer { flex: 1; } .center { text-align: center; } .m0 { margin: 0 !important; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px !important; } .mt0 { margin-top: 0; }

/* Icônes SVG */
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; pointer-events: none; }
.tool i .ic { width: 14px; height: 14px; }
.dz-icon .ic { width: 22px; height: 22px; }
.success-mark .ic { width: 32px; height: 32px; }
.empty .big { width: 64px; height: 64px; border-radius: 18px; background: #fff7e6; color: var(--sun-2); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .big .ic { width: 30px; height: 30px; }
.steps li b .ic { width: 12px; height: 12px; }
.icon-btn { display: inline-grid; place-items: center; }
.icon-btn .ic { width: 18px; height: 18px; }
.fld .del { display: none; place-items: center; }
.fld.sel .del, .fld:hover .del { display: grid; }
.fld .del .ic { width: 11px; height: 11px; }
.secure-line .ic, .userbox .ic { width: 14px; height: 14px; }

/* ===== Calibrage des boutons ===== */
.btn { min-height: 40px; padding: 8px 16px; font-size: .9rem; line-height: 1.2; border-radius: 10px; gap: 8px; }
.btn-sm { min-height: 32px; padding: 6px 12px; font-size: .82rem; border-radius: 8px; gap: 6px; }
.btn-lg { min-height: 46px; padding: 10px 22px; font-size: .96rem; }
.btn-block { white-space: normal; text-align: center; }
.btn .ic { width: 16px; height: 16px; }
.btn-sm .ic { width: 14px; height: 14px; }
.page-head { align-items: center; }
.page-head .actions { gap: 8px; }
.actions .inline { display: inline-flex; }

/* ===== En-tête ===== */
.topbar-in { gap: 18px; }
.nav { gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; font-weight: 500; }
.nav a .ic { width: 18px; height: 18px; opacity: .85; }
.nav a.on .ic { color: var(--sun); opacity: 1; }
.userbox { gap: 6px; }
.account-link { display: inline-flex; align-items: center; gap: 10px; color: #dbe3ee; text-decoration: none; padding: 4px 10px 4px 4px; border-radius: 99px; }
.account-link:hover, .account-link.on { background: rgba(255,255,255,.08); color: #fff; }
.account-link .avatar { width: 32px; height: 32px; }
.linkbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: 9px; }
.linkbtn .ic { width: 18px; height: 18px; }

/* ===== Tablette ===== */
@media (max-width: 1100px) {
  .lb-text, .uname { display: none; }
  .account-link { padding: 4px; }
  .nav a { padding: 8px 10px; }
}

/* ===== Mobile et tablette portrait : barre d'onglets en bas ===== */
@media (max-width: 820px) {
  .topbar-in { height: 56px; padding: 0 14px; }
  .brand img { width: 30px; height: 30px; }
  .userbox { margin-left: auto; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--navy); border-top: 1px solid rgba(255,255,255,.08);
         display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .nav a { flex-direction: column; gap: 4px; padding: 6px 4px; font-size: .74rem; text-align: center; justify-content: center; border-radius: 10px; }
  .nav a .ic { width: 22px; height: 22px; }
  .nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  body.has-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .workspace { height: auto; }
  .footer { padding-bottom: 20px; }
}

/* ===== Mobile ===== */
@media (max-width: 720px) {
  .page { padding: 18px 14px 40px; }
  h1 { font-size: 1.35rem; }
  .page-head { gap: 12px; }
  .page-head > div:first-child { flex: 1 1 100%; }
  .page-head .actions { width: 100%; }
  .page-head .actions > .btn, .page-head .actions > form { flex: 1 1 auto; }
  .page-head .actions > form .btn { width: 100%; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 1.4rem; }
  .card-pad { padding: 18px; }
  .toolbar { padding: 12px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; }
  /* Tableaux en cartes */
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { padding: 4px 0; border: 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; text-align: right; }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; text-align: left; flex: none; }
  .table-wrap td:first-child { display: block; text-align: left; padding-bottom: 8px; }
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td .actions { justify-content: flex-end; }
  .table-wrap td .people { justify-content: flex-end; }
  .auth-wrap { padding: 28px 14px 20px; }
  .auth-card .card { padding: 22px; }
  .modal { padding: 0; place-items: end center; }
  .modal-box { border-radius: 18px 18px 0 0; max-height: 94vh; }
  .modal-foot .btn { flex: 1 1 auto; }
  .typed-preview { font-size: 36px; }
  .rcpt { flex-wrap: wrap; }
  .rcpt .actions { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .doc-hero { align-items: flex-start; }
}

/* Espaces de travail sur petit écran */
@media (max-width: 860px) {
  #signing .viewer { order: -1; }
  #signing .side { border-bottom: 0; border-top: 1px solid var(--line); }
  .side { padding: 16px; gap: 14px; }
  .signer-pick { flex-direction: row; overflow-x: auto; }
  .signer-opt { flex: none; }
  .fld { touch-action: none; }
}

.nav .short { display: none; }
@media (max-width: 480px) { .nav .full { display: none; } .nav .short { display: inline; } }
@media (max-width: 720px) { .page-head .actions > .btn { flex: 1 1 0; min-width: 0; } }

/* Barre d'action fixe du signataire (mobile) */
.mobile-signbar { display: none; }
@media (max-width: 860px) {
  .mobile-signbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(15,23,42,.08); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 12px; font-size: .88rem; color: var(--muted); }
  .mobile-signbar .btn { flex: none; }
  #signing { padding-bottom: 76px; }
}
@media (max-width: 1000px) and (min-width: 821px) { .nav .full { display: none; } .nav .short { display: inline; } }
.list-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; min-height: 180px; }
.count-line { font-size: .86rem; color: var(--muted); margin-top: 6px; }
.count-line b { color: var(--text); }
.send-progress { display: flex; align-items: center; gap: 14px; }
.send-progress .progress { width: 100%; height: 8px; }
.progress.big { width: 100%; height: 8px; display: block; }
@media (max-width: 900px) { .grid-2, .grid-cols-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .page-head .actions .btn { white-space: normal; text-align: center; } html, body { overflow-x: hidden; } }
