/* Lot 2 de l'audit du 18/10 : états de chargement, aides sous les champs, compteur, notifications, modèles. */

/* BUG-14 : tant que la session n'est pas lue, un écran de chargement couvre la page (pas de flash du mode invité).
   Si le script ne démarre pas, l'écran s'efface seul après 9 s. */
.app-skeleton { display: none; }
body.app-booting main { position: relative; min-height: 70vh; }
body.app-booting .app-skeleton { display: flex; flex-direction: column; gap: 14px; position: absolute; inset: 0; z-index: 30; padding: 34px clamp(16px, 4vw, 40px); background: var(--paper, #F4F2E9); animation: nv-skeleton-out 0s linear 9s forwards; }
body.app-booting .prototype { visibility: hidden; }
.app-skeleton-line { display: block; height: 18px; width: 70%; border-radius: 9px; background: #E4E0CF; animation: nv-pulse 1.2s ease-in-out infinite; }
.app-skeleton-line.is-title { height: 34px; width: 46%; }
.app-skeleton-line.is-short { width: 38%; }
.app-skeleton-block { display: block; height: 220px; border-radius: 16px; background: #EAE7D8; animation: nv-pulse 1.2s ease-in-out infinite; }
.app-skeleton p { margin: 6px 0 0; color: #56675E; font-weight: 650; }
@keyframes nv-pulse { 50% { opacity: .55; } }
@keyframes nv-skeleton-out { to { opacity: 0; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { .app-skeleton-line, .app-skeleton-block { animation: none; } }

/* Enregistrement du profil : état visible sous le bouton */
.company-save-status { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-weight: 650; font-size: 14px; background: #EDF7D0; color: #102D24; }
.company-save-status[data-kind="busy"] { background: #F1EFE3; color: #33493F; }
.company-save-status[data-kind="error"] { background: #FAE7DE; color: #A9401D; }
.company-save-status.is-dirty { background: #FFF3D6; color: #5C4410; margin: 0 0 12px; }
.proposal-hint { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #FFF3D6; border: 1px solid #C9A13A; color: #5C4410; font-weight: 600; font-size: 14px; }

/* Valeurs de départ « à vérifier » (M-3), cadence expliquée (BUG-24), modèles (BUG-25 / M-2) */
.assumed-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #FFF3D6; border: 1px solid #C9A13A; color: #5C4410; font-size: 11.5px; font-weight: 750; letter-spacing: .01em; vertical-align: 1px; }
.assumed-tag[hidden] { display: none; }
.assumed-tag[data-kind="profile"] { background: #EDF7D0; border-color: #8FB43F; color: #1F4A2A; }
.rate-why { display: block; margin-top: 4px; color: #56675E; font-size: 12px; font-weight: 500; line-height: 1.35; }
.template-picker { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-weight: 650; }
.template-picker select { min-height: 46px; max-width: 420px; }
.template-picker small { font-weight: 500; color: #56675E; }
.usual-block { margin-top: 18px; }
.qc-pending { opacity: .7; }
.qc-pending-note { display: block; margin-top: 4px; font-size: 12px; font-style: italic; }
.usual-note { margin: 0 0 12px; font-size: 13px; color: #56675E; }

/* Centre de notifications des devis (S-5) */
.unread-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: #A9401D; color: #FFF; font-size: 11px; font-weight: 800; line-height: 1; }
.unread-dot[hidden] { display: none; }
.notif-panel { margin: 0 0 18px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 8px; }
.notif-head h2 { margin: 0; font-size: 17px; }
.notif-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.notif-item { display: grid; grid-template-columns: 24px 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px 6px; border-radius: 8px; font-size: 14px; }
.notif-item.is-unread { background: #EDF7D0; font-weight: 650; }
.notif-icon { text-align: center; }
.notif-time { color: #56675E; font-size: 12.5px; white-space: nowrap; }
.notif-new { padding: 1px 7px; border-radius: 999px; background: #102D24; color: #CFF57F; font-size: 11px; font-weight: 800; }
.notif-open { font-size: 13px; }
@media (max-width: 600px) { .notif-item { grid-template-columns: 24px 1fr auto; } .notif-time { grid-column: 2; } .notif-open { grid-column: 3; grid-row: 1; } }

/* Aperçu du devis sans compte : filigrane « APERÇU » (BUG-07), aussi à l'impression */
.is-watermarked .proposal-paper { position: relative; }
@media screen { .is-watermarked .proposal-paper { overflow: hidden; } }
.is-watermarked .proposal-paper::after { content: "APERÇU"; position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(44px, 12vw, 104px); font-weight: 900; letter-spacing: .06em; white-space: nowrap; color: rgba(169, 64, 29, .16); transform: rotate(-28deg); pointer-events: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.proposal-hint div + div { margin-top: 6px; }
.proposal-hint .text-button { font-weight: 800; text-decoration: underline; }
.qr-actions #qc-preview { order: 1; }

/* Options au choix dans le devis (M-8) */
.options-block { margin: 18px 0 0; padding: 14px 16px 12px; border: 1.5px solid var(--line, #E4E0D1); border-radius: 12px; min-width: 0; }
.options-block legend { padding: 0 6px; font-size: 15px; font-weight: 800; }
.options-help { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: #56675E; }
.option-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 150px) 36px; gap: 8px; align-items: end; margin: 0 0 10px; }
.option-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 650; min-width: 0; }
.option-row input { width: 100%; min-height: 44px; padding: 8px 10px; font-size: 15px; }
.option-row .input-unit { display: flex; align-items: center; gap: 6px; }
.options-error { margin: 4px 0 8px; padding: 8px 10px; border-radius: 8px; background: #FAE7DE; color: #A9401D; font-size: 13px; font-weight: 600; }
.options-foot { display: flex; align-items: center; gap: 12px; }
.options-foot small { color: #56675E; }
.quote-options { display: block; margin-top: 4px; font-size: 13px; color: #33493F; }
@media (max-width: 600px) { .option-row { grid-template-columns: minmax(0, 1fr) 36px; } .option-row .option-price { grid-column: 1; } .option-row .remove-option { grid-column: 2; grid-row: 1; align-self: start; margin-top: 20px; } }

/* Alertes de révision tarifaire (M-8) dans le centre de notifications */
.notif-revision .notif-text { font-weight: 600; }
.notif-actions { display: flex; flex-wrap: wrap; gap: 2px 14px; grid-column: 2 / -1; }
.notif-primary { font-weight: 800; text-decoration: underline; }
.notif-revision.is-unread .notif-text { font-weight: 700; }

/* Quote follow-up: existing paper, ink and Archivo hierarchy. */
.quote-status-declined,.ss-status.quote-status-declined { white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;max-width:100%; }
.notif-text { min-width:0;overflow-wrap:anywhere; }
.quote-followup,.quote-history { margin-top:8px;font-size:13px;line-height:1.5;overflow-wrap:anywhere; }
.quote-followup p,.quote-history p { margin:4px 0; }
.quote-followup button { margin:4px 16px 4px 0;min-height:44px; }
.quote-history summary { cursor:pointer;min-height:32px;font-weight:650; }
.home-declined { margin-top:24px;padding:16px;border:1px solid var(--line);border-radius:12px; }
.home-declined h2 { font-size:18px;margin:0 0 12px; }
.home-declined p { margin:8px 0;overflow-wrap:anywhere; }
.vat-onboarding { margin:0 0 16px;padding:16px;border:1px solid var(--line);border-radius:12px;line-height:1.5; }
.vat-onboarding p { margin:0 0 8px; }
.vat-onboarding a,.vat-onboarding button { display:inline-block;margin-right:16px;min-height:44px; }

/* Native client choice stays within the dialog on narrow screens. */
.app-ui .send-field select{width:100%;max-width:100%;min-width:0;padding:11px 13px;border:1.5px solid var(--line);border-radius:10px;background:var(--field);font:inherit;}
#restored-draft-note{margin-top:12px;}
