/* =========================================================
   SERVICE CLIENT — tableau de bord desktop (Jenny, Kenny)
   Direction C · consulté sur ordinateur, empilé sur mobile
   ========================================================= */

/* La page « fiche » est mobile-first (main.container 600px, .page-properties
   720px) : on l'élargit uniquement en mode Service client. */
body.sc-mode main.container { max-width: 1480px; }
.page-properties.sc-mode {
  max-width: 1480px;
  padding: 10px 22px 48px;
}

.sc-dash {
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(6px);
  animation: cardIn 0.35s var(--ease-out) forwards;
}

/* ---------- Hero ---------- */
.sc-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 2px 0;
}
.sc-hero-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sc-hero-text { min-width: 0; line-height: 1.15; }
.sc-hero-eyebrow {
  font-size: var(--t-11);
  font-weight: var(--w-medium);
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.sc-hero-name {
  font-size: var(--t-20);
  font-weight: var(--w-semibold);
  color: var(--ink-1);
  letter-spacing: var(--ls-tight);
  margin-top: 1px;
}
.sc-hero-right { display: flex; align-items: center; gap: 10px; }

.sc-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-1);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.sc-status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-4) 18%, transparent);
  flex: none;
}
.sc-status.is-on .sc-status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
  animation: scPulse 2.4s ease-in-out infinite;
}
.sc-status.is-off .sc-status-dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
@keyframes scPulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 10%, transparent); }
}
.sc-status-text { display: flex; flex-direction: column; line-height: 1.15; }
.sc-status-label { font-size: var(--t-12); font-weight: var(--w-semibold); color: var(--ink-1); }
.sc-status.is-on .sc-status-label { color: var(--ok); }
.sc-status.is-off .sc-status-label { color: var(--warn); }
.sc-status-detail { font-size: var(--t-11); color: var(--ink-3); white-space: nowrap; }
.sc-status-clock {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--t-13);
  font-weight: var(--w-medium);
  color: var(--ink-2);
  padding-left: 10px;
  border-left: 1px solid var(--line-1);
  font-variant-numeric: tabular-nums;
}

.sc-restricted {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line-1);
  color: var(--ink-2);
  font-size: var(--t-13);
  line-height: 1.45;
}
.sc-restricted-icon { font-size: 16px; line-height: 1.3; }

/* ---------- Barre d'actions ---------- */
.sc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-1);
  font-family: inherit;
  font-size: var(--t-13);
  font-weight: var(--w-semibold);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  -webkit-user-select: none; user-select: none;
}
.sc-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sc-btn:hover { background: var(--surface-2); border-color: var(--line-3); }
.sc-btn:active { transform: scale(0.985); }
.sc-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); height: 44px; padding: 0 18px; font-size: var(--t-14); }
.sc-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- Grille : 3 colonnes égales + cadre Aujourd’hui ---------- */
.sc-board {
  --sc-cols: minmax(280px, 1fr) minmax(360px, 1.3fr) minmax(280px, 1fr);
  --sc-top-h: clamp(400px, calc(100dvh - 390px), 620px);
  display: grid;
  grid-template-columns: var(--sc-cols);
  gap: 14px;
  align-items: stretch;
}
.sc-panel {
  background: var(--surface);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.sc-board > .sc-panel {
  height: var(--sc-top-h);
}
.sc-board > .sc-panel-bot { overflow: visible; }
.sc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-1);
  flex-wrap: wrap;
  flex: none;
}
.sc-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--t-13);
  font-weight: var(--w-semibold);
  color: var(--ink-1);
  letter-spacing: 0.01em;
}
.sc-panel-sub { font-size: var(--t-11); color: var(--ink-3); }
.sc-panel-tools { display: flex; align-items: center; gap: 8px; }
.sc-panel-body { padding: 10px 12px 14px; }
.sc-panel-inbox .sc-panel-body,
.sc-panel-todo .sc-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sc-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  font-variant-numeric: tabular-nums;
}
.sc-count:empty { display: none; }
.sc-count-alert { background: var(--danger); color: #fff; }
.sc-sync { font-size: var(--t-11); color: var(--ink-4); white-space: nowrap; }
.sc-icon-btn {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.sc-icon-btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-icon-btn:hover { background: var(--surface-2); }
.sc-mini-btn {
  height: 30px; padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-1);
  font-family: inherit; font-size: var(--t-12); font-weight: var(--w-semibold);
  cursor: pointer;
}
.sc-mini-btn:hover { background: var(--surface-2); }

.sc-loading, .sc-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 26px 12px;
  text-align: center;
  color: var(--ink-3);
  font-size: var(--t-13);
  line-height: 1.45;
}
.sc-loading { flex-direction: row; }
.sc-loading .spinner { width: 16px; height: 16px; border-width: 2px; }
.sc-empty .sc-hint { font-size: var(--t-12); color: var(--ink-4); }
.sc-error { color: var(--danger); }

/* ---------- Non-lus (WhatsApp + Beds24) ---------- */
.sc-inbox-summary {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 4px 8px;
  font-size: var(--t-11); font-weight: var(--w-semibold); color: var(--ink-3);
  text-transform: uppercase; letter-spacing: var(--ls-wider);
}
.sc-inbox-dot { color: var(--ink-4); }
.sc-inbox-warn {
  margin: 0 0 8px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--t-12);
  line-height: 1.35;
}

/* ---------- Aujourd’hui : 3 panneaux alignés sous Non-lus / bot / to-do ---------- */
.sc-today {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--sc-cols);
  column-gap: 14px;
  row-gap: 0;
  background: var(--surface-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
  padding-bottom: 12px;
}
.sc-today-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-1);
  background: var(--surface);
}
.sc-today-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 280px;
  background: var(--surface);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  overflow: hidden;
}
.sc-today-col-head {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-1);
  flex: none;
}
.sc-today-col-head.is-in { color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.sc-today-col-head.is-out { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.sc-today-col-head.is-ench { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.sc-today-col-head .sc-count { margin-left: auto; }
.sc-today-col-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 12px;
}
.sc-today-col-body .enchainement-list { padding: 0; gap: 4px; }
.sc-moves-empty {
  padding: 18px 8px;
  text-align: center;
  font-size: var(--t-12);
  color: var(--ink-4);
  font-style: italic;
}
.sc-move-item {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
}
.sc-move-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sc-move-who .enchainement-apt-name { flex: none; }
.sc-move-room {
  font-size: var(--t-11);
  font-weight: var(--w-medium);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-move-ench {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.sc-move-ench-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sc-move-ench-top .enchainement-apt-name { flex: 1; }
.sc-move-ench-guests {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sc-move-ench-guest {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 3px 6px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line-1);
}
.sc-move-ench-guest.enchainement-clickable:hover { background: var(--surface-2); }
.sc-move-item.enchainement-clickable:focus-visible,
.sc-move-ench-guest.enchainement-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.sc-move-ench-k {
  font-size: var(--t-10);
  font-weight: var(--w-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--ink-4);
  flex: none;
}
.sc-move-ench-n {
  font-size: var(--t-12);
  font-weight: var(--w-medium);
  color: var(--ink-1);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-conv {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px 9px 8px;
  margin-bottom: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-1);
  background: var(--surface);
  color: var(--ink-1);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.sc-conv:hover { background: var(--surface-2); border-color: var(--line-3); }
.sc-conv:active { transform: scale(0.995); }
.sc-conv-badge {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
  flex: none;
}
.sc-conv.is-warm .sc-conv-badge { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.sc-conv.is-late { border-color: color-mix(in srgb, var(--danger) 35%, var(--line-1)); }
.sc-conv-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sc-conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sc-conv-name { font-size: var(--t-13); font-weight: var(--w-semibold); color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-conv-time { font-size: var(--t-11); color: var(--ink-4); white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.sc-conv.is-late .sc-conv-time { color: var(--danger); font-weight: var(--w-semibold); }
.sc-conv-sub { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sc-conv-room { font-size: var(--t-12); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-conv-preview {
  font-size: var(--t-12); color: var(--ink-2); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sc-conv-go { display: inline-flex; color: var(--ink-4); }
.sc-conv-go svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-conv:hover .sc-conv-go { color: var(--accent); }

.sc-chan {
  display: inline-flex; align-items: center; gap: 4px;
  height: 18px; padding: 0 7px;
  border-radius: var(--r-pill);
  font-size: var(--t-10); font-weight: var(--w-semibold);
  letter-spacing: 0.02em; text-transform: uppercase;
  flex: none;
}
.sc-chan svg { width: 11px; height: 11px; }
.sc-chan-wa { background: color-mix(in srgb, #25d366 18%, transparent); color: #128c4a; }
.sc-chan-airbnb { background: color-mix(in srgb, #ff385c 14%, transparent); color: #d0294a; }
.sc-chan-booking { background: color-mix(in srgb, #003580 14%, transparent); color: #1f4fa8; }
.sc-chan-direct { background: var(--surface-2); color: var(--ink-3); }

/* ---------- Mr PEAK BED embarqué ---------- */
/* La liste déroulante (absolute, z 30) doit passer AU-DESSUS de la fenêtre du
   bot située juste en dessous : on positionne la barre pour l'empiler devant. */
.sc-logement-bar {
  position: relative;
  z-index: 5;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-1);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}
.sc-logement-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-11); font-weight: var(--w-semibold); color: var(--ink-3);
  text-transform: uppercase; letter-spacing: var(--ls-wider);
}
.sc-logement-label svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-combo { position: relative; display: flex; align-items: center; }
.sc-combo-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); pointer-events: none; display: inline-flex;
}
.sc-combo-icon svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-combo-input {
  flex: 1;
  height: 38px;
  padding: 0 34px 0 32px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-1);
  font-family: inherit;
  font-size: var(--t-13);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.sc-combo-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sc-combo-input::placeholder { color: var(--ink-4); }
.sc-combo-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 18px; line-height: 1;
  cursor: pointer;
}
.sc-combo-clear:hover { background: var(--surface-sunken); color: var(--ink-1); }
.sc-combo-list {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 30;
  max-height: 280px;
  overflow-y: auto;
  margin: 0; padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
}
.sc-combo-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.sc-combo-item.is-active, .sc-combo-item:hover { background: var(--accent-soft); }
.sc-combo-name { font-size: var(--t-13); font-weight: var(--w-medium); color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-combo-agent { font-size: var(--t-11); color: var(--ink-3); white-space: nowrap; flex: none; }
.sc-combo-empty { padding: 10px 12px; font-size: var(--t-12); color: var(--ink-3); }

.sc-logement-mention {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--ink-1);
  font-size: var(--t-13);
  line-height: 1.35;
  animation: msgIn 0.2s var(--ease-out);
}
.sc-logement-mention > svg { width: 16px; height: 16px; stroke: var(--accent); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sc-logement-mention strong { font-weight: var(--w-semibold); }
.sc-mention-text { flex: 1; min-width: 0; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sc-mention-text.is-stacked { flex-direction: column; align-items: flex-start; gap: 2px; }
.sc-mention-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sc-mention-agent { color: var(--ink-2); font-size: var(--t-12); }
.sc-mention-property { color: var(--ink-2); white-space: nowrap; }
.sc-mention-property strong { color: var(--ink-1); font-weight: 600; }
.sc-mention-sep { color: var(--ink-4); padding: 0 2px; }
.sc-mention-wa {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #25d366; color: #fff;
  margin-left: 2px;
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
  flex: none;
}
.sc-mention-wa svg { width: 13px; height: 13px; }
.sc-mention-wa:hover { transform: scale(1.1); filter: brightness(0.94); }
.sc-mention-wa.is-disabled { background: var(--surface-sunken); color: var(--ink-4); cursor: help; }
.sc-mention-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  margin-left: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  font-family: inherit; font-size: var(--t-12); font-weight: var(--w-semibold);
  cursor: pointer; white-space: nowrap; flex: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.sc-mention-btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-mention-btn:hover { background: var(--accent); color: var(--accent-foreground); }

.sc-bot-host {
  flex: 1;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* La fenêtre flottante devient un bloc plein dans son hôte.
   z-index: auto est indispensable : en enfant flex, le z-index 10000 de
   .chat-window crée un contexte d'empilement même en position static et
   recouvrait la liste déroulante du sélecteur Logement. */
.chat-window.sc-embedded {
  position: static;
  z-index: auto;
  transform: none !important;
  transition: none;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  min-height: 0;
}
.chat-window.sc-embedded .chat-window-header { padding: 10px 14px; }
.chat-window.sc-embedded .chat-btn-close { display: none; }
.chat-window.sc-embedded .chat-window-input-area { padding: 10px; }
.chat-window.sc-embedded .chat-msg { max-width: 88%; font-size: var(--t-14); }

/* Saisie verrouillée tant qu'aucun logement n'est choisi. */
.chat-window.sc-chat-locked .chat-window-input-area { position: relative; }
.chat-window.sc-chat-locked .chat-window-input {
  background: var(--surface-2);
  color: var(--ink-3);
  border-style: dashed;
  cursor: pointer;
  box-shadow: none !important;
}
.chat-window.sc-chat-locked .chat-window-input::placeholder { color: var(--ink-3); }
.chat-window.sc-chat-locked .chat-btn-send { opacity: 0.4; cursor: not-allowed; }
.chat-window.sc-chat-locked .chat-window-input-area::before {
  content: "🏠 Choisissez un logement pour poser votre question";
  position: absolute;
  left: 10px; right: 10px; top: -26px;
  padding: 4px 10px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--t-11);
  font-weight: var(--w-semibold);
  text-align: center;
  pointer-events: none;
}
.chat-msg-ctx {
  display: block;
  font-size: var(--t-11);
  opacity: 0.8;
  margin-bottom: 3px;
}

/* ---------- To-do ---------- */
.sc-todo-section + .sc-todo-section { margin-top: 12px; }
.sc-todo-section-head {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--t-12); font-weight: var(--w-semibold); color: var(--ink-2);
  padding: 2px 2px 8px;
}
.sc-todo-cards { display: flex; flex-direction: column; gap: 8px; }
.sc-todo-cards .task-card { animation-delay: 0ms !important; }

/* ---------- Modale Contacts ---------- */
.sc-modal-overlay {
  position: fixed; inset: 0;
  z-index: 10500;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: scFade 0.18s var(--ease-out);
}
.sc-modal-overlay.closing { animation: scFadeOut 0.18s var(--ease) forwards; }
@keyframes scFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scFadeOut { to { opacity: 0; } }
.sc-modal {
  width: min(560px, 100%);
  max-height: min(84vh, 760px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  overflow: hidden;
  animation: msgIn 0.2s var(--ease-out);
}
.sc-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line-1);
}
.sc-modal-title { font-size: var(--t-16); font-weight: var(--w-semibold); color: var(--ink-1); }
.sc-modal-sub { font-size: var(--t-12); color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.sc-modal-close {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 15px;
  cursor: pointer;
}
.sc-modal-close:hover { background: var(--surface-2); }
.sc-modal-search { position: relative; display: flex; padding: 10px 12px; border-bottom: 1px solid var(--line-1); background: var(--surface-2); }
.sc-modal-search .sc-combo-icon { left: 22px; }
.sc-modal-body { padding: 8px 10px 14px; overflow-y: auto; }
.sc-contact-group {
  font-size: var(--t-11); font-weight: var(--w-semibold); color: var(--ink-3);
  text-transform: uppercase; letter-spacing: var(--ls-wider);
  padding: 10px 6px 6px;
}
.sc-contact {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px;
  border-radius: var(--r-md);
}
.sc-contact:hover { background: var(--surface-2); }
.sc-contact-main { flex: 1; min-width: 0; }
.sc-contact-name { font-size: var(--t-14); font-weight: var(--w-semibold); color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-contact-role { font-size: var(--t-12); color: var(--ink-3); }
.sc-wa {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border-radius: var(--r-md);
  background: #25d366;
  color: #fff;
  font-size: var(--t-12); font-weight: var(--w-semibold);
  text-decoration: none;
  flex: none;
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}
.sc-wa svg { width: 16px; height: 16px; }
.sc-wa:hover { filter: brightness(0.94); }
.sc-wa:active { transform: scale(0.97); }
.sc-wa.is-disabled { background: var(--surface-2); color: var(--ink-4); cursor: default; }

/* ---------- Fiche logement (698 + 784) ---------- */
.sc-modal-wide { width: min(1180px, 100%); max-height: min(94vh, 1000px); }
.sc-fiche-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-1);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}
.sc-fiche-ico {
  width: 42px; height: 42px; flex: none;
  border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-foreground);
  display: inline-flex; align-items: center; justify-content: center;
}
.sc-fiche-ico svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-fiche-headtext { min-width: 0; flex: 1; }
.sc-fiche .sc-modal-title { font-size: var(--t-20); letter-spacing: var(--ls-tight); }
.sc-fiche-people { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sc-fiche-agent {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 3px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: var(--t-12); font-weight: var(--w-semibold); color: var(--ink-1);
}
.sc-fiche-agent.is-repl { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line-2)); padding-left: 8px; }
.sc-fiche-agent .sc-mention-wa { width: 20px; height: 20px; }
.sc-fiche-agent .sc-mention-wa svg { width: 12px; height: 12px; }

.sc-fiche-search { position: relative; display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-1); background: var(--surface-2); gap: 10px; }
.sc-fiche-search .sc-combo-icon { left: 24px; }
.sc-fiche-search .sc-combo-input { height: 40px; font-size: var(--t-14); }
.sc-fiche-count { font-size: var(--t-11); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-fiche-count:empty { display: none; }

.sc-fiche-body { padding: 14px 16px 18px; background: var(--bg); }
.sc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sc-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px;
  max-width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--line-1);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.sc-chip-ico { width: 28px; height: 28px; flex: none; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.sc-chip-ico svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-chip-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sc-chip-label { font-size: var(--t-10); font-weight: var(--w-semibold); color: var(--ink-3); text-transform: uppercase; letter-spacing: var(--ls-wider); }
.sc-chip-val { font-size: var(--t-13); font-weight: var(--w-semibold); color: var(--ink-1); white-space: normal; overflow-wrap: anywhere; }

/* Sections en 2 colonnes (masonry via CSS columns) : chaque section garde
   sa hauteur naturelle, rien n'est tronqué. */
.sc-fiche-body .sc-sec { break-inside: avoid; margin-bottom: 12px; }
.sc-fiche-body { column-gap: 12px; }
@media (min-width: 900px) { .sc-fiche-body { columns: 2; } .sc-fiche-body .sc-chips { column-span: all; } .sc-fiche-body .sc-empty { column-span: all; } }
.sc-sec {
  background: var(--surface);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.sc-sec-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-1);
  font-size: var(--t-13); font-weight: var(--w-semibold); color: var(--ink-1);
  background: var(--surface-2);
}
.sc-sec-head svg { width: 17px; height: 17px; stroke: var(--accent); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sc-sec-head .sc-count { margin-left: auto; }
.sc-sec-interne .sc-sec-head { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.sc-sec-interne .sc-sec-head svg { stroke: var(--danger); }
.sc-sec-interne { border-color: color-mix(in srgb, var(--danger) 35%, var(--line-1)); }
.sc-sec-body { padding: 4px 6px 6px; }

.sc-row { padding: 9px 8px 10px; border-radius: var(--r-sm); }
.sc-row + .sc-row { border-top: 1px dashed var(--line-1); }
.sc-row:hover { background: var(--surface-2); }
.sc-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sc-row-label { font-size: var(--t-11); font-weight: var(--w-semibold); color: var(--ink-3); text-transform: uppercase; letter-spacing: var(--ls-wider); line-height: 1.3; }
.sc-row-actions { display: inline-flex; gap: 4px; opacity: 0.35; transition: opacity var(--dur-fast) var(--ease); flex: none; }
.sc-row:hover .sc-row-actions, .sc-row:focus-within .sc-row-actions { opacity: 1; }
.sc-row-action {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit; font-size: var(--t-11); font-weight: var(--w-semibold);
  text-decoration: none; cursor: pointer;
}
.sc-row-action svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-row-action:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.sc-copy.is-done { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.sc-val {
  font-size: var(--t-14);
  line-height: 1.5;
  color: var(--ink-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sc-val + .sc-val { margin-top: 6px; }
.sc-val mark, .sc-row-label mark { background: color-mix(in srgb, var(--warn) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.sc-link { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; word-break: break-all; }
.sc-link svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; margin-left: 2px; vertical-align: -1px; }
.sc-pin-token {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--warn-soft); color: var(--warn);
  font-size: var(--t-11); font-weight: var(--w-semibold); white-space: nowrap;
  vertical-align: 1px;
}
.sc-pin-token svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.9; fill: none; }
.sc-yn { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: var(--r-pill); font-size: var(--t-11); font-weight: var(--w-semibold); vertical-align: 1px; }
.sc-yn-yes { background: var(--ok-soft); color: var(--ok); }
.sc-yn-no { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.sc-val-conf {
  position: relative;
  padding: 8px 10px 8px 34px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.sc-val-conf > svg { position: absolute; left: 10px; top: 10px; width: 15px; height: 15px; stroke: var(--danger); stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sc-val-conf-tag { display: block; font-size: var(--t-10); font-weight: var(--w-semibold); color: var(--danger); text-transform: uppercase; letter-spacing: var(--ls-wider); margin-bottom: 3px; }
.sc-row.is-internal .sc-row-label { color: var(--danger); }
.sc-val-internal { border-left: 3px solid var(--danger); padding-left: 10px; }

.sc-linge { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 4px 4px; }
.sc-linge-item { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-1); font-size: var(--t-12); color: var(--ink-2); }
.sc-linge-item strong { color: var(--ink-1); font-variant-numeric: tabular-nums; }

.sc-fiche-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--line-1);
  font-size: var(--t-11); color: var(--ink-3);
  background: var(--surface);
}
.sc-fiche-foot:empty { display: none; }
.sc-fiche-warn { color: var(--warn); font-weight: var(--w-semibold); }
.sc-fiche-src strong { font-weight: var(--w-semibold); color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sc-board { --sc-cols: 1fr; --sc-top-h: 440px; }
  .sc-today { grid-template-columns: 1fr; }
  .sc-today-col { height: 240px; }
}
@media (max-width: 760px) {
  .page-properties.sc-mode { padding: 8px 12px 90px; }
  .sc-hero-name { font-size: var(--t-18); }
  .sc-status-detail { display: none; }
  .sc-btn-primary { width: 100%; justify-content: center; }
  .sc-modal-overlay { padding: 8px; }
  .sc-fiche-head { flex-wrap: wrap; }
  .sc-fiche-people { width: 100%; justify-content: flex-start; }
  .sc-mention-btn { margin-left: 0; width: 100%; justify-content: center; }
  .sc-row-actions { opacity: 1; }
}

@media (prefers-color-scheme: dark) {
  .sc-wa { background: #1fa855; }
  .sc-chan-wa { color: #4ade80; }
  .sc-chan-airbnb { color: #ff6b85; }
  .sc-chan-booking { color: #7fa6ea; }
}
