/* =====================================================================
   Orova — portail client. Design system (tokens) + composants + pages.
   Thème clair. Contrastes AA : le texte orange/vert/rouge utilise les
   variantes « -ink » ; l'orange plein sert de fond (texte encre dessus).
   ===================================================================== */

:root {
  /* Marque */
  --ink: #0C1116;
  --ink-2: #1B232B;
  --ink-3: #2A333C;
  --cream: #F4F1EA;
  --cream-2: #ECE7DC;
  --orange: #FF6B2C;
  --orange-hover: #FF8250;
  --orange-ink: #B23F0C;      /* texte orange sur fond clair (5,2:1) */
  --orange-soft: #FFE9DE;
  --green: #1F9D55;
  --green-ink: #13703B;
  --green-soft: #E2F3E8;
  --red: #E5484D;
  --red-ink: #B4232A;
  --red-soft: #FDE8E8;

  /* Surfaces & texte */
  --bg: var(--cream);
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --border: #E3DDD0;
  --border-strong: #CFC7B6;
  --text: var(--ink);
  --text-2: #4A535C;          /* secondaire, 7:1 sur blanc */
  --text-3: #6A727A;          /* tertiaire, 4,8:1 sur blanc */
  --focus: #FF6B2C;

  /* Paires de statut (fond / texte) */
  --t-neutral-bg: #EFEBE2; --t-neutral: #4A4F55;
  --t-blue-bg: #E3ECF8;    --t-blue: #1D4F86;
  --t-amber-bg: #FFF1CC;   --t-amber: #7A5000;
  --t-orange-bg: #FFE9DE;  --t-orange: #A13A0B;
  --t-green-bg: #E2F3E8;   --t-green: #13703B;
  --t-red-bg: #FDE8E8;     --t-red: #B4232A;
  --t-violet-bg: #EEE8FB;  --t-violet: #5B34B0;
  --t-ink-bg: var(--ink);  --t-ink: #FFFFFF;

  /* Typo */
  --font-title: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-text: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fs-xs: 12px; --fs-sm: 13.5px; --fs-md: 15px; --fs-lg: 17px;

  /* Formes */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(12,17,22,.05), 0 1px 1px rgba(12,17,22,.03);
  --shadow-2: 0 8px 24px -8px rgba(12,17,22,.18), 0 2px 6px rgba(12,17,22,.06);
  --shadow-3: 0 24px 60px -12px rgba(12,17,22,.35);

  /* Mise en page */
  --sidebar-w: 256px;
  --content-max: 1160px;
  --gutter: 40px;
  --topbar-h: 60px;
  --bottomnav-h: 66px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-md)/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.emoji { line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.h1 { font: 800 34px/1.08 var(--font-title); letter-spacing: -0.02em; }
.h2 { font: 700 18px/1.3 var(--font-title); letter-spacing: -0.01em; }
.h3 { font: 600 15px/1.35 var(--font-text); }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.eyebrow { font: 700 11.5px/1.3 var(--font-text); letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.link { color: var(--orange-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { color: var(--ink); }
.danger-text { color: var(--red-ink); }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font: 700 12px/1 var(--font-text); vertical-align: 2px; }

/* ------------------------------------------------------------------ boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: var(--r-md); cursor: pointer;
  font: 700 15px/1.2 var(--font-text); text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn.is-loading { opacity: .85; cursor: progress; }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn--md { min-height: 42px; padding: 9px 16px; }
.btn--lg { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--orange); color: var(--ink); border-color: var(--orange); box-shadow: 0 1px 0 rgba(12,17,22,.12), inset 0 -2px 0 rgba(12,17,22,.12); }
.btn--primary:hover:not(:disabled) { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn--dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--dark:hover:not(:disabled) { background: var(--ink-3); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover:not(:disabled) { border-color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: rgba(12,17,22,.06); }
.btn--subtle { background: var(--cream-2); color: var(--ink); }
.btn--subtle:hover:not(:disabled) { background: #E2DBCC; }
.btn--danger { background: var(--surface); color: var(--red-ink); border-color: #F0B9BB; }
.btn--danger:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red-ink); }
.btn--danger-solid { background: var(--red-ink); color: #fff; border-color: var(--red-ink); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(12,17,22,.07); color: var(--ink); }
.spinner { display: inline-block; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; opacity: .8; flex: none; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ champs */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font: 600 14px/1.35 var(--font-text); }
.field__hint { font-size: var(--fs-sm); color: var(--text-3); }
.field__error { font-size: var(--fs-sm); color: var(--red-ink); font-weight: 600; }
.input {
  width: 100%; min-height: 44px; padding: 10px 13px; border: 1.5px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s; appearance: none;
}
textarea.input { resize: vertical; line-height: 1.5; min-height: 88px; }
select.input { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A535C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.input::placeholder { color: #8A9097; }
.input:hover { border-color: #B5AC98; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,107,44,.28); }
.has-error .input { border-color: var(--red-ink); }
.input--sm { min-height: 38px; padding: 7px 11px; font-size: 14px; }
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 38px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { width: 22px; height: 22px; border-radius: 7px; border: 1.8px solid var(--border-strong); background: #fff; display: grid; place-items: center; color: transparent; transition: all .12s; flex: none; }
.check input:checked + .check__box { background: var(--ink); border-color: var(--ink); color: #fff; }
.check input:focus-visible + .check__box { outline: 3px solid var(--focus); outline-offset: 2px; }
.check__label { font-size: 14.5px; }

/* ------------------------------------------------------------------ badges, pastilles, onglets */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font: 600 12px/1.45 var(--font-text); white-space: nowrap; background: var(--tb); color: var(--tc); }
.tone-neutral { --tb: var(--t-neutral-bg); --tc: var(--t-neutral); }
.tone-blue { --tb: var(--t-blue-bg); --tc: var(--t-blue); }
.tone-amber { --tb: var(--t-amber-bg); --tc: var(--t-amber); }
.tone-orange { --tb: var(--t-orange-bg); --tc: var(--t-orange); }
.tone-green { --tb: var(--t-green-bg); --tc: var(--t-green); }
.tone-red { --tb: var(--t-red-bg); --tc: var(--t-red); }
.tone-violet { --tb: var(--t-violet-bg); --tc: var(--t-violet); }
.tone-ink { --tb: var(--ink); --tc: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--font-text); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip__count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--cream-2); font-size: 12px; font-weight: 700; }
.chip.is-active .chip__count { background: rgba(255,255,255,.18); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.tabs { flex-shrink: 0; align-self: flex-start; display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--cream-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs__tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 10px; font: 600 14.5px/1.2 var(--font-text); cursor: pointer; color: var(--text-2); white-space: nowrap; min-height: 38px; }
.tabs__tab:hover { color: var(--ink); }
.tabs__tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tabs__count { color: var(--orange-ink); font-weight: 700; }

/* ------------------------------------------------------------------ cartes, alertes, squelettes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card--pad { padding: 24px; }
.card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.card-head__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--cream); color: var(--ink); flex: none; }
.card-head__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-md); border: 1px solid; font-size: 14.5px; }
.alert > .ic { margin-top: 2px; }
.alert > p, .alert > div { flex: 1; }
.alert--error { background: var(--red-soft); border-color: #F4C2C4; color: #7E1A1F; }
.alert--error .btn { flex: none; }
.alert--info { background: #EEF3FA; border-color: #D3E0F1; color: #173E69; }
.alert--success { background: var(--green-soft); border-color: #BFE3CC; color: #0F5A2F; }
.alert--warning { background: var(--t-amber-bg); border-color: #F2D98E; color: #5E3D00; }
.skeleton { border-radius: var(--r-md); background: linear-gradient(90deg, #ECE6DA 0%, #F5F1E9 50%, #ECE6DA 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 16px; }
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--cream); color: var(--text-2); margin-bottom: 4px; }
.empty__title { font: 700 17px/1.35 var(--font-title); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; flex: none; font-weight: 700; color: var(--av); background: color-mix(in srgb, var(--av) 14%, white); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--av) 30%, transparent); }
.divider { height: 1px; background: var(--border); border: 0; margin: 4px 0; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; padding: 13px 12px 13px 15px; border-radius: 14px; border: 1px solid; box-shadow: var(--shadow-2); font-size: 14.5px; font-weight: 500; animation: toast-in .22s ease-out; }
.toast p { flex: 1; padding-top: 1px; }
.toast > .ic { margin-top: 1px; }
.toast--succes { background: #F1FAF4; border-color: #BFE3CC; color: #0F5A2F; }
.toast--erreur { background: #FFF3F3; border-color: #F4C2C4; color: #7E1A1F; }
.toast--info { background: #fff; border-color: var(--border); color: var(--ink); }
.toast__close { border: 0; background: transparent; color: inherit; opacity: .6; cursor: pointer; padding: 2px; border-radius: 6px; }
.toast__close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ fenêtres */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(12,17,22,.5); display: grid; place-items: center; padding: 20px; overflow-y: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); display: flex; flex-direction: column; max-height: calc(100dvh - 40px); animation: pop .18s ease-out; }
.modal--sm { max-width: 440px; }
.modal--lg { max-width: 720px; }
.modal__head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 0; }
.modal__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.modal__body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal__body > *, .panel__body > *, .thread__body > *, .sam__fil > * { flex-shrink: 0; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.confirm-msg { color: var(--text-2); font-size: 15px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* menu déroulant */
.menu { position: relative; display: inline-flex; }
.menu__list { position: absolute; top: calc(100% + 6px); z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-2); padding: 6px; display: flex; flex-direction: column; }
.menu__list--right { right: 0; }
.menu__list--left { left: 0; }
.menu__item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.menu__item:hover { background: var(--cream); }
.menu__item.is-danger { color: var(--red-ink); }
.menu__item.is-danger:hover { background: var(--red-soft); }

/* panneau latéral */
.drawer-wrap { position: fixed; inset: 0; z-index: 70; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(12,17,22,.45); animation: fade .15s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--bg); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); opacity: .4; } }

/* ------------------------------------------------------------------ mise en page */
.boot { min-height: 60vh; display: grid; place-items: center; color: var(--text-3); }
/* Ordinateur : grille 2 colonnes ; la barre latérale est collante (100vh, défilement interne) et le fond encre de la colonne
   descend sur toute la hauteur de la page (avant : position fixed, coupée à ~900 px sur les captures pleine page). */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); align-items: start; background: linear-gradient(90deg, var(--ink) var(--sidebar-w), transparent var(--sidebar-w)); }
.main { grid-column: 2; grid-row: 1; min-width: 0; padding: 36px var(--gutter) 64px; outline: none; }
.page { max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__sub { color: var(--text-2); font-size: 16px; margin-top: 8px; max-width: 64ch; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.demo-flag { max-width: var(--content-max); margin: -16px auto 20px; font-size: 13px; font-weight: 600; color: var(--t-amber); background: var(--t-amber-bg); border: 1px dashed #E2C060; border-radius: 10px; padding: 6px 12px; width: fit-content; }

.logo { font: 800 26px/1 var(--font-title); letter-spacing: -0.035em; color: var(--ink); text-decoration: none; }
.logo--clair { color: var(--cream); }
.logo__dot { color: var(--orange); }

.sidebar { grid-column: 1; grid-row: 1; position: sticky; top: 0; height: 100vh; height: 100dvh; width: var(--sidebar-w); background: var(--ink); color: #D6D9DC; display: flex; flex-direction: column; padding: 22px 14px 16px; overflow-y: auto; z-index: 20; scrollbar-width: thin; scrollbar-color: #2A333C transparent; }
.sidebar__brand { padding: 4px 12px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__link { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 39px; border-radius: 11px; color: #C9CED3; text-decoration: none; font: 500 14.5px/1.2 var(--font-text); border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left; }
.nav__link:hover { background: rgba(244,241,234,.07); color: #fff; }
.nav__link.is-active { background: rgba(255,107,44,.14); color: #fff; font-weight: 600; }
.nav__link.is-active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--orange); }
.nav__link.is-active .ic { color: var(--orange); }
.nav__link.is-locked .nav__label { opacity: .62; }
.nav__label { flex: 1; min-width: 0; }
.nav__lock { color: #8B939B; }
.nav__badge { min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--orange); color: var(--ink); font: 700 11.5px/20px var(--font-text); text-align: center; }
.sidebar__agents { margin-top: 14px; padding: 14px 12px 4px; border-top: 1px solid rgba(244,241,234,.1); }
.sidebar__agents .eyebrow { color: #8B939B; margin-bottom: 10px; }
.sidebar__agents li { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 14px; color: #E3E6E8; }
.sidebar__agents li.is-off { color: #8B939B; }
.agent-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: color-mix(in srgb, var(--c) 30%, #0C1116); box-shadow: inset 0 0 0 1.5px var(--c); flex: none; }
.online { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; margin-left: auto; box-shadow: 0 0 0 3px rgba(61,220,132,.16); }
.sidebar__foot { margin-top: auto; padding: 16px 0 0; border-top: 1px solid rgba(244,241,234,.1); display: flex; flex-direction: column; gap: 2px; }
.sidebar__company { padding: 0 12px; font-weight: 600; color: #fff; font-size: 14.5px; }
.sidebar__muted { padding: 0 12px 8px; font-size: 13px; color: #9AA1A8; }
.sidebar__agents .sidebar__muted { padding: 0; }
.nav__logout { color: #C9CED3; }

.topbar, .bottomnav { display: none; }
.mobile-only { display: none !important; }

/* bulle Sam */
.sam-bubble { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.sam-bubble__btn { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--ink); color: var(--orange); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-2), 0 0 0 4px rgba(255,107,44,.18); transition: transform .15s; }
.sam-bubble__btn:hover { transform: scale(1.05); }
.sam-bubble__panel { width: min(400px, calc(100vw - 32px)); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-3); border: 1px solid var(--border); overflow: hidden; animation: pop .18s ease-out; }
.sam-bubble__head { display: flex; align-items: center; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.sam-bubble__full { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--orange-ink); }
.toasts { bottom: 96px; }

/* ------------------------------------------------------------------ Sam (discussion) */
.sam { display: flex; flex-direction: column; min-height: 320px; background: var(--surface); }
.sam__fil { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sam__accueil { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 10px; }
.sam__suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.sam__suggestions .chip { white-space: normal; text-align: left; font-weight: 500; }
.sam-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--orange); flex: none; }
.sam-avatar--lg { width: 54px; height: 54px; }
.sam__msg { display: flex; flex-direction: column; gap: 8px; max-width: 86%; }
.sam__msg.is-user { align-self: flex-end; align-items: flex-end; }
.sam__msg.is-sam { align-self: flex-start; }
.sam__bulle { padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.is-user .sam__bulle { background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.is-sam .sam__bulle { background: var(--cream); border-bottom-left-radius: 5px; }
.sam__reflexion { display: flex; gap: 8px; align-items: center; color: var(--text-2); }
.sam__prop { border: 1.5px dashed #E8A57F; background: #FFF6F0; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.sam__prop .eyebrow { color: var(--orange-ink); }
.sam__prop-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.sam__correction { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 12px 8px 16px; background: var(--t-amber-bg); color: var(--t-amber); font-size: 13.5px; font-weight: 600; }
.sam__saisie { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.sam__saisie textarea { min-height: 44px; max-height: 140px; resize: none; }
.sam__send { width: 44px; min-height: 44px; padding: 0; flex: none; }

/* ------------------------------------------------------------------ connexion / pages publiques */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__aside { background: var(--ink); color: var(--cream); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__aside::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--orange) 0%, #E2551A 55%, transparent 56%); opacity: .95; }
.auth__pitch { position: relative; z-index: 1; max-width: 460px; }
.auth__pitch h2 { font: 800 44px/1.05 var(--font-title); letter-spacing: -0.03em; color: #fff; }
.auth__pitch h2 em { font-style: normal; color: var(--orange); }
.auth__pitch p { margin-top: 18px; color: #B9C0C6; font-size: 17px; max-width: 40ch; }
.auth__agents { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; max-width: 360px; }
.auth__agents span { padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid rgba(244,241,234,.18); font-size: 13.5px; color: #E3E6E8; }
.auth__main { display: grid; place-items: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.auth__card .logo { font-size: 30px; }
.auth__sub { color: var(--text-2); margin-top: 8px; font-size: 16px; }
.auth__form { display: flex; flex-direction: column; gap: 16px; }
.auth__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw .icon-btn { position: absolute; right: 3px; top: 3px; }
.auth__note { font-size: 13.5px; color: var(--text-3); }

.solo { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.solo__card { max-width: 520px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.solo__code { font: 800 120px/0.9 var(--font-title); letter-spacing: -0.05em; color: var(--ink); }
.solo__code span { color: var(--orange); }

/* ------------------------------------------------------------------ module verrouillé */
.locked { max-width: 640px; margin: 24px auto; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding: 36px; }
.locked__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--ink); color: var(--orange); }
.locked__title { font-size: 28px; }
.locked__text { color: var(--text-2); font-size: 16px; }
.locked__points { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.locked__points li { display: flex; gap: 10px; align-items: flex-start; }
.locked__points .ic { color: var(--green-ink); margin-top: 3px; }
.locked__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ------------------------------------------------------------------ tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { border-radius: var(--r-lg); padding: 18px 18px 16px; background: var(--kb); color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 1px solid color-mix(in srgb, var(--kc) 14%, transparent); }
.kpi__top { display: flex; align-items: center; gap: 8px; font: 600 13.5px/1.3 var(--font-text); color: var(--kc); }
.kpi__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.65); font-size: 15px; }
.kpi__val { font: 800 34px/1.05 var(--font-title); letter-spacing: -0.03em; color: var(--kc); font-variant-numeric: tabular-nums; }
.kpi__foot.xs { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpi__foot { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; min-height: 20px; }
.evo { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(255,255,255,.7); }
.evo--up { color: var(--green-ink); }
.evo--down { color: var(--red-ink); }
.evo--flat { color: var(--text-2); }
.k0 { --kb: #E3ECF8; --kc: #1D4F86; }
.k1 { --kb: #FFE9DE; --kc: #A13A0B; }
.k2 { --kb: #E2F3E8; --kc: #13703B; }
.k3 { --kb: #FFF1CC; --kc: #7A5000; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.onboarding { border-color: #F1C9B3; background: linear-gradient(180deg, #FFF6F0, #fff 120px); }
.onboarding .card-head__icon { background: var(--orange); color: var(--ink); }
.question { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--border); }
.question:first-of-type { border-top: 0; padding-top: 0; }
.question__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 220px; }
.toolbar select.input { width: auto; flex: 0 1 auto; min-width: 160px; }
.v-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.v-selectall { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.v-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; background: var(--surface); transition: background .12s; position: relative; }
.v-row:last-child { border-bottom: 0; }
.v-row:hover { background: #FCFAF6; }
.v-row.is-selected { background: #FFF6F0; box-shadow: inset 4px 0 0 var(--orange); }
.v-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.v-row__title { font-weight: 600; }
.v-row__detail { color: var(--text-2); font-size: 14px; }
.v-row__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.v-row__wait { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.v-row__wait.is-urgent { color: var(--orange-ink); font-weight: 700; }
.v-row__open { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.selbar { position: sticky; bottom: 20px; z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px 12px 18px; background: var(--ink); color: #fff; border-radius: 16px; box-shadow: var(--shadow-3); margin-top: 12px; }
.selbar__count { font-weight: 700; margin-right: auto; }
.selbar .btn--ghost { color: #fff; }
.selbar .btn--ghost:hover { background: rgba(255,255,255,.1); }
.selbar .btn--secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.activity li:first-child { border-top: 0; padding-top: 0; }
.activity__dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, white); font-size: 15px; flex: none; }
.activity__txt { flex: 1; min-width: 0; font-size: 14px; }
.activity__txt strong { color: var(--c-ink, var(--ink)); }
.activity__when { font-size: 12.5px; color: var(--text-3); }
.detail-block { display: flex; flex-direction: column; gap: 6px; }
.quote { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }

/* ------------------------------------------------------------------ messages */
.inbox { display: grid; grid-template-columns: 380px minmax(0, 1fr); min-height: 620px; overflow: hidden; padding: 0; }
.inbox__list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.inbox__tools { padding: 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.inbox__items { overflow-y: auto; max-height: 680px; flex: 1; }
.conv { display: flex; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; width: 100%; text-align: left; cursor: pointer; position: relative; }
.conv:hover { background: #FCFAF6; }
.conv.is-active { background: #FFF6F0; box-shadow: inset 4px 0 0 var(--orange); }
.conv__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv__name { font-weight: 600; }
.conv__when { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.conv__when.is-urgent { color: var(--orange-ink); font-weight: 700; }
.conv__when.is-sent { color: var(--green-ink); font-weight: 700; }
.conv__preview { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox__detail { display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }
.thread__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.thread__body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 78%; display: flex; flex-direction: column; gap: 5px; }
.bubble__txt { padding: 12px 15px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.bubble__meta { font-size: 12.5px; color: var(--text-3); }
.bubble--client { align-self: flex-start; }
.bubble--client .bubble__txt { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble--agent { align-self: flex-end; align-items: flex-end; }
.bubble--agent .bubble__txt { background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.bubble--draft .bubble__txt { background: #FFF6F0; color: var(--ink); border: 1.5px dashed #E8A57F; }
.reply { border-top: 1px solid var(--border); background: var(--surface); padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.reply__hint { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.reply__hint .ic { color: var(--orange-ink); }
.reply__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ tickets */
.stat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 14px; color: var(--text-2); font-weight: 500; }
.stat__val { font: 800 32px/1.05 var(--font-title); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__val.is-warn { color: var(--orange-ink); }
.ticket { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.ticket.is-urgent { border-color: #F1B48F; background: #FFF9F5; box-shadow: inset 4px 0 0 var(--orange); }
.ticket__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ticket__date { font-size: 13px; color: var(--text-3); }
.ticket__subject { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.ticket__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ devis & factures */
.dictee { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.recap { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; margin-top: 12px; }
.sums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sum { text-align: left; padding: 15px 16px; border-radius: var(--r-lg); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.sum:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.sum.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.sum__label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.sum__val { font: 800 24px/1.1 var(--font-title); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sum.is-warn { background: #FFF6F0; border-color: #F1C9B3; }
.sum.is-warn .sum__val { color: var(--orange-ink); }
.sum.is-warn.is-active { border-color: var(--orange-ink); box-shadow: 0 0 0 1px var(--orange-ink); }
.table-wrap { overflow-x: auto; }
.deals { width: 100%; border-collapse: separate; border-spacing: 0; }
.deals th { text-align: left; font: 600 12.5px/1.3 var(--font-text); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 12px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.deals th:first-child { border-top-left-radius: var(--r-lg); padding-left: 18px; }
.deals th:last-child { border-top-right-radius: var(--r-lg); }
.deals td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.deals td:first-child { padding-left: 18px; }
.deals tr:last-child td { border-bottom: 0; }
.deals tbody tr:hover td { background: #FCFAF6; }
.deals tr.is-open td { background: #FFF6F0; }
.sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.sort:hover { color: var(--ink); }
.deal-client { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deal-client__name { font-weight: 600; }
.deal-client__name:hover { text-decoration: underline; }
.deal-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.pdf-links { display: flex; gap: 10px; font-size: 13px; }
.pdf-links a { color: var(--text-2); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.pdf-links a:hover { color: var(--ink); }
.frise { display: flex; align-items: flex-start; min-width: 220px; }
.frise__step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 0; }
.frise__step::before, .frise__step::after { content: ''; position: absolute; top: 9px; height: 2px; width: 50%; background: var(--border-strong); }
.frise__step::before { left: 0; }
.frise__step::after { right: 0; }
.frise__step:first-child::before, .frise__step:last-child::after { display: none; }
.frise__step.is-fait::before, .frise__step.is-fait::after, .frise__step.is-en_cours::before { background: var(--fc); }
.frise__dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; position: relative; z-index: 1; color: #fff; }
.is-fait .frise__dot { background: var(--fc); border-color: var(--fc); }
.is-en_cours .frise__dot { border-color: var(--fc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fc) 22%, transparent); }
.is-en_cours .frise__dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--fc); }
.frise__label { font-size: 11.5px; color: var(--text-3); text-align: center; white-space: nowrap; }
.is-en_cours .frise__label { color: var(--ink); font-weight: 700; }
.is-fait .frise__label { color: var(--text-2); }
.frise--sm .frise__label { display: none; }
.frise--sm { min-width: 120px; max-width: 150px; }
.frise--sm .frise__dot { width: 16px; height: 16px; }
.frise--sm .frise__step::before, .frise--sm .frise__step::after { top: 7px; }
.frise--lg .frise__dot { width: 26px; height: 26px; }
.frise--lg .frise__step::before, .frise--lg .frise__step::after { top: 12px; }
.frise--lg .frise__label { font-size: 12.5px; }
.c-vert { --fc: #13703B; } .c-orange { --fc: #C24A12; } .c-rouge { --fc: #B4232A; } .c-bleu { --fc: #1D4F86; } .c-violet { --fc: #5B34B0; } .c-gris { --fc: #6A727A; }
.deal-cards { display: none; }
.deal-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.deal-card.is-selected { box-shadow: inset 4px 0 0 var(--orange); }
.deal-card .deal-actions { justify-content: flex-start; flex-wrap: wrap; }
.deal-card__top { display: flex; gap: 12px; align-items: flex-start; }
.panel__head { padding: 20px 22px 16px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.panel__title { display: flex; align-items: flex-start; gap: 12px; }
.panel__amount { font: 800 26px/1 var(--font-title); letter-spacing: -0.02em; white-space: nowrap; }
.panel__body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.panel__foot { border-top: 1px solid var(--border); background: var(--surface); padding: 14px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.panel__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.panel__btns .btn { flex: 1 1 auto; }
.section-title { font: 700 13px/1.3 var(--font-text); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 8px; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.lines th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12.5px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.lines td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lines .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lines tfoot td { border-bottom: 0; background: var(--surface-2); }
.lines tfoot tr.total td { font-weight: 800; font-size: 15.5px; }
.timeline li { display: flex; gap: 10px; padding: 7px 0; font-size: 14px; align-items: baseline; }
.timeline li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; transform: translateY(-1px); }
.timeline li:last-child::before { background: var(--orange); }
.readonly { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.newdoc-lines { display: flex; flex-direction: column; gap: 8px; }
.newdoc-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border-strong); border-radius: 10px; background: #fff; }
.qty button { width: 32px; height: 34px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.qty button:hover { color: var(--ink); }
.qty span, .qty input { min-width: 30px; width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border: 0; background: transparent; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: end; }
.totals { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 14px; padding: 4px 2px; }
.totals strong { font: 800 20px/1.2 var(--font-title); }

/* ------------------------------------------------------------------ mon compte */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.profile { display: flex; gap: 16px; align-items: center; }
.profile__avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--orange); display: grid; place-items: center; font: 800 26px/1 var(--font-title); flex: none; }
.plan { display: inline-flex; padding: 6px 14px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font: 700 14px/1.3 var(--font-text); }
.plan em { font-style: normal; color: var(--orange); }
.conn { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.conn:first-child { border-top: 0; padding-top: 0; }
.conn__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--cream); display: grid; place-items: center; font-size: 17px; flex: none; }
.conn__name { flex: 1; font-weight: 500; }

/* ================================================================== responsive */
@media (max-height: 960px) and (min-width: 1024px) {
  .sidebar__agents ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .sidebar__agents li span:not(.agent-dot) { display: none; }
  .sidebar__agents li { padding: 0; }
  .agent-dot { width: 28px; height: 28px; font-size: 13px; }
}
@media (max-width: 1280px) {
  .sums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr); }
  .deals-table { display: none; }
  .deal-cards { display: flex; flex-direction: column; gap: 12px; }
}
@media (max-width: 1023px) {
  :root { --gutter: 16px; }
  .shell { display: block; background: none; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding: calc(var(--topbar-h) + 20px) var(--gutter) calc(var(--bottomnav-h) + 32px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 30; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: rgba(244,241,234,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .topbar .logo { font-size: 24px; }
  .topbar__company { font-size: 13.5px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--ink); }
  .bottomnav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #A9B0B6; text-decoration: none; font: 600 11.5px/1.1 var(--font-text); border: 0; background: transparent; cursor: pointer; position: relative; }
  .bottomnav__item.is-active { color: #fff; }
  .bottomnav__item.is-active .bottomnav__icon { background: rgba(255,107,44,.2); color: var(--orange); }
  .bottomnav__icon { position: relative; display: grid; place-items: center; width: 46px; height: 30px; border-radius: 15px; }
  .bottomnav__badge { position: absolute; top: -4px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--orange); color: var(--ink); font: 700 10.5px/18px var(--font-text); text-align: center; padding: 0 4px; }
  .sheet-wrap { position: fixed; inset: 0; z-index: 75; }
  .sheet-backdrop { position: absolute; inset: 0; background: rgba(12,17,22,.5); animation: fade .15s; }
  .sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow-y: auto; background: var(--ink); border-radius: 22px 22px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); animation: sheet-up .2s ease-out; }
  .sheet__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px 12px; }
  .sheet__head .icon-btn { color: #C9CED3; }
  .sheet__head .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
  .nav--sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; }
  .nav--sheet .nav__link.is-active::before { display: none; }
  .sam-bubble { display: none; }
  .toasts { bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); right: 16px; }
  .demo-flag { margin: -6px 0 14px; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: .5; } }
@media (max-width: 860px) {
  .kpis, .kpis--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox { grid-template-columns: 1fr; min-height: 0; }
  .inbox__list { border-right: 0; }
  .inbox__items { max-height: none; }
  .inbox.show-detail .inbox__list { display: none; }
  .inbox:not(.show-detail) .inbox__detail { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .mobile-only { display: inline-grid !important; }
  .stat-cards { gap: 10px; }
}
@media (max-width: 600px) {
  .h1 { font-size: 27px; }
  .page { gap: 18px; }
  .card--pad { padding: 18px; }
  .kpi { padding: 14px; }
  .kpi__val { font-size: 27px; }
  .stat { padding: 14px; }
  .stat__val { font-size: 26px; }
  .sum__val { font-size: 20px; }
  .toolbar select.input { flex: 1 1 140px; min-width: 0; font-size: 14px; padding-left: 11px; }
  .v-row { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .v-row__meta { justify-content: flex-start; width: 100%; padding-left: 36px; }
  .dictee { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :first-child { grid-column: 1 / -1; }
  .newdoc-line { grid-template-columns: minmax(0, 1fr) auto; }
  .modal__foot .btn { flex: 1; }
  .overlay { padding: 10px; align-items: end; }
  .modal { max-height: calc(100dvh - 20px); border-radius: 20px; }
  .thread__body { padding: 14px; }
  .bubble { max-width: 92%; }
  .reply { padding: 14px; }
  .panel__head, .panel__body, .panel__foot { padding-left: 16px; padding-right: 16px; }
  .locked { padding: 24px 20px; margin-top: 0; }
  .locked__title { font-size: 24px; }
  .solo__code { font-size: 92px; }
  .selbar { bottom: calc(var(--bottomnav-h) + 10px); }
  .selbar .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
