/* =====================================================================
   app.css — compléments propres à l'application (le reste est repris
   tel quel de la maquette : fonts, style, components, responsive).
   ===================================================================== */

/* Lien d'évitement (clavier) */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.skip-link:focus { left: 8px; }
.page-wrap:focus { outline: none; }

/* Entrée de menu pas encore livrée : visible mais inactive */
.nav-link.is-soon { opacity: .55; cursor: default; }
.nav-link.is-soon:hover { background: transparent; color: var(--side-text); }
.nav-link.is-soon .nav-tag { text-transform: none; }

/* Badge d'environnement (LOCAL / RECETTE) — jamais affiché en production */
.env-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .05em; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-3); cursor: help; }
.env-badge.env-recette { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

/* Bouton thème : l'icône suit le thème sans JavaScript */
.theme-ic { display: inline-flex; }
.theme-ic-sun, :root[data-theme="dark"] .theme-ic-moon { display: none; }
:root[data-theme="dark"] .theme-ic-sun { display: inline-flex; }

/* États vides et pages d'erreur */
.empty-title { font-size: 17px; margin: 4px 0 6px; color: var(--text); }
.empty p { max-width: 620px; margin: 6px auto; line-height: 1.55; }
.error-code { font-size: 40px; font-weight: 750; color: var(--text-2); margin: 0; letter-spacing: -.02em; }
.trace { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; max-height: 360px; }

/* Avancement par lots */
.lot-list { list-style: none; margin: 0; padding: 6px 16px 14px; }
.lot-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.lot-list li:last-child { border-bottom: 0; }
.lot-list li > span:nth-child(2) { flex: 1; min-width: 0; }
.lot-list b { display: block; font-weight: 600; }
.lot-list small { display: block; color: var(--muted); font-size: 12px; }
.lot-num { flex: none; width: 34px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-3); }
.lot-list li.done .lot-num { color: var(--good); background: var(--good-soft); }
.side-brand, .side-brand:hover { text-decoration: none; }

/* Utilisateur connecté (barre du haut) */
.top-user { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: default; }
.top-logout { display: inline-flex; margin: 0; }

/* Pages sans menu (connexion, erreurs hors session) */
body.guest { background: var(--bg); min-height: 100vh; }
.guest-wrap { max-width: 420px; margin: 0 auto; padding: 8vh 16px 40px; display: flex; flex-direction: column; gap: 18px; }
.guest-wrap > .card:not(.guest-card) { max-width: none; }
.guest-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
.guest-brand img { width: 36px; height: 36px; }
.guest-brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.guest-brand .env-badge { margin-left: auto; }
.guest-title { font-size: 20px; margin: 0 0 14px; }
.guest-card .info-strip { margin-bottom: 12px; }
.guest-submit { width: 100%; justify-content: center; height: 40px; margin-top: 4px; }

/* Double authentification */
.guest-wrap:has(.guest-wide) { max-width: 520px; }
.guest-lead { margin: -6px 0 14px; line-height: 1.5; }
.otp-input { font-size: 20px; letter-spacing: .3em; text-align: center; height: 46px; font-variant-numeric: tabular-nums; }
.guest-help { margin-top: 14px; font-size: 12.5px; color: var(--text-2); }
.guest-help summary, .mfa-steps summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.mfa-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 16px; }
.mfa-steps li { line-height: 1.5; }
.qr-box { width: 200px; height: 200px; margin: 10px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.mfa-key { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; word-break: break-all; }
.recovery-codes { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.recovery-codes code { display: block; text-align: center; font-family: var(--mono); font-size: 14px; letter-spacing: .08em; padding: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.mb { margin-bottom: 12px; }
.otp-small { width: 140px; height: 36px; font-size: 16px; }
.small { font-size: 12px; }
h3 { font-size: 14px; margin: 0 0 4px; }
a.top-user { text-decoration: none; cursor: pointer; }
a.top-user:hover { color: var(--text); background: var(--border); }
.warn-strip { background: var(--warn-soft); border-bottom-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.warn-strip .ic { color: var(--warn); }
.recovery-input { width: 170px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }

/* Connexion Amazon (lot 1.5) */
.nowrap { white-space: nowrap; }
.btn.is-busy { opacity: .7; cursor: progress; }
.page-head .row { align-items: center; gap: 8px; }
.kv.kv-wide { grid-template-columns: minmax(130px, max-content) minmax(0, 1fr); }
.kv.kv-wide dd { text-align: left; white-space: normal; overflow-wrap: anywhere; }

/* Synchronisation (lot 1.6) */
.kpi-mini { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi-mini b { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.right { text-align: right; }
.block { display: block; }
form.inline { display: inline-flex; margin: 0; }
.pad { padding: 12px 16px; margin: 0; }
tr.is-off td { opacity: .6; }
.card > .tabs { padding: 0 12px; }

/* Stock FBA (lot 1.8) */
.mp-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mp-tab { display: inline-flex; flex-direction: column; align-items: flex-start; min-width: 74px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none; line-height: 1.2; }
.mp-tab b { font-size: 13px; color: var(--text); }
.mp-tab small { font-size: 11px; color: var(--muted); }
.mp-tab:hover { border-color: var(--primary); }
.mp-tab.on { border-color: var(--primary); background: var(--primary-soft, var(--surface-3)); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot th { border-top: 2px solid var(--border); }
.input.sm { height: 30px; font-size: 13px; }
td.warn, b.warn { color: var(--warn); }

/* Installation (lot 1.9) */
.install-checks { list-style: none; padding: 0; margin: 6px 0 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.install-checks li { display: flex; gap: 8px; align-items: flex-start; }
.install-checks li.good .ic { color: var(--good); }
.install-checks li.warn .ic { color: var(--warn); }
.install-checks li.crit .ic { color: var(--crit); }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tbl tbody tr.sel { background: var(--primary-soft); }
