/* ==========================================================================
   Bliss CRM — "Atoll" theme layer
   Loaded last. Defines the design tokens and the polished look of every
   screen on top of the component stylesheets.
   Palette: deep atoll navy rail, lagoon accent, coral for urgency, reef green
   for done, sand-sun amber for "soon". Type: Golos Text (Cyrillic-first UI face).
   ========================================================================== */

:root {
  --chart-2: #e07a3a;
  color-scheme: light;
  --font-ui: "Golos Text", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;

  --bg: #eef3f5;
  --surface: #ffffff;
  --surface-2: #f6f9fa;
  --surface-3: #ecf1f3;
  --surface-raised: #ffffff;
  --surface-inset: #f2f6f7;
  --text: #13242c;
  --text-2: #3d525c;
  --muted: #6a7d86;
  --line: #e0e8eb;
  --line-strong: #cbd7dc;

  --accent: #0b7a93;
  --accent-hover: #086579;
  --accent-soft: #e3f3f6;
  --accent-ink: #ffffff;
  --success: #198257;
  --success-soft: #e3f5ec;
  --warning: #a8670b;
  --warning-soft: #fdf1dc;
  --danger: #d4442f;
  --danger-soft: #fdebe7;
  --purple: #6b5bd2;

  --rail: #0e2630;
  --rail-2: #14323d;
  --rail-text: #a9c3cc;
  --rail-text-strong: #f2f8fa;
  --rail-accent: #5fd0de;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --control-h: 38px;
  --sidebar-w: 224px;
  --topbar-h: 64px;
  --shadow-card: 0 1px 2px rgba(14, 38, 48, .04);
  --shadow-pop: 0 18px 48px rgba(14, 38, 48, .16), 0 2px 6px rgba(14, 38, 48, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  --chart-2: #f2a15f;
  color-scheme: dark;
  --bg: #0a1519;
  --surface: #101e23;
  --surface-2: #0d1a1e;
  --surface-3: #18292f;
  --surface-raised: #13232a;
  --surface-inset: #0c181c;
  --text: #e3edf0;
  --text-2: #b7c8ce;
  --muted: #7f949c;
  --line: #1f3239;
  --line-strong: #2b434b;
  --accent: #4fbdd3;
  --accent-hover: #6fcde0;
  --accent-soft: #123640;
  --accent-ink: #062027;
  --success: #5cc795;
  --success-soft: #133127;
  --warning: #e3b15f;
  --warning-soft: #33291a;
  --danger: #f2826f;
  --danger-soft: #3a211d;
  --purple: #ab9df0;
  --rail: #071216;
  --rail-2: #0f2128;
  --rail-text: #8fa9b2;
  --rail-text-strong: #eef6f8;
  --rail-accent: #62d3e2;
  --shadow-card: none;
  --shadow-pop: 0 22px 54px rgba(0, 0, 0, .5);
}

body {
  font: 14px/1.5 var(--font-ui);
  letter-spacing: -.003em;
  font-feature-settings: "tnum" 0;
  background: var(--bg);
}
button, input, select, textarea { font-family: var(--font-ui); }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* Controls ------------------------------------------------------------------ */
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-color: var(--line-strong);
  border-radius: 9px;
  font-size: 13.5px;
}
:where(input, select, textarea):hover:not(:disabled):not(:focus) { border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong)); }
:where(input, select, textarea):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
select { cursor: pointer; }
.button, .mini-button {
  border-radius: 9px;
  font-weight: 560;
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.button:active:not(:disabled), .mini-button:active:not(:disabled) { transform: translateY(1px); }
.button.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 1px 2px rgba(14,38,48,.12); }
html[data-theme="dark"] .button.primary { color: var(--accent-ink); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.ghost { border-color: var(--line-strong); }
.button.ghost:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); color: var(--accent); background: var(--surface); }
.button.compact { min-height: 32px; padding: 0 12px; font-size: 13px; }
.mini-button { min-height: 30px; padding: 0 10px; font-size: 12.5px; background: var(--surface-3); }
.mini-button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, var(--surface-3)); color: var(--accent); }
:where(button, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.chip {
  min-height: 21px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 560;
  letter-spacing: 0;
}
.chip.blue { background: var(--accent-soft); color: var(--accent); }
.gmail-label, .thread-fact, .moved-badge { min-height: 21px; border-radius: 999px; padding: 2px 8px; font-size: 11.5px; font-weight: 520; }

.card { border-color: var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card-head { min-height: 56px; padding: 10px 14px; }
.card-head b { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.card-head span { font-size: 12px; }

/* Sign-in -------------------------------------------------------------------- */
.login-view {
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--rail-accent) 22%, transparent), transparent 60%),
    linear-gradient(160deg, var(--rail) 0%, #123a46 100%);
}
.login-card { width: min(400px, 100%); padding: 32px; border: 0; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.login-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.login-card label:not([hidden]) { font-size: 13px; font-weight: 520; }
.login-card .button.primary { min-height: 44px; font-size: 14.5px; }

/* Shell: atoll navy rail ------------------------------------------------------ */
.sidebar {
  gap: 20px;
  padding: 14px 12px 12px;
  border-right: 0;
  background: linear-gradient(180deg, var(--rail) 0%, var(--rail-2) 100%);
  color: var(--rail-text);
}
.brand strong { color: var(--rail-text-strong); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(145deg, #1a8ea3, #0b5466); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; }
.sidebar-toggle { color: var(--rail-text); }
.sidebar-toggle:hover { background: rgba(255,255,255,.07); color: var(--rail-text-strong); }
.compose-button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: var(--rail-accent);
  color: #062a33;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(95, 208, 222, .22);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.compose-button:hover { background: #7ddbe7; color: #062a33; border-color: transparent; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(95, 208, 222, .3); }
.nav-group-label { color: color-mix(in srgb, var(--rail-text) 70%, transparent); font-size: 12px; font-weight: 520; padding-bottom: 6px; }
.nav-stack { gap: 2px; }
.nav {
  min-height: 40px;
  border-radius: 10px;
  color: var(--rail-text);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav:hover { background: rgba(255, 255, 255, .06); color: var(--rail-text-strong); }
.nav.active { background: rgba(95, 208, 222, .14); color: var(--rail-text-strong); font-weight: 560; box-shadow: inset 3px 0 0 var(--rail-accent); }
.nav.active svg { color: var(--rail-accent); }
.nav em { min-width: 22px; height: 20px; background: rgba(255, 255, 255, .09); color: var(--rail-text-strong); font-size: 11.5px; font-weight: 600; }
.nav.active em { background: rgba(95, 208, 222, .22); color: var(--rail-text-strong); }
.nav.has-attention em, .nav em.is-alert { background: #e8573f; color: #fff; }
.user-box { border-top-color: rgba(255, 255, 255, .08); }
.sidebar-profile-button { background: rgba(95, 208, 222, .18); color: var(--rail-text-strong); box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.sidebar-user-copy b { color: var(--rail-text-strong); font-size: 13px; }
.sidebar-user-copy span { color: var(--rail-text); font-size: 11.5px; }
.sidebar-collapsed .nav em, .sidebar-collapsed .nav.has-attention em { border-color: var(--rail); background: #e8573f; color: #fff; }
.sidebar-collapsed .nav.active { box-shadow: none; }

.main { padding: 0 18px 18px; }
.topbar { gap: 16px; }
.topbar h1 { font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.topbar-actions { gap: 8px; }
.searchbox { height: 40px; border-radius: 11px; background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-card); }
.searchbox input { font-size: 13.5px; height: 36px; }
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }

.notification-bell, .topbar-icon-button, .workspace-menu > summary {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow-card);
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.notification-bell:hover, .topbar-icon-button:hover, .workspace-menu > summary:hover, .workspace-menu[open] > summary { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--surface); }
.notification-bell svg, .topbar-icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-bell em, .topbar-icon-button em {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  line-height: 1;
}
.notification-bell.has-due svg { animation: bell-ring 2.4s var(--ease) 1; transform-origin: 50% 15%; }
@keyframes bell-ring { 0%, 60%, 100% { transform: rotate(0); } 8% { transform: rotate(14deg); } 16% { transform: rotate(-12deg); } 24% { transform: rotate(8deg); } 32% { transform: rotate(-5deg); } }

/* Team chat lives in the top bar now (it used to float over the Send button). */
.chat-fab.topbar-icon-button { position: relative; right: auto; bottom: auto; z-index: auto; transform: none; backdrop-filter: none; }
.chat-fab.topbar-icon-button:hover { transform: none; box-shadow: var(--shadow-card); }
.chat-fab.topbar-icon-button svg { opacity: 1; width: 20px; height: 20px; }
.chat-fab.topbar-icon-button.has-unread { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.chat-panel { top: calc(var(--topbar-h) + 4px); bottom: auto; right: 18px; height: min(680px, calc(100dvh - var(--topbar-h) - 24px)); border-radius: 18px; box-shadow: var(--shadow-pop); }

.attention-pulse {
  min-height: 34px;
  padding: 0 12px;
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 560;
}
.attention-pulse b { font-weight: 600; }

.workspace-menu-panel { width: min(320px, calc(100vw - 32px)); padding: 16px; gap: 12px; border-radius: 16px; }
.workspace-preference { font-size: 13.5px; }
.language-switch button { font-size: 12px; }
.reminder-prefs { display: grid; gap: 10px; padding: 10px 0; border-block: 1px solid var(--line); }
.pref-switch { position: relative; width: 40px; height: 24px; padding: 0; border-radius: 999px; background: var(--line-strong); transition: background .18s var(--ease); }
.pref-switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s var(--ease); }
.pref-switch.on { background: var(--accent); }
.pref-switch.on i { transform: translateX(16px); }

/* Notification centre ------------------------------------------------------- */
.notification-center { border-radius: 16px; box-shadow: var(--shadow-pop); border-color: var(--line); }
.notification-group.due .notification-group-label { color: var(--danger); }
.notification-group-label { font-size: 12px; font-weight: 600; }
.notification-item h4 { font-size: 13.5px; font-weight: 560; }
.notification-item p { font-size: 12.5px; }

/* Layout: panels side by side; side panel only overlays on narrow screens ---- */
.mail-layout, .desk-layout { gap: 12px; }
.mail-layout { grid-template-columns: var(--inbox-queue-width, 360px) 6px minmax(0, 1fr) 360px; }
.desk-layout { grid-template-columns: var(--desk-queue-width, 320px) 6px minmax(0, 1fr) 340px; }
@media (max-width: 1500px) {
  .mail-layout { grid-template-columns: var(--inbox-queue-width, 330px) 6px minmax(0, 1fr) 320px; }
  .mail-layout.details-collapsed { grid-template-columns: var(--inbox-queue-width, 330px) 6px minmax(0, 1fr); }
  .desk-layout { grid-template-columns: var(--desk-queue-width, 300px) 6px minmax(0, 1fr) 320px; }
  .desk-layout.details-collapsed { grid-template-columns: var(--desk-queue-width, 300px) 6px minmax(0, 1fr); }
  .allocation-side:not([hidden]), .desk-side:not([hidden]) { position: relative; inset: auto; width: auto; box-shadow: var(--shadow-card); z-index: auto; }
}
@media (max-width: 1280px) {
  .mail-layout, .mail-layout.details-collapsed { grid-template-columns: var(--inbox-queue-width, 300px) 6px minmax(0, 1fr); }
  .desk-layout, .desk-layout.details-collapsed { grid-template-columns: var(--desk-queue-width, 280px) 6px minmax(0, 1fr); }
  .allocation-side:not([hidden]), .desk-side:not([hidden]) { position: absolute; z-index: 26; inset: 0 0 0 auto; width: min(380px, 60vw); box-shadow: var(--shadow-pop); animation: side-in .22s var(--ease); }
}
@keyframes side-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.desk-resizer, .inbox-resizer { border-radius: 999px; }
.desk-resizer span, .inbox-resizer span { background: var(--line-strong); }

/* Queues (Allocation / Sales desk) ------------------------------------------- */
.thread-list-card, .manager-queue { background: var(--surface); }
.thread-rows, .queue-rows { padding: 4px 6px 10px; }
.thread-row, .queue-row {
  width: 100%;
  margin: 0 0 2px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.thread-row { min-height: 84px; gap: 10px; }
.queue-row { min-height: 80px; gap: 10px; }
.thread-row.single-mode { grid-template-columns: 36px minmax(0, 1fr); }
.thread-row.bulk-mode { grid-template-columns: 20px 36px minmax(0, 1fr); }
.queue-row { grid-template-columns: 36px minmax(0, 1fr); }
.avatar-cell, .sender-avatar { width: 36px; height: 36px; }
.sender-avatar { font-size: 12.5px; font-weight: 600; letter-spacing: .01em; background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.thread-row:hover, .queue-row:hover { background: var(--surface-2); border-color: var(--line); }
.thread-row.active, .queue-row.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.thread-row.sla-overdue:not(.active), .queue-row.sla-overdue:not(.active) { box-shadow: inset 3px 0 0 var(--danger); }
.thread-row.sla-risk:not(.active), .queue-row.sla-risk:not(.active) { box-shadow: inset 3px 0 0 var(--warning); }
.queue-row.attention-critical:not(.active) { background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 18%, transparent); box-shadow: inset 3px 0 0 var(--danger); }
.queue-row.attention-high:not(.active), .queue-row.attention-soon:not(.active) { background: color-mix(in srgb, var(--warning-soft) 50%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 18%, transparent); box-shadow: inset 3px 0 0 var(--warning); }
.queue-row.attention-critical .thread-subject { color: var(--text); }
.thread-line strong, .queue-row .thread-main > strong { font-size: 14px; font-weight: 600; }
.thread-subject { margin-top: 2px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.thread-main p, .queue-snippet { margin: 3px 0 6px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.thread-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.thread-request-summary { font-size: 12px; font-weight: 520; color: var(--text-2); }
.queue-row .queue-badges { margin-top: 6px; }
.thread-row .thread-badges .chip { min-height: 20px; font-size: 11.5px; padding-inline: 7px; }
.unread-dot, .priority-dot { width: 9px; height: 9px; border: 2px solid var(--surface); }
.reminder-chip { background: var(--accent-soft); color: var(--accent); }
.reminder-chip::before { content: ''; width: 7px; height: 7px; margin-right: 2px; border-radius: 50%; border: 1.5px solid currentColor; }

.allocation-local-search { margin: 10px 12px 6px; }
.allocation-local-search input { height: 38px; border-radius: 10px; font-size: 13.5px; }
.allocation-filters { gap: 4px; padding: 4px 12px 10px; flex-wrap: wrap; overflow: visible; border: 0; background: transparent; }
.allocation-filters button { min-height: 32px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 520; }
.allocation-filters button.on { background: var(--text); color: var(--surface); }
.allocation-filters button.on em { background: color-mix(in srgb, var(--surface) 22%, transparent); color: var(--surface); }
.allocation-filters button em { font-size: 11.5px; }
.incoming-head-actions { gap: 6px; }
.incoming-head-actions select { height: 32px; font-size: 13px; border-radius: 9px; }
#startBulkSelect { min-height: 32px; }
.bulk-toolbar {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0 0 6px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  box-shadow: 0 6px 16px rgba(14, 38, 48, .08);
  animation: bulk-in .18s var(--ease);
}
@keyframes bulk-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bulk-toolbar > span { font-size: 12.5px; color: var(--text-2); font-weight: 520; }
.bulk-toolbar select { height: 32px; font-size: 12.5px; }
.thread-row.bulk-mode .select-cell input, .bulk-check input { width: 16px; height: 16px; }

.queue-tools { margin: 0; padding: 12px 12px 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.desk-queue-search { height: 38px; margin-bottom: 10px; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.desk-queue-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.desk-queue-search input { font-size: 13.5px; height: 34px; }
/* Primary queue filters: one segmented control instead of a 2×2 box grid */
.queue-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.queue-filter-grid .queue-tab { height: auto; min-height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 0; padding: 4px 2px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 520; text-align: center; transition: background .18s, color .18s, box-shadow .18s; }
.queue-filter-grid .queue-tab span { flex: 0 0 auto; max-width: 100%; }
.queue-filter-grid .queue-tab em { order: -1; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.queue-filter-grid .queue-tab:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 50%, transparent); }
.queue-filter-grid .queue-tab.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-card); }
.queue-filter-grid .queue-tab.on em { color: var(--accent); }
.queue-tab { border-radius: 9px; font-size: 13px; font-weight: 520; }
.queue-tab em { font-size: 12px; font-variant-numeric: tabular-nums; }
.queue-tab.on { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.queue-more-filters { margin-top: 6px; border-top: 0; }
.queue-more-filters > summary { min-height: 30px; justify-content: flex-start; gap: 6px; padding: 0 4px; border-radius: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 520; transition: background .15s; }
.queue-more-filters > summary:hover { background: var(--surface-2); }
.queue-more-filters > summary::before { content: ''; width: 6px; height: 6px; margin: 0 4px 2px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease); }
.queue-more-filters[open] > summary::before { transform: rotate(45deg); }
.queue-more-filters > summary span { margin-left: auto; font-size: 12px; }
.queue-more-filters[open] > :not(summary) { animation: panel-in .2s var(--ease); }
.manager-queue .card-head select { width: 170px; height: 34px; font-size: 13px; }

/* Reading pane --------------------------------------------------------------- */
.reader-empty { color: var(--muted); font-size: 13.5px; }
.allocation-reader-empty b, .desk-empty-state b { font-size: 16px; font-weight: 600; color: var(--text); }
.allocation-reader-empty span { font-size: 13.5px; }
.allocation-reader-title { flex-wrap: wrap; align-items: flex-start; row-gap: 12px; }
.allocation-reader-copy { flex: 1 1 320px; }
.allocation-reader-copy h2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.allocation-routing-actions { flex: 0 1 auto; margin-left: auto; }
.allocation-reader-badges { flex-wrap: wrap; overflow: visible; margin-top: 8px; }
.allocation-mail-head { padding: 16px 18px 14px; }
.reader-title-row h2, .allocation-reader-copy h2, .desk-title-copy h2 { font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.desk-title-copy h2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.desk-title-copy p, .allocation-reader-copy p { font-size: 13px; }
.allocation-route-picker > span, .allocation-details-slot > span { font-size: 12px; font-weight: 520; color: var(--muted); }
.desk-thread-head { padding: 16px 18px 12px; gap: 10px; }
.desk-action-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 520;
}
.desk-action-button:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--accent); background: var(--surface); }
.desk-action-button.price-check-open { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.desk-action-button.price-check-open:hover { background: var(--accent-hover); color: var(--accent-ink); }
.details-toggle-button { min-height: 36px; border-radius: 10px; font-size: 13px; }
.desk-pipeline > summary { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; }
.desk-pipeline-current small { display: none; }
.desk-pipeline-current b { font-size: 13px; font-weight: 560; }

/* Remind-me control in the conversation header */
.desk-remind { position: relative; flex: 0 0 auto; }
.desk-remind > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.desk-remind > summary::-webkit-details-marker { display: none; }
.desk-remind.is-set > summary { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); color: var(--accent); }
.desk-remind.is-due > summary { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); color: var(--danger); }
.desk-remind-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: pop-in .16s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.desk-remind-panel header { display: grid; gap: 2px; }
.desk-remind-panel header b { font-size: 14px; font-weight: 600; }
.desk-remind-panel header span { color: var(--muted); font-size: 12.5px; }
.desk-remind-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.desk-remind-presets button { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 520; text-align: left; }
.desk-remind-presets button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.desk-remind-custom { display: grid; grid-template-columns: minmax(0, 1fr) 112px auto; gap: 6px; }
.desk-remind-custom input { height: 36px; font-size: 13px; }
.desk-remind-clear { justify-self: start; padding: 4px 0; background: none; color: var(--danger); font-size: 13px; font-weight: 520; }
.desk-remind-clear:hover { text-decoration: underline; }

.thread-attention-banner { border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.thread-attention-banner b { font-size: 13.5px; font-weight: 600; }
.live-deadline { border-radius: 999px; }
.live-deadline small { letter-spacing: 0; font-size: 11.5px; }
.desk-status-row .operational-badges .live-deadline { min-height: 24px; }

/* Messages: calm timeline, one conversation column */
.allocation-messages .message-content, #deskMain > .messages .message-content { padding-left: 44px; }
.allocation-messages .attachment-list { padding-left: 44px; }
.message-avatar { width: 32px; height: 32px; }
.message-head-main b { font-size: 14px; font-weight: 600; }
.message-date { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.message-subject { font-size: 13px; color: var(--text-2); }
.message-recipients { font-size: 12.5px; }
.message-body-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.quoted-block > summary { font-size: 12.5px; }
.attachment-pill { border-radius: 10px; font-size: 13px; }

/* Skeletons while a conversation loads */
.messages-skeleton { display: grid; gap: 12px; padding: 4px 0; }
.message.message-skeleton { padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.skeleton-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.skeleton-avatar { width: 32px; height: 32px; border-radius: 50%; }
.skeleton-body { display: grid; gap: 9px; }
.skeleton-line { height: 10px; border-radius: 999px; }
.skeleton-avatar, .skeleton-line { background: linear-gradient(90deg, var(--surface-3) 0%, color-mix(in srgb, var(--surface-3) 40%, var(--surface)) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton-line.push { margin-left: auto; }
.w-12 { width: 12%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-60 { width: 60%; } .w-75 { width: 75%; } .w-90 { width: 90%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Reply composer */
.reply-box { margin: 0 16px 16px; border-radius: 14px; border-color: var(--line-strong); box-shadow: 0 4px 16px rgba(14, 38, 48, .05); }
.reply-box:is(.is-composing, :has(.rich-reply-editor:focus)) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent), 0 8px 24px rgba(14, 38, 48, .08); }
.reply-envelope > summary { min-height: 38px; padding: 0 14px; font-size: 13px; }
.reply-envelope > summary em { font-size: 12.5px; color: var(--accent); }
.rich-reply-editor { font-size: 14px; line-height: 1.6; padding: 12px 14px; }
.send-split .button.primary { min-height: 38px; padding: 0 18px; font-size: 14px; }

/* Side panels */
.allocation-side, .desk-side { background: var(--surface); }
.allocation-section-head span, .desk-side-section-head span, .desk-side-section > summary span { font-size: 13.5px; font-weight: 600; color: var(--text); }
.allocation-section-head small, .desk-side-section-head small, .desk-side-section > summary small { font-size: 12px; }
.request-summary-item span, .desk-request-row span, .request-workspace-row span { font-size: 12px; color: var(--muted); }
.request-summary-item b, .desk-request-row strong, .request-workspace-row strong { font-size: 13.5px; font-weight: 520; }
.section-edit-button { min-height: 30px; border-radius: 8px; font-size: 12.5px; }
.manager-picker-toggle { min-height: 42px; border-radius: 11px; }
.manager-picker-selection b { font-size: 13.5px; font-weight: 560; }
.manager-picker-selection small { font-size: 12px; }
.manager-picker-menu { border-radius: 14px; box-shadow: var(--shadow-pop); }
.manager-picker-option { border-radius: 10px; }
.manager-picker-option b { font-size: 13.5px; font-weight: 560; }
.manager-picker-option small { font-size: 12px; }

/* Action center */
.action-summary { gap: 10px; }
.action-row, .action-rows > * { transition: background .14s var(--ease); }

/* Mail feed */
.feed-row { transition: background .14s var(--ease); }
.feed-row-sender strong { font-size: 14px; font-weight: 600; }
.feed-row-subject-line b { font-size: 13.5px; font-weight: 560; }
.feed-row-subject-line span { font-size: 12.5px; }
.feed-thread-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }

/* Dialogs */
dialog { border-radius: 18px; }
dialog::backdrop { background: rgba(8, 22, 28, .42); backdrop-filter: blur(2px); }
.compose-dialog { border-radius: 18px; box-shadow: var(--shadow-pop); }

/* Toasts */
.toast-item { border-radius: 12px; padding: 11px 12px; }
.toast-item > span { font-size: 13.5px; }

/* Reminder alert: one card hanging from the bell ------------------------------ */
.reminder-stack {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 1400;
  width: min(372px, calc(100vw - 16px));
}
.reminder-stack[hidden] { display: none; }
.reminder-stack::before {
  content: '';
  position: absolute;
  top: -6px;
  right: var(--caret-right, 18px);
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 3px 0 0 0;
  background: var(--surface);
  transform: rotate(45deg);
  z-index: 1;
}
.reminder-card {
  position: relative;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 48px -16px rgba(8, 30, 38, .38), 0 2px 6px rgba(8, 30, 38, .08);
  transform-origin: calc(100% - var(--caret-right, 18px)) 0;
}
.reminder-card::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.reminder-card.danger::after { background: var(--danger); }
.reminder-card.followup::after { background: var(--warning); }
.reminder-stack[data-enter="drop"] .reminder-card { animation: reminder-drop .42s cubic-bezier(.2, .9, .25, 1.15); }
.reminder-stack[data-enter="next"] .reminder-card { animation: reminder-next .24s var(--ease); }
.reminder-stack[data-enter="prev"] .reminder-card { animation: reminder-prev .24s var(--ease); }
.reminder-stack[data-enter="swap"] .reminder-card { animation: reminder-swap .26s var(--ease); }
.reminder-card.leaving { animation: reminder-leave .2s ease-in forwards; }
@keyframes reminder-drop { from { opacity: 0; transform: translateY(-10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes reminder-next { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes reminder-prev { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes reminder-swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes reminder-leave { to { opacity: 0; transform: translateY(-8px) scale(.9); } }
.notification-bell.absorb { animation: bell-absorb .5s var(--ease); }
.notification-bell.ringing svg { animation: bell-ring 2.4s var(--ease) 1; transform-origin: 50% 15%; }
@keyframes bell-absorb { 40% { transform: scale(1.12); box-shadow: 0 0 0 6px var(--accent-soft); } }

.reminder-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 0 16px; min-width: 0; }
.reminder-card-icon { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.reminder-card.danger .reminder-card-icon { background: var(--danger-soft); color: var(--danger); }
.reminder-card.followup .reminder-card-icon { background: var(--warning-soft); color: var(--warning); }
.reminder-card-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reminder-card.reminder .reminder-card-icon svg { animation: bell-ring 2.4s var(--ease) 1; transform-origin: 50% 20%; }
.reminder-card-head b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.reminder-card.danger .reminder-card-head b { color: var(--danger); }
.reminder-card.followup .reminder-card-head b { color: var(--warning); }
.reminder-card-head time { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.reminder-pager { margin-left: auto; display: inline-flex; align-items: center; gap: 0; padding: 2px; border-radius: 999px; background: var(--surface-2); }
.reminder-pager span { min-width: 34px; text-align: center; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.reminder-pager button, .reminder-dismiss { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.reminder-pager button:hover:not(:disabled), .reminder-dismiss:hover { background: var(--surface-3); color: var(--text); }
.reminder-pager button:disabled { opacity: .35; cursor: default; }
.reminder-pager svg, .reminder-dismiss svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.reminder-dismiss { flex: 0 0 auto; }
.reminder-card-head time + .reminder-dismiss, .reminder-card-head b + .reminder-dismiss { margin-left: auto; }

.reminder-card-body { display: grid; gap: 2px; margin: 8px 8px 0; padding: 8px 8px; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background .15s; }
.reminder-card-body:hover { background: var(--surface-2); }
.reminder-card-note { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.reminder-card-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.reminder-card-note + .reminder-card-subject { color: var(--text-2); font-size: 13px; }
.reminder-card-body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }

.reminder-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 10px 12px 12px 16px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.reminder-snooze-label { color: var(--muted); font-size: 12px; }
.reminder-snooze { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-3); }
.reminder-snooze button { min-height: 26px; padding: 0 9px; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 520; transition: background .15s, color .15s; }
.reminder-snooze button:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.reminder-card-actions .button.compact { margin-left: auto; min-height: 32px; padding: 0 14px; font-size: 13px; }

/* Team tools ---------------------------------------------------------------- */
#view-team.active { display: block; overflow: auto; overscroll-behavior: contain; }
.team-shell { display: grid; gap: 16px; padding-bottom: 12px; }
.team-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.team-head-copy h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.team-head-copy p { margin: 4px 0 0; max-width: 64ch; color: var(--muted); font-size: 13.5px; }
.team-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-card); }
.team-tabs button { min-height: 36px; padding: 0 16px; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 520; }
.team-tabs button:hover { color: var(--text); background: var(--surface-2); }
.team-tabs button.on { background: var(--accent); color: var(--accent-ink); }
.team-panel { animation: panel-in .2s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.team-readonly-pill { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 520; }
.team-hint-line { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.signature-composer-grid.single { grid-template-columns: minmax(0, 1fr); }
.own-badge { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-style: normal; font-weight: 560; }
.admin-entity-row.is-own { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.team-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 220px; color: var(--muted); }
.inline-spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.duty-card.read-only .coverage-form { display: none; }
#saveLabelCatalog:disabled { opacity: .55; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reminder-card, .reminder-card.leaving, .notification-bell.absorb, .desk-remind-panel, .team-panel, .bulk-toolbar, .allocation-side:not([hidden]), .desk-side:not([hidden]) { animation: none; }
  .skeleton-avatar, .skeleton-line { animation: none; }
  .reminder-stack[data-enter] .reminder-card { animation: none; }
}

/* Small screens */
@media (max-width: 760px) {
  .main { padding: 0 8px 8px; }
  .topbar h1 { font-size: 18px; }
  .reminder-stack { left: 8px; width: auto; }
  .reminder-snooze-label { display: none; }
  .desk-remind-panel { position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; }
  .team-tabs { width: 100%; overflow-x: auto; }
  .chat-panel { right: 8px; left: 8px; width: auto; }
}

/* Analytics ----------------------------------------------------------------- */
.trend-legend .legend-blue { background: var(--accent); }
.trend-legend .legend-green { background: var(--chart-2); }
.analytics-page-copy b { font-size: 16px; font-weight: 600; }
.analytics-card { border-radius: var(--radius-lg); }
.analytics-card .section-title h3 { font-size: 14px; font-weight: 600; }

/* Admin --------------------------------------------------------------------- */
.user-list-tools { grid-template-columns: 1fr 1fr; }
.user-list-tools input { grid-column: 1 / -1; }
.admin-nav-item { border-radius: 9px; font-size: 13.5px; }
.admin-nav-item.on { background: var(--accent-soft); color: var(--accent); }
.admin-title-row-v3 h2 { font-size: 18px; font-weight: 600; }

/* Conversation headers adapt to the width of their own pane, not the window */
#deskMain, #reader { container-type: inline-size; }
@container (max-width: 820px) {
  .desk-primary-head { grid-template-columns: minmax(0, 1fr); }
  .desk-head-actions { justify-content: flex-start; flex-wrap: wrap; }
  .desk-thread-tools { flex-wrap: wrap; }
  .allocation-routing-actions { margin-left: 0; width: 100%; }
  .allocation-route-picker { flex: 1 1 auto; }
}
@container (max-width: 560px) {
  .desk-action-button span, .details-toggle-button span { display: none; }
  .desk-remind > summary span { display: inline; }
  .thread-attention-banner { flex-wrap: wrap; }
}

.bulk-toolbar { display: grid; gap: 8px; }
.bulk-toolbar-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bulk-toolbar-row select { flex: 1 1 auto; min-width: 0; }
.bulk-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 520; }
.bulk-count { flex: 1 1 auto; min-width: 0; color: var(--text-2); font-size: 13px; }

/* Price check: an inset sheet with Request | Search + Results ------------------ */
.price-check-dialog {
  inset: 12px;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 0 0 100vmax rgba(8, 22, 28, .46), 0 30px 80px -20px rgba(0, 0, 0, .45);
}
.price-check-dialog[open] { animation: sheet-in .32s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.price-check-dialog-shell { background: var(--surface-2); }
.price-workspace-header { min-height: 60px; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 0 12px 0 22px; background: var(--surface); }
.price-workspace-back { display: none; }
.price-workspace-header b { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.price-workspace-header span { font-size: 12.5px; }
.price-workspace-close { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: transparent; color: var(--muted); transition: background .15s, color .15s, transform .15s; }
.price-workspace-close:hover { background: var(--surface-3); color: var(--text); }
.price-workspace-close:active { transform: scale(.94); }
.price-workspace-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.price-check-dialog-body { background: var(--surface-2); scrollbar-gutter: auto; }
.price-check-dialog-body .price-check-card { background: transparent; }

.price-check-workspace { grid-template-columns: 360px minmax(0, 1fr); background: transparent; min-height: 100%; }
.price-check-controls { display: grid; align-content: start; gap: 12px; padding: 16px; border-right: 1px solid var(--line); background: var(--surface); }
.price-check-dialog-body .price-check-controls { max-height: calc(100dvh - 86px); scrollbar-width: thin; scrollbar-gutter: auto; }
.price-check-controls .request-workspace-context { padding: 0; border: 0; gap: 12px; }
.request-workspace-context > header > div:first-child b { font-size: 15px; font-weight: 600; }
.request-workspace-row strong { font-weight: 560; }

.price-check-controls .requested-hotel-choices { gap: 8px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.requested-hotel-head > span { color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.text-action { min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; transition: background .15s; }
.requested-hotel-list { gap: 6px; }
.requested-hotel-row { grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.requested-hotel-row:last-child { border-bottom: 1px solid var(--line); }
.requested-hotel-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.requested-hotel-row:active { transform: scale(.99); }
.requested-hotel-row.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.requested-hotel-row b { font-size: 13.5px; font-weight: 560; color: var(--text); }
.requested-hotel-row small { font-size: 12px; }
.requested-hotel-check { width: 20px; height: 20px; border-radius: 6px; }
.requested-hotel-row.on .requested-hotel-check { border-color: var(--accent); }

.price-check-results { gap: 16px; padding: 16px 20px 28px; background: transparent; }
.price-search-section { overflow: visible; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
.price-search-heading { flex-wrap: wrap; padding: 14px 16px 10px; }
.price-search-heading b { font-size: 15px; font-weight: 600; }
.price-search-heading-tools { display: flex; align-items: center; gap: 8px; }
.price-source-tabs { display: inline-flex; margin: 0; padding: 3px; border: 0; border-radius: 10px; background: var(--surface-3); }
.price-source-tabs button { min-height: 30px; padding: 0 14px; border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 520; transition: background .15s, color .15s, box-shadow .15s; }
.price-source-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }

.price-check-form { gap: 12px; padding: 4px 16px 14px; }
.price-form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.price-form-row > * { min-width: 0; }
.price-field-profile { flex: 1 1 170px; max-width: 240px; }
.price-field-hotel { flex: 3 1 260px; }
.price-field-room { flex: 3 1 240px; }
.price-form-row-stay .date-row { flex: 2 1 300px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.price-form-row-stay .price-guest-grid { flex: 1 1 190px; gap: 12px; }
.price-form-row-stay .price-child-ages { flex: 1 1 220px; display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 12px; }
.price-child-ages label:last-child:nth-child(3) { grid-column: auto; }
.price-check-form > .price-form-row label, .price-check-form .date-row label, .price-check-form .price-guest-grid label, .price-check-form .price-child-ages label { display: grid; gap: 6px; color: var(--text-2); font-size: 12.5px; font-weight: 520; }
.price-check-form input, .price-check-form select { height: 40px; border-radius: 10px; font-size: 13.5px; }
.price-check-form .price-hotel-combo > input { height: 38px; font-size: 13.5px; }
.price-hotel-clear, .price-hotel-toggle { top: 6px; }
.price-match-line, .price-check-notice, .price-check-error { border-radius: 10px; font-size: 13px; padding: 9px 12px; }

.price-check-actionbar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.price-check-actionbar > span { flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: 13px; text-align: left; }
.price-check-actionbar.blocked > span { color: var(--warning); }
.price-check-actionbar.blocked > span::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.price-check-submit { width: auto; min-width: 210px; min-height: 42px; padding: 0 22px; border-radius: 11px; font-size: 14px; font-weight: 600; transition: transform .15s, box-shadow .15s, opacity .15s; }
.price-check-submit:not(:disabled):hover { box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); transform: translateY(-1px); }
.price-check-submit:not(:disabled):active { transform: translateY(0) scale(.98); }

.price-results-split { display: grid; gap: 16px; align-items: start; }
.price-results-split.has-brief { grid-template-columns: minmax(0, 1fr) 340px; }
.price-results-main { min-width: 0; display: grid; gap: 14px; align-content: start; }
.price-results-brief { position: sticky; top: 0; min-width: 0; }
.price-results-brief .price-hotel-brief { gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
.price-results-brief .price-hotel-brief.loading { min-height: 120px; place-items: center; color: var(--muted); }
.price-results-brief .price-section-title { grid-template-columns: 32px minmax(0, 1fr); }
.price-results-brief .price-dashboard-facts { grid-template-columns: minmax(0, 1fr); }
.price-results-brief .price-dashboard-facts > span { grid-template-columns: minmax(96px, .8fr) minmax(0, 1.4fr); padding: 8px 0; }
.price-results-brief .price-dashboard-facts small { font-size: 12px; }
.price-results-brief .price-dashboard-facts b { font-size: 13px; font-weight: 520; }
.price-reference-contracts { border-radius: 12px; }
.price-reference-contracts > summary { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.price-result-history { padding: 10px 12px; border-radius: 14px; box-shadow: var(--shadow-card); }
.price-result-history-tab { border-radius: 10px; padding: 7px 10px; transition: border-color .15s, background .15s; }
.price-result-layout { animation: panel-in .28s var(--ease); }

.price-check-placeholder { min-height: 360px; display: grid; place-items: center; align-content: center; justify-items: center; gap: 6px; padding: 40px 24px; border: 1.5px dashed var(--line-strong); border-radius: 18px; background: color-mix(in srgb, var(--surface) 55%, transparent); text-align: center; }
.price-check-placeholder .price-placeholder-icon { width: 56px; height: 56px; margin-bottom: 8px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.price-check-placeholder .price-placeholder-icon svg { width: 26px; height: 26px; }
.price-check-placeholder > b { color: var(--text); font-size: 17px; font-weight: 600; }
.price-check-placeholder > p { margin: 0 0 14px; max-width: 42ch; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.price-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; text-align: left; }
.price-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; transition: color .2s; }
.price-steps i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 12px; font-style: normal; font-weight: 600; transition: background .2s, color .2s, border-color .2s; }
.price-steps li.current { color: var(--text); }
.price-steps li.current i { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.price-steps li.done { color: var(--text-2); }
.price-steps li.done span { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.price-steps li.done i { border-color: var(--success); background: var(--success); color: #fff; }
.price-steps i svg.i { width: 14px; height: 14px; stroke-width: 2.6; }

@media (max-width: 1320px) {
  .price-results-split.has-brief { grid-template-columns: minmax(0, 1fr); }
  .price-results-brief { position: static; order: -1; }
  .price-results-brief .price-dashboard-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
}
@media (max-width: 1080px) {
  .price-check-workspace { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .price-check-dialog { inset: 0; border: 0; border-radius: 0; }
  .price-check-workspace { grid-template-columns: minmax(0, 1fr); }
  .price-check-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .price-check-dialog-body .price-check-controls { position: static; max-height: none; overflow: visible; }
  .price-check-results { padding: 12px; }
}
@media (max-width: 620px) {
  .price-workspace-header { padding-left: 14px; }
  .price-results-brief .price-dashboard-facts { grid-template-columns: minmax(0, 1fr); }
  .price-check-actionbar { flex-direction: column; align-items: stretch; }
  .price-check-submit { width: 100%; }
  .price-search-heading-tools { width: 100%; justify-content: space-between; }
  .price-check-placeholder { min-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .price-check-dialog[open], .price-result-layout { animation: none; }
}
.price-check-placeholder > * { grid-column: auto; grid-row: auto; }
.price-check-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.price-check-placeholder .price-placeholder-icon { flex: 0 0 auto; }
.price-check-form .price-hotel-combo { height: 40px; border-radius: 10px; }
.price-search-heading-tools .text-action { order: -1; }
.price-check-placeholder > b, .price-check-placeholder > p, .price-check-placeholder > span, .price-check-placeholder > ol { align-self: center; }
.price-search-heading > .price-search-heading-tools { display: flex; align-items: center; gap: 8px; }

/* Avatars: initials under the photo, so a failed photo never shows a broken icon */
.sender-avatar.has-photo { position: relative; overflow: hidden; }
.sender-avatar.has-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Empty states: centred, with a soft icon, never a lone line in a corner */
.empty-hero { height: 100%; min-height: 320px; display: grid; place-items: center; padding: 32px 24px; text-align: center; }
.empty-hero > div { max-width: 340px; display: grid; justify-items: center; gap: 6px; animation: panel-in .3s var(--ease); }
.empty-hero-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.empty-hero-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-hero b { color: var(--text); font-size: 16px; font-weight: 600; }
.empty-hero > div > span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.contacts-empty.detail.empty-hero { display: grid; }

/* Queue rows: chips shrink with an ellipsis instead of being cut mid-letter */
.queue-row .queue-badges { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-height: 46px; overflow: hidden; }
.queue-row .queue-badges > * { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-secondary-filters { flex-wrap: wrap; gap: 4px; }
.queue-secondary-filters .queue-tab.compact { flex: 0 0 auto; height: 30px; padding: 0 10px; border-radius: 8px; }
.queue-secondary-filters .queue-tab.compact span { overflow: visible; }
.personal-tabs-title em { font-style: normal; }

/* Motion: views, popovers, menus and rows ------------------------------------ */
.view.active { animation: view-in .24s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.notification-center:not([hidden]) { animation: pop-in .2s var(--ease); transform-origin: top right; }
.workspace-menu[open] > .workspace-menu-panel { animation: pop-in .2s var(--ease); transform-origin: top right; }
.chat-panel:not([hidden]) { animation: pop-in .24s var(--ease); transform-origin: top right; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
dialog[open]:not(.price-check-dialog) { animation: dialog-in .26s cubic-bezier(.2, .9, .3, 1); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
dialog[open]::backdrop { animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; } }
.thread-row, .queue-row, .feed-row, .action-row, .admin-entity-row, .requested-hotel-row, .nav-item { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.button, .mini-button, .queue-tab, .team-tabs button, .topbar-icon-button, .notification-bell { transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease; }
.button:not(:disabled):active, .mini-button:not(:disabled):active, .topbar-icon-button:active, .notification-bell:active { transform: scale(.97); }
details > summary + * { transform-origin: top; }
@media (prefers-reduced-motion: reduce) {
  .view.active, .notification-center:not([hidden]), .workspace-menu[open] > .workspace-menu-panel, .chat-panel:not([hidden]), dialog[open]:not(.price-check-dialog), dialog[open]::backdrop, .empty-hero > div, .queue-more-filters[open] > :not(summary) { animation: none; }
  .button:not(:disabled):active, .mini-button:not(:disabled):active { transform: none; }
}

/* Icons ---------------------------------------------------------------------- */
svg.i { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Admin → Gmail sync --------------------------------------------------------- */
.gsync { display: grid; gap: 14px; max-width: 980px; }
.gsync-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); animation: panel-in .24s var(--ease); }
.gsync-source { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.gsync-source-copy { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gsync-source-copy b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.gsync-source-copy small { color: var(--muted); font-size: 12.5px; }
.gsync-source-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.gsync-source-icon svg.i { width: 20px; height: 20px; }
.button.compact svg.i { width: 16px; height: 16px; }
.button.compact:has(svg.i) { display: inline-flex; align-items: center; gap: 6px; }
.gsync-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.gsync-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.gsync-head p { margin: 3px 0 0; max-width: 62ch; color: var(--muted); font-size: 13px; line-height: 1.45; }
.gsync-pill { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 560; white-space: nowrap; }
.gsync-pill.ok { background: var(--success-soft); color: var(--success); }
.gsync-pill.warn { background: var(--warning-soft); color: var(--warning); }
.gsync-empty { margin: 0 0 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.gsync-table { display: grid; }
.gsync-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(200px, 1.4fr) 110px 44px 44px; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); transition: background .15s, opacity .15s; }
.gsync-row:first-child { border-top: 0; }
.gsync-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.gsync-row.is-disabled { opacity: .55; }
.gsync-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gsync-person > div { min-width: 0; display: grid; }
.gsync-person b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 560; }
.gsync-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.gsync-avatar { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.gsync-select select { width: 100%; height: 36px; border-radius: 10px; font-size: 13px; }
.gsync-status { justify-self: start; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 560; white-space: nowrap; }
.gsync-status.ok { background: var(--success-soft); color: var(--success); }
.gsync-status.auto { background: var(--accent-soft); color: var(--accent); }
.gsync-status.warn { background: var(--warning-soft); color: var(--warning); }
.gsync-status.muted { background: var(--surface-3); color: var(--muted); }
.gsync-count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.gsync-toggle, .pref-switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; padding: 0; border-radius: 999px; background: var(--line-strong); transition: background .2s var(--ease); }
.gsync-toggle i, .pref-switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.gsync-toggle.on, .pref-switch.on { background: var(--accent); }
.gsync-toggle.on i, .pref-switch.on i { transform: translateX(16px); }
.gsync-options { display: grid; }
.gsync-option { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.gsync-option:first-child { border-top: 0; padding-top: 2px; }
.gsync-option b { display: block; font-size: 13.5px; font-weight: 600; }
.gsync-option small { display: block; margin-top: 2px; max-width: 70ch; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.gsync-savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); }
.gsync-savebar > span { margin-right: auto; color: var(--muted); font-size: 13px; }
.gsync-savebar.is-dirty { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-pop); }
.gsync-savebar.is-dirty > span { color: var(--text); font-weight: 560; }
@media (max-width: 760px) {
  .gsync-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .gsync-select { grid-column: 1 / -1; grid-row: 2; }
  .gsync-status { grid-row: 3; }
  .gsync-count { display: none; }
  .gsync-source { flex-direction: column; align-items: stretch; }
}

/* Team → Labels (from Gmail) */
.team-labels { display: grid; gap: 14px; }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.tl-source { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tl-source b { display: block; font-size: 14px; font-weight: 600; }
.tl-source small { display: block; max-width: 72ch; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.tl-source-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.tl-search { display: flex; align-items: center; gap: 8px; max-width: 420px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); }
.tl-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-search input { flex: 1 1 auto; min-width: 0; height: 36px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 13.5px; }
.tl-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tl-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); animation: panel-in .24s var(--ease); }
.tl-card > header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.tl-card > header b { font-size: 14.5px; font-weight: 600; }
.tl-card > header span { color: var(--muted); font-size: 12.5px; }
.tl-note { margin: -4px 0 8px; color: var(--muted); font-size: 12.5px; }
.tl-list { display: grid; }
.tl-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); font-size: 13.5px; }
.tl-row:first-child { border-top: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.tl-dot.owner { border-radius: 50%; background: var(--chart-2); }
.tl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-count, .tl-owner { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tl-owner em { color: var(--warning); font-style: normal; }
.tl-empty { margin: 6px 0; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .tl-columns { grid-template-columns: 1fr; } .tl-head { flex-direction: column; align-items: stretch; } }

/* Desk: whose requests (own vs. covering a colleague) */
.desk-scope { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.desk-scope::-webkit-scrollbar { display: none; }
.desk-scope-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 520; transition: background .15s, border-color .15s, color .15s; }
.desk-scope-chip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.desk-scope-chip small { color: var(--muted); font-size: 11.5px; }
.desk-scope-chip:hover { border-color: var(--line-strong); color: var(--text); }
.desk-scope-chip.cover { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.desk-scope-chip.duty { border-style: dashed; border-color: color-mix(in srgb, var(--purple) 45%, var(--line)); }
.desk-scope-chip.on { border-style: solid; border-color: var(--text); background: var(--text); color: var(--surface); }
.desk-scope-chip.on em, .desk-scope-chip.on small { color: inherit; opacity: .75; }
.desk-away-note { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; line-height: 1.4; }
.desk-away-note svg.i { width: 16px; height: 16px; }
.desk-away-note b { font-weight: 600; }

/* Mail feed: Gmail-like search + combinable filters ------------------------- */
.feed-filter-bar { position: relative; z-index: 5; flex: 0 0 auto; display: grid; gap: 8px; padding: 10px 14px; overflow: visible; border-bottom: 1px solid var(--line); background: var(--surface); }
.feed-picker-option, .feed-picker-button, .feed-toggle { font-family: inherit; }
.feed-filter-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feed-search { flex: 1 1 320px; min-width: 220px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--muted); transition: border-color .15s, box-shadow .15s, background .15s; }
.feed-search:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.feed-search input { flex: 1 1 auto; min-width: 0; height: 34px; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--text); font-size: 13.5px; }
.feed-search input::-webkit-search-cancel-button { display: none; }
.feed-search button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: transparent; color: var(--muted); }
.feed-search button:hover { background: var(--surface-3); color: var(--text); }
.feed-search button svg.i { width: 15px; height: 15px; }
.feed-picker { position: relative; }
.feed-picker-button, .feed-toggle { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 520; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.feed-picker-button svg.i, .feed-toggle svg.i { width: 16px; height: 16px; }
.feed-picker-button:hover, .feed-toggle:hover { border-color: var(--line-strong); color: var(--text); }
.feed-picker-button > span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.feed-picker-chevron { width: 14px; height: 14px; color: var(--muted); transition: transform .2s var(--ease); }
.feed-picker.open .feed-picker-chevron { transform: rotate(180deg); }
.feed-picker.has-value .feed-picker-button, .feed-toggle.on { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); color: var(--accent); }
.feed-toggle em { font-style: normal; color: var(--muted); font-size: 12px; }
.feed-toggle.on em { color: inherit; opacity: .8; }
.feed-picker-menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 290px; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); animation: pop-in .18s var(--ease); transform-origin: top left; }
.feed-picker-search { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.feed-picker-search svg.i { width: 15px; height: 15px; }
.feed-picker-search input { flex: 1 1 auto; min-width: 0; height: 30px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 13px; }
.feed-picker-options { max-height: 300px; overflow-y: auto; display: grid; gap: 1px; scrollbar-width: thin; }
.feed-picker-option { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 34px; padding: 0 8px; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left; transition: background .12s; }
.feed-picker-option:hover { background: var(--surface-2); }
.feed-picker-option em { color: var(--muted); font-size: 12px; font-style: normal; font-variant-numeric: tabular-nums; }
.feed-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-check { width: 18px; height: 18px; display: grid; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 5px; color: #fff; transition: background .12s, border-color .12s; }
.feed-picker-option.on .feed-check { border-color: var(--accent); background: var(--accent); }
.feed-check svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.feed-picker-empty { margin: 8px; color: var(--muted); font-size: 13px; }
.feed-picker-menu footer { display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--line); }
.feed-clear-all { margin-left: auto; }
.feed-active-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.feed-active-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 12.5px; animation: pop-in .16s var(--ease); }
.feed-active-chip svg.i { width: 14px; height: 14px; color: var(--muted); }
.feed-active-chip button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: transparent; color: var(--muted); }
.feed-active-chip button:hover { background: var(--surface); color: var(--text); }
.feed-active-chip button svg.i { width: 12px; height: 12px; }
@media (max-width: 760px) {
  .feed-search { flex-basis: 100%; }
  .feed-picker-menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; }
}
.feed-tool-button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 520; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.feed-tool-button:hover { border-color: var(--line-strong); color: var(--text); }
.feed-tool-button svg.i { width: 16px; height: 16px; }
.feed-row.kb-focus { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
.feed-more { display: block; width: calc(100% - 28px); margin: 10px 14px 16px; min-height: 40px; border: 1px dashed var(--line-strong); border-radius: 12px; background: transparent; color: var(--accent); font-size: 13px; font-weight: 560; }
.feed-more span { color: var(--muted); font-weight: 400; }
.feed-more:hover { background: var(--accent-soft); }

/* Pinned rates ---------------------------------------------------------------- */
.price-rate-card > summary { position: relative; }
.price-pin-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 30px; margin-left: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 520; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.price-pin-button svg.i { width: 15px; height: 15px; }
.price-pin-button:hover { border-color: var(--accent); color: var(--accent); }
.price-pin-button:active { transform: scale(.95); }
.price-pin-button.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.price-pin-button.on svg.i { animation: pin-drop .35s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pin-drop { from { transform: translateY(-5px) rotate(-20deg); } }
.pinned-rates { display: grid; gap: 8px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.pinned-rates-head { display: flex; align-items: center; gap: 7px; color: var(--accent); }
.pinned-rates-head svg.i { width: 16px; height: 16px; }
.pinned-rates-head b { color: var(--text); font-size: 14px; font-weight: 600; }
.pinned-rates-head em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.pinned-rates-head .text-action { margin-left: auto; }
.pinned-rates-list { display: grid; gap: 8px; }
.pinned-rate { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); animation: pop-in .2s var(--ease); }
.pinned-rate header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pinned-rate header b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.pinned-rate header strong { flex: 0 0 auto; color: var(--accent); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pinned-rate-room { color: var(--text-2); font-size: 12.5px; }
.pinned-rate small { color: var(--muted); font-size: 12px; }
.pinned-rate .pinned-rate-transfer { color: var(--success); }
.pinned-rate .pinned-rate-offer { color: var(--purple); }
.pinned-rate footer { display: flex; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.pinned-rate-action { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 12px; transition: background .12s, color .12s; }
.pinned-rate-action svg.i { width: 14px; height: 14px; }
.pinned-rate-action:hover { background: var(--surface-2); color: var(--text); }
.pinned-rate-action.danger { margin-left: auto; }
.pinned-rate-action.danger:hover { background: var(--danger-soft); color: var(--danger); }
.pinned-strip { margin: 6px 0 2px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.pinned-strip > summary { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; cursor: pointer; list-style: none; color: var(--accent); font-size: 13px; font-weight: 600; }
.pinned-strip > summary::-webkit-details-marker { display: none; }
.pinned-strip > summary svg.i { width: 15px; height: 15px; }
.pinned-strip > summary em { font-style: normal; color: var(--muted); font-weight: 520; }
.pinned-strip-peek { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 400; }
.pinned-strip[open] .pinned-strip-peek { visibility: hidden; }
.pinned-strip-chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .2s var(--ease); }
.pinned-strip[open] .pinned-strip-chevron { transform: rotate(180deg); }
.pinned-strip-list { display: flex; gap: 8px; padding: 0 10px 10px; overflow-x: auto; scrollbar-width: thin; }
.pinned-strip-list .pinned-rate { flex: 0 0 280px; }

/* Rate cards in the team chat */
.chat-rate-cards { display: grid; gap: 6px; margin-top: 6px; }
.chat-rate-ref { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.rate-card { display: grid; gap: 2px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.chat-rate-ref:hover .rate-card { box-shadow: var(--shadow-card); border-color: var(--accent); }
.rate-card-head { display: flex; justify-content: space-between; gap: 10px; }
.rate-card-head b { font-size: 13px; font-weight: 600; }
.rate-card-head strong { color: var(--accent); font-size: 13.5px; }
.rate-card-room { color: var(--text-2); font-size: 12.5px; }
.rate-card small { color: var(--muted); font-size: 11.5px; }
.rate-card .rate-card-transfer { color: var(--success); }
.chat-attachment-chip.rate { display: inline-flex; align-items: center; gap: 5px; }
.chat-attachment-chip svg.i { width: 13px; height: 13px; }

/* Message editors (reply + compose) ------------------------------------------ */
.reply-format-toolbar { max-width: none; overflow-x: auto; opacity: .72; pointer-events: auto; gap: 2px; scrollbar-width: none; transition: opacity .18s ease; }
.reply-format-toolbar::-webkit-scrollbar { display: none; }
.reply-box:is(.is-composing, :has(.rich-reply-editor:focus)) .reply-format-toolbar, .reply-format-toolbar:hover, .compose-format-toolbar { max-width: none; opacity: 1; }
.format-tool, .attach-icon-button { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 8px; color: var(--text-2); transition: background .12s, color .12s, transform .12s; }
.format-tool svg.i, .attach-icon-button svg.i { width: 17px; height: 17px; stroke-width: 1.75; }
.format-tool:hover, .attach-icon-button:hover { background: var(--surface-3); color: var(--text); }
.format-tool:active { transform: scale(.92); }
.format-tool.on { background: var(--accent-soft); color: var(--accent); }
.format-tool:disabled { opacity: .4; pointer-events: none; }
.toolbar-divider { flex: 0 0 auto; height: 20px; margin: 0 4px; }
.rich-reply-editor, .rich-compose-editor { font-size: 14px; line-height: 1.6; }
.rich-reply-editor blockquote, .rich-compose-editor blockquote { margin: 6px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); color: var(--text-2); }
.rich-reply-editor ul, .rich-reply-editor ol, .rich-compose-editor ul, .rich-compose-editor ol { margin: 4px 0; padding-left: 24px; }
.rich-reply-editor a, .rich-compose-editor a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.rich-reply-editor img, .rich-compose-editor img { max-width: 100%; height: auto; border-radius: 6px; }
.compose-editor-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rich-compose-editor { flex: 1 1 auto; min-height: 240px; padding: 16px 20px; overflow-y: auto; outline: none; color: var(--text); }
.rich-compose-editor:empty::before, .rich-compose-editor.is-empty:not(:focus)::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.compose-footer-tools { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.compose-footer-tools::-webkit-scrollbar { display: none; }
.compose-send-button { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .rich-compose-editor { min-height: 180px; } }

/* Pinned rates: compact rows, pin as an icon button ------------------------- */
.price-rate-card > summary { grid-template-columns: 14px minmax(0, 1fr) auto 34px; }
.price-pin-button { width: 34px; height: 34px; margin: 0; padding: 0; justify-content: center; border-radius: 10px; color: var(--muted); }
.price-pin-button svg.i { width: 17px; height: 17px; }
.price-pin-button.on { color: var(--accent-ink); }
@media (max-width: 620px) { .price-rate-card > summary .price-pin-button { grid-column: 2; grid-row: auto; justify-self: start; } }

.pinned-rates { gap: 6px; padding: 10px; border-radius: 12px; }
.pinned-rates-head b { font-size: 13px; }
.pinned-rates-list, .pinned-strip-list { display: grid; gap: 4px; }
.pinned-strip-list { padding: 0 8px 8px; overflow: visible; }
.pinned-strip > summary { min-height: 34px; font-size: 12.5px; }
.pinned-rates-list, .pinned-strip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pinned-strip-list { padding: 0 10px 10px; }
.pinned-row { flex: 0 1 340px; min-width: 0; max-width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 14px; row-gap: 2px; padding: 9px 8px 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s; animation: pop-in .18s var(--ease); }
.pinned-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pinned-rates .pinned-row { flex-basis: 100%; }
.pinned-rates .pr-transfer { display: none; }
.pinned-rates .pr-room { grid-column: 1 / -1; }
.pinned-row > b, .pinned-row > span, .pinned-row > small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-hotel { font-size: 12.5px; font-weight: 600; }
.pr-price { justify-self: end; padding-right: 4px; color: var(--accent); font-size: 13px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pr-room { color: var(--text-2); font-size: 12px; }
.pr-transfer { justify-self: end; padding-right: 4px; color: var(--success); font-size: 11.5px; }
.pr-meta { align-self: center; color: var(--muted); font-size: 11.5px; }
.pr-meta em { font-style: normal; color: var(--purple); }
.pr-actions { justify-self: end; align-self: center; display: flex; }
.pr-actions button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: transparent; color: var(--muted); transition: background .12s, color .12s; }
.pr-actions button:hover { background: var(--surface-2); color: var(--text); }
.pr-actions button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.pr-actions svg.i { width: 15px; height: 15px; }

/* Chat: attached rate chip */
.chat-attachment-chip.rate { max-width: 260px; gap: 6px; padding: 3px 8px; font-size: 12px; }
.chat-attachment-chip.contact { max-width: 240px; gap: 6px; padding: 3px 8px; font-size: 12px; }
.chat-contact-refs { display: grid; gap: 6px; margin-top: 6px; }
.chat-contact-ref { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-contact-card { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.chat-contact-ref:hover .chat-contact-card { border-color: var(--accent); box-shadow: var(--shadow-card); }
.chat-contact-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.chat-contact-copy { display: grid; gap: 1px; min-width: 0; }
.chat-contact-kind { color: var(--accent); font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.chat-contact-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-contact-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 11.5px; }
.chat-contact-copy small.secondary { color: var(--muted); }
.chat-attachment-chip .chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.chat-attachment-chip svg.i { flex: 0 0 auto; }

/* Label picker on a request (labels come from Gmail) */
.crm-tag-add { align-items: start; }
.crm-tag-add .mini-button { height: 34px; }
.crm-label-combobox { position: relative; min-width: 0; }
.crm-label-combobox > input { width: 100%; height: 34px; border-radius: 9px; font-size: 13px; }
.crm-label-combo-options { position: absolute; z-index: 80; top: calc(100% + 4px); left: 0; right: 0; display: grid; gap: 1px; max-height: 260px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); scrollbar-width: thin; animation: pop-in .16s var(--ease); }
.crm-label-combo-options[hidden] { display: none; }
.crm-label-combo-option { width: 100%; min-height: 32px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left; }
.crm-label-combo-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-label-combo-option:hover, .crm-label-combo-option:focus { background: var(--surface-2); outline: 0; }
.crm-label-combo-empty { margin: 6px 8px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.requested-hotel-row .requested-hotel-last { color: var(--success); font-size: 11.5px; }

/* Team → Vacations & duty ----------------------------------------------------- */
.cov { position: relative; display: grid; gap: 14px; }
.cov-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.cov-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cov-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.cov-avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.cov-avatar.duty { background: color-mix(in srgb, var(--purple) 16%, transparent); color: var(--purple); }
.cov-avatar.duty svg.i { width: 15px; height: 15px; }
.cov-avatar.empty { background: var(--surface-3); color: var(--muted); }
.cov-avatar.empty svg.i { width: 14px; height: 14px; }

.cov-calendar-wrap { position: relative; }
.cov-calendar { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cov-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cov-month-nav { display: flex; align-items: center; gap: 6px; }
.cov-month-nav b { min-width: 150px; text-align: center; font-size: 15px; font-weight: 600; text-transform: capitalize; }
.cov-icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: transparent; color: var(--text-2); transition: background .12s, color .12s; }
.cov-icon-btn:hover { background: var(--surface-3); color: var(--text); }
.cov-icon-btn svg.i { width: 17px; height: 17px; }
.cov-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.cov-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.cov-grid { display: grid; }
.cov-row { --lanes: 1; display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(var(--lanes) * 30px + 10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.cov-row:not(.cov-row-head):hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cov-row:last-child { border-bottom: 0; }
.cov-row-head { position: sticky; top: 0; z-index: 2; min-height: 44px; background: var(--surface); }
.cov-row-person { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0 12px; border-right: 1px solid var(--line); font-size: 13px; font-weight: 520; }
.cov-row-person > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cov-days { display: grid; }
.cov-day { display: grid; place-items: center; gap: 0; padding: 4px 0; color: var(--text-2); }
.cov-day small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; }
.cov-day b { font-size: 12.5px; font-weight: 560; }
.cov-day.weekend b { color: var(--muted); }
.cov-day.today b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.cov-row-track { position: relative; min-width: 0; }
.cov-grid-bg { position: absolute; inset: 0; display: flex; pointer-events: none; }
.cov-grid-bg i { flex: 1 1 0; border-right: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.cov-grid-bg i.weekend { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.cov-grid-bg i.today { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.cov-bar { --bar: var(--accent); --lane: 0; position: absolute; top: calc(5px + var(--lane) * 30px); height: 26px; display: flex; align-items: center; gap: 5px; min-width: 0; padding: 0 8px 0 7px; background: var(--bar); overflow: hidden; border: 0; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 560; white-space: nowrap; text-align: left; transition: filter .15s, transform .15s; animation: cov-grow .35s var(--ease); transform-origin: left center; }
@keyframes cov-grow { from { opacity: 0; transform: scaleX(.6); } }
.cov-bar:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cov-bar.duty { background: linear-gradient(90deg, var(--purple), color-mix(in srgb, var(--purple) 70%, #c4a6ff)); }
.cov-bar.finished { opacity: .45; }
.cov-bar.upcoming { opacity: .85; }
.cov-bar.clip-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cov-bar.clip-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.cov-popover { position: absolute; z-index: 20; top: 56px; right: 14px; width: 330px; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); animation: pop-in .18s var(--ease); transform-origin: top right; }
.cov-popover header { display: flex; align-items: center; gap: 8px; }
.cov-popover header .cov-icon-btn { margin-left: auto; width: 28px; height: 28px; }
.cov-pop-title { font-size: 14px; font-weight: 600; }
.cov-pill { padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.cov-pill.active { background: var(--success-soft); color: var(--success); }
.cov-pill.upcoming { background: var(--accent-soft); color: var(--accent); }
.cov-pop-dates { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--text-2); font-size: 13px; }
.cov-pop-dates svg.i { width: 15px; height: 15px; color: var(--muted); }
.cov-pop-note { margin: 0; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.cov-pop-map { display: grid; gap: 8px; }
.cov-pop-map > div { display: flex; align-items: center; gap: 9px; }
.cov-pop-map b { display: block; font-size: 13px; }
.cov-pop-map small { color: var(--muted); font-size: 12px; }
.cov-popover footer { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--line); }
.cov-popover footer .button { display: inline-flex; align-items: center; gap: 6px; }
.cov-popover footer svg.i { width: 15px; height: 15px; }
.danger-text { color: var(--danger); }

/* Side sheet */
.cov-sheet-backdrop { position: fixed; inset: 0; z-index: 1500; background: rgba(8, 22, 28, .38); animation: fade-in .2s ease; }
.cov-sheet { position: fixed; z-index: 1501; top: 12px; right: 12px; bottom: 12px; width: min(620px, calc(100vw - 24px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: sheet-slide .3s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheet-slide { from { opacity: 0; transform: translateX(30px); } }
.cov-sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px 22px; border-bottom: 1px solid var(--line); }
.cov-sheet-head b { display: block; font-size: 17px; font-weight: 600; }
.cov-sheet-head small { display: block; max-width: 52ch; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cov-sheet-head .cov-icon-btn { margin-left: auto; }
.cov-sheet-body { flex: 1 1 auto; display: grid; align-content: start; gap: 16px; overflow-y: auto; padding: 18px 22px; }
.cov-sheet-foot { display: flex; align-items: center; gap: 8px; padding: 14px 18px 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.cov-sheet-foot > span { flex: 1 1 auto; color: var(--text-2); font-size: 13px; }
.cov-people-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; }
.cov-people-pick label, .cov-note { display: grid; gap: 6px; color: var(--text-2); font-size: 12.5px; font-weight: 520; }
.cov-people-arrow { padding-bottom: 10px; color: var(--muted); }
.cov-people-arrow svg.i { width: 18px; height: 18px; }
.cov-person-select { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.cov-person-select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cov-person-select select { flex: 1 1 auto; min-width: 0; height: 42px; border: 0; background: transparent; box-shadow: none; font-size: 13.5px; }
.cov-note input { height: 40px; border-radius: 10px; font-size: 13.5px; }
.cov-warning { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 12.5px; line-height: 1.45; }
.cov-warning svg.i { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
.cov-range { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.cov-range-head { display: flex; align-items: center; gap: 8px; }
.cov-range-summary { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 560; }
.cov-range-summary.done { color: var(--text); }
.cov-range-summary svg.i { width: 16px; height: 16px; color: var(--accent); }
.cov-range-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cov-cal-month > b { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; text-align: center; text-transform: capitalize; }
.cov-cal-week, .cov-cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cov-cal-week span { padding: 4px 0; color: var(--muted); font-size: 11px; text-align: center; text-transform: capitalize; }
.cov-cal-cell { position: relative; height: 34px; display: grid; place-items: center; border-radius: 0; background: transparent; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; transition: background .1s, color .1s; }
.cov-cal-cell.blank { pointer-events: none; }
.cov-cal-cell.weekend { color: var(--text-2); }
.cov-cal-cell.past { color: var(--muted); opacity: .6; }
.cov-cal-cell:hover:not(.blank) { background: var(--surface-3); border-radius: 9px; }
.cov-cal-cell.today::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cov-cal-cell.in { background: var(--accent-soft); border-radius: 0; }
.cov-cal-cell.start, .cov-cal-cell.end { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cov-cal-cell.start { border-radius: 9px 0 0 9px; }
.cov-cal-cell.end { border-radius: 0 9px 9px 0; }
.cov-cal-cell.start.end { border-radius: 9px; }
.cov-cal-cell.start:not(:has(~ .in)):not(:has(~ .end)) { border-radius: 9px; }
.cov-range-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.cov-chip { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12.5px; transition: border-color .12s, color .12s, background .12s; }
.cov-chip:hover { border-color: var(--accent); color: var(--accent); }
.cov-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cov-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cov-times label { display: grid; gap: 5px; color: var(--text-2); font-size: 12.5px; }
.cov-times input { height: 38px; border-radius: 10px; }
.cov-block { display: grid; gap: 10px; }
.cov-block-head { display: flex; align-items: baseline; gap: 8px; }
.cov-block-head b { font-size: 14px; font-weight: 600; }
.cov-block-head small { color: var(--muted); font-size: 12.5px; }
.cov-block-head .text-action { margin-left: auto; }
.cov-team-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cov-team-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12.5px; transition: border-color .12s, background .12s, color .12s; }
.cov-team-chip:hover { border-color: var(--line-strong); color: var(--text); }
.cov-team-chip.on { border-color: var(--purple); background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--text); }
.cov-team-chip svg.i { width: 14px; height: 14px; color: var(--purple); }
.cov-map { display: grid; gap: 6px; }
.cov-map-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(150px, .9fr); align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.cov-map-row b { display: block; font-size: 13px; font-weight: 560; }
.cov-map-row small { color: var(--muted); font-size: 11.5px; }
.cov-map-row > svg.i { width: 15px; height: 15px; color: var(--muted); }
.cov-map-row select { height: 34px; border-radius: 9px; font-size: 13px; }
.cov-muted { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .cov-row { grid-template-columns: 110px minmax(0, 1fr); }
  .cov-range-months { grid-template-columns: 1fr; }
  .cov-range-months .cov-cal-month + .cov-cal-month { display: none; }
  .cov-people-pick { grid-template-columns: 1fr; }
  .cov-people-arrow { display: none; }
  .cov-sheet { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 92vh; }
  .cov-popover { left: 8px; right: 8px; width: auto; }
}
.cov-bar svg.i { flex: none; width: 13px; height: 13px; }
.cov-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cov-bar.vacation { --bar: #14a3b8; }
.cov-bar.dayoff { --bar: #3b82f6; }
.cov-bar.sick { --bar: #e5534b; }
.cov-bar.trip { --bar: #d98a1c; }
.cov-bar.crm { --bar: #64748b; }
.cov-bar.duty { --bar: var(--purple); }
.cov-bar.pending { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bar) 30%, var(--surface)) 0 6px, color-mix(in srgb, var(--bar) 18%, var(--surface)) 6px 12px); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--bar); }
.cov-bar.uncovered:not(.pending) { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warning) 85%, #fff); }
.cov-cal-head { flex-wrap: wrap; }
.cov-cal-meta { color: var(--muted); font-size: 12.5px; }
.cov-cal-head .cov-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-left: auto; color: var(--muted); font-size: 12px; }
.cov-cal-head .cov-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cov-cal-head .cov-legend i { width: 12px; height: 8px; border-radius: 3px; }
.cov-legend i.vacation { background: #14a3b8; }
.cov-legend i.dayoff { background: #3b82f6; }
.cov-legend i.sick { background: #e5534b; }
.cov-legend i.trip { background: #d98a1c; }
.cov-legend i.duty { background: var(--purple); }
.cov-legend i.pending { background: repeating-linear-gradient(135deg, var(--line-strong) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cov-grid-bg i.monday { border-left: 1px solid var(--line); }
.cov-day.monday { box-shadow: inset 1px 0 0 var(--line); }
.cov-row.has .cov-row-person { font-weight: 600; }
.cov-row.duty-row { background: color-mix(in srgb, var(--purple) 5%, transparent); }
.cov-you { padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-style: normal; font-weight: 600; }

.cov-summary { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(260px, .9fr); gap: 12px; }
.cov-card { display: grid; grid-template-rows: auto 1fr; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); animation: ana-in .3s ease both; }
.cov-card > header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cov-card > header b { font-size: 14px; }
.cov-card > header small { color: var(--muted); font-size: 12px; }
.cov-card.fix.has { border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); background: color-mix(in srgb, var(--warning) 5%, var(--surface)); }
.cov-today-list, .cov-fix-list { display: grid; gap: 4px; align-content: start; max-height: 220px; overflow-y: auto; }
.cov-today-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.cov-today-row:hover { background: var(--surface-2); }
.cov-today-row b, .cov-fix-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.cov-today-row small, .cov-fix-row small { display: block; color: var(--muted); font-size: 12px; }
.cov-covers { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-style: normal; color: var(--text-2); }
.cov-covers svg.i { width: 13px; height: 13px; color: var(--muted); }
.cov-covers.warn { color: var(--warning); font-weight: 600; }
.cov-fix-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, auto); align-items: center; gap: 10px; padding: 6px 4px; }
.cov-cover-select { height: 32px; max-width: 200px; border-radius: 9px; font-size: 12.5px; }
.cov-muted.ok { display: inline-flex; align-items: center; gap: 6px; color: var(--success); }
.cov-muted.ok svg.i { width: 15px; height: 15px; }
.cov-sync { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 9px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.cov-sync svg.i { width: 12px; height: 12px; }
.cov-sync.ok { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); }
.cov-sync.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.cov-sync.busy svg.i { animation: ana-spin .8s linear infinite; }
.cov-sync.off { cursor: default; }
.cov-side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cov-side-stats div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.cov-side-stats b { font-size: 20px; line-height: 1.1; }
.cov-side-stats span { color: var(--muted); font-size: 12px; }
.cov-side-actions { display: flex; flex-wrap: wrap; gap: 8px; align-self: end; }
.cov-side-actions .button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.cov-side-actions svg.i { width: 16px; height: 16px; }
.cov-card.side { grid-template-rows: auto auto 1fr; }

.cov-type { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--tone, var(--accent)) 14%, transparent); color: var(--tone, var(--accent)); font-size: 12px; font-weight: 600; }
.cov-type svg.i { width: 13px; height: 13px; }
.cov-type.vacation, .cov-type-chip.vacation { --tone: #14a3b8; }
.cov-type.dayoff, .cov-type-chip.dayoff { --tone: #3b82f6; }
.cov-type.sick, .cov-type-chip.sick { --tone: #e5534b; }
.cov-type.trip, .cov-type-chip.trip { --tone: #d98a1c; }
.cov-type.crm, .cov-type-chip.crm { --tone: #64748b; }
.cov-type.duty { --tone: var(--purple); }
.cov-pill.pending { background: var(--warning-soft); color: var(--warning); }
.cov-pop-person { display: flex; align-items: center; gap: 10px; }
.cov-pop-person b { display: block; font-size: 14px; }
.cov-pop-person small { color: var(--muted); font-size: 12.5px; }
.cov-pop-cover { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; }
.cov-pop-cover > span { color: var(--muted); }
.cov-pop-cover > b { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.cov-pop-cover > b.warn { color: var(--warning); }
.cov-pop-hint { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.cov-pop-hint.ok { color: var(--success); }
.cov-pop-hint svg.i { width: 14px; height: 14px; flex: none; }
.cov-popover footer { gap: 8px; }
.cov-type-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cov-type-chip { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 560; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.cov-type-chip svg.i { width: 18px; height: 18px; color: var(--tone); }
.cov-type-chip:hover { border-color: var(--tone); }
.cov-type-chip.on { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); color: var(--text); box-shadow: 0 0 0 1px var(--tone); }
.cov-people-pick label > span em { color: var(--muted); font-style: normal; font-weight: 400; }
.cov-cal-cell.taken:not(.start):not(.end):not(.in) { color: var(--warning); text-decoration: line-through; }
@media (max-width: 1100px) { .cov-summary { grid-template-columns: 1fr 1fr; } .cov-card.side { grid-column: 1 / -1; } }
@media (max-width: 760px) { .cov-summary { grid-template-columns: 1fr; } .cov-type-pick { grid-template-columns: 1fr 1fr; } .cov-fix-row { grid-template-columns: auto minmax(0, 1fr); } .cov-fix-row .cov-cover-select { grid-column: 1 / -1; max-width: none; } }
#toast.toast-stack { z-index: 2600; }

/* ---------- Signatures: editor card + mail-style preview ---------- */
.sig-card { display: grid; grid-template-rows: auto 1fr; min-height: 0; height: 100%; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.sig-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.sig-head > .sig-who { display: grid; gap: 2px; min-width: 0; flex: 1; }
.sig-head b { font-size: 14px; }
.sig-head small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-head .button { display: inline-flex; align-items: center; gap: 6px; }
.sig-head .button svg { width: 15px; height: 15px; }
.sig-head .button.is-busy { opacity: .65; pointer-events: none; }
.sig-save-state { font-size: 12px; color: var(--muted); transition: color .2s; }
.sig-save-state.dirty { color: var(--warning); }
.sig-save-state.ok { color: var(--success); }
.sig-save-state.bad { color: var(--danger); }
.sig-body { display: grid; gap: 18px; padding: 18px; overflow: auto; align-content: start; }
.sig-section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 8px; }
.sig-section-head > b { font-size: 13px; }
.sig-section-head > small { color: var(--muted); font-size: 12px; }
.sig-insert { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.sig-insert > span { color: var(--muted); font-size: 11.5px; margin-right: 2px; }
.sig-token { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px 0 6px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s; }
.sig-token svg { width: 13px; height: 13px; }
.sig-token:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); transform: translateY(-1px); }
.sig-editor-block .signature-admin-editor { min-height: 170px; border-radius: 12px; }
.sig-editor-block .signature-resolve-hint { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.sig-editor-block .signature-resolve-hint svg { width: 14px; height: 14px; flex: none; }
.sig-seg { display: inline-flex; margin-left: auto; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.sig-seg button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; transition: background .15s, color .15s; }
.sig-seg button svg { width: 13px; height: 13px; }
.sig-seg button.on { background: var(--surface); color: var(--text, inherit); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.sig-mail { --mail-bg: #ffffff; --mail-fg: #1f2329; --mail-muted: #737a85; --mail-line: #e6e8ec; --mail-skel: #eef0f3; border: 1px solid var(--line); border-radius: 14px; background: var(--mail-bg); color: var(--mail-fg); overflow: hidden; transition: background .25s, color .25s; }
.sig-mail.dark { --mail-bg: #1f2226; --mail-fg: #e7e9ec; --mail-muted: #9aa1ab; --mail-line: #31353b; --mail-skel: #2b2f35; }
.sig-mail-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--mail-line); }
.sig-mail-head > div { display: grid; gap: 1px; min-width: 0; }
.sig-mail-head b { font-size: 13px; color: var(--mail-fg); }
.sig-mail-head small { font-size: 12px; color: var(--mail-muted); }
.sig-mail-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 20%, var(--mail-bg)); color: var(--accent); font-size: 12px; font-weight: 700; flex: none; }
.sig-mail-body { display: grid; gap: 7px; padding: 16px 16px 4px; }
.sig-mail-body i { display: block; height: 8px; border-radius: 4px; background: var(--mail-skel); }
.sig-mail-body i.short { width: 55%; }
.sig-mail .sig-mail-signature { min-height: 0; max-height: 360px; overflow: auto; padding: 14px 16px 18px; background: transparent; color: var(--mail-fg); font-size: 13px; line-height: 1.5; }
.sig-mail .sig-mail-signature a { color: #2f7de1; }
.sig-mail .signature-preview-empty { color: var(--mail-muted); }
.sig-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.sig-fields span { display: grid; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.sig-fields small { color: var(--muted); font-size: 11px; }
.sig-fields b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.signature-composer-grid .sig-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.signature-bulk-compose > .sig-insert { margin: 0 0 10px; }
@media (max-width: 900px) { .sig-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sig-insert { margin-left: 0; } }

/* ---------- Contacts: person card ---------- */
.contacts-avatar { background: hsl(var(--hue, 190) 60% 50% / .16); color: hsl(var(--hue, 190) 55% 42%); }
html[data-theme="dark"] .contacts-avatar { background: hsl(var(--hue, 190) 55% 55% / .2); color: hsl(var(--hue, 190) 70% 72%); }
.contacts-hero { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, hsl(var(--hue, 190) 60% 50% / .10), transparent 60%); animation: contacts-in .25s ease; }
.contacts-hero-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.contacts-hero .contacts-avatar { width: 58px; height: 58px; font-size: 19px; box-shadow: 0 0 0 4px var(--surface); }
.contacts-hero h2 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
.contacts-hero .contacts-detail-identity > span { color: var(--muted); font-size: 13px; }
.contacts-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.contacts-hero-chips span { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.contacts-hero-chips span.tag { background: color-mix(in srgb, var(--purple) 12%, var(--surface)); border-color: color-mix(in srgb, var(--purple) 26%, var(--line)); color: var(--purple); }
.contacts-detail-actions .contacts-action-button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.contacts-detail-actions .contacts-action-button:hover { background: var(--surface-2); transform: translateY(-1px); }
.contacts-detail-actions .contacts-action-button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.contacts-detail-actions .contacts-action-button.icon-only { width: 34px; padding: 0; justify-content: center; }
.contacts-detail-actions .contacts-action-button svg { width: 16px; height: 16px; }
.contacts-detail-body { width: 100%; max-width: 1240px; padding: 16px 22px 28px; }
.contacts-detail-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; }
.contacts-main-col, .contacts-side-col { display: grid; gap: 14px; min-width: 0; }
.contacts-activity > header svg, .contacts-side-card > header svg, .contacts-notes > svg { width: 15px; height: 15px; color: var(--accent); }
/* Key facts under the hero: one compact strip instead of separate cards. */
.contacts-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.contacts-fact { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.contacts-fact-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; background: var(--surface-2); color: var(--accent); }
.contacts-fact-icon svg { width: 14px; height: 14px; }
.contacts-fact-copy { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; line-height: 1.4; }
.contacts-fact-copy small { color: var(--muted); font-size: 11px; }
.contacts-fact-copy a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.contacts-fact-copy a:hover { color: var(--accent); }
.contacts-birthday-soon { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 11px; font-style: normal; font-weight: 600; }
/* Right column: company with its managers, then location and business. */
.contacts-side-card { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.contacts-side-card > header { display: flex; align-items: center; gap: 9px; min-width: 0; }
.contacts-side-card > header span { display: grid; min-width: 0; }
.contacts-side-card > header small { color: var(--muted); font-size: 11px; }
.contacts-side-card > header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.contacts-info-group { display: grid; min-width: 0; }
.contacts-info-group + .contacts-info-group { padding-top: 10px; border-top: 1px solid var(--line); }
.contacts-info-group h3 { margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.contacts-profile-row { grid-template-columns: 104px minmax(0, 1fr); padding: 5px 0; border-bottom: 0; }
.contacts-owner-block { display: grid; gap: 6px; }
.contacts-owner-block > small { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.contacts-owner-list { display: flex; flex-wrap: wrap; gap: 6px; }
.contacts-owner-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 4px 0 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.contacts-owner-chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; padding-right: 6px; }
.contacts-owner-avatar { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 9.5px; font-weight: 700; }
.contacts-owner-avatar img { width: 100%; height: 100%; object-fit: cover; }
.contacts-owner-detach { display: grid; place-items: center; width: 20px; height: 20px; margin-left: -4px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.contacts-owner-detach svg { width: 11px; height: 11px; }
.contacts-owner-detach:hover { background: var(--surface-3); color: var(--text); }
.contacts-owner-detach.confirming { background: var(--danger-soft); color: var(--danger); }
.contacts-owner-empty { color: var(--muted); font-size: 12px; }
.contacts-notes { display: flex; gap: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.contacts-notes > svg { flex: 0 0 auto; margin-top: 2px; }
.contacts-notes p { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.contacts-activity { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.contacts-activity > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.contacts-activity > header span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; }
.contacts-activity > header small { color: var(--muted); font-size: 12px; }
.contacts-request { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.contacts-request:last-child { border-bottom: 0; }
.contacts-request:hover { background: var(--surface-2); }
.contacts-request-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.contacts-request-dot.closed, .contacts-request-dot.done, .contacts-request-dot.won { background: var(--success); }
.contacts-request-dot.lost { background: var(--muted); }
.contacts-request-copy { display: grid; gap: 2px; min-width: 0; }
.contacts-request-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.contacts-request-copy small { color: var(--muted); font-size: 12px; }
.contacts-request time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.contacts-activity-empty { padding: 16px; color: var(--muted); font-size: 12.5px; }
@keyframes contacts-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) { .contacts-detail-columns { grid-template-columns: minmax(0, 1fr); } .contacts-side-col { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; } }
@media (max-width: 760px) { .contacts-hero { flex-direction: column; } .contacts-detail-actions { flex-wrap: wrap; } .contacts-facts { padding: 12px; gap: 10px 18px; } .contacts-detail-body { padding: 14px 12px 24px; } }

/* ---------- Analytics: sectioned dashboard ---------- */
#view-analytics.ana.active { display: grid; }
.ana { --ana-good: var(--success); --ana-warn: var(--warning); --ana-bad: var(--danger); --ana-c1: var(--accent); --ana-c2: var(--chart-2, #e07a3a); --ana-c3: var(--purple); --ana-c4: var(--success); --ana-c5: var(--warning); --ana-c6: var(--muted); gap: 14px; align-content: start; padding: 4px 2px 28px; transition: opacity .2s; }
.ana.is-loading { opacity: .6; }
.ana-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ana-title { display: grid; gap: 2px; }
.ana-title b { font-size: 16px; letter-spacing: -.01em; }
.ana-title span { color: var(--muted); font-size: 12.5px; }
.ana-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ana-seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.ana-seg button { height: 28px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.ana-seg button:hover { color: inherit; }
.ana-seg button.on { background: var(--surface); color: inherit; box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.ana-controls .analytics-select { height: 36px; border-radius: 10px; }
.ana-refresh { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; }
.ana-refresh svg { width: 16px; height: 16px; }
.ana.is-loading .ana-refresh svg { animation: ana-spin .8s linear infinite; }
@keyframes ana-spin { to { transform: rotate(360deg); } }
.ana-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ana-kpi { position: relative; display: grid; gap: 6px; align-content: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; animation: ana-in .3s ease both; }
.ana-kpi::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); opacity: .7; }
.ana-kpi.good::after { background: var(--ana-good); }
.ana-kpi.bad::after { background: var(--ana-bad); }
.ana-kpi-top { display: flex; align-items: center; gap: 8px; }
.ana-kpi-top small { color: var(--muted); font-size: 12px; font-weight: 600; }
.ana-kpi-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.ana-kpi.good .ana-kpi-icon { background: color-mix(in srgb, var(--ana-good) 14%, transparent); color: var(--ana-good); }
.ana-kpi.bad .ana-kpi-icon { background: color-mix(in srgb, var(--ana-bad) 14%, transparent); color: var(--ana-bad); }
.ana-kpi-icon svg { width: 15px; height: 15px; }
.ana-kpi > b { font-size: 26px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ana-kpi-bar { height: 5px; border-radius: 999px; background: var(--surface-3, var(--surface-2)); overflow: hidden; }
.ana-kpi-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s ease; }
.ana-kpi.good .ana-kpi-bar i { background: var(--ana-good); }
.ana-kpi-note { color: var(--muted); font-size: 12px; }
.ana-kpi-note em { font-style: normal; opacity: .8; }
.ana-kpi-note em::before { content: "· "; }
.ana-insights { display: flex; flex-wrap: wrap; gap: 8px; }
.ana-insights:empty { display: none; }
.ana-insight { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--purple) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--purple) 22%, var(--line)); font-size: 12.5px; }
.ana-insight svg { width: 15px; height: 15px; color: var(--purple); flex: none; }
.ana-section-label { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.ana-section-label b { font-size: 14px; }
.ana-section-label span { color: var(--muted); font-size: 12.5px; }
.ana-grid { display: grid; gap: 12px; }
.ana-grid.flow { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.ana-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ana-card { display: grid; grid-template-rows: auto 1fr; gap: 12px; min-width: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); animation: ana-in .3s ease both; }
.ana-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ana-card h3 { margin: 0; font-size: 13.5px; }
.ana-card > header small { color: var(--muted); font-size: 12px; }
.ana-card .trend-legend { margin: 0; color: var(--muted); font-weight: 500; }
.ana-card .legend-blue { background: var(--accent); height: 8px; width: 8px; border-radius: 2px; }
.ana-card .legend-green { background: var(--chart-2, #e07a3a); }
.ana-card.is-empty .chart-wrap { display: none; }
.ana-empty { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 120px; color: var(--muted); font-size: 12.5px; text-align: center; }
.ana-empty svg { width: 22px; height: 22px; opacity: .5; }
.ana-funnel { display: grid; gap: 7px; align-content: start; }
.ana-stage { display: grid; grid-template-columns: 130px minmax(0, 1fr) 28px; align-items: center; gap: 10px; font-size: 12.5px; }
.ana-stage > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-stage > b { text-align: right; font-variant-numeric: tabular-nums; }
.ana-stage.zero { color: var(--muted); }
.ana-stage.zero b { font-weight: 500; }
.ana-stage-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ana-stage-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--purple))); transition: width .5s ease calc(var(--i) * 30ms); }
.ana-donut-layout { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; align-items: center; }
.ana-donut { display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; }
.ana-donut > div { display: grid; place-items: center; align-content: center; width: 80px; height: 80px; border-radius: 50%; background: var(--surface); }
.ana-donut b { font-size: 19px; line-height: 1.1; }
.ana-donut span { color: var(--muted); font-size: 11px; }
.ana-legend { display: grid; gap: 8px; min-width: 0; }
.ana-legend > div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto 38px; align-items: center; gap: 8px; font-size: 12.5px; }
.ana-legend i { width: 9px; height: 9px; border-radius: 3px; }
.ana-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-legend small { color: var(--muted); text-align: right; }
.ana-bars { display: grid; gap: 10px; align-content: start; }
.ana-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 12.5px; }
.ana-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-bar-row > b { font-variant-numeric: tabular-nums; }
.ana-bar-track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ana-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s ease; }
.ana-bar-row.alt .ana-bar-track i { background: var(--purple); }
.ana-bar-row.good .ana-bar-track i { background: var(--ana-good); }
.ana-bar-row.warn .ana-bar-track i { background: var(--ana-warn); }
.ana-bar-row.bad .ana-bar-track i { background: var(--ana-bad); }
.ana-bar-row > small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.ana-bar-row > small:empty { display: none; }
.ana-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-content: start; }
.ana-tile { display: grid; gap: 4px; justify-items: start; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.ana-tile svg { width: 16px; height: 16px; color: var(--muted); }
.ana-tile b { font-size: 22px; line-height: 1.1; }
.ana-tile span { color: var(--muted); font-size: 12px; }
.ana-tile.good svg, .ana-tile.good b { color: var(--ana-good); }
.ana-tile.bad { background: color-mix(in srgb, var(--ana-bad) 10%, var(--surface-2)); }
.ana-tile.bad svg, .ana-tile.bad b { color: var(--ana-bad); }
.ana-foot { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.ana-people { grid-template-rows: auto; padding: 4px 0; }
.ana-table { display: grid; }
.ana-tr { display: grid; grid-template-columns: minmax(180px, 1.6fr) minmax(140px, 1.3fr) repeat(5, minmax(80px, .8fr)); align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: 13px; font-variant-numeric: tabular-nums; }
.ana-tr:last-of-type { border-bottom: 0; }
.ana-tr.head { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.ana-tr:not(.head):hover { background: var(--surface-2); }
.ana-tr .is-bad { color: var(--ana-bad); font-weight: 600; }
.ana-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ana-who i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-size: 11px; font-style: normal; font-weight: 700; flex: none; }
.ana-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ana-cell-bar { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; }
.ana-cell-bar em { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ana-cell-bar em i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.ana-ring { --p: 0; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ana-ring.good { background: conic-gradient(var(--ana-good) calc(var(--p) * 1%), var(--surface-2) 0); }
.ana-ring i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); font-size: 9.5px; font-style: normal; font-weight: 700; }
.ana-people .ana-foot { padding: 8px 16px 6px; margin: 0; }
@keyframes ana-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1280px) { .ana-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ana-grid.flow, .ana-grid.three { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .ana-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ana-table { overflow-x: auto; } .ana-tr { min-width: 780px; } .ana-seg { overflow-x: auto; max-width: 100%; } }
.ana .trend-card { grid-column: auto; min-height: 0; }

/* Signatures: wide screens put the editor and the preview side by side. */
@media (min-width: 1500px) {
  .sig-card:not(.sig-bulk-targets) > .sig-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .sig-bulk-main > .sig-body > .sig-preview-as { grid-column: 2; grid-row: 1; align-self: start; margin-bottom: -8px; }
  .sig-bulk-main > .sig-body > .sig-editor-block { grid-row: 1 / span 2; }
  .sig-bulk-main > .sig-body > .sig-preview { grid-column: 2; }
}
.signature-variable-chip { font-family: inherit; }
.sig-step { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); font-size: 13px; font-weight: 700; }
.sig-bulk { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.sig-bulk .sig-card { height: auto; }
.sig-start-from { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sig-start-from select { height: 32px; max-width: 220px; border-radius: 9px; font-size: 12.5px; }
.sig-preview-as { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.sig-preview-as select { height: 32px; max-width: 260px; border-radius: 9px; font-size: 12.5px; }
.sig-bulk-targets { position: sticky; top: 8px; grid-template-rows: auto auto minmax(0, 1fr) auto; max-height: calc(100vh - 210px); }
.sig-target-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 8px; }
.sig-target-tools input { flex: 1 1 100%; height: 34px; border-radius: 9px; font-size: 13px; }
.sig-target-list { display: grid; align-content: start; gap: 2px; min-height: 120px; padding: 0 8px 8px; overflow-y: auto; }
.sig-target { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.sig-target[hidden] { display: none; }
.sig-target:hover { background: var(--surface-2); }
.sig-target:has(input:checked) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sig-target input { width: 16px; height: 16px; accent-color: var(--accent); }
.sig-target .admin-entity-avatar { width: 28px; height: 28px; font-size: 11px; }
.sig-target b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 560; }
.sig-target small { display: block; font-size: 11.5px; color: var(--muted); }
.sig-target.diff small { color: var(--warning); }
.sig-target.empty small { color: var(--danger); }
.sig-target.same small { color: var(--success); }
.sig-bulk-foot { display: grid; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.sig-bulk-foot .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; }
.sig-bulk-foot .button svg { width: 16px; height: 16px; }
.sig-bulk-foot .button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.sig-bulk-foot small { color: var(--muted); font-size: 11.5px; text-align: center; }
@media (max-width: 1100px) { .sig-bulk { grid-template-columns: 1fr; } .sig-bulk-targets { position: static; max-height: none; } }
.signatures-master-detail { max-height: none; height: calc(100vh - var(--topbar-h) - 150px); min-height: 520px; }
#signatureInspector > .sig-card { border: 0; border-radius: 0; }
.cov-popover { width: min(380px, calc(100% - 28px)); }
.cov-popover footer { flex-wrap: wrap; }
.cov-pop-cover .cov-cover-select { min-width: 0; max-width: 210px; }
.notification-actions a.mini-button { color: var(--text-2); text-decoration: none; }

/* ---------- Presence dots (Staff + Dashboard + CRM activity) ---------- */
.presence-avatar { position: relative; display: inline-flex; flex: 0 0 auto; }
.presence-dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: var(--line-strong); box-sizing: content-box; }
.presence-dot.online { background: var(--success); }
.presence-dot.meeting { background: var(--warning); }
.presence-dot.absent { background: var(--purple); }
.presence-dot.away, .presence-dot.unknown { background: var(--line-strong); }
.presence-dot.unknown { display: none; }

/* ---------- Allocation: company managers and client history ---------- */
.owner-suggestion { display: grid; gap: 5px; margin-top: 8px; }
.owner-suggestion > small { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.owner-suggestion-list { display: flex; flex-wrap: wrap; gap: 6px; }
.owner-suggestion-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 3px 4px 3px 4px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 999px; background: var(--accent-soft); }
.owner-suggestion-chip.current { border-color: var(--success); background: var(--success-soft); }
.owner-suggestion-chip > span:not(.presence-avatar) { display: grid; min-width: 0; padding-right: 4px; }
.owner-suggestion-chip b { font-size: 12px; font-weight: 650; white-space: nowrap; }
.owner-suggestion-chip small { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.owner-suggestion-chip .mini-button { min-height: 26px; border-radius: 999px; }
.owner-suggestion-avatar { width: 26px; height: 26px; font-size: 10px; }
.manager-owner-badge { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-style: normal; font-weight: 700; vertical-align: 1px; }
.manager-picker-option.company-owner { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.returning-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 650; white-space: nowrap; }
.returning-pill.booked { background: var(--success-soft); color: var(--success); }
.returning-pill.company { background: color-mix(in srgb, var(--purple) 14%, var(--surface)); color: var(--purple); }
.client-history { display: grid; gap: 10px; }
.client-history .allocation-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-history-block { display: grid; gap: 7px; }
.client-history-block + .client-history-block { padding-top: 10px; border-top: 1px solid var(--line); }
.client-history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.client-history-head b { font-size: 12.5px; }
.client-history-head small { color: var(--muted); font-size: 11px; }
.client-history-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.client-history-stats span { display: grid; gap: 1px; padding: 6px 8px; border-radius: 9px; background: var(--surface-2); }
.client-history-stats b { font-size: 14px; }
.client-history-stats small { color: var(--muted); font-size: 10.5px; }
.client-history-last { display: grid; gap: 1px; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.client-history-last:hover { border-color: var(--accent); }
.client-history-last small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.client-history-last b { font-size: 12.5px; }
.client-history-last span { color: var(--text-2); font-size: 11.5px; }
.client-history-note { margin: 0; color: var(--muted); font-size: 11.5px; }
.client-history-desk { padding: 12px 14px; }

/* ---------- Search everywhere (top bar) ---------- */
.global-search { position: relative; flex: 0 1 380px; min-width: 0; }
.global-search .searchbox { width: 100%; }
.global-search-panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; max-height: min(70vh, 560px); overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-pop); min-width: 380px; }
.gsearch-section + .gsearch-section { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.gsearch-section > header { padding: 6px 8px 4px; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.gsearch-row { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.gsearch-row:hover, .gsearch-row:focus-visible { background: var(--surface-2); outline: none; }
.gsearch-icon { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-3); color: var(--accent); }
.gsearch-icon svg { width: 14px; height: 14px; }
.gsearch-copy { display: grid; gap: 1px; min-width: 0; }
.gsearch-copy b, .gsearch-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-copy b { font-size: 12.5px; font-weight: 600; }
.gsearch-copy small { color: var(--muted); font-size: 11.5px; }
.gsearch-key { margin-right: 4px; color: var(--accent); font-style: normal; font-weight: 700; }
.gsearch-row time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.gsearch-ext { color: var(--muted); }
.gsearch-ext svg { width: 13px; height: 13px; }
.gsearch-empty { padding: 14px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 760px) { .global-search-panel { position: fixed; top: 64px; left: 10px; right: 10px; min-width: 0; } }

/* ---- Analytics: money & losses ---- */
.ana-revenue { display: grid; gap: 12px; align-content: start; }
.ana-money { display: grid; gap: 2px; }
.ana-money b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ana-money span { color: var(--muted); font-size: 12px; }
.ana-money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ana-money-grid > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.ana-money-grid small { color: var(--muted); font-size: 11.5px; }
.ana-money-grid b { font-size: 15px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-money-grid em { font-style: normal; color: var(--ana-good); font-size: 12px; font-weight: 600; }
.ana-money-other { display: flex; flex-wrap: wrap; gap: 6px; }
.ana-money-other span { padding: 3px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.ana-money-other small { color: var(--muted); }
.ana-foot.is-warn { color: var(--ana-warn); }
.ana-money-cell { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ana-bar-row.muted .ana-bar-track i { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.ana-lost-notes { display: grid; gap: 6px; align-content: start; }
.ana-lost-note { display: grid; gap: 3px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: var(--surface-2); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ana-lost-note:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.ana-lost-note span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.ana-lost-note span b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ana-lost-note span em { flex: none; font-style: normal; font-size: 11px; color: var(--ana-bad); }
.ana-lost-note p { margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Admin: AI usage ---- */
.ai-usage-panel { display: grid; gap: 8px; align-content: start; min-width: 0; }
.ai-usage-head { display: flex; align-items: baseline; gap: 6px; }
.ai-usage-head b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ai-usage-head span { color: var(--muted); font-size: 12px; }
.ai-usage-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ai-usage-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.ai-usage-bar.warn i { background: var(--ana-warn, #d99a1e); }
.ai-usage-bar.over i { background: var(--ana-bad, #d64545); }
.ai-usage-rows { display: grid; gap: 4px; }
.ai-usage-rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; font-size: 12.5px; }
.ai-usage-rows small { color: var(--muted); }
.ai-usage-rows b { font-variant-numeric: tabular-nums; }
.ai-usage-note { margin: 0; color: var(--ana-bad, #d64545); font-size: 12px; }

/* ---- Stage details (deal amount / close reason) ---- */
.stage-details-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.stage-details-dialog::backdrop { background: rgba(15, 18, 25, .38); }
.stage-details-form { display: grid; }
.stage-details-form > header { display: grid; gap: 2px; padding: 16px 18px 10px; }
.stage-details-form > header b { font-size: 15px; }
.stage-details-form > header small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-details-body { display: grid; gap: 12px; padding: 4px 18px 14px; }
.stage-details-body label { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.stage-details-body input, .stage-details-body select, .stage-details-body textarea { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.stage-details-body textarea { resize: vertical; min-height: 64px; }
.stage-details-hint { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.stage-money-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
.stage-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.stage-reasons legend { width: 100%; margin-bottom: 6px; padding: 0; color: var(--text-2); font-size: 12.5px; }
.stage-details-body label.stage-reason { position: relative; display: inline-flex; cursor: pointer; }
.stage-reason input { position: absolute; opacity: 0; pointer-events: none; }
.stage-reason span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 12.5px; transition: background .15s, border-color .15s; }
.stage-reason:hover span { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.stage-reason input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); font-weight: 600; }
.stage-reason input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage-details-error { margin: 0; color: var(--ana-bad, #d64545); font-size: 12px; }
.stage-details-form > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.side-deal-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(70px, .8fr) minmax(0, 1fr); gap: 8px; }
.desk-request-row.deal-fact strong { font-variant-numeric: tabular-nums; }

/* ---- Reply templates ---- */
.reply-templates-button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.reply-templates-button svg { width: 15px; height: 15px; }
.reply-templates-button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); }
.reply-templates-button:disabled { opacity: .5; cursor: default; }
.reply-templates-popover { z-index: 80; width: min(380px, calc(100vw - 24px)); max-height: min(460px, calc(100vh - 40px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 48px rgba(0,0,0,.18); overflow: hidden; }
.tpl-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
.tpl-head b { font-size: 13.5px; }
.tpl-search { padding: 0 12px 8px; }
.tpl-search input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.tpl-body { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.tpl-list { overflow-y: auto; padding: 0 6px 6px; }
.tpl-list section + section { margin-top: 4px; }
.tpl-list h4 { margin: 6px 6px 4px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tpl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; border-radius: 10px; }
.tpl-row:hover { background: var(--surface-2); }
.tpl-pick { display: grid; gap: 2px; min-width: 0; padding: 7px 8px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tpl-pick b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-pick small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-row-actions { display: flex; gap: 2px; padding-right: 4px; opacity: 0; transition: opacity .12s; }
.tpl-row:hover .tpl-row-actions, .tpl-row:focus-within .tpl-row-actions { opacity: 1; }
.tpl-row-actions .icon-button { width: 26px; height: 26px; }
.tpl-row-actions .icon-button svg { width: 14px; height: 14px; }
.tpl-row-actions .confirming { color: var(--ana-bad, #d64545); background: color-mix(in srgb, var(--ana-bad, #d64545) 12%, transparent); }
.tpl-empty { padding: 18px 12px; color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.45; }
.tpl-save-current { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
.tpl-save-current svg { width: 15px; height: 15px; }
.tpl-save-current:hover { background: var(--surface-2); }
.tpl-form { display: grid; gap: 10px; padding: 0 12px 12px; overflow-y: auto; }
.tpl-form label { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.tpl-form input[name="name"] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.tpl-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.tpl-scope label { position: relative; display: block; cursor: pointer; }
.tpl-scope input { position: absolute; opacity: 0; }
.tpl-scope span { display: block; padding: 6px; border-radius: 8px; text-align: center; font-size: 12.5px; }
.tpl-scope input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tpl-form label.tpl-check { display: flex; align-items: center; gap: 8px; }
.tpl-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.tpl-placeholders { display: flex; flex-wrap: wrap; gap: 4px; }
.tpl-placeholders button { padding: 3px 7px; border: 1px dashed var(--line); border-radius: 6px; background: transparent; color: var(--text-2); font: 11.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.tpl-placeholders button:hover { border-color: var(--accent); color: var(--accent); }
.tpl-form footer { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- AI assist ---- */
.ai-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-mail-note > .ai-chips { margin: 2px 0 6px; }
.ai-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.ai-chip.urgent { background: color-mix(in srgb, var(--ana-bad, #d64545) 14%, var(--surface)); color: var(--ana-bad, #d64545); }
.ai-chip.intent-complaint { background: color-mix(in srgb, var(--ana-bad, #d64545) 10%, var(--surface)); color: var(--ana-bad, #d64545); }
.ai-chip.intent-confirmation, .ai-chip.intent-payment { background: color-mix(in srgb, var(--ana-good, #2f9e6a) 14%, var(--surface)); color: var(--ana-good, #2f9e6a); }
.ai-chip.intent-change, .ai-chip.intent-cancellation { background: color-mix(in srgb, var(--ana-warn, #d99a1e) 16%, var(--surface)); color: color-mix(in srgb, var(--ana-warn, #d99a1e) 80%, var(--text)); }
.ai-chip.lang { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); }
.ai-assist-section { display: grid; gap: 8px; }
.ai-assist-section > header { align-items: center; }
.ai-assist-summary { margin: 0; color: var(--text); font-size: 12.5px; line-height: 1.45; }
.ai-summary-button { display: inline-flex; align-items: center; gap: 6px; justify-self: start; }
.ai-summary-button svg { width: 14px; height: 14px; color: var(--accent); }
.ai-thread-summary { display: grid; gap: 4px; padding: 9px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.ai-thread-summary-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ai-thread-summary-head .link-button { text-transform: none; letter-spacing: 0; }
.ai-thread-summary-text { font-size: 12.5px; line-height: 1.45; }
.ai-thread-summary-text p { margin: 0 0 4px; }
.ai-thread-summary-text ul { margin: 0 0 4px; padding-left: 16px; }
.link-button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.link-button:disabled { color: var(--muted); cursor: default; }
.link-button svg { width: 13px; height: 13px; }
.message-translation { margin: 6px 16px 10px; }
.message-translation-text { margin-top: 6px; padding: 10px 12px; border-left: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 0 10px 10px 0; background: var(--surface-2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.signature-card > summary { cursor: pointer; }
.signature-rows { display: grid; gap: 2px; padding-top: 6px; }
.signature-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto auto; align-items: center; gap: 6px; min-height: 28px; font-size: 12.5px; }
.signature-row > span { color: var(--muted); font-size: 11.5px; }
.signature-row > a, .signature-row > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.signature-row > em { font-style: normal; font-size: 10.5px; color: var(--ana-warn, #d99a1e); white-space: nowrap; }
.signature-row .icon-button { width: 24px; height: 24px; opacity: .55; }
.signature-row .icon-button:hover { opacity: 1; }
.signature-row .icon-button svg { width: 13px; height: 13px; }
.reply-templates-button.ai svg { color: var(--accent); }
.ai-reply-popover { z-index: 80; width: min(360px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 48px rgba(0,0,0,.18); }
.ai-reply-body { display: grid; gap: 10px; padding: 0 12px 12px; }
.ai-reply-body label { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.ai-reply-body textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; resize: vertical; }
.ai-reply-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-reply-actions .button { display: inline-flex; align-items: center; gap: 6px; }
.ai-reply-actions .button svg { width: 14px; height: 14px; }
.ai-reply-actions .is-busy { opacity: .7; cursor: progress; }
.ai-chip { font-style: normal; }
.desk-side-section-head > .ai-chips { display: flex; justify-content: flex-end; max-width: 62%; }
.signature-card > summary { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.signature-card > summary::-webkit-details-marker { display: none; }
.signature-card > summary > div { min-width: 0; display: grid; gap: 2px; }
.signature-card > summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.signature-chevron { flex: none; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.signature-card[open] .signature-chevron { transform: rotate(-135deg) translateY(-2px); }
.stage-label { display: flex; align-items: baseline; gap: 6px; } .stage-label .field-optional { color: var(--muted); font-size: 11.5px; }
.setting-group-grid:has(#aiUsagePanel) { grid-template-columns: minmax(0, 1fr); }
.ai-usage-panel .mini-button { justify-self: start; }
.setting-hint { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; font-weight: 400; line-height: 1.4; }
.tracker-multi .tracker-actions { grid-column: 1 / -1; justify-content: flex-start; }
.stage-details-form:focus { outline: none; }

/* ---- Sales desk details: tabs instead of one long column ---- */
.desk-side-head.side-tabs-head { min-height: 46px; gap: 6px; padding: 0 8px 0 10px; }
.desk-side-head > .side-tabs, .side-tabs { display: flex; flex: 1 1 auto; min-width: 0; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.side-tab { position: relative; flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 28px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.side-tab:hover { color: var(--text); }
.side-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.side-tab em { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-style: normal; font-size: 10.5px; line-height: 16px; text-align: center; }
.side-tab-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.side-tab-dot.bad { background: var(--ana-bad, #d64545); }
.side-tab-dot.warn { background: var(--ana-warn, #d99a1e); }
.side-tab-dot.good { background: var(--ana-good, #2f9e6a); }
.side-tab-panel[hidden] { display: none; }
.side-tab-panel > .desk-side-section { padding: 10px 0; }
.side-tab-panel > .desk-side-section:first-child { padding-top: 12px; }
.side-tab-empty { margin: 6px 0; color: var(--muted); font-size: 12.5px; }
.side-tracker-section .tracker-integration-row { border: 0; padding: 0; background: transparent; }
.side-ai-section .ai-assist-section.bare { display: grid; gap: 10px; }
.side-ai-section .ai-mail-next { padding-top: 8px; }
.side-owner-actions .side-form { display: grid; gap: 10px; }
.side-handler-wrap { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-handler-wrap > small { color: var(--muted); font-size: 11.5px; }
.desk-side-section .desk-request-row { padding-top: 5px; padding-bottom: 5px; }

/* ---- Compact client card ---- */
.client-card { display: grid; gap: 10px; }
.client-card-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.client-card-avatar { width: 38px; height: 38px; font-size: 13px; }
.client-card-who { display: grid; gap: 1px; min-width: 0; }
.client-card-who b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card-who span { color: var(--text-2); font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.client-card-who small { color: var(--muted); font-size: 11.5px; }
.client-card-open { width: 30px; height: 30px; display: inline-grid; place-items: center; color: var(--muted); }
.client-card-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.client-card-open:hover { color: var(--accent); }
.client-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.client-card-badges:empty { display: none; }
.returning-pill.warn { background: color-mix(in srgb, var(--ana-warn, #d99a1e) 14%, var(--surface)); color: color-mix(in srgb, var(--ana-warn, #d99a1e) 85%, var(--text)); }
.client-card-lines { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.client-card-line { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 32px; padding: 0 4px 0 10px; font-size: 12.5px; }
.client-card-line + .client-card-line { border-top: 1px solid var(--line); }
.client-card-line > svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.client-card-line a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.client-card-line a:hover { color: var(--accent); }
.client-card-line em { font-style: normal; font-size: 10.5px; color: var(--ana-warn, #d99a1e); }
.client-card-line .icon-button { width: 26px; height: 26px; opacity: 0; transition: opacity .12s; }
.client-card-line:hover .icon-button, .client-card-line .icon-button:focus-visible { opacity: .7; }
.client-card-line .icon-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
@media (hover: none) { .client-card-line .icon-button { opacity: .6; } }
.client-card-social { display: flex; flex-wrap: wrap; gap: 6px; }
.social-chip { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.social-chip:hover { color: var(--accent); }
.social-chip.telegram { color: #2a9fd8; } .social-chip.whatsapp { color: #25a35a; } .social-chip.instagram { color: #c13584; } .social-chip.linkedin { color: #0a66c2; }
.client-card-history { display: grid; gap: 6px; }
.client-card-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 12.5px; color: var(--text-2); }
.client-card-stats > small { width: 100%; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.client-card-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.client-card-last { display: grid; gap: 1px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.client-card-last:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.client-card-last small { color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.client-card-last b { font-size: 13px; }
.client-card-last span { color: var(--muted); font-size: 11.5px; }
.client-card-owners { display: grid; gap: 6px; }
.client-card-owners > small { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.client-card-owners > span { display: flex; flex-wrap: wrap; gap: 6px; }
.client-card-owner { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.client-card-owner-avatar { width: 22px; height: 22px; font-size: 9px; }
.allocation-client-card .client-card { margin-top: 4px; }
.gsearch-all { position: sticky; bottom: -6px; display: flex; align-items: center; gap: 8px; width: calc(100% + 12px); margin: 6px -6px -6px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--surface-raised, var(--surface)); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
.gsearch-all small { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; }
.gsearch-all kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font: 10.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.gsearch-all:hover, .gsearch-all:focus-visible { background: var(--surface-2); outline: none; }

.side-tab-panel .reminder-section.due { padding-left: 10px; }
.global-search .searchbox { position: relative; }
.gsearch-clear { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: -4px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.gsearch-clear:hover { background: var(--surface-2); color: var(--text); }
.gsearch-clear svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.gsearch-clear[hidden] { display: none; }
.global-search #searchInput::-webkit-search-cancel-button { display: none; }

/* ---- Details tabs: reminder and spacing polish ---- */
.side-tab-panel .reminder-section.due { box-shadow: none; padding-left: 0; }
.side-tab-panel .reminder-section > summary { min-height: 40px; }
.side-tab-panel .reminder-controls { padding: 10px 0 2px; gap: 10px; border-top: 0; }
.side-tab-panel .reminder-date-time { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 8px; }
.side-tab-panel .reminder-controls label { font-size: 11.5px; }
.side-tab-panel .reminder-quick-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.side-tab-panel .reminder-quick-actions [data-reminder-save] { grid-column: 1 / -1; height: 32px; }
.side-tab-panel .reminder-quick-actions .mini-button { justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-tab-panel .labels-section .crm-tags-empty { display: none; }
.side-tab-panel .labels-section .crm-tag-list:has(> .crm-tags-empty:only-child) { display: none; }
.side-tab-panel .labels-section .desk-side-section-head { margin-bottom: 6px; }
.side-owner-actions .desk-side-section-head { margin-bottom: 8px; }
.side-owner-actions .side-form label { display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.side-handler-wrap .linked-record { padding: 8px 10px; border-radius: 10px; }
.side-client-section .client-card + .side-handler-wrap { margin-top: 14px; }
.side-tabs { background: color-mix(in srgb, var(--surface-2) 80%, transparent); }

/* ---- Contact review list and signature prefill ---- */
.contact-review-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
.contact-review-row-meta { min-width: 44px; }
.contact-review-row-meta b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); font-size: 11px; line-height: 18px; text-align: center; }
.contact-create-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.contact-signature-badge { flex: none; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-style: normal; font-size: 11px; font-weight: 600; }

/* ---- Admin → Goals → Deals: list editors like Pipeline ---- */
.deals-settings > header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.deals-settings > header span { color: var(--muted); font-size: 12px; font-weight: 400; }
.deals-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.deals-settings-grid > div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.deals-settings-label { color: var(--text-2); font-size: 12px; font-weight: 600; }
.deals-settings-label small { margin-left: 4px; color: var(--muted); font-weight: 400; }
.settings-chip.is-default { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.settings-chip-badge { margin-left: 2px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-style: normal; font-size: 10.5px; font-weight: 600; }
@media (max-width: 900px) { .deals-settings-grid { grid-template-columns: 1fr; } }
.admin-settings-grid-v3 .deals-settings { grid-column: 1 / -1; }

/* Stage suggestion from the newest agent message */
.stage-hint-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 8px 0 0; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.stage-hint-icon { display: inline-flex; width: 26px; height: 26px; flex: 0 0 26px; align-items: center; justify-content: center; border-radius: 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.stage-hint-icon svg { width: 15px; height: 15px; }
.stage-hint-copy { display: grid; gap: 1px; min-width: 0; flex: 1 1 240px; font-size: 13px; line-height: 1.35; }
.stage-hint-line { display: flex; gap: 6px; min-width: 0; align-items: baseline; }
.stage-hint-line b { flex: 0 0 auto; }
.stage-hint-copy q { min-width: 0; color: var(--muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-hint-copy small b { color: var(--text, inherit); font-weight: 600; }
.stage-hint-copy small { color: var(--muted); font-size: 12px; }
.stage-hint-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.stage-hint-actions .button { min-height: 30px; padding: 0 10px; font-size: 12.5px; }

.contact-review-tools { grid-template-columns: minmax(0, 1fr) auto; }
.contact-review-tools select { width: auto; max-width: 150px; padding-right: 26px; }

/* Manager picker avatars: a later generic .sender-avatar size made them oval */
.sender-avatar.manager-option-avatar { width: 28px; height: 28px; min-width: 28px; flex: 0 0 28px; aspect-ratio: 1; border-radius: 50%; font-size: 11px; }

/* AI notes on Overview and the AI tab */
.ai-notes-card { display: grid; gap: 8px; padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.side-tab-panel > .desk-side-section.ai-notes-card { gap: 9px; margin: 12px 0 6px; padding: 12px 14px 13px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.side-tab-panel > .desk-side-section.ai-notes-card + .desk-side-section { padding-top: 12px; }
.ai-notes-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ai-notes-title { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ai-notes-title svg { width: 14px; height: 14px; }
.ai-notes-card > .ai-chips { margin-top: -2px; }
.ai-notes-head .ai-notes-more { margin: 0 0 0 auto; padding: 0 2px; min-height: 0; font-size: 12px; }
.ai-notes-summary { margin: 0; color: var(--text); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ai-next-callout { display: grid; gap: 4px; padding: 8px 11px 9px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.ai-next-label { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ai-next-label svg { width: 12px; height: 12px; }
.ai-next-callout p { margin: 0; color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.ai-assist-section.bare { display: grid; gap: 12px; }
.ai-latest { display: grid; gap: 7px; }
.ai-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ai-block-head .link-button { text-transform: none; letter-spacing: 0; font-weight: 600; }
.ai-block-head .ai-chips { text-transform: none; letter-spacing: 0; }
.ai-latest .ai-assist-summary { font-size: 13px; line-height: 1.5; }
.ai-facts { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ai-facts li { position: relative; padding-left: 14px; color: var(--text); font-size: 12.5px; line-height: 1.4; }
.ai-facts li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ai-thread-summary { gap: 8px; padding: 10px 11px; }
.ai-thread-summary-text { display: grid; gap: 4px; font-size: 12.5px; line-height: 1.5; }
.ai-thread-summary-text h4 { margin: 6px 0 0; color: var(--text); font-size: 12px; font-weight: 700; }
.ai-thread-summary-text h4:first-child { margin-top: 0; }
.ai-thread-summary-text p, .ai-thread-summary-text ul { margin: 0; }
.ai-thread-summary-text li + li { margin-top: 3px; }

/* Reply being sent: shown at once, confirmed by the server copy */
.message.message-sending { opacity: .72; }
.message-sending-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.message-sending-state i { width: 10px; height: 10px; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: bm-spin .8s linear infinite; }
@keyframes bm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .message-sending-state i { animation: none; } }

/* New messages slide in softly instead of popping */
@keyframes bm-message-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.messages > .message-enter { animation: bm-message-enter .32s cubic-bezier(.2, .7, .2, 1) both; }
.message.message-sending { transition: opacity .25s ease; }
.stage-hint-banner, .ai-notes-card { animation: bm-message-enter .3s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .messages > .message-enter, .stage-hint-banner, .ai-notes-card { animation: none; } }

/* Remind me: even preset grid, date and time fully visible */
.desk-remind-panel { width: 344px; gap: 12px; padding: 16px; }
.desk-remind-presets button { display: flex; align-items: center; justify-content: center; text-align: center; }
.desk-remind-presets button:last-child:nth-child(odd) { grid-column: 1 / -1; }
.desk-remind-custom { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) auto; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.desk-remind-custom input { min-width: 0; padding: 0 8px; }
.desk-remind-custom .button { height: 36px; padding: 0 14px; }
.desk-remind-note { height: 38px; }
.desk-remind-panel.align-left { right: auto; left: 0; }

/* Bulk signature progress */
.sig-bulk-progress { display: grid; gap: 6px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); animation: pop-in .18s var(--ease); }
.sig-bulk-progress[hidden] { display: none; }
.sig-bulk-progress-text { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.sig-bulk-progress-text span { color: var(--muted); font-variant-numeric: tabular-nums; }
.sig-bulk-progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.sig-bulk-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s var(--ease); }
.sig-bulk-progress[data-state="busy"] .sig-bulk-progress-track i { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 35%, transparent), transparent); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sig-bulk-progress[data-state="done"] .sig-bulk-progress-text b { color: var(--accent); }
.sig-bulk-progress[data-state="error"] { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.sig-bulk-progress[data-state="error"] .sig-bulk-progress-text b { color: var(--danger); }
.sig-bulk-progress[data-state="error"] .sig-bulk-progress-track i { background: var(--danger); }
.button.is-busy { opacity: .7; cursor: progress; }

/* Loading screen: hides the empty shell until the first data is drawn */
.app-loading { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--bg, var(--surface)); transition: opacity .38s var(--ease), visibility .38s; }
.app-loading.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.app-loading-card { display: grid; justify-items: center; gap: 12px; animation: pop-in .3s var(--ease) both; }
.app-loading-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-pop); }
.app-loading-mark img { width: 34px; height: 34px; object-fit: contain; }
.app-loading-card b { font-size: 17px; font-weight: 650; color: var(--text); }
.app-loading-card small { color: var(--muted); font-size: 12.5px; }
.app-loading-bar { position: relative; width: 168px; height: 3px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.app-loading-bar i { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: inherit; background: var(--accent); animation: app-loading-slide 1.1s cubic-bezier(.45, 0, .25, 1) infinite; }
@keyframes app-loading-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .app-loading-bar i { animation: none; width: 100%; opacity: .6; } }
.attention-pulse[hidden] { display: none; }

/* Smoothness pass */
@keyframes side-panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.side-tab-panel:not([hidden]) { animation: side-panel-in .22s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes desk-surface-soft { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#deskMain.desk-surface-entering, #deskMain .desk-surface-entering { animation: desk-surface-soft .26s cubic-bezier(.2, .7, .2, 1) both; }
.queue-row, .thread-row, .action-row, .feed-row { transition: background-color .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease; }
.button, .mini-button, .desk-action-button, .queue-tab, .icon-button, .link-button { transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease, opacity .16s ease; }
.rich-reply-editor { transition: min-height .24s cubic-bezier(.2, .7, .2, 1); }
.reply-box { transition: border-color .2s ease, box-shadow .2s ease; }
@media (prefers-reduced-motion: reduce) {
  .side-tab-panel:not([hidden]), #deskMain.desk-surface-entering, #deskMain .desk-surface-entering { animation: none; }
  .rich-reply-editor { transition: none; }
}
