/* ============================================================================
   VOX — Harmonisation layer
   Load this AFTER app.css (one <link> in base.html). It re-skins the app to the
   cleaned design system WITHOUT touching the 3 700-line app.css:
     · refined amber / ink / warm-stone palette (overrides the :root vars)
     · two-font system — Barlow body, Oswald display
     · lighter shadows (heavy 0 4px 12px /.15 → real elevation only)
     · calmer inputs (weight moves from a 3px resting border to the focus ring)
     · Lucide icon sizing (replaces the emoji glyphs)
   To roll back: remove the <link>. Nothing else changes.
   ============================================================================ */

/* ---- Fonts: add Barlow (Oswald already imported by app.css) -------------- */
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ---- Global type up-scale +20% (app.css uses rem everywhere) ------------- */
html { font-size: 19.2px; }

/* ---- Compact bubbles: counter the +20% text growth and trim 20% on top --- */
.quote-card { position: relative; padding: 6px 120px 6px 16px; }
.quote-card__header { margin-bottom: 0; }
.quote-card__client { margin-bottom: 2px; }
.quote-card__actions {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
.line-item  { padding: 4px 14px; }
.catalog-item__view { padding: 0.3rem 0.75rem; }
.card       { padding: 6px 16px; }
.card__content { padding: 2px 0; gap: 4px; }

/* ---- Palette override (same variable names app.css already uses) --------- */
:root {
  --color-bg:           #DBD3C1;   /* cleaned warm canvas (was #C9BDA3) */
  --color-header:       #16160F;   /* ink (was #1a1a1a) */
  --color-header-text:  #D9A227;   /* amber-400 */
  --color-accent:       #C9971D;   /* refined amber (was #D4A017) */
  --color-accent-light: #FBF3DA;
  --color-success:      #2E7D52;
  --color-danger:       #C42E2E;
  --color-text:         #211F18;
  --color-text-muted:   #6E6552;
  --color-white:        #fff;
  --color-card-bg:      #ffffff;
  --color-border:       #DED6C6;
  --radius:             6px;        /* was 3px — a touch softer, still industrial */

  --font-main:  'Oswald', 'Arial Narrow', Arial, sans-serif;  /* display */
  --font-body:  'Barlow', system-ui, -apple-system, sans-serif; /* body */

  /* one shared, lighter elevation token */
  --shadow-card: 0 1px 3px rgba(31, 28, 18, 0.08), 0 1px 2px rgba(31, 28, 18, 0.04);
  --shadow-float: 0 8px 24px rgba(31, 28, 18, 0.14);
}

/* ---- Two-font system ----------------------------------------------------- */
/* Body / running text → Barlow. Titles, labels, buttons, badges keep Oswald
   because app.css sets them to var(--font-main) explicitly. */
body { font-family: var(--font-body); letter-spacing: 0; }

/* Form values read better in Barlow than condensed Oswald */
.form-input, .input, .search-bar, .search-bar__input,
.line-item__fields input, .email-row__input, .email-row .form-input,
.catalog-form__row input, .catalog-form__row select,
.catalog-item__edit-fields input, .catalog-item__edit-fields select {
  font-family: var(--font-body);
}

/* ---- Size harmonisation (tame the ad-hoc rem values) --------------------- */
.section-title, .section__title { font-size: 1.25rem; letter-spacing: .04em; }
.line-item__title  { font-size: 1.0625rem; }
.line-item__fields input { font-size: 1.0625rem; font-weight: 600; }
.line-item__total  { font-size: 1.25rem; }
.line-item__fields label, .line-item__total-cell label { font-size: .75rem; }
.quote-header__main h1 { font-size: 1.0625rem; }

/* ---- Lighter shadows: replace the blanket 0 4px 12px /.15 ----------------- */
.card, .tile, .voice-box, .quote-card, .quote-header, .table, .totals,
.line-item, .email-row, .note-box, .search-bar, .search-bar__input,
.btn--primary, .btn--danger, .btn--outline, .form-input, .input,
.generating-overlay, .product-card, .dropzone {
  box-shadow: var(--shadow-card);
}
.login-card { box-shadow: var(--shadow-float); }
.totals__row, .table td { box-shadow: none; }

/* ---- Cards: hairline border instead of full-amber outline ---------------- */
.card { border: 1px solid var(--color-border); border-radius: 10px; }
.card--bordered-top { border-top: 3px solid var(--color-accent); }
.quote-card { border: 1px solid var(--color-border); border-radius: 10px; }
.tile { border: 1px solid var(--color-border); border-top: 4px solid var(--color-accent); border-radius: 10px; }
.section-title, .section__title { border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent); border-radius: 8px; }

/* ---- Calmer inputs: quiet at rest, amber ring on focus ------------------- */
.form-input, .input, .search-bar, .search-bar__input,
.line-item__fields input, .email-row__input {
  border: 1.5px solid var(--color-border);
}
.form-input:focus, .input:focus, .search-bar:focus, .search-bar__input:focus,
.line-item__fields input:focus, .email-row__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 151, 29, 0.18);
  background: #fff;
}
.line-item__fields input { background: #F7F4EE; }

/* ---- Buttons: press = 1px nudge (was opacity .8) ------------------------- */
.btn { transition: background .14s ease, border-color .14s ease, transform .06s ease; }
.btn:active { opacity: 1; transform: translateY(1px); }
.btn--primary:hover { background: #A87C14; border-color: #A87C14; color: #fff; }
.btn--dark:hover { background: #2C2A20; }

/* ---- Badges: align to the semantic palette ------------------------------ */
.badge--sent { background: #E2ECF6; border-color: #2F6DB0; color: #2F6DB0; }
.badge--signed, .badge--paid { background: #F3E5F5; border-color: #6A1B9A; color: #6A1B9A; }
.badge--accepted, .badge--validated { background: #E2F0E6; border-color: #2E7D52; color: #2E7D52; }
.badge--rejected { background: #F7E2E0; border-color: #C42E2E; color: #C42E2E; }
.badge--draft { background: #E9E3D6; border-color: #C9BFA9; color: #6E6552; }

/* ---- Totals: amber highlight (was lemon #FFFACD) ------------------------- */
.totals__row--total { background: #FBF3DA; }

/* ---- Tile / card emoji glyphs are gone — neutralise leftover sizing ------ */
.tile__icon, .card__icon, .dropzone__icon { font-size: 0; }

/* ============================================================================
   LUCIDE icons — sizing for the <i data-lucide> elements that replace emoji.
   Lucide swaps <i data-lucide="x"> for an <svg class="lucide">.
   ============================================================================ */
.lucide, [data-lucide] { stroke-width: 2; vertical-align: middle; }

/* sidebar */
.sidebar__icon { display: inline-flex; align-items: center; justify-content: center; }
.sidebar__icon .lucide, .sidebar__icon svg { width: 19px; height: 19px; }

/* dashboard tiles */
.tile__icon { display: inline-flex; align-items: center; justify-content: center; }
.tile__icon .lucide, .tile__icon svg { width: 30px; height: 30px; color: var(--color-accent); }

/* generic card icon */
.card__icon { display: inline-flex; }
.card__icon .lucide, .card__icon svg { width: 26px; height: 26px; color: var(--color-accent); }

/* voice box mic — green circle, white glyph (red while recording via app.css) */
.voice-box__icon-wrap .lucide, .voice-box__icon-wrap svg { width: 26px; height: 26px; color: #fff; }
.voice-box--recording .voice-box__icon-wrap .lucide,
.voice-box--recording .voice-box__icon-wrap svg { color: #fff; }
/* the old emoji used an inner amber chip; remove it once it's a Lucide icon */
.voice-box__icon { background: transparent; padding: 0; font-size: 0; }

/* dropzone upload glyph */
.dropzone__icon { display: inline-flex; }
.dropzone__icon .lucide, .dropzone__icon svg { width: 30px; height: 30px; color: var(--color-accent); }

/* ---- Dashboard (voice-cta / mini-stats / priorities) -------------------- */
.voice-cta__mic { display: inline-flex; align-items: center; justify-content: center; font-size: 0; }
/* Micro en encre noire pour trancher avec la pastille amber. */
.voice-cta__mic .lucide, .voice-cta__mic svg { width: 26px; height: 26px; color: var(--color-header); }
/* Variante "slim" : bandeau plus fin (chip retire). */
.voice-cta--slim { padding-top: 10px; padding-bottom: 10px; }
.voice-cta--slim .voice-cta__mic { width: 44px; height: 44px; }
.mini__icon { display: inline-flex; align-items: center; justify-content: center; font-size: 0; }
.mini__icon .lucide, .mini__icon svg { width: 22px; height: 22px; color: var(--color-accent); }
.prio__icon { display: inline-flex; align-items: center; justify-content: center; }
.prio__icon .lucide, .prio__icon svg { width: 18px; height: 18px; }

/* ============================================================================
   DASHBOARD SURFACES — clean up shadows, semantic colors & ink sidebar states
   ============================================================================ */

/* Lighter, consistent elevation (was 0 4px 14px /.2, 0 6px 16px /.18 …) */
.voice-cta { background: linear-gradient(135deg, #16160F 0%, #2C2A20 100%); box-shadow: var(--shadow-card); }
.voice-cta:hover { box-shadow: var(--shadow-float); }
.mini { box-shadow: var(--shadow-card); }
.mini:hover { box-shadow: var(--shadow-float); border-color: var(--color-accent); }
.prio { box-shadow: var(--shadow-card); }
.prio:hover { box-shadow: var(--shadow-float); }
.panel { box-shadow: var(--shadow-card); border: 1px solid var(--color-border); border-radius: 10px; }

/* Priorities: align the warn/info accents to the VOX semantic palette */
.prio--warn { border-top-color: var(--color-accent); }
.prio--info { border-top-color: #2F6DB0; }
.prio--urgent .prio__icon { background: #F7E2E0; color: var(--color-danger); }
.prio--warn   .prio__icon { background: #FBF1D4; color: #B5731A; }
.prio--info   .prio__icon { background: #E2ECF6; color: #2F6DB0; }

/* Sidebar states → ink palette (was #222 / #888 / #aaa) */
.sidebar__section { color: #837A63; }
.sidebar__item:hover { background: #2C2A20; color: #fff; }
.sidebar__item--active { background: #1F1E16; color: var(--color-header-text); }
.sidebar__item--logout { color: #9A917B; }

/* ============================================================================
   TYPE HARMONISATION — snap the ad-hoc rem sizes onto one consistent scale.
   The app's generous (touch-friendly) sizing is kept; only the *inconsistency*
   is removed (was 0.98 / 1.09 / 1.19 / 1.26 / 1.47 / 1.54rem …).
     label  0.8rem · meta 0.9rem · body 1rem · subtitle 1.125rem
     cta-title 1.25rem · value 1.5rem · count 2.5rem
   ============================================================================ */
.sidebar__section { font-size: 0.78rem; letter-spacing: .1em; }
.sidebar__item { font-size: 0.95rem; }
.voice-cta__title { font-size: 1.25rem; letter-spacing: .04em; }
.mini__label { font-size: 0.8rem; letter-spacing: .04em; }
.mini__value { font-size: 1.5rem; }
.prio__label { font-size: 0.96rem; letter-spacing: .04em; }
.prio__count { font-size: 2rem; }
.prio { padding-top: 12px; padding-bottom: 12px; }

/* Trait amber 2px en bas de toutes les cartes du design system.
   Donne un soulignement chaud coherent (devis, factures, dashboard, account...). */
.quote-card,
.card,
.tile,
.mini,
.prio,
.panel,
.product-card,
.catalog-item__view {
  border-bottom: 2px solid var(--color-accent);
}

/* Centrage vertical net pour TOUTES les pastilles/badges du site.
   Tout texte dans une pill / chip / tag / badge doit etre centre verticalement.
   Convention : si tu ajoutes une nouvelle classe arrondie pour afficher un
   label court (statut, unite, count...), ajoute-la a cette liste OU utilise
   directement la classe utilitaire `.pill` definie plus bas. */
.badge,
.catalog-item__unit-pill,
.admin-superadmin-tag,
.beta-banner__pill,
.card__badge,
.invoice-status-badge,
.line-item__tag,
.ob-sample-card__tag,
.quote-header__badge,
.quote-status-badge,
.result-badge,
.sidebar__badge,
.sync-badge,
.unsaved-badge,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Le tag "LIGNE LIBRE" est un flex : sans gap, les espaces entre le texte,
   les liens et les separateurs disparaissent. On retablit l'espacement. */
.line-item__tag { gap: 0.35rem; flex-wrap: wrap; justify-content: flex-start; }
.prio__desc { font-size: 0.9rem; }
.prio__action { font-size: 0.8rem; letter-spacing: .04em; }
.panel__title { font-size: 1.125rem; letter-spacing: .04em; }
.panel__link { font-size: 0.8rem; }
.panel__empty { font-size: 0.95rem; }
.quote-row__title { font-size: 0.95rem; }
.quote-row__meta { font-size: 0.8rem; }
.quote-row__amount { font-size: 1rem; }

/* ============================================================================
   ADMIN / FEEDBACK / IMPERSONATION / BETA — composants ajoutes pour la phase
   beta-testeurs (admin platform, modal feedback, banniere d'impersonation).
   ============================================================================ */

/* ---- Banniere d'impersonation (rouge, sticky top) ---- */
.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-danger);
  color: #fff;
  padding: 8px 16px;
  box-shadow: 0 2px 6px rgba(196, 46, 46, 0.4);
  margin: -16px -16px 16px;
}
.impersonation-banner__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.92rem;
}
.impersonation-banner strong { font-weight: 600; }
.impersonation-banner__quit {
  background: #fff;
  color: var(--color-danger);
  border: 1px solid #fff;
  padding: 4px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  font-family: var(--font-main);
  margin-left: auto;
}
.impersonation-banner__quit:hover { background: #FBE7E5; }

/* ---- Banniere BETA (au-dessus du dashboard artisan) ---- */
.beta-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-accent-light);
  border: 1px solid #E8D49A;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.beta-banner__pill {
  background: var(--color-accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-family: var(--font-main);
}
.beta-banner__text { flex: 1; color: var(--color-text); }
.beta-banner__cta {
  background: var(--color-header);
  color: #fff;
  border: none;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-main);
}
.beta-banner__cta:hover { background: #2C2A20; }

/* ---- Bouton flottant feedback (FAB bottom-right) ---- */
@keyframes feedback-fab-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: var(--color-header);
  color: var(--color-header-text);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(31, 28, 18, 0.18);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  animation: feedback-fab-float 3.5s ease-in-out infinite;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.feedback-fab:hover {
  background: #2C2A20;
  box-shadow: 0 12px 28px rgba(31, 28, 18, 0.26);
  animation-play-state: paused;
}
.feedback-fab:active { box-shadow: 0 6px 16px rgba(31, 28, 18, 0.18); }
.feedback-fab .lucide, .feedback-fab svg {
  width: 24px; height: 24px; color: var(--color-header-text);
}

/* Accessibilite : respecter le souhait de mouvement reduit */
@media (prefers-reduced-motion: reduce) {
  .feedback-fab { animation: none; }
}

/* ---- Modal feedback (<dialog>) ---- */
.feedback-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 32px);
  background: var(--color-card-bg);
  box-shadow: var(--shadow-float);
}
.feedback-modal::backdrop { background: rgba(22, 22, 15, 0.5); }
.feedback-modal form { padding: 20px 22px; }
.feedback-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.feedback-modal__header h2 {
  font-family: var(--font-main);
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.2;
}
.feedback-modal__close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0 4px;
  line-height: 1;
}
.feedback-types {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.feedback-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
}
.feedback-type input { margin: 0; }
.feedback-type:has(input:checked) {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}
.feedback-modal__thanks {
  text-align: center;
  padding: 16px 4px;
}
.feedback-modal__thanks h2 {
  font-family: var(--font-main);
  margin-bottom: 8px;
}
.feedback-modal__thanks p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

